Sequential flow detection and data pre-reading

By introducing sequential flow detection and pre-reading mechanisms into storage devices, sequential flow processing of multiple application IO commands is optimized, access delay and service quality problems are solved, and more efficient data access and storage management is achieved.

CN110389709BActive Publication Date: 2024-11-01MEMBLAZE TECH BEIJING
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN201810355427.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-04-19
Publication Date
2024-11-01
Estimated Expiration
2038-04-19

AI Technical Summary

Technical Problem

When existing storage devices process IO commands for multiple applications, it is difficult for existing storage devices to effectively detect and execute sequential streams, resulting in access delays and poor service quality.

Method used

By introducing a sequential flow detection method, the addresses and hits of the sequential flow descriptor and candidate sequential flow descriptor are updated, and read-outs are identified and implemented to optimize data access order and cache management.

Benefits of technology

Reduces access delay, improves service quality, optimizes the response time of subsequent read commands through read preview, and reduces write amplification and data block migration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110389709B_ABST
    Figure CN110389709B_ABST
Patent Text Reader

Abstract

The present application provides a method and storage device for sequential flow detection and pre-reading. The sequential flow detection method provided includes: in response to the address accessed by a first read command hitting a first sequential flow descriptor among multiple sequential flow descriptors, updating the address recorded in the first sequential flow descriptor with the address accessed by the first read command; and instructing to pre-read the first sequential flow corresponding to the first sequential flow descriptor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to a storage system, and more particularly, to detecting a sequential stream formed by a plurality of read commands accessing a continuous address space, and performing data pre-reading according to the detection of the sequential stream. Background Art

[0002] Figure 1 The block diagram of the solid-state storage device is shown. The solid-state storage device 102 is coupled to the host to provide storage capacity for the host. The host and the solid-state storage device 102 can be coupled in a variety of ways, including but not limited to connecting the host and the solid-state storage device 102 through, for example, 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), 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 data of the FTL table and / or 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] In a solid-state storage device, the FTL (Flash Translation Layer) is used to maintain the mapping information from the logical address to the physical address. The logical address constitutes the storage space of the solid-state storage device perceived by the upper-layer software such as the operating system. The physical address is the address used to access the physical storage unit of the solid-state storage device. In the related art, the address mapping can also be implemented using the intermediate address form. For example, the logical address is mapped to the intermediate address, and then the intermediate address is further mapped to the physical address.

[0008] The table structure that stores the mapping information from logical addresses to physical addresses is called an FTL table. The FTL table is an important metadata in a solid-state storage device. Usually, the data items of the FTL table record the address mapping relationship in units of data pages in the solid-state storage device.

[0009] Storage devices are used to process IO commands. IO commands can be sent to storage devices (e.g., disks, solid-state drives, USB flash drives, optical disks, etc.), storage servers, or storage systems (such as cloud storage). If the addresses accessed by multiple IO commands are continuous or approximately continuous, these IO commands are said to belong to the same sequential flow.

[0010] Each IO command carries or indicates the address (logical address or physical address) of the data to be accessed. The length of the data to be accessed by each IO command can be fixed or variable. When the host accesses the storage device, the data access party such as the application program may split the large block data access into multiple IO commands and send them to the storage device. There may also be multiple applications and / or multiple operating systems (such as virtual machines) accessing the storage device in the host, which causes the IO commands of multiple access parties to be interleaved, thereby making the original access to the continuous address discontinuous.

[0011] Figure 2A A schematic diagram showing IO commands from multiple applications being provided to a storage device.

[0012] There are multiple applications in the host. Application A generates multiple IO commands (for example, IO commands A1 and A2) that access consecutive addresses. These IO commands belong to sequential stream A. For example, these IO commands of application A are from copying a large-size video file. Application B generates multiple IO commands (for example, IO commands B1 and B2) that access consecutive addresses. These IO commands belong to sequential stream B. The applications in the host also generate multiple IO commands that access other address spaces (for example, Figure 2A In the example, the IO commands S, E, D, and C in the storage device are in a sequential stream C). In the operating system, driver, device interface, and / or bus, multiple IO commands are organized into a different order than the original order and received by the storage device. For example, the storage device receives IO commands in the order of A1, B1, C, and B2.

[0013] Figure 2B A schematic diagram showing data placement on a storage device for data from multiple applications.

[0014] The storage device receives the IO commands in the order of A1, B1, C and B2, and writes the data accessed by the IO commands (taking write commands as an example) into the storage medium in the order in which the IO commands are received. Figure 2B In the example, IO commands A1, B1, C, and B2 are assigned to consecutive physical addresses, resulting in the data corresponding to multiple IO commands (such as IO commands A1 and A2, or IO commands B1 and B2) that originally accessed consecutive logical addresses being scattered rather than continuously stored in the storage medium.

[0015] The storage device also provides a pre-reading mechanism. For example, in response to the host accessing address A1, the storage device predicts that the host will likely continue to access address A2 that is continuous or adjacent to address A1, so that the storage device reads data from address A2 before receiving the host's read command, and caches the data read from address A2 to respond to the host's subsequent read command. Summary of the invention

[0016] Improved sequential flow detection and read-ahead capabilities are needed in storage devices to provide lower access latency and better quality of service.

[0017] According to the first aspect of the present application, a first sequential flow detection method according to the first aspect of the present application is provided, comprising: in response to an address accessed by a first read command hitting a first sequential flow descriptor among multiple sequential flow descriptors, updating the address recorded in the first sequential flow descriptor with the address accessed by the first read command; and instructing a pre-read of a first sequential flow corresponding to the first sequential flow descriptor.

[0018] According to the first sequential flow detection method of the first aspect of the present application, a second sequential flow detection method according to the first aspect of the present application is provided, which also includes: in response to the address accessed by the first read command not hitting any of the multiple sequential flow descriptors, identifying whether the address accessed in the first read command hits any of the multiple candidate sequential flow descriptors.

[0019] According to the second sequential flow detection method of the first aspect of the present application, a third sequential flow detection method according to the first aspect of the present application is provided, which also includes: in response to the address accessed by the first read command hitting the first candidate sequential flow descriptor among multiple candidate sequential flow descriptors, updating the address of the first candidate sequential flow descriptor record with the address accessed by the first command and incrementing the number of hits of the first candidate sequential flow descriptor record.

[0020] According to the third sequential flow detection method of the first aspect of the present application, a fourth sequential flow detection method according to the first aspect of the present application is provided, which also includes: updating the second sequential flow descriptor among multiple sequential flow descriptors using the address and the number of hits recorded by the first candidate sequential flow descriptor.

[0021] According to the fourth sequential flow detection method of the first aspect of the present application, a fifth sequential flow detection method according to the first aspect of the present application is provided, wherein the second sequential flow descriptor is the sequential flow descriptor with the smallest number of hits among multiple sequential flow descriptors.

[0022] According to one of the first to fifth sequential flow detection methods of the first aspect of the present application, a sixth sequential flow detection method according to the first aspect of the present application is provided, wherein the address accessed in response to the first read command hits the first sequential flow descriptor among multiple sequential flow descriptors, and the number of hits recorded by the first sequential flow descriptor is also incremented.

[0023] According to the sixth sequential flow detection method of the first aspect of the present application, a seventh sequential flow detection method according to the first aspect of the present application is provided, wherein in response to the address accessed by the first read command not hitting any of the multiple sequential flow descriptors, nor hitting any of the multiple candidate sequential flow descriptors, the number of hits of each of the multiple sequential flow descriptors and the number of hits of each of the multiple candidate sequential flow descriptors are decremented.

[0024] According to one of the first to seventh sequential flow detection methods of the first aspect of the present application, an eighth sequential flow detection method according to the first aspect of the present application is provided, wherein if the address accessed by the read command is the same as, overlaps with and / or is adjacent to the address recorded in the first sequential flow descriptor, it is identified that the address accessed by the read command hits the first sequential flow descriptor.

[0025] According to one of the second to fifth sequential flow detection methods of the first aspect of the present application, a ninth sequential flow detection method according to the first aspect of the present application is provided, wherein if the address accessed by the read command is the same as, overlaps with and / or is adjacent to the address recorded in the first candidate sequential flow descriptor, it is identified that the address accessed by the read command hits the first candidate sequential flow descriptor.

[0026] According to one of the second to fifth or ninth sequential flow detection methods of the first aspect of the present application, a tenth sequential flow detection method according to the first aspect of the present application is provided, which also includes: in response to obtaining a first read command, updating a recent IO command address set according to an address accessed by the first read command.

[0027] According to the tenth sequential flow detection method of the first aspect of the present application, an eleventh sequential flow detection method according to the first aspect of the present application is provided, wherein a first element is generated according to the address accessed by the first read command, and the first element is added to the recent IO command address set, wherein the first element records the address accessed by the first read command and the number of initialized hits.

[0028] According to the tenth sequential flow detection method of the first aspect of the present application, a twelfth sequential flow detection method according to the first aspect of the present application is provided, wherein if the address accessed by the first read command hits the second element of the recent IO command address set, the number of hits of the second element is incremented.

[0029] According to the eleventh sequential flow detection method of the first aspect of the present application, a thirteenth sequential flow detection method according to the first aspect of the present application is provided, which also includes: deleting the second element from the recent IO command address set to accommodate the first element.

[0030] According to one of the tenth to thirteenth sequential flow detection methods of the first aspect of the present application, a fourteenth sequential flow detection method according to the first aspect of the present application is provided, which also includes: updating a second candidate sequential flow descriptor among multiple candidate sequential flow descriptors using the address and the number of hits recorded by the elements of the recent IO command address set.

[0031] According to the fourteenth sequential flow detection method of the first aspect of the present application, a fifteenth sequential flow detection method according to the first aspect of the present application is provided, further comprising: the second candidate sequential flow descriptor is a sequential flow descriptor with the smallest number of hits among multiple candidate sequential flow descriptors.

[0032] According to the second aspect of the present application, a first pre-reading method according to the second aspect of the present application is provided, comprising: in response to receiving an instruction to pre-read a first sequential stream corresponding to a first sequential stream descriptor, pre-reading is performed according to the pre-reading start address and a local pre-reading size parameter.

[0033] According to the first pre-reading method of the second aspect of the present application, a second pre-reading method according to the second aspect of the present application is provided, wherein according to one of the sequential stream detection methods provided in the first aspect of the present application, an indication of pre-reading the first sequential stream corresponding to the first sequential stream descriptor is obtained.

[0034] According to the first or second pre-reading method of the second aspect of the present application, a third pre-reading method according to the second aspect of the present application is provided, further comprising: storing the pre-read data in one or more cache units.

[0035] According to the third pre-reading method of the second aspect of the present application, a fourth pre-reading method according to the second aspect of the present application is provided, wherein if the read command hits the cache unit, the pre-reading start address and the local pre-reading size parameters are determined according to an enhanced strategy; if the read command does not hit the cache unit, the pre-reading start address and the local pre-reading size parameters are determined according to a cautious strategy.

[0036] According to the third pre-reading method of the second aspect of the present application, a fifth pre-reading method according to the second aspect of the present application is provided, wherein if the address accessed by the read command is not adjacent to the address range of the last pre-reading of the first sequential stream, the starting address of this pre-reading and the local pre-reading size parameters are determined according to a cautious strategy; if the address accessed by the read command is adjacent to the address range of the last pre-reading of the first sequential stream, and the data size accessed by the read command is similar to the data size of the last pre-reading, the starting address of this pre-reading and the local pre-reading size parameters are determined according to an enhanced strategy.

[0037] According to the fifth pre-reading method of the second aspect of the present application, a sixth pre-reading method according to the second aspect of the present application is provided, wherein if the address accessed by the read command is close to the address range of the last pre-reading of the first sequential stream, and the data size accessed by the read command is not similar to the data size of the last pre-reading, the starting address of this pre-reading and the local pre-reading size parameters are determined according to a cautious strategy.

[0038] According to the third pre-reading method of the second aspect of the present application, a seventh pre-reading method according to the second aspect of the present application is provided, wherein if the address accessed by the read command is not adjacent to the address range of the last pre-reading of the first sequential stream, and the read command hits the cache unit, the starting address of this pre-reading and the local pre-reading size parameters are determined according to a first cautious strategy; if the address accessed by the read command is not adjacent to the address range of the last pre-reading of the first sequential stream, and the read command does not hit the cache unit, the starting address of this pre-reading and the local pre-reading size parameters are determined according to a second cautious strategy; wherein the second cautious strategy is more cautious than the first cautious strategy.

[0039] According to the third pre-reading method of the second aspect of the present application, an eighth pre-reading method according to the second aspect of the present application is provided, wherein if the address accessed by the read command is close to the address range of the last pre-reading of the first sequential stream, the starting address of this pre-reading and the local pre-reading size parameters are determined according to the enhanced strategy, and if the address accessed by the read command is not close to the address range of the last pre-reading of the first sequential stream, the starting address of this pre-reading and the local pre-reading size parameters are determined according to the cautious strategy.

[0040] According to one of the fifth to eighth pre-reading methods of the second aspect of the present application, a ninth pre-reading method according to the second aspect of the present application is provided, wherein the pre-reading start address and the local pre-reading size parameters are determined according to an enhanced strategy, including increasing the pre-reading data size in the local pre-reading relative to the size of the last pre-reading data, and / or implementing pre-reading at an address farther than the starting address of the last pre-reading.

[0041] According to one of the fifth to ninth pre-reading methods of the second aspect of the present application, a tenth pre-reading method according to the second aspect of the present application is provided, wherein the pre-reading start address and the local pre-reading size parameters are determined according to a prudent strategy, including reducing the pre-reading data size in the local pre-reading relative to the size of the last pre-reading data, and / or using the end of the address range accessed by the read command as the starting address of this pre-reading.

[0042] According to the third aspect of the present application, a storage device according to the present application is provided, characterized in that it includes a control component and a non-volatile memory, and the control component implements one of the sequential flow detection methods according to the first aspect of the present application or one of the pre-reading methods according to the second aspect of the present application.

[0043] According to the fourth aspect of the present application, a storage device according to the fourth aspect of the present application is provided, characterized in that it includes a control component and a non-volatile memory, and the control component implements one of the sequential flow detection methods according to the first aspect of the present application or one of the pre-reading methods according to the second aspect of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0045] Figure 1 A schematic diagram of a solid-state storage device in the prior art provided by this application;

[0046] Figure 2A A schematic diagram showing IO commands from multiple applications being provided to a storage device;

[0047] Figure 2B A schematic diagram showing data placement on a storage device for data from multiple applications;

[0048] Figure 3 It is a schematic diagram of implementing sequential flow detection on write commands;

[0049] Figure 4 A block diagram of a storage device according to an embodiment of the present application is shown;

[0050] Figure 5 A sequential flow descriptor and a candidate sequential flow descriptor according to an embodiment of the present application are shown;

[0051] Figure 6 A flowchart of detecting a sequential flow according to an embodiment of the present application is shown;

[0052] Figure 7 A sequential stream descriptor, a candidate sequential stream descriptor and a recent IO command address set according to another embodiment of the present application are shown;

[0053] Figure 8 A flowchart of detecting a sequential flow according to another embodiment of the present application is shown;

[0054] Fig.9A A flowchart for implementing pre-reading according to an embodiment of the present application is shown;

[0055] Fig. 9B A flowchart for implementing pre-reading according to another embodiment of the present application is shown; and

[0056] Fig.10A flowchart of sequential flow detection and pre-reading according to another embodiment of the present application is shown. DETAILED DESCRIPTION

[0057] The following is a clear and complete description of the technical solutions in the embodiments of the present application in conjunction with the drawings 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 those skilled in the art without creative work are within the scope of protection of the present application.

[0058] Figure 3 This is a schematic diagram of implementing sequential stream detection on write commands. As an example, sequential stream detection is implemented on received write commands in a storage device. From multiple write commands accessing the storage device, sequential stream A, sequential stream B formed by write commands accessing continuous addresses, and multiple write commands (indicated by C, D, E, ... S) whose accessed addresses are not sequential (also called random streams) are detected. In addition, sequential stream A is assigned a continuous physical address on the storage medium (for example, data block 1), and sequential stream B is assigned a continuous physical address on the storage medium (for example, data block 2), and the random stream is written to data block 3. When the data life cycle corresponding to sequential stream A is completed and updated or invalidated (for example, when sequential stream A corresponds to a large-size video file, the video file is deleted), the data in data block 1 becomes invalid, and when data block 1 is recovered, there is no need to move the valid data in the data block (because there is no valid data in data block 1, or the valid data is small), thereby reducing write amplification. In addition, the data in the sequential stream may also be read continuously. For example, when sequential stream A corresponds to a large-size video file, the data corresponding to A1, A2, A3 and A4 in data block 1 are likely to be read continuously. Therefore, for data block 1 storing the sequential stream, when responding to a read command, the subsequent data can be pre-read before receiving the subsequent read command, thereby reducing the response time to the subsequent read command. In the Chinese patent application with application number 201610169011.1 and invention name Sequential Stream Detection Method and Device, a variety of embodiments for implementing sequential stream detection are provided. The entire text is incorporated into this application by reference.

[0059] Figure 4 A block diagram of a storage device according to an embodiment of the present application is shown. The storage device according to an embodiment of the present application performs sequential flow detection on a read command and performs pre-reading according to the detection result.

[0060] See also Figure 4 The control component 204 of the storage device includes a host interface 210 , a medium interface 220 for accessing the NVM chip 105 , a cache management unit 260 , a backend processing unit 270 , a sequential flow detection unit 250 and a pre-reading unit 255 .

[0061] The host interface 210 is used to exchange commands and data with the host. For example, the host and the storage device communicate via the NVMe / PCIe protocol, the host interface 210 processes the PCIe protocol data packet, extracts the NVMe protocol command, and returns the processing result of the NVMe protocol command to the host.

[0062] The cache management unit 260 is coupled to the host interface 210, and is used to receive IO commands sent by the host to the storage device, and try to use one or more cache units to serve the received IO commands to improve the certainty of the performance of the IO commands being processed by the storage device.

[0063] The cache management unit 260 also writes the data in the cache unit into the NVM chip (105) through the backend processing unit 270, and / or reads data from the NVM chip (105) to fill the cache unit.

[0064] Optionally, the cache unit 260 forwards part of the received IO commands (eg, read commands that do not hit the cache unit) to the backend processing unit 270 for processing, without using the cache unit to service these IO commands.

[0065] The backend processing unit 270 receives IO commands (the form of IO commands changes due to processing by the cache management unit 260, and is collectively referred to as IO commands for simplicity) and accesses one or more NVM chips.

[0066] Optionally, the backend processing unit 270 processes the IO command using existing technology, or processes the IO command using technology to be developed in the future.

[0067] Optionally, the cache management unit 260 maintains a cache descriptor table (or a cache descriptor pool). The cache descriptor table 260 records a plurality of cache descriptors. One or more of the cache descriptors records the address of the corresponding cache unit in the DRAM 110, the state of the cache unit, and / or the location of valid data in the cache unit. For example, in the Chinese patent application with application number 201810264435.5, the invention name is "Storage device with cache having enhanced IO performance determinism", and the application date is March 28, 2018, it is described to use the cache management unit 260 to provide a cache. Caches for storage devices are also provided in application numbers 201610819411.2, 201610819400.4, 201710219096.4 and 201710219077.1.

[0068] The control component is also coupled to external memory (eg, DRAM) 110 .

[0069] Continue to view Figure 4, part of the space of the external memory 110 (cache unit 0, cache unit 1, ..., cache unit 7) is used as a cache. The cache unit has a specified size. For example, the specified size of the cache unit is 512 bytes, 1KB, 2KB, 4KB, etc.

[0070] The cache management unit 260 manages the allocation and use of the cache unit. Exemplarily, for a write command, under the instruction of the cache management unit 260, the data to be written is transmitted from the host to the cache unit in the external memory 110 through the host interface 210, and the data in the cache unit is also transmitted to the NVM chip 105 through the media interface 220. For example, the cache management unit 260 transmits the data in the cache unit to the NVM chip 105 through the media interface 220 via the backend processing unit 270.

[0071] For a read command, the cache management unit 260 identifies whether the cache unit hits. If the cache unit hits, data is obtained from the cache unit and sent to the host under the instruction of the cache management unit 260. If the cache unit does not hit, data is obtained from the NVM chip 105 and sent to the host.

[0072] The backend processing unit 270 includes an FTL module for converting the logical address of the IO command into a physical address. The backend processing unit 270 also manages the NVM chip and the data thereon, and provides services such as wear leveling and garbage collection.

[0073] Optionally, the storage device exposes a physical address space to the host, such as a physical address space that complies with the (Open Channel SSD, OpenChannel SSD, OCSSD) protocol. Thus, the physical address to be accessed is indicated in the IO command. Thus, the backend processing unit 270 does not need to use the FTL module to convert from the logical address to the physical address.

[0074] Continue to view Figure 4The host interface 210 is also coupled to a sequential flow detection unit 250. The sequential flow detection unit 250 also receives an IO command sent by the host to the storage device, or optionally receives a logical address / physical address accessed by an IO command (referred to as the address accessed by the IO command). The sequential flow detection unit identifies one or more sequential flows based on the address of the received IO command, and indicates the identified sequential flows to the pre-read unit 255. The pre-read unit 255 pre-reads the identified sequential flows, pre-reads the data to be read by the subsequent read command on the sequential flows in advance, and stores the read data in a cache unit. Optionally, the data read by the pre-read unit 255 is also managed by a cache management unit 260. The cache management unit 260 allocates a cache unit for the pre-read data, and records the pre-read logical address / physical address and the index of the cache unit storing the pre-read data in a cache descriptor table. Optionally, the cache of the pre-read data is managed by another cache management unit or a sequential flow detection unit 250 different from the cache management unit 260.

[0075] In response to receiving a read command from the host interface, the cache management unit 260, other cache management units or the sequential flow detection unit 250 further checks whether the data to be read by the read command hits the cache of pre-read data.

[0076] Figure 5 The sequence flow descriptor and candidate sequence flow descriptor according to the embodiment of the present application are shown. The sequence flow detection unit 250 maintains the sequence flow descriptor and the candidate sequence flow descriptor. The sequence flow descriptor indicates the sequence flow identified by the sequence flow detection unit 250, and the candidate sequence flow descriptor indicates the candidate sequence flow.

[0077] By way of example, there are one or more sequential stream descriptors. Figure 5 2 sequential stream descriptors (510 and 512) are shown in FIG. There are one or more candidate sequential stream descriptors. Figure 5 4 candidate sequence flow descriptors (540, 542, 544 and 546) are shown in FIG. It can be understood that the sequence flow detection unit 250 can maintain other numbers of sequence flow descriptors and candidate sequence flow descriptors.

[0078] The sequential stream descriptor is used to describe the identified sequential stream. As an example, the sequential stream descriptor describes the sequential stream by address (address accessed by the read command) and the number of hits. Furthermore, the sequential stream descriptor further describes the sequential stream by pre-reading the start address and the pre-reading data size. Still optionally, the sequential stream descriptor also records the size of the data read by the IO command.

[0079] The hit count recorded by the sequence stream descriptor is the number of read commands that hit the sequence stream described by the sequence stream descriptor during its life cycle. The situation where the read command hits the sequence stream includes, for example, that the address accessed by the read command is the same as, overlaps with, and / or is adjacent to the address recorded in the sequence stream descriptor (the difference between the two addresses is less than a specified threshold).

[0080] The pre-read start address recorded by the sequential stream descriptor is the start address (logical address or physical address) of the data read in the last pre-read operation performed by the sequential stream descriptor. The pre-read data size recorded by the sequential stream descriptor is the size of the data read in the last pre-read operation performed by the sequential stream descriptor.

[0081] The candidate sequence stream descriptor records the same or similar content as the sequence stream descriptor.

[0082] Figure 6 A flowchart for detecting a sequential flow according to an embodiment of the present application is shown.

[0083] Sequential flow detection unit 250 (see also Figure 4 ) obtains a read command (optionally, an address accessed by the read command) (610) from the host interface 210, and determines whether the address accessed by the read command hits the sequential stream (620). Whether the address accessed by the read command hits the sequential stream is determined by comparing the address accessed by the read command with the address recorded in the sequential stream descriptor. For example, the address accessed by the read command is A1, and the address recorded in the sequential stream descriptor 510 is A2. If A1 and A2 are the same, overlapped (corresponding to the case where the address is a range) and / or adjacent (the absolute value of the difference between A1 and A2 is less than a threshold), it is determined that the address accessed by the read command hits the sequential stream 510. Optionally, the address accessed by the read command is compared with the address recorded in each (510 and 512) of the sequential stream descriptors maintained by the sequential stream detection unit 250 to identify whether the address accessed by the read command hits any of the sequential streams represented by the sequential stream descriptors.

[0084] For the sequential stream descriptor (e.g., sequential stream descriptor 510) hit by the address accessed by the read command, the hit sequential stream descriptor is updated (630), for example, the address recorded in the sequential stream descriptor 510 is replaced with the address accessed by the read command (A1), and the number of hits recorded in the sequential stream descriptor is incremented.

[0085] If the address (A1) accessed by the read command does not hit any of the maintained sequence flow descriptors, it is determined whether the address accessed by the read command hits the candidate sequence flow (650). The address accessed by the read command is compared with the address recorded in the candidate sequence flow descriptor to determine whether the address accessed by the read command hits the candidate sequence flow.

[0086] If the address accessed by the read command hits the candidate sequential flow descriptor (e.g., candidate sequential flow descriptor 540), the hit candidate sequential flow descriptor is updated (660), for example, the address recorded in the candidate sequential flow descriptor 540 is replaced with the address accessed by the read command (A1), and the hit count recorded by the candidate sequential flow descriptor is incremented. Further, for the updated hit candidate sequential flow descriptor, it is also identified whether the candidate sequential flow descriptor meets the conditions for upgrading to a sequential flow descriptor (670). For example, if the hit count recorded by the candidate sequential flow descriptor exceeds a threshold value (e.g., 5, 10, or 100), the hit count recorded by the candidate sequential flow descriptor is greater than the hit count recorded by all other candidate sequential flow descriptors, or the hit count recorded by the candidate sequential flow descriptor is greater than the hit count recorded by one or more sequential flow descriptors, the candidate sequential flow corresponding to the candidate sequential flow descriptor is upgraded. One of the sequential flow descriptors is updated according to the candidate sequential flow descriptor to be upgraded (680). For example, a sequence flow descriptor (510) with the lowest recorded hit count, or a sequence flow descriptor that has not been used, is selected, and the address and hit count recorded by the candidate sequence flow descriptor (540) to be upgraded are used to replace the address and hit count of the selected sequence flow descriptor (510), so as to upgrade the candidate sequence flow to a sequence flow.

[0087] Optionally or further, in order to upgrade the candidate sequential flow descriptor, the selected sequential flow descriptor (e.g., the sequential flow descriptor 510) is also downgraded. The upgraded candidate sequential flow descriptor (540) is updated with the address and the hit count of the downgraded sequential flow descriptor (510). By downgrading the sequential flow descriptor to the candidate sequential flow descriptor, the candidate sequential flow descriptor is provided with an opportunity to be upgraded to a sequential flow descriptor again.

[0088] It should be noted that in the Figure 6 In the description of the embodiment, there is no careful distinction between sequential streams and sequential stream descriptors, nor is there a careful distinction between candidate sequential streams and candidate sequential stream descriptors. This is for the purpose of simplicity and clarity of explanation, and those skilled in the art will be able to understand its meaning. A sequential stream descriptor may be, for example, data for describing a sequential stream contained in a storage space in a memory, and this storage space may be modified so that the sequential stream descriptor is updated. The sequential stream descriptor indicates a sequential stream (for example, an address and a number of hits) through the data recorded therein. Thus, the address of the read command hits the sequential stream descriptor, which is also understood as hitting the sequential stream indicated by the sequential stream descriptor; upgrading the candidate sequential stream descriptor to a sequential stream descriptor is also understood as upgrading the candidate sequential stream indicated by the candidate sequential stream descriptor to a sequential stream; downgrading a sequential stream descriptor to a candidate stream descriptor is also understood as downgrading the sequential stream indicated by the sequence stream descriptor to a candidate sequential stream.

[0089] In an optional embodiment, if the address accessed by the read command does not hit any candidate sequential flow descriptor, one of the candidate sequential flow descriptors is selected to accommodate the candidate sequential flow indicated by the address accessed by the read command. For example, the candidate sequential flow descriptor with the smallest number of hits among the candidate sequential flow descriptors is selected, or the candidate sequential flow descriptor that was last updated the longest is selected. The read command access address is recorded in the selected candidate sequential flow descriptor, and the number of hits is initialized. In another optional embodiment, if the address accessed by the read command does not hit any candidate sequential flow descriptor, the address of the read command is not recorded in any candidate sequential flow descriptor.

[0090] Figure 7 A sequence flow descriptor, a candidate sequence flow descriptor, and a recent IO command address set according to another embodiment of the present application are shown. The sequence flow detection unit 250 maintains the sequence flow descriptor, the candidate sequence flow descriptor, and the recent IO command address set. The sequence flow descriptor indicates the sequence flow identified by the sequence flow detection unit 250, and the candidate sequence flow descriptor indicates the candidate sequence flow. The address set of recent IO commands accommodates the addresses of the recently received read commands and the number of times they are hit in each element of the set, limited by the storage space of the set. Optionally, the address set of recent IO commands is sorted, sorted in the order in which the addresses of the IO commands are received. Thus, when the set is full, the set element indicating the earliest received IO command is deleted from the set to obtain storage space to accommodate new elements.

[0091] As an example, each element of the address set of recent IO commands records the address of the IO command (read command) and, optionally, the number of times the address is hit (also referred to as the number of times the element is hit). The address set of recent IO commands accommodates a specified number of elements. For a received IO command, if the address set of recent IO commands has free space, an element is generated according to the address accessed by the IO command and added to the address set of recent IO commands. If the address set of recent IO commands has no free space, the elements of the address set of recent IO commands are sorted, and the element that was first added to the address set of recent IO commands is deleted to obtain space. Optionally or further, when deleting an element from the address set of recent IO commands, the number of times the element is hit is also considered. Optionally, to add the generated element to the address set of recent IO commands, traverse each element of the address set of recent IO commands to find out whether there is an element in the address set of recent IO commands that is hit by the address accessed by the IO command. If there is an element in the address set of recent IO commands that is hit by the address accessed by the IO command, the number of times the element is hit is incremented. If there is no element hit by the address accessed by the IO command in the address set of recent IO commands, an element is generated according to the address accessed by the IO command and added to the address set of recent IO commands.

[0092] When a specified condition is met or a specified situation occurs, the elements in the address set of recent IO commands are upgraded to candidate sequence flows (and obtain candidate sequence flow descriptors). The specified conditions include, for example, that the number of hits of the elements in the address set of recent IO commands is greater than a specified threshold, that the number of hits of the elements in the address set of recent IO commands is greater than the number of hits of the candidate sequence flow descriptor, etc.

[0093] Figure 8 A flowchart for detecting a sequential flow according to another embodiment of the present application is shown.

[0094] Sequential flow detection unit 250 (see also Figure 4 ) obtains a read command (optionally, an address accessed by the read command) from the host interface 210 (810), and determines whether the address accessed by the read command hits the sequential stream (820).

[0095] For a sequential stream descriptor (eg, sequential stream descriptor 510 ) hit by the address accessed by the read command, the hit sequential stream descriptor is updated ( 830 ).

[0096] If the address (A1) accessed by the read command does not hit any of the maintained sequential stream descriptors, it is determined whether the address accessed by the read command hits the candidate sequential stream (850).

[0097] If the address accessed by the read command hits a candidate sequential flow descriptor (e.g., candidate sequential flow descriptor 540), the hit candidate sequential flow descriptor is updated (860). Further, for the updated hit candidate sequential flow descriptor, it is also identified whether the candidate sequential flow descriptor meets the condition for upgrading to a sequential flow descriptor (870). One of the sequential flow descriptors is updated according to the candidate sequential flow descriptor to be upgraded (880).

[0098] In an optional implementation, if the address accessed by the read command does not hit any candidate sequential stream descriptor, the address set of recent IO commands is updated according to the address accessed by the read command (852). For example, an element of the address set of recent IO commands is generated according to the address accessed by the read command, and the address of the read command is recorded in the generated element of the address set of recent IO commands, as well as the number of times the address is hit (for example, to 1). Optionally, in order to add the generated element to the address set of recent IO commands, each element of the address set of recent IO commands is traversed to find out whether there is an element in the address set of recent IO commands that will be hit by the address of the read command. If there is an element in the address set of recent IO commands that is hit by the address of the read command, the number of times the element is hit is incremented.

[0099] Further, for the updated address set of recent IO commands, it is also identified whether the updated element in the address set of recent IO commands meets the condition for upgrading to a candidate sequential flow descriptor (854). One of the candidate sequential flow descriptors is updated according to the element to be upgraded (856). For example, the selected candidate sequential flow descriptor is updated according to the address and the number of hits of the element to be upgraded. And optionally or further, for the selected sequential flow descriptor, an element of the address set of recent IO commands is generated according to the address and the number of hits recorded therein, and the generated element is added to the address set of recent IO commands.

[0100] Optionally or further, in response to an element of the address set of a recent IO command being upgraded to a candidate sequence flow, the process turns to step 870 to identify, for the updated hit candidate sequence flow descriptor, whether the candidate sequence flow descriptor meets the conditions for upgrading to a sequence flow descriptor.

[0101] Fig.9A A flowchart for implementing pre-reading according to an embodiment of the present application is shown.

[0102] According to an embodiment of the present application, when the sequence flow detection unit 250 maintains a valid sequence flow descriptor, the pre-reading unit 255 performs a pre-reading operation. The existence of a valid sequence flow descriptor means that there is currently an identified and valid sequence flow. The sequence flow descriptor is dynamic, and accordingly, the sequence flow is also dynamic. At any time, there may be 0, 1 or more sequence flows. The pre-reading unit 255 performs pre-reading on the existing sequence flows.

[0103] As an example, in response to a read command (910) obtained from the host interface hitting a sequential stream or in response to identifying a new sequential stream (a candidate sequential stream is upgraded to a sequential stream), pre-reading is implemented. The sequential stream detection unit 250 provides a pre-reading indication to the pre-reading unit 255 according to the read command obtained from the host interface hitting a sequential stream or identifying a new sequential stream (a candidate sequential stream is upgraded to a sequential stream). Optionally, the sequential stream detection unit 250 also obtains a pre-reading start address and a pre-reading data size from the hit sequential stream descriptor or the newly upgraded sequential stream descriptor. The pre-reading start address and the pre-reading size recorded in the sequential stream descriptor are the start address and the pre-reading size of the last pre-reading operation performed on the sequential stream indicated by the sequential stream descriptor.

[0104] If the read command hits the sequential stream, the sequential stream detection unit 250 or the cache management unit 260 also identifies whether the read command hits the cache unit filled by the previous pre-read operation (920). If the read command hits the cache unit filled by the previous pre-read operation, data is obtained from the hit cache unit as a response to the read command, and the pre-reading implemented on the sequential stream is also strengthened (930). Strengthening the pre-reading implemented on the sequential stream means increasing the size of the pre-read data, and / or starting the pre-reading at an address farther from the current address of the sequential stream. For example, the pre-reading unit 255 uses the larger of the end address of the address accessed by the read command and the end address of the last pre-reading as the starting address of this pre-reading, and uses the size of the last pre-reading or a multiple of the size of the last pre-reading as the size of this pre-reading. And optionally, the local pre-reading size should not exceed the specified maximum value. If the read command hits the sequential stream, but the read command does not hit the cache unit filled by the previous pre-reading operation, the pre-reading on the sequential stream is implemented cautiously (925). Pre-reading the sequence stream carefully means limiting the size of pre-read data and / or starting pre-reading at an address in the sequence stream that is closer to the current address. For example, the pre-reading unit 255 uses the end address of the address accessed by the read command as the starting address of this pre-reading, and uses the specified size as the size of this pre-reading. Optionally, in response to identifying a new sequence stream, pre-reading the sequence stream is also carefully performed.

[0105] In an optional embodiment, if the read command hits the sequential stream, the sequential stream detection unit 250 or the cache management unit 260 also identifies whether the address accessed by the read command is close to the address range of the last pre-read. The address accessed by the read command is close to the address range of the last pre-read, which means that the address accessed by the read command is within the address range of the last pre-read, or the distance from the boundary of the address range of the last pre-read is less than the specified threshold, which also means that the last pre-read operation has a positive effect, and the pre-read sequence is likely to be accessed by the real read command. If the address accessed by the read command is close to the address range of the last pre-read, strengthen the pre-reading implemented on the sequential stream. If the address accessed by the read command is not close to the address range of the last pre-read, carefully implement the pre-reading on the sequential stream.

[0106] Still optionally, pre-reading is performed on an existing sequence stream without taking the existence of a read command hitting the sequence stream as a prerequisite. For an existing sequence stream, even if no read command hits the sequence stream, pre-reading on the sequence stream is performed cautiously.

[0107] The pre-reading unit 255 performs a pre-reading operation (940) according to the start address of the pre-reading and the size of the pre-reading. The pre-reading operation is performed by, for example, issuing a pre-reading command to the back-end processing unit 270. The data read from the NVM chip 105 according to the pre-reading operation is stored in the cache unit. The sequential stream detection unit 250 also updates the pre-reading start address and the pre-reading size in the sequential stream descriptor according to the start address of the pre-reading and the size of the pre-reading.

[0108] Fig. 9B A flowchart for implementing pre-reading according to another embodiment of the present application is shown.

[0109] according to Fig. 9B In the embodiment, the pre-reading unit 255 performs pre-reading on the sequential stream indicated by the sequential stream descriptor.

[0110] For example, in response to a read command (950) obtained from a host interface hitting a sequential stream, and the address accessed by the read command is adjacent to the address range of the last pre-read (960), the pre-reading performed on the sequential stream is strengthened. If the address accessed by the read command is not adjacent to the address range of the last pre-read, the pre-reading performed on the sequential stream is performed cautiously (965).

[0111] In an optional embodiment, in response to identifying in step 960 that the address accessed by the read command is far from the address range of the last pre-read, it is further identified whether the read command hits the cache unit filled by the previous pre-read operation. If the read command does not hit the cache unit filled by the previous pre-read operation, turn to step 965 to carefully implement the pre-read on the sequential stream. If the read command hits the cache unit filled by the previous pre-read operation, it means that the previous pre-read operation is valid, but the pre-read address range is too far and deviates from the subsequent possible read command, so turn to step 975 to determine the size of this pre-read according to the cautious pre-read strategy.

[0112] In a still optional implementation, in response to identifying at step 960 that the address accessed by the read command is close to the address range of the last pre-read, the relationship between the data size accessed by the read command and the data size of the last pre-read is also determined (970). For example, if the data size accessed by the read command is close to the data size of the last pre-read, it also means that the last pre-read played a positive role and the waste of read bandwidth caused by the pre-read is small, so the pre-reading implemented on the sequential stream is strengthened, and in particular, the size of this pre-reading is determined according to the strengthened strategy (972). For example, the size of this pre-reading is set to be the same as the size of the last pre-reading or larger than the size of the last pre-reading. Optionally, if the data size accessed by the read command is significantly larger than the data size of the last pre-reading, the size of this pre-reading is also determined using the strengthened strategy.

[0113] Returning to step 970, if the size of the data accessed by the read command is significantly smaller than the size of the data pre-read last time, it means that the pre-read last time played a negative role, and the pre-read data was not fully utilized, resulting in a large waste of read bandwidth caused by pre-reading, so the size of this pre-reading is determined according to a cautious pre-reading strategy (975). For example, the size of this pre-reading is set to be smaller than the size of the last pre-reading.

[0114] And in step 980, since the address accessed by the read command is close to the address range of the last pre-read, an enhanced strategy is adopted to determine the start address of this pre-read. For example, the pre-read unit 255 uses the larger of the end address of the address accessed by the read command and the end address of the last pre-read as the start address of this pre-read.

[0115] And the pre-reading unit 255 performs a pre-reading operation according to the start address of the pre-reading and the size of the pre-reading (990).

[0116] Fig.10 A flowchart of sequential flow detection and pre-reading according to another embodiment of the present application is shown.

[0117] Sequential flow detection unit 250 (see also Figure 4 ) obtains a read command (optionally, an address accessed by the read command) from the host interface 210 (1010), and updates the address set of recent IO commands according to the address accessed by the read command (1020). For example, an element of the address set of recent IO commands is generated according to the address accessed by the read command, the address of the read command is recorded in the generated element of the address set of recent IO commands, and the number of times the address is hit is initialized (for example, to 1), and the generated element is added to the address set of recent IO commands.

[0118] Optionally, in order to add the generated element to the address set of recent IO commands, each element of the address set of recent IO commands is further traversed to find whether there is an element in the address set of recent IO commands that will be hit by the address of the read command. If there is an element in the address set of recent IO commands that is hit by the address of the read command, the number of times the element is hit is incremented.

[0119] It is determined whether the address accessed by the read command hits the sequential stream (1030). If the address accessed by the read command hits the sequential stream descriptor (eg, the sequential stream descriptor 510), the hit sequential stream descriptor is updated (1040).

[0120] Then, pre-reading is performed according to the hit sequential stream descriptor (1045). For example, the sequential stream detection unit 250 indicates the hit sequential stream descriptor to the pre-reading unit 255. Optionally, the pre-reading unit 255 is provided with information (obtained in step 1010) indicating whether the IO command hits the cache unit (or the number of hit cache units), the start address of the last pre-reading, and the size of the last pre-reading.

[0121] The pre-reading unit 255 performs pre-reading according to the information provided by the sequential flow detection unit 250. For example, according to Fig.9A or Fig. 9B The process of the embodiment shown processes pre-reading. It can be understood that Fig.9A and Fig. 9B For the purpose of clarity, the steps of obtaining the IO command ( 910 and 950 ) are shown, and the pre-read unit 255 performs the pre-reading without obtaining the IO command again.

[0122] Continue to view Fig.10 If the address accessed by the read command does not hit any of the maintained sequential stream descriptors (1030), it is determined whether the address accessed by the read command hits the candidate sequential stream (1050).

[0123] If the address accessed by the read command hits the candidate sequential flow descriptor (1050), the hit candidate sequential flow descriptor is updated (1060). Further, for the updated hit candidate sequential flow descriptor, it is also identified whether the candidate sequential flow descriptor meets the condition of upgrading to a sequential flow descriptor (1070). If the upgrading condition is met, one of the sequential flow descriptors is updated according to the candidate sequential flow descriptor to be upgraded (1080). For the newly generated sequential flow descriptor due to the upgrade, pre-reading is performed according to the newly upgraded sequential flow descriptor (1045).

[0124] If the address accessed by the read command does not hit the candidate sequence flow descriptor (1050), in this case, the address accessed by the read command does not hit any of the sequence flow descriptor and the candidate sequence flow descriptor. The number of times the address accessed by the read command does not hit any of the sequence flow descriptor and the candidate sequence flow descriptor is counted. If the number is greater than a specified threshold (1090), it means that the currently identified sequence flow and the candidate sequence flow descriptor deviate greatly from the actual situation, and the number of hits of all sequence flow descriptors and candidate sequence flow descriptors is updated (1095). For example, the number of hits is halved, the number of hits is subtracted from a specified value, or the number of hits is reduced proportionally.

[0125] The embodiment of the present application also provides a program including program code. When the program is loaded into a host and executed on the host, the program enables the processor of the host to execute one of the methods according to the embodiment of the present application provided above.

[0126] It should be understood that each block of the block diagram and the flow chart and the combination of blocks of the block diagram and the flow chart can be implemented by various means including computer program instructions, respectively. These computer program instructions can be loaded onto a general-purpose computer, a special-purpose computer or other programmable data control device to produce a machine, so that the instructions executed on the computer or other programmable data control device create a device for implementing the functions specified in one or more flow chart blocks.

[0127] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data control device to function in a particular manner, so that the instructions stored in the computer readable memory can be used to manufacture an article of manufacture including computer readable instructions for implementing the functions specified in one or more flowchart blocks. The computer program instructions may also be loaded onto a computer or other programmable data control device to cause a series of operations to be performed on the computer or other programmable data control device, thereby producing a computer-implemented process, and the instructions executed on the computer or other programmable data control device provide operations for implementing the functions specified in one or more flowchart blocks.

[0128] Thus, the blocks of the block diagrams and flow charts support a combination of means for performing a specified function, a combination of operations for performing a specified function, and a combination of program instruction means for performing a specified function. It should also be understood that each block of the block diagrams and flow charts and the combination of blocks of the block diagrams and flow charts can be implemented by a hardware-based special-purpose computer system that performs the specified function or operation, or by a combination of special-purpose hardware and computer instructions.

[0129] Although the present invention has been described with reference to examples, this is for illustrative purposes only and is not intended to limit the present application, and changes, additions and / or deletions to the embodiments may be made without departing from the scope of the present application.

[0130] Those skilled in the art to which these embodiments relate and who benefit from the teachings presented in the above description and associated drawings will recognize many modifications and other embodiments of the present application described herein. Therefore, it should be understood that the present application is not limited to the specific embodiments disclosed, and modifications and other embodiments are intended to be included within the scope of the appended claims. Although specific terms are employed herein, they are used only in a general and descriptive sense and are not used for the purpose of limitation.

Claims

1. A sequential flow detection method, characterized in that: include: In response to the address accessed by the first read command hitting a first sequential stream descriptor among the plurality of sequential stream descriptors, updating the address recorded in the first sequential stream descriptor with the address accessed by the first read command; Instructing to perform pre-reading on the first sequential stream corresponding to the first sequential stream descriptor; In response to the address accessed by the first read command not hitting any one of the plurality of sequential stream descriptors, identifying whether the address accessed in the first read command hits any one of the plurality of candidate sequential stream descriptors; In response to the address accessed by the first read command hitting a first candidate sequential flow descriptor among the plurality of candidate sequential flow descriptors, updating the address of the first candidate sequential flow descriptor record with the address accessed by the first read command, and incrementing the number of hits of the first candidate sequential flow descriptor record; Pre-reading is performed according to the newly upgraded sequence stream descriptor in the hit first candidate sequence stream descriptor; The contents recorded by the sequence flow descriptor include the address and the number of hits, and the candidate sequence flow descriptor records the same or similar contents as the sequence flow descriptor.

2. The method according to claim 1, wherein In response to the address accessed by the first read command, a first sequential stream descriptor among the plurality of sequential stream descriptors is hit, and the number of hits recorded in the first sequential stream descriptor is also incremented.

3. The method according to claim 2, wherein In response to the address accessed by the first read command not hitting any of the plurality of sequential stream descriptors and not hitting any of the plurality of candidate sequential stream descriptors, the hit count of each of the plurality of sequential stream descriptors and the hit count of each of the plurality of candidate sequential stream descriptors are decremented.

4. The method according to claim 3, wherein: If the address accessed by the read command is the same as, overlaps with, and / or is adjacent to the address recorded in the first sequential stream descriptor, it is recognized that the address accessed by the read command hits the first sequential stream descriptor.

5. The method according to claim 3, wherein: If the address accessed by the read command is the same as, overlaps with, and / or is adjacent to the address recorded in the first candidate sequential stream descriptor, it is recognized that the address accessed by the read command hits the first candidate sequential stream descriptor.

6. The method according to any one of claims 3 to 5, wherein: Also includes: In response to obtaining the first read command, the recent IO command address set is updated according to the address accessed by the first read command.

7. The method according to any one of claims 3 to 5, wherein: A first element is generated according to the address accessed by the first read command, and the first element is added to a recent IO command address set, wherein the first element records the address accessed by the first read command and the number of initialized hits.

8. The method according to claim 7, wherein: If the address accessed by the first read command hits the second element of the recent IO command address set, the hit count of the second element is incremented.

9. The method according to claim 8, wherein: Also includes: The second element is deleted from the recent IO command address set to accommodate the first element.

10. The method according to claim 9, wherein: Also includes: The second candidate sequence flow descriptor among the plurality of candidate sequence flow descriptors is updated using the address and the hit count recorded by the element of the recent IO command address set.

11. The method according to claim 10, wherein: It also includes: the second candidate sequential stream descriptor is a sequential stream descriptor with the smallest number of hits among the multiple candidate sequential stream descriptors.

12. A pre-reading method, characterized in that: include: The read command hits the sequential stream or candidate sequential stream and performs pre-reading; In response to receiving an instruction to perform pre-reading on the first sequential stream corresponding to the first sequential stream descriptor, pre-reading is performed according to the pre-reading start address and the local pre-reading size parameter; Storing the pre-read data in one or more cache units; Also includes: If the read command hits the cache unit, the pre-reading start address and the local pre-reading size parameters are determined according to the enhanced strategy; wherein the enhanced strategy includes increasing the pre-reading data size and / or starting the pre-reading at an address farther from the current address in the sequential stream; If the read command does not hit the cache unit, the pre-read start address and the local pre-read size parameters are determined according to a prudent strategy; wherein the prudent strategy includes limiting the pre-read data size and / or starting the pre-read at an address closer to the current address in the sequential stream; In response to an address accessed by a read command not hitting any one of a plurality of sequential stream descriptors, identifying whether the address accessed in the read command hits any one of a plurality of candidate sequential stream descriptors; In response to the address accessed by the read command hitting a candidate sequence flow descriptor among a plurality of candidate sequence flow descriptors, the address recorded in the candidate sequence flow descriptor is updated with the address accessed by the read command, and the number of hits recorded in the candidate sequence flow descriptor is incremented; pre-reading is performed according to a newly upgraded sequence flow descriptor among the hit candidate sequence flow descriptors; The contents recorded by the sequence flow descriptor include the address and the number of hits, and the candidate sequence flow descriptor records the same or similar contents as the sequence flow descriptor.

13. The method according to claim 12, wherein If the address accessed by the read command is not adjacent to the address range of the last pre-read of the first sequential stream, the pre-read start address and the local pre-read size parameters are determined according to a prudent strategy; If the address accessed by the read command is close to the address range of the last pre-read of the first sequential stream, and the data size accessed by the read command is similar to the data size of the last pre-read, the pre-read start address and the local pre-read size parameters are determined according to the enhanced strategy; in, Determining the pre-reading start address and local pre-reading size parameters according to the enhanced strategy includes increasing the pre-reading data size in the local pre-reading relative to the size of the pre-reading data last time, and / or performing pre-reading at an address farther than the start address of the pre-reading last time; Among them, determining the pre-reading start address and local pre-reading size parameters according to a cautious strategy includes: reducing the pre-reading data size in the local pre-reading relative to the size of the last pre-reading data, and / or using the end of the address range accessed by the read command as the start address of this pre-reading.

14. The method according to claim 12, wherein: If the address accessed by the read command is close to the address range of the last pre-read of the first sequential stream, and the data size accessed by the read command is not similar to the data size of the last pre-read, the pre-read start address and the local pre-read size parameters are determined according to a cautious strategy; Among them, determining the pre-reading start address and local pre-reading size parameters according to a cautious strategy includes: reducing the pre-reading data size in the local pre-reading relative to the size of the last pre-reading data, and / or using the end of the address range accessed by the read command as the start address of this pre-reading.

15. The method according to claim 12, wherein: If the address accessed by the read command is not adjacent to the address range of the last pre-read of the first sequence stream, and the read command hits the cache unit, the pre-read start address and the local pre-read size parameter are determined according to the first cautious strategy; if the address accessed by the read command is not adjacent to the address range of the last pre-read of the first sequence stream, and the read command does not hit the cache unit, the pre-read start address and the local pre-read size parameter are determined according to the second cautious strategy; Among them, determining the pre-reading start address and local pre-reading size parameters according to a cautious strategy includes: reducing the pre-reading data size in the local pre-reading relative to the size of the last pre-reading data, and / or using the end of the address range accessed by the read command as the start address of this pre-reading.

16. The method according to claim 12, wherein: If the address accessed by the read command is close to the address range of the last pre-read of the first sequence stream, the pre-read start address and the local pre-read size parameters are determined according to the enhanced strategy; if the address accessed by the read command is not close to the address range of the last pre-read of the first sequence stream, the pre-read start address and the local pre-read size parameters are determined according to the cautious strategy; Determining the pre-reading start address and the local pre-reading size parameters according to the enhanced strategy includes increasing the pre-reading data size in the local pre-reading relative to the size of the pre-reading data last time, and / or performing pre-reading at an address farther than the start address of the pre-reading last time; Among them, determining the pre-reading start address and local pre-reading size parameters according to a cautious strategy includes: reducing the pre-reading data size in the local pre-reading relative to the size of the last pre-reading data, and / or using the end of the address range accessed by the read command as the start address of this pre-reading.

17. A storage device, characterized in that: The invention comprises a control component and a non-volatile memory, wherein the control component implements the method according to any one of claims 1 to 16.

Citation Information

Cited By

  • Multi-stream storage device based on unified cache architecture

    CN110968520B

  • Applying a unified cache architecture to assemble data for non-volatile storage media

    CN110968528B