Sequence flow detection method and flash memory device

By using hash tables and linked list structures in flash memory devices to detect read requests, the sequential flow problem in the prior art is solved, and more efficient sequential flow recognition and flash device performance improvement are achieved.

CN119620937AActive Publication Date: 2025-03-14DAPUSTOR CORP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411583294.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-03-14
Estimated Expiration
2044-11-07

AI Technical Summary

Technical Problem

The prior art is difficult to identify sequential flows interfered with by random flow in sequential flow detection, resulting in low recognition efficiency of sequential flows.

Method used

By using the first hash table, non-sequential stream linked list and sequential stream linked list, the current read request is detected to identify the sequential stream interfered by the random stream. The specific steps include obtaining the current read request, querying the first hash table, determining whether the starting address exists, if it exists, merge the request and increase the request length, and if the length is greater than the threshold, it is determined as a sequential stream request.

Benefits of technology

It improves the recognition efficiency of sequential streams, can effectively identify sequential streams interfered with random streams, and improves the sequential reading performance of flash memory devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119620937A_ABST
    Figure CN119620937A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the field of storage device application, and discloses a sequence flow detection method and flash memory device.The sequence flow detection method comprises the steps that a first hash table is queried through an initial address of a current read request, and if it is determined that the current read request is a non-sequence flow request, the current read request is inserted into a non-sequence flow linked list; moreover, in combination with the request length of the historical request of the non-sequence flow linked list, whether the current read request is the sequence flow request is determined, and the current read request is inserted into the sequence flow linked list, so that the sequence flow of random flow interference can be identified, and the identification efficiency of the sequence flow is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage device applications, and in particular to a sequential stream detection method and a flash memory device. Background Art

[0002] Prefetching algorithm, also known as pre-reading algorithm, is a technique used to improve the performance of computer systems. The algorithm reduces the access latency to slow storage devices (such as hard disks or network storage) by loading the data into cache or memory before it is needed. Prefetching algorithms play a key role in a variety of applications, including operating systems, databases, etc. Prefetching algorithms are equally important in solid state drives (SSDs). Effective prefetching will significantly improve the sequential read performance of SSDs.

[0003] Sequence flow detection is the core processing part of the prefetch algorithm, which is used to filter out request sequences that meet the conditions. At present, sequence flow detection relies on the information provided by the host for identification, for example: grouping sequence flows according to the host's submission queue identifier or namespace identifier. However, this identification method can only support at most one sequence flow under each submission queue or namespace, and when the same sequence flow is sent to different submission queues, the sequence flow information will be lost. In addition, since the queue identifier and flow identifier are not strongly related to the sequence flow, and the time-local requests of the same queue may have concurrent sequence flows, and the requests under the same flow identifier may also be completely random, it is impossible to identify the sequence flow interfered by the random flow, resulting in low efficiency in sequence flow identification. Summary of the invention

[0004] An embodiment of the present application provides a sequential flow detection method and a flash memory device, which detects the current read request through a first hash table, a non-sequential flow linked list and a sequential flow linked list. The present application can identify the sequential flow interfered by the random flow, thereby improving the efficiency of sequential flow recognition.

[0005] The embodiments of the present application provide the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides a method for detecting a sequential flow, the method comprising:

[0007] Get the current read request, where the current read request corresponds to a start address and an end address;

[0008] According to the starting address, query the first hash table to determine whether the starting address exists in the first hash table;

[0009] If the starting address does not exist in the first hash table, determine that the current read request is a non-sequential stream request, and insert the current read request into a non-sequential stream linked list, wherein the non-sequential stream linked list is used to store historical requests for non-sequential streams;

[0010] If the starting address already exists in the first hash table, the current read request is merged with the historical request, and the request length of the historical request of the non-sequential stream linked list is increased;

[0011] Determine whether the request length of the historical request of the non-sequential stream linked list is greater than the length threshold;

[0012] If yes, determine that the current read request is a sequential flow request, and insert the current read request into a sequential flow linked list, wherein the sequential flow linked list is used to store historical requests of the sequential flow;

[0013] If not, it is determined that the current read request is a non-sequential stream request, and the current read request is inserted into the non-sequential stream linked list.

[0014] In some embodiments,

[0015] The non-sequential flow linked list includes a first LRU table, and the sequential flow linked list includes a second LRU table;

[0016] After inserting the current read request into the non-sequential stream linked list, the method further includes:

[0017] If the non-sequential stream linked list overflows, the start address and end address corresponding to the last read request of the non-sequential stream linked list are obtained;

[0018] According to the starting address corresponding to the last read request, query the second hash table to determine whether the starting address corresponding to the last read request exists in the second hash table;

[0019] If yes, get the previous read request of the last read request;

[0020] If not, the current read request of the non-sequential stream linked list is deleted, and the end address of the current read request is inserted into the second hash table.

[0021] In some embodiments,

[0022] The method also includes:

[0023] After obtaining a previous read request of the last read request, repeatedly querying the second hash table to determine whether a starting address of the previous read request of the last read request exists in the second hash table;

[0024] If the starting address of the previous read request of the last read request exists in the second hash table, the second hash table is queried repeatedly until all read requests of the non-sequential stream linked list are traversed;

[0025] If all read requests of the non-sequential stream linked list are traversed, the last read request of the non-sequential stream linked list is deleted.

[0026] In some embodiments,

[0027] Merge the current read request with the historical request, including:

[0028] Obtain the first historical request with the same starting address as the current read request;

[0029] Modify the end address of the first historical request to the end address of the current read request to obtain a second historical request;

[0030] The method also includes:

[0031] The second historical request is inserted into the non-sequential flow linked list, and the first historical request is deleted.

[0032] In some embodiments,

[0033] The method also includes:

[0034] After the current read request is inserted into the sequential flow linked list, if the sequential flow linked list overflows, the last read request of the sequential flow linked list is deleted.

[0035] In some embodiments,

[0036] The sequence flow list corresponds to multiple sequence flows;

[0037] The method also includes:

[0038] If the current read request is inserted into the sequence flow linked list, the last update time of the sequence flow corresponding to the current read request is updated;

[0039] If the difference between the last update time of a sequence flow and the current time is greater than the time threshold, the sequence flow is deleted.

[0040] In some embodiments, the first hash table is used to store key-value pairs corresponding to the logical block addresses, wherein the key-value pairs include a key and a hash value, and determining whether the start address exists in the first hash table includes:

[0041] Calculate the first key corresponding to the starting address;

[0042] Calculate a first hash value based on the first key;

[0043] Determine whether the first hash value exists in the first hash table;

[0044] If the first hash value exists in the first hash table, determining that the start address exists in the first hash table;

[0045] If the first hash value does not exist in the first hash table, it is determined that the start address does not exist in the first hash table.

[0046] In some embodiments, calculating the first key corresponding to the start address includes:

[0047] According to the logical block number corresponding to the starting address, determine the binary value corresponding to the logical block number;

[0048] Shift the binary value corresponding to the logical block number right by M bits to obtain a right-shifted binary value, where M is a positive integer;

[0049] The binary value after right shift is converted into a decimal value, and the converted decimal value is determined as the first key corresponding to the starting address.

[0050] In some embodiments,

[0051] The method also includes:

[0052] Calculate the second key corresponding to the end address of the current read request;

[0053] Calculate a second hash value based on the second key;

[0054] If the second hash value is not equal to the first hash value, and the second hash value exists in the first hash table, the current read request is discarded.

[0055] In some embodiments,

[0056] After obtaining the current read request, the method further includes:

[0057] Obtaining a current detection mode, wherein the detection mode includes a random flow filtering mode or a sequential flow detection mode;

[0058] If the current detection mode is the random stream filtering mode, and the current read request is identified as a sequential stream request, switching to the sequential stream detection mode, wherein the sequential stream detection mode includes: executing the steps after obtaining the current read request;

[0059] If the current detection mode is the sequential flow detection mode, and the number of current sequential flows is zero, then switch to the random flow filtering mode.

[0060] In some embodiments,

[0061] Random stream filtering modes, including:

[0062] According to the starting address of the current read request, query the second hash table to determine whether the starting address exists in the second hash table;

[0063] If the starting address exists in the second hash table, the current read request is merged with the historical request to obtain a merged request;

[0064] If the starting address does not exist in the second hash table, the ending address of the current read request is inserted into the second hash table.

[0065] In some embodiments, the second hash table is used to store key-value pairs corresponding to the logical block addresses, wherein the key-value pairs include a key and a hash value, the logical block address is the key of the second hash table, and each slot of the second hash table can store only one key-value pair;

[0066] Determining whether the start address exists in the second hash table includes:

[0067] Get the third key corresponding to the starting address;

[0068] Calculate a third hash value based on the third key;

[0069] Determine whether the third hash value exists in the second hash table;

[0070] If so, it is determined that the starting address exists in the second hash table;

[0071] If not, it is determined that the start address does not exist in the second hash table.

[0072] In some embodiments,

[0073] The method also includes:

[0074] When inserting the end address of the current read request into the second hash table, if a hash conflict occurs, the end address replaces the key in the second hash table, wherein the space of the second hash table is larger than the space of the non-sequential stream linked list, and the space of the second hash table is larger than the space of the sequential stream linked list.

[0075] In a second aspect, an embodiment of the present application provides a flash memory device, including:

[0076] A processor and a memory, the processor is used to execute the executable program code in the memory, and when the executable program code is executed, the processor executes the instructions of the sequential flow identification method of the first aspect.

[0077] The beneficial effect of the embodiment of the present application is that, different from the prior art, the embodiment of the present application provides a sequential flow detection method, including: obtaining a current read request, wherein the current read request corresponds to a starting address and an ending address; querying a first hash table according to the starting address to determine whether the starting address exists in the first hash table; if the starting address does not exist in the first hash table, determining that the current read request is a non-sequential flow request, and inserting the current read request into a non-sequential flow linked list, wherein the non-sequential flow linked list is used to store historical requests for non-sequential flows; if the starting address already exists in the first hash table, merging the current read request with the historical request, and increasing the request length of the historical request of the non-sequential flow linked list; determining whether the request length of the historical request of the non-sequential flow linked list is greater than a length threshold; if so, determining that the current read request is a sequential flow request, and inserting the current read request into a sequential flow linked list, wherein the sequential flow linked list is used to store historical requests for sequential flows; if not, determining that the current read request is a non-sequential flow request, and inserting the current read request into the non-sequential flow linked list.

[0078] The first hash table is queried through the starting address of the current read request. If it is determined that the current read request is a non-sequential stream request, the current read request is inserted into the non-sequential stream linked list; and, combined with the request length of the historical requests of the non-sequential stream linked list, it is determined whether the current read request is a sequential stream request, and the current read request is inserted into the sequential stream linked list. The present application can identify sequential streams interfered by random streams and improve the efficiency of identifying sequential streams. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0080] Figure 1 is a structural schematic diagram of a flash memory device provided in an embodiment of the present application;

[0081] Figure 2 It is a flow chart of a sequential flow detection method provided in an embodiment of the present application;

[0082] Figure 3 yes Figure 2 A detailed flowchart of step S203 in FIG.

[0083] Figure 4 yes Figure 2 A detailed flowchart of step S204 in FIG.

[0084] Figure 5 is another flow chart of a sequential flow detection method provided in an embodiment of the present application;

[0085] Figure 6 It is a schematic diagram of a process of switching detection modes provided in an embodiment of the present application;

[0086] Figure 7 is a schematic diagram of a sequential flow detection mode provided in an embodiment of the present application;

[0087] Figure 8 It is a flow chart of a random flow filtering mode provided in an embodiment of the present application;

[0088] Fig. 9 is a schematic diagram of a second hash table provided in an embodiment of the present application;

[0089] Fig.10 yes Figure 8 A detailed flowchart of step S802 in FIG.

[0090] Fig.11 It is a schematic diagram of the overall process of a sequential flow detection method provided in an embodiment of the present application;

[0091] Fig.12 It is a schematic diagram of the structure of another flash memory device provided in an embodiment of the present application.

[0092] Description of Figure Numbers:

[0093] Label name Label name 100 Flash memory devices 200 Host 110 Flash Media 120 Controller 121 processor 122 Memory 123 Flash Memory Controller 124 interface DETAILED DESCRIPTION

[0094] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0095] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional module division is performed in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a sequence different from the module division in the device or the flow chart. Furthermore, the words "first", "second", "third", etc. used in this application do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.

[0096] Sequential flow usually refers to a series of tasks, activities or commands executed in a specific order. Sequential flow detection is the core processing part of the prefetch algorithm, which is used to filter out the request sequence that meets the conditions. For example, in a group of I / O requests sorted by time, a continuous range of address requests is extracted, where continuous refers to the logical address continuity seen by the host. According to the characteristics of the address of this continuous range, it can be simply divided into the following categories:

[0097] (1) Random stream: The address segments of a certain interval request sequence have no obvious order relationship (such as 1919, 114, 810, 514...).

[0098] (2) Strictly continuous increasing sequence flow: The address segments of a certain interval request sequence differ by 1 (such as 1, 2, 3, 4, 5...).

[0099] (3) Non-strictly continuous increasing sequence flow: two consecutive address segments of a certain interval request sequence are not necessarily increasing, but multiple consecutive address segments are increasing (such as 1, 3, 2, 4, 5... (1, 3, 2 are not continuously increasing, but ignoring 3, they are all continuously increasing)) or continuous reading increases but the difference between consecutive address segments is not 1 (1, 4, 7, 8, 9...).

[0100] (4) Concurrent sequential streams: A subsequence of a requested address segment contains several sequential streams (such as 1, 101, 2, 102, 3, 103...).

[0101] (5) Sequential streams interfered by random streams: Sequential streams (including 2, 3, and 4) contain random streams (such as 1, 541, 2, 312, 3, 4, 4586, 5…).

[0102] As SSD technology evolves, random read performance is improving, and some sequential flow detection algorithms cannot keep up with the request processing speed of SSDs. Taking enterprise-level PCIe Gen5 SSDs as an example, the number of 4KB random read input / output operations per second (IOPS) is large, and if the sequential flow detection speed in the SSD is lower than the maximum IOPS, the prefetch algorithm will lose requests that are not processed due to cache overflow.

[0103] Related technologies include: a simple prefetch algorithm, which monitors all file access requests online, records the last read information of the file, and when a new request arrives, in addition to normal sequential flow judgment, it is also necessary to judge a variety of abnormal situations, including whether the prefetch function is disabled, whether the peripheral is too busy to prefetch, whether the memory pressure is too high, etc. These abnormal situations make this algorithm complex and inefficient. However, its sequential flow detection logic is relatively simple. The existing SSD prefetch algorithm refers to this strategy, records the last request sent by the host, and determines whether the current request is continuous with the previous one. If it is continuous, a pre-read is initiated. Since the simple prefetch algorithm only records one historical request, the algorithm cannot capture the sequential flow interfered by concurrent sequential flows and random flows, and cannot identify non-strictly continuous increasing sequential flows.

[0104] Related technologies also include: pre-fetching algorithms with files as objects, such as: on-demand pre-fetching algorithms of Linux systems, which are used to optimize the performance of concurrent sequential streams. The on-demand pre-fetching algorithm is logically divided into two parts: a monitoring / triggering part and a matching / execution part. The monitoring part is embedded in the read request process and checks whether the pre-fetching conditions are met before accessing the page. Its pre-fetching condition is accessing a cache missing page or a pre-fetching mark page. The matching part consists of a group of judgment modules, which check the initial read, subsequent read, interleaved read, random read and other modes. The Linux kernel maintains a pre-reading window for each file, recording the location of the last read request, the start and length of the pre-read page, and the advance amount of asynchronous pre-fetching. The number of windows memorized by the algorithm is equal to the number of files. The pre-reading window is updated when the file header is read, the sequential stream is captured, or the pre-fetching mark is accessed. Although the algorithm can effectively capture the sequential streams interfered by concurrent sequential streams and random streams, it cannot be deployed in SSDs due to its dependence on the Linux operating system environment.

[0105] Related technologies also include: pre-fetching algorithms that use arrays or jump tables to record historical windows. However, this method has high algorithm complexity and low performance. In addition, the ability to resist random flow interference and concurrent sequential flow detection is affected by the window size. The larger the window, the better the detection effect, but the higher the computational complexity, and it is difficult to balance the two.

[0106] Related technologies also include: pre-fetching algorithms that rely on information provided by the host, for example: grouping sequential flows according to the host's submission queue identifier or namespace identifier. However, this identification method can only support at most one sequential flow under each submission queue or namespace, and when the same sequential flow is sent to different submission queues, the sequential flow information will be lost. In addition, since the queue identifier and flow identifier are not strongly related to the sequential flow, and the time-localized requests of the same queue may have concurrent sequential flows, and the requests under the same flow identifier may also be completely random, it is impossible to identify the sequential flow interfered by the random flow, resulting in low efficiency in identifying the sequential flow.

[0107] In view of this, an embodiment of the present application provides a sequential flow detection method and a flash memory device, which detects a current read request through a first hash table, a non-sequential flow linked list and a sequential flow linked list to improve the efficiency of sequential flow recognition.

[0108] The technical solution of this application is described in detail below with reference to the accompanying drawings:

[0109] The sequential flow detection method in the embodiment of the present application is applied to flash memory devices, such as USB flash drives, SD cards, microSD cards, CF cards, solid state drives (SSDs), etc. Flash memory devices are storage devices that use semiconductor flash memory (NAND Flash) as a medium, and their main components include flash memory media, flash memory controllers, dynamic random access memory (DRAM), etc. Among them, an important function of the flash memory controller is to perform storage operations as a driver of the flash memory chip, and its main operations include erasing, writing, and reading.

[0110] See also Figure 1 , Figure 1 It is a structural schematic diagram of a flash memory device provided in an embodiment of the present application.

[0111] like Figure 1 As shown, the flash memory device 100 includes a flash memory medium 110 and a controller 120 connected to the flash memory medium 110. The flash memory device 100 is connected to the host 200 in a wired or wireless manner to achieve data interaction, for example, the host 200 sends a read request to the flash memory device 100, and the read request corresponds to a request tuple, and the request tuple includes a start address and an end address, so that the host 200 can read the data at the corresponding position of the flash memory device 100.

[0112] Flash memory medium 110, as the storage medium of flash memory device 100, is also called flash memory, NAND Flash, Flash memory or Flash particles. It is a type of storage device and a non-volatile memory that can store data for a long time even without current supply. Its storage characteristics are equivalent to those of a hard disk, making flash memory medium 110 the basis of storage media for various portable digital devices.

[0113] The controller 120 includes a processor 121 , a memory 122 , a flash memory controller 123 and an interface 124 .

[0114] The processor 121 is connected to the memory 122, the flash controller 123 and the interface 124 respectively, wherein the processor 121 and the memory 122, the flash controller 123 and the interface 124 can be connected via a bus or other means, and the processor is used to run the non-volatile software program, instructions and modules stored in the memory 122, so as to implement any one of the method embodiments of the present application. On this basis, through firmware development, it is also responsible for the core processing of the flash translation layer (FTL).

[0115] The memory 122 is mainly used to cache the read / write instructions sent by the host 200 , and to cache the read data or write data obtained from the flash memory medium 110 according to the read / write instructions sent by the host 200 .

[0116] The flash memory controller 123 is connected to the flash memory medium 110 , the processor 121 and the memory 122 , and is used to access the back-end flash memory medium 110 and manage various parameters and data I / O of the flash memory medium 110 .

[0117] Interface 124 connects the host 200, the processor 121 and the memory 122, and is used to receive data sent by the host 200, or receive data sent by the processor 121 to realize data transmission between the host 200 and the processor 121. Interface 124 can be a SATA-2 interface, a SATA-3 interface, a SAS interface, an MSATA interface, a PCI-E interface, a NGFF interface, a CFast interface, an SFF-8639 interface and an M.2NVME / SATA protocol.

[0118] See also Figure 2 , Figure 2 It is a flow chart of a sequential flow detection method provided in an embodiment of the present application.

[0119] like Figure 2 As shown, the process of the sequential flow detection method includes:

[0120] Step S201: Obtain a current read request, wherein the current read request corresponds to a start address and an end address.

[0121] Specifically, the current read request is sent by the host to the flash memory device, and the current read request corresponds to a request tuple, which includes a start address and an end address, wherein the start address and the end address are both logical block addresses (Logical Block Addressing, LBA), wherein the logical block address can be represented by a logical block number.

[0122] Step S202: query the first hash table according to the starting address.

[0123] Specifically, the first hash table is a sequential stream hash table, and the first hash table is used to store key-value pairs corresponding to logical block addresses, and the key-value pairs (key-value) include a key (key) and a hash value (value).

[0124] Step S203: Determine whether the start address exists in the first hash table.

[0125] For details, please refer to Figure 3 , Figure 3 yes Figure 2 Detailed flowchart of step S203 in .

[0126] like Figure 3 As shown, step S203 includes:

[0127] Step S2031: Calculate the first key corresponding to the start address.

[0128] Specifically, the starting address corresponds to a logical block number, that is, the starting address is represented by the logical block number, and calculating the first key corresponding to the starting address includes the following steps (1)-(3):

[0129] Step (1): According to the logical block number corresponding to the starting address, determine the binary value corresponding to the logical block number.

[0130] Specifically, the logical block number is a decimal value, and determining the binary value corresponding to the logical block number includes: converting the decimal value corresponding to the logical block number into a binary value, for example: if the logical block number is 3, then the binary value is 11.

[0131] Step (2): right-shift the binary value corresponding to the logical block number by M bits to obtain a right-shifted binary value, where M is a positive integer.

[0132] It can be understood that the right shift operation is for binary values. For example, if the logical block number is 3 in decimal, its binary value is 11, and it becomes 1 when shifted right by one position.

[0133] In the embodiment of the present application, M is a positive integer, M is the number of bits to be right-shifted, and the value of M can be set according to specific needs, for example: setting M=1 or 2, preferably, the value of M is 1.

[0134] Step (3): Convert the binary value after right shift into a decimal value, and determine the converted decimal value as the first key corresponding to the starting address.

[0135] For example: if the binary value after right shift is 1, then the decimal value is also 1. At this time, the first key corresponding to the starting address is 1.

[0136] In the embodiment of the present application, the value obtained by right shifting the binary value corresponding to the start address by M bits is used as the first key. Due to the determinism of the hash function, the same key is input into the hash function, and the calculated hash value is the same, so that the hash values ​​of the logical block addresses (LBA) within a certain range are judged to be the same, and the sequential stream in a non-strictly continuous increasing form can be identified, for example:

[0137] Assume that M=1, that is, the logical block number is shifted right by 1 bit to obtain the key. Assume that there is a non-strictly continuous increasing stream at this time, and its logical block number is (1, 3, 4, 5, 6, 7, 9...), at this time, the corresponding binary is (01, 11, 100, 101, 110, 111, 1001...), after shifting right by 1 bit, the binary is (0, 1, 10, 10, 11, 11, 100...), then the corresponding key is (0, 1, 2, 2, 3, 3, 4...), at this time, the keys corresponding to logical block numbers 4 and 5 are the same, and the logical The keys corresponding to logical block numbers 6 and 7 are also the same; assuming that the next logical block number is 11 at this time, for a simple prefetch algorithm, since there is no logical block number 10 in the historical request, it is not considered that the current logical block number can form a sequential stream with the historical request; and the present application checks the key of the historical request, for example: the key corresponding to logical block number 11 is 5. At this time, by checking whether there is 4 in the first hash table, and the key corresponding to 9 is 4, it will be judged as continuous, thereby identifying the sequential stream, thereby improving the accuracy of sequential stream identification.

[0138] Step S2032: Calculate a first hash value according to the first key.

[0139] Specifically, the first key is calculated through a hash function to obtain a first hash value.

[0140] It can be understood that a hash function is an algorithm that converts input data (such as a string, a number, etc.) into a hash value. For the same input, the hash function always returns the same hash value, that is, the same hash value can be calculated based on the same key.

[0141] In the embodiment of the present application, the hash function includes a simple hash function, an additive hash function, a multiplicative hash function, a string hash function, a cryptographic hash function, and the like.

[0142] Step S2033: Determine whether the first hash value exists in the first hash table.

[0143] The first hash table is used to record the logical block addresses corresponding to the historical requests. Specifically, the first hash table is used to store the key-value pairs corresponding to the logical block addresses, ie, the key and the hash value. It can be understood that the historical requests refer to the historical read requests.

[0144] By searching the first hash table, if the first hash table contains the first hash value, it is determined that the first hash value exists in the first hash table, which means that a key corresponding to the start address exists in the first hash table. At this time, step S2033 is entered.

[0145] If the first hash table does not contain the first hash value, it is determined that the first hash value does not exist in the first hash table, which means that the key corresponding to the start address does not exist in the first hash table. At this time, step S2034 is entered.

[0146] Step S2033: Determine whether the start address exists in the first hash table.

[0147] Specifically, if the first hash value exists in the first hash table, it is determined that the starting address exists in the first hash table. It can be understood that if the first hash value exists in the first hash table, it means that the current read request can correspond to the historical request, that is, the current read request has the same starting address as the historical request, and at this time, the current read request can be merged with the historical request.

[0148] Step S2034: Determine whether the start address does not exist in the first hash table.

[0149] Specifically, if the first hash value does not exist in the first hash table, it is determined that the start address does not exist in the first hash table.

[0150] Step S204: merge the current read request with the historical request.

[0151] Specifically, if the start address exists in the first hash table, the current read request is merged with the historical request.

[0152] For details, please refer to Figure 4 , Figure 4 yes Figure 2 A detailed flowchart of step S204 in FIG.

[0153] like Figure 4 As shown, step S204 includes:

[0154] Step S2041: Acquire the first historical request having the same starting address as the current read request.

[0155] Specifically, according to the starting address of the current read request, the non-sequential stream linked list is searched for the first historical request having the same starting address as the current read request.

[0156] Step S2042: modify the end address of the first historical request to the end address of the current read request to obtain a second historical request.

[0157] Specifically, after obtaining the first historical request, the end address of the first historical request is modified to the end address of the current read request to obtain the second historical request, wherein the request tuple corresponding to the second historical request is (the starting address of the current read request, the end address of the current read request).

[0158] In the embodiment of the present application, after obtaining the second historical request, the method further includes:

[0159] The second historical request is inserted into the non-sequential flow linked list, and the first historical request is deleted.

[0160] By deleting the first historical request and inserting the second historical request into the non-sequential flow linked list, the historical requests in the non-sequential flow linked list can be updated, which is beneficial to the identification of the sequential flow.

[0161] Step S205: Increase the request length of the historical requests of the non-sequential flow linked list.

[0162] Specifically, the non-sequential flow linked list corresponds to a request length, and the request length is used to record the number of times the historical request in the non-sequential flow linked list is hit, for example, when the historical request is hit once, the request length is increased by one, thereby obtaining an updated request length. In an embodiment of the present application, the initial request length can be set according to specific needs, for example, set to zero.

[0163] After the current read request is merged with the historical request, that is, after the current read request is merged with the first historical request, the request length of the historical request of the non-sequential stream linked list is increased.

[0164] Step S206: Determine whether the request length of the historical request of the non-sequential flow linked list is greater than the length threshold.

[0165] Specifically, the length threshold is set according to specific needs, for example, it can be set according to the number of commands in the sequential flow in the business model or business process, where the number of commands refers to the number of specific tasks or activities that need to be performed in the entire business model or business process. For example, in the business process, the number of commands in the sequential flow can be directly reflected as the number of specific tasks that participants need to perform. At this time, the length threshold can be set to be the same as the number of commands in the sequential flow in the business model or business process. For example, if the number of commands is 8, the length threshold is set to 8. By judging whether the request length of the historical request of the non-sequential flow linked list is greater than the length threshold, if the request length is greater than the length threshold, it means that the historical request in the non-sequential flow linked list is hit multiple times. At this time, it is determined that the current read request is a sequential flow request, that is, entering step S209.

[0166] Step S207: Determine whether the current read request is a non-sequential stream request.

[0167] Specifically, if the request length of the historical request of the non-sequential stream linked list is less than or equal to the length threshold, it is determined that the current read request is a non-sequential stream request.

[0168] Step S208: insert the current read request into the non-sequential flow linked list.

[0169] Specifically, if it is determined that the current read request is a non-sequential stream request, the current read request is inserted into the non-sequential stream linked list.

[0170] Step S209: Determine whether the current read request is a sequential stream request.

[0171] Specifically, if the request length of the historical request of the non-sequential stream linked list is greater than the length threshold, it is determined that the current read request is a sequential stream request.

[0172] Step S210: insert the current read request into the sequential flow linked list.

[0173] Specifically, if it is determined that the current read request is a sequential flow request, the current read request is inserted into the sequential flow linked list.

[0174] In the embodiment of the present application, after the current read request is inserted into the sequential flow linked list, it is further determined whether the sequential flow linked list overflows, so as to perform corresponding operations.

[0175] Specifically, after inserting the current read request into the sequence flow linked list, if the sequence flow linked list overflows, the last read request of the sequence flow linked list is deleted. Specifically, the sequence flow linked list overflows, including: the request length of the historical request of the sequence flow linked list exceeds the maximum length of the sequence flow linked list.

[0176] In the embodiment of the present application, the sequential flow linked list includes a second LRU table, and the last read request of the sequential flow linked list is the longest unused read request in the second LRU table, for example: the historical request that was first added to the second LRU table.

[0177] In the embodiment of the present application, the sequential stream linked list corresponds to multiple sequential streams, and one sequential stream corresponds to one stream object. After processing the current read request, various related information can be saved in the created or merged stream object. The present application also records the number of created stream objects in real time, and records whether a stream object is a sequential stream, and whether the request length of each stream object exceeds the length threshold.

[0178] In the embodiment of the present application, since it only relies on the logical address information of the current read request, that is, the logical block address, the present application can more effectively identify the sequential flow, thereby improving the recognition efficiency.

[0179] In the embodiment of the present application, after the current read request is inserted into the non-sequential flow linked list, it is further determined whether the non-sequential flow linked list overflows, so as to perform corresponding operations.

[0180] For details, please refer to Figure 5 , Figure 5 This is another flow chart of a sequential flow detection method provided in an embodiment of the present application.

[0181] like Figure 5 As shown, another process of the sequential flow detection method includes:

[0182] Step S501: insert the current read request into the non-sequential flow linked list.

[0183] Step S502: If the non-sequential stream linked list overflows, the start address and the end address corresponding to the last read request of the non-sequential stream linked list are obtained.

[0184] Specifically, the non-sequential stream linked list is used to store non-sequential stream requests. The maximum length of the non-sequential stream linked list is limited. After the current read request is inserted into the non-sequential stream linked list, if the non-sequential stream linked list overflows, specifically, the non-sequential stream linked list overflows, including: the length of the historical request of the non-sequential stream linked list exceeds the maximum length of the non-sequential stream linked list. If the length of the historical request at this time exceeds the maximum length of the non-sequential stream linked list, the start address and end address corresponding to the last read request of the non-sequential stream linked list are obtained.

[0185] Step S503: query the second hash table according to the starting address corresponding to the read request.

[0186] Specifically, the second hash table is a non-sequential stream hash table or a random stream hash table, and the second hash table is used to store logical block addresses, wherein the logical block addresses in the second hash table are hash values ​​of the second hash table, and each slot of the second hash table can store only one key-value pair.

[0187] Step S504: Determine whether the start address corresponding to the read request exists in the second hash table.

[0188] Specifically, the last read request is used as the current read request, and it is determined whether the starting address corresponding to the current read request exists in the second hash table, that is, whether the current read request hits the second hash table. If the starting address corresponding to the current read request exists in the second hash table, step S505 is entered.

[0189] If the starting address corresponding to the current read request does not exist in the second hash table, proceed to step S506.

[0190] Step S505: Determine whether all read requests in the non-sequential stream linked list have been traversed.

[0191] Specifically, after the current read request hits the second hash table, it is necessary to obtain the previous read request of the current read request in the non-sequential stream linked list. Therefore, it is necessary to determine whether all read requests in the non-sequential stream linked list have been traversed to confirm whether the previous read request of the current read request can be obtained.

[0192] If all read requests in the non-sequential flow linked list are traversed, the process proceeds to step S508: deleting the last read request in the non-sequential flow linked list.

[0193] If all read requests in the non-sequential stream linked list have not been traversed, it means that the previous read request of the current read request can be obtained, and then the process goes to step S506: obtaining the previous read request of the read request.

[0194] Step S506: Obtain the previous read request of the read request.

[0195] Specifically, if all read requests in the non-sequential flow linked list have not been traversed, the previous read request of the current read request is obtained in the non-sequential flow linked list, and the previous read request of the current read request is used as the new current read request to further repeat step S503 and subsequent steps.

[0196] Step S507: Delete the current read request of the non-sequential stream linked list.

[0197] Specifically, if the starting address corresponding to the current read request does not exist in the second hash table, the current read request of the non-sequential stream linked list is deleted.

[0198] Step S508: Delete the last read request of the non-sequential stream linked list.

[0199] Specifically, if all read requests of the non-sequential stream are traversed, the last read request of the non-sequential stream linked list is deleted.

[0200] In an embodiment of the present application, when a read request is eliminated in a non-sequential flow linked list, the historical requests that have been eliminated are recorded through the second hash table. When eliminating, the non-sequential flow linked list is traversed from the end, that is, the search is started from the last read request in the non-sequential flow linked list, and the first read request that fails to hit the second hash table is found, recorded and eliminated, thereby enabling potential sequential flows to be retained preferentially and increasing the probability of identifying sequential flows at a higher random flow ratio.

[0201] In an embodiment of the present application, in order to optimize the scenario with only random read requests and speed up the processing speed of the algorithm, the present application sets two different detection modes. When certain conditions are met, it is necessary to switch to different detection modes for detection.

[0202] For details, please refer to Figure 6 , Figure 6 It is a flow chart of a switching detection mode provided in an embodiment of the present application.

[0203] like Figure 6 As shown, the process of switching the detection mode includes:

[0204] Step S601: Acquire the current detection mode.

[0205] Among them, the detection mode includes a random flow filtering mode or a sequential flow detection mode. When the detection starts, the default detection mode is the random flow filtering mode, that is, in the initial state, the detection mode is the random flow filtering mode. If it is in the random flow filtering mode and a sequential flow request is identified, the random flow filtering mode is switched to the sequential flow detection mode.

[0206] Step S602: Determine whether the current detection mode is the random flow filtering mode.

[0207] Specifically, it is determined whether the current detection mode is the random stream filtering mode. If so, the process proceeds to step S603: identifying that the current read request is a sequential stream request.

[0208] Step S603: Identify that the current read request is a sequential stream request.

[0209] Specifically, by determining that the starting address of the current read request already exists in the first hash table, and the request length of the historical request of the non-sequential stream linked list is greater than the length threshold, it is determined that the current read request is a sequential stream request, and at this time, step S604 is entered.

[0210] It can be understood that the specific content of identifying whether the current read request is a sequential stream request can refer to the relevant content in the above embodiment, which will not be repeated here.

[0211] Step S604: Switch to sequential flow detection mode.

[0212] Specifically, if the current read request is a sequential flow request, the sequential flow detection mode is switched to. The sequential flow detection mode includes:

[0213] According to the starting address of the current read request, the first hash table is queried to determine whether the starting address exists in the first hash table.

[0214] If the starting address does not exist in the first hash table, the current read request is determined to be a non-sequential stream request, and the current read request is inserted into the non-sequential stream linked list, wherein the non-sequential stream linked list is used to store historical requests for non-sequential streams.

[0215] If the starting address already exists in the first hash table, the current read request is merged with the historical request, and the request length of the historical request of the non-sequential stream linked list is increased.

[0216] Determine whether the request length of the historical request of the non-sequential stream linked list is greater than the length threshold.

[0217] If so, it is determined that the current read request is a sequential flow request, and the current read request is inserted into a sequential flow linked list, wherein the sequential flow linked list is used to store historical requests of the sequential flow.

[0218] If not, it is determined that the current read request is a non-sequential stream request, and the current read request is inserted into the non-sequential stream linked list.

[0219] It is understandable that in the sequential flow detection mode, all read requests that fail to hit will create new historical requests unless there are overlapping historical requests. The overlapping historical requests refer to requests with completely identical start and end addresses.

[0220] In order to improve the detection capability of sequential flow with random flow interference under limited resources, the sequential flow detection mode corresponds to a sequential flow linked list and a non-sequential flow linked list, wherein the non-sequential flow linked list includes a first LRU table and the sequential flow linked list includes a second LRU table.

[0221] In the sequential flow detection mode, newly created read requests will be inserted into the non-sequential flow list. Only when the length of the historical requests in the non-sequential flow list exceeds the threshold, the historical request will be identified as a sequential flow, and resources such as cache will be allocated and hung in the sequential flow list. Therefore, if a flow has been identified as a sequential flow, only a new sequential flow can eliminate it, while the random flow will only eliminate the historical requests that have not yet formed a sequential flow.

[0222] Please refer to Figure 7 , Figure 7 It is a schematic diagram of a sequential flow detection mode provided in an embodiment of the present application.

[0223] like Figure 7 As shown, the sequential flow detection mode corresponds to the sequential flow linked list and the non-sequential flow linked list. In the initial state, the sequential flow linked list and the non-sequential flow linked list are both empty. When a read request is obtained, the second hash table, that is, the non-sequential flow hash table, is queried. If no historical request is found, that is, the starting address of the current read request does not exist in the second hash table, the end address of the current read request is inserted into the second hash table, and when inserted into the second hash table, the node of the second hash table will point to the current read request.

[0224] After the logical block address (LBA) is right-shifted, a key is obtained, wherein the sequential flow detection mode corresponds to a first hash table, the first hash table includes a plurality of slots, each slot includes at least one node, and each node is used to store a key-value pair, the key-value pair including a key and a hash value. By comparing the hash value corresponding to the starting address of the current read request with the hash value in the first hash table, it can be determined whether the current read request hits the first hash table, and further combined with the request length of the historical request of the non-sequential flow linked list to determine whether the current read request is inserted into the non-sequential flow linked list or the sequential flow linked list, the present application can identify the sequential flow interfered by the random flow, and improve the recognition efficiency of the sequential flow.

[0225] The following is a detailed description of the workflow of the sequential flow detection mode, which includes the following steps:

[0226] (1) Query the starting address of the current read request input in the first hash table. If it hits, that is, the starting address of the current read request is located in the first hash table, go to step (2); if it does not hit, that is, the starting address of the current read request is not located in the first hash table, go to step (5).

[0227] (2) The current read request is merged with the historical request in the non-sequential flow linked list, and the corresponding historical request in the non-sequential flow linked list is deleted, and the request length of the historical request in the non-sequential flow linked list is increased.

[0228] (3) Determine whether the request length of the historical request of the non-sequential flow linked list is greater than the length threshold; if so, proceed to step (4); if not, proceed to step (5).

[0229] (4) Insert the current read request into the sequence flow linked list and output the sequence flow request tuple; if the sequence flow linked list overflows, eliminate the last read request in the sequence flow linked list and proceed to step (7).

[0230] (5) Insert the current read request into the non-sequential flow linked list; if the non-sequential flow linked list overflows, obtain the request tuple corresponding to the last read request in the non-sequential flow linked list and proceed to step (6); if the non-sequential flow linked list does not overflow, proceed to step (7).

[0231] (6) Query the starting address of the current read request in the second hash table, where the last read request of the non-sequential stream linked list is the current read request. If a hit occurs, that is, the starting address of the last read request is located in the second hash table, obtain the previous read request of the last read request and repeat step (6); and, if a hit occurs but all read requests of the non-sequential stream linked list have been traversed, directly delete the last read request of the non-sequential stream linked list.

[0232] If there is a miss, that is, the starting address of the last read request is not located in the second hash table, the current read request of the non-sequential stream linked list is deleted, and the ending address of the current read request is inserted into the second hash table.

[0233] In the embodiment of the present application, potential sequential flows can be retained through an elimination mechanism, thereby improving the sequential flow identification capability in a scenario with a large amount of random flow interference.

[0234] In an embodiment of the present application, in a sequence flow detection mode, the sequence flow linked list corresponds to a plurality of sequence flows, and the method further includes:

[0235] If the current read request is inserted into the sequence flow linked list, the last update time of the sequence flow corresponding to the current read request is updated; if the difference between the last update time of a sequence flow and the current time is greater than the time threshold, the sequence flow is deleted.

[0236] Specifically, if the current read request is inserted into the sequence flow linked list, the last update time of the sequence flow corresponding to the current read request is updated to the current time, and the difference between the last update time and the current time is counted in real time. If there is a sequence flow whose difference between the last update time and the current time is greater than the time threshold, the sequence flow is deleted.

[0237] It is understandable that when a flow that has been identified as a sequential flow receives a new request, that is, when the new request is merged with the historical request, it means that the flow still exists, and the time of the flow is updated.

[0238] In the embodiment of the present application, a timer is set to record the most recent update time of each sequence flow to determine the difference between the most recent update time of each sequence flow and the current time. It can be understood that the timer is triggered when the power is turned on and always exists, for example, it is triggered once per second. When the timer is triggered, the timer-related function is executed to detect the state of the sequence flow. If the current time of a sequence flow exceeds the time threshold from the last update time, for example: the time threshold is 5 seconds, if the current time of a sequence flow exceeds 5 seconds from the last update time, then this flow is eliminated.

[0239] By using the time threshold to determine the sequence flows that have not been updated for a long time, the sequence flows that have not been updated for a long time are eliminated, and the cache and other resources are released in time, which can improve the hit rate of prefetching.

[0240] Furthermore, after all resources corresponding to the sequential flows are released, the current detection mode is switched from the sequential flow detection mode to the random flow filtering mode.

[0241] In the embodiment of the present application, in the sequential flow detection mode, there may be abnormal scenarios, so it is necessary to handle the abnormal scenarios, for example:

[0242] When two or more different sequential streams or random streams read the same address at a certain moment, the following scenario may occur: the hash values ​​of the start address and the end address of the current read request are not equal, and the hash value corresponding to the end address can hit the hash table. At this time, a new historical request cannot be created to the non-sequential stream linked list, and the current read request needs to be discarded.

[0243] Specifically, a first hash value corresponding to the start address of the current read request is calculated, and a second hash value corresponding to the end address of the current read request is calculated; if the second hash value is not equal to the first hash value, and the second hash value exists in the first hash table, the current read request is discarded.

[0244] It can be understood that the method for determining whether the second hash value exists in the first hash table is the same as the method for determining whether the first hash value exists in the first hash table, which will not be described in detail here.

[0245] In an embodiment of the present application, in a scenario where the hash values ​​of the start address and the end address of the current read request are not equal and the hash value corresponding to the end address can hit the hash table, multiple sequential streams only need to be identified as one sequential stream, and the principle of prefetching is to get the data into the cache in advance. Since the triggering conditions for prefetching are relatively loose, for example: if two streams read the same range, if lba3 already exists, no matter which stream creates it, a prefetch can be triggered to read the data into the cache. Therefore, the current read request can be directly discarded at this time, thereby avoiding more complex computing overhead and improving the recognition efficiency of sequential streams.

[0246] It is understandable that in the concurrent sequential flow scenario, due to the upper limit of resource allowance, for example, limited cache resources, sequential flows need to be eliminated.

[0247] For example: In a concurrent sequential flow scenario, assuming that the maximum number of currently identifiable sequential flows is N, when the number of sequential flows exceeds N, the completely interwoven sequence flows will cause the sequence flow linked list to jitter, and the sequence flow cannot be effectively identified. However, when the sequence flow resources are insufficient, the existing sequence flows can also be retained without the newly identified sequence flows eliminating the old sequence flows, and the old sequence flows are only eliminated after a timeout. Therefore, when the number of sequence flows exceeds the upper limit of the allowed resources, it is necessary to select a suitable elimination strategy based on the actual scenario. For example: when the current read request is inserted into the sequential flow linked list, if the number of sequential flows exceeds N, the sequence flow linked list will not eliminate the existing flows, and the new flow will not be put into the sequential flow linked list due to insufficient resources, and will continue to be retained in the non-sequential flow linked list for updating.

[0248] Through the elimination strategy, N sequence flows can be reserved for pre-fetching so that the sequence flow linked list does not jitter, so that the sequence flow can be effectively identified, which is beneficial to improving the recognition efficiency of the sequence flow.

[0249] (7) End the workflow of sequential flow detection.

[0250] Step S605: The current number of sequence flows is zero.

[0251] Specifically, if the current number of sequence flows is zero, that is, the number of sequence flows in the sequence flow linked list is zero, it means that there is no sequence flow at this time, and all are random flows. At this time, you can switch to the random flow filtering mode.

[0252] Step S606: Switch to random flow filtering mode.

[0253] Specifically, if the current detection mode is not the random flow filtering mode, that is, the current detection mode is the sequential flow detection mode, at this time, if the number of current sequential flows is zero, the sequential flow detection mode is switched to the random flow filtering mode.

[0254] For details, please refer to Figure 8 , Figure 8 It is a flow chart of a random flow filtering mode provided in an embodiment of the present application.

[0255] like Figure 8 As shown, the process of the random flow filtering mode includes:

[0256] Step S801: query the second hash table according to the starting address of the current read request.

[0257] The second hash table is a non-sequential stream hash table or a random stream hash table, and the second hash table is used to store key-value pairs corresponding to the logical block addresses.

[0258] Please refer to Fig. 9 , Fig. 9 It is a schematic diagram of a second hash table provided in an embodiment of the present application.

[0259] like Fig. 9 As shown, the logical block address (lba) is the key of the second hash table, and the second hash table includes multiple slots. Each slot has and can only store one node. Each node is used to store a key-value pair, which includes a key and a hash value, that is, each slot has and can only store one key-value pair.

[0260] In the embodiment of the present application, in the random stream filtering mode, in order to avoid identifying the logical block addresses (LBA) within a certain range as continuous, the logical block address itself is used as the hash value.

[0261] Step S802: Determine whether the start address exists in the second hash table.

[0262] Please refer to Fig.10 , Fig.10 yes Figure 8 Detailed flowchart of step S802 in .

[0263] like Fig.10 As shown, step S802 includes:

[0264] Step S8021: Obtain the third key corresponding to the starting address.

[0265] Specifically, the starting address corresponds to a logical block number, that is, the starting address is represented by the logical block number. Since the key in the second hash table is the logical block address itself, the logical block number corresponding to the starting address is directly used as the third key.

[0266] Step S8022: Calculate a third hash value according to the third key.

[0267] Specifically, the third key is calculated through a hash function to obtain a third hash value.

[0268] Step S8023: Determine whether the third hash value exists in the second hash table.

[0269] The second hash table is used to record the logical block address corresponding to the historical request. Specifically, the second hash table is used to record the key-value pair corresponding to the logical block address corresponding to the historical request, that is, the key and the hash value. Each slot of the second hash table can store only one key-value pair.

[0270] By searching the second hash table, it is determined whether the third hash value, that is, the logical block number corresponding to the logical block address, exists in the second hash table.

[0271] If the third hash value exists in the second hash table, it means that there is a key corresponding to the start address in the second hash table. At this time, the process proceeds to step S8024: determining whether the start address exists in the second hash table.

[0272] If the third hash value does not exist in the second hash table, it means that there is no key corresponding to the start address in the second hash table. At this time, the process proceeds to step S8025: determining whether the start address does not exist in the second hash table.

[0273] Step S8024: Determine whether the start address exists in the second hash table.

[0274] Specifically, if the third hash value exists in the second hash table, it is determined that the start address exists in the second hash table.

[0275] Step S8025: Determine whether the start address does not exist in the second hash table.

[0276] Specifically, if the third hash value does not exist in the second hash table, it is determined that the start address does not exist in the second hash table.

[0277] Step S803: merge the current read request with the historical request to obtain a merged request.

[0278] Specifically, if the start address exists in the second hash table, the current read request is merged with the historical request to obtain a merged request.

[0279] Specifically, the current read request is merged with the historical request to obtain a merged request, including:

[0280] According to the starting address of the current read request, search the non-sequential stream linked list for a historical request with the same starting address as the current read request; modify the ending address of the historical request to the ending address of the current read request to obtain a merged historical request.

[0281] In an embodiment of the present application, if the starting address exists in the second hash table, it means that the current read request is continuous with the historical request in the non-random flow linked list. At this time, it is necessary to switch to the sequential flow detection mode, that is, the merged request is detected through the sequential flow detection mode. The specific detection content can refer to the relevant content mentioned in the above embodiment, which will not be repeated here.

[0282] Step S804: inserting the end address of the current read request into the second hash table.

[0283] Specifically, if the start address does not exist in the second hash table, the end address of the current read request is inserted into the second hash table.

[0284] It can be understood that since the hash value corresponding to the end address of the current read request may have a hash conflict with the hash value corresponding to the key in the second hash table, that is, the end address of the current read request is used as the key, the calculated hash value is repeated with a hash value in the second hash table. At this time, since a slot can only store one key-value pair, the original slot is directly overwritten, that is, the key-value pair corresponding to the end address of the current read request is saved in the node of the slot in the second hash table to update the node of the original slot corresponding to the hash conflict, thereby realizing a conflict-covering hash table.

[0285] It is understood that a hash value is a fixed-size integer value calculated by applying a hash function to an input key. The hash value is used to determine the storage location (i.e., slot or index) of the key in the hash table.

[0286] In an embodiment of the present application, in the random stream filtering mode, the algorithm does not strictly save the past N historical requests, but uses a second hash table, i.e., a conflict-covered hash table, to replace the LRU table to record historical requests. It should be noted that conflict coverage means that the size of the slot of the hash table is only 1. When the hash table is inserted, if a valid element already exists at the position to be inserted, the element is directly overwritten. The present application uses hash conflicts to replace the first-in, first-out historical window. Although the conflict coverage does not cover the request that has not been accessed for the longest time, it can ensure the rapid insertion of new requests.

[0287] In order to improve the hit rate, the embodiment of the present application sets the space of the second hash table to be larger than the non-sequential stream linked list, and also larger than the space of the sequential stream linked list, for example: the size of the second hash table is set to be X times (X>1) of the non-sequential stream linked list, where X is an adjustable parameter. The second hash table is a non-sequential stream hash table or a random stream hash table, and the non-sequential stream linked list is an LRU table.

[0288] In the embodiment of the present application, in the scenario of sequential streams, it is assumed that the number of concurrent sequential streams is M. In some extreme cases, all concurrent sequential stream requests are completely interleaved, that is, there are no spatiotemporal continuous requests, and the first request of each stream all has a hash conflict, which causes the conflict to cover the information of the first M-1 sequential streams. In this extreme case, the second hash table, that is, the random stream hash table, only remembers the request of the last sequential stream, which is assumed to be lba_m.

[0289] At this time, when the second request of each sequential stream arrives, the first M-1 requests do not hit the sequential request, but because the logical block number itself is used as the key, it can be guaranteed that lba_m will not be overwritten. Therefore, the Mth sequential stream will be detected, and then switched to the sequential stream detection mode. The historical requests are strictly maintained through the LRU table. Although 2×(M-1) requests are lost in the random stream filtering mode, after the detection mode is switched, all sequential streams will be identified, and only the request length is lost. In the extreme case of the scenario where the random stream interferes with the sequential stream, each two sequential stream requests are separated by a non-sequential stream request or a random stream request with a hash conflict, and the random stream filtering mode will degenerate into a simple prefetch algorithm, that is, only the previous request is remembered. In this case, the switching of the detection mode is triggered by relying on spatiotemporal continuous requests.

[0290] In practice, the scenario where the random flow interferes with the sequential flow will remain in this mode after switching to the sequential flow detection mode. The sequential flow can be detected all the time after switching to the sequential flow mode through the random flow filtering mode. The early lost requests will not affect the detection effect of the sequential flow.

[0291] In an embodiment of the present application, assuming that all historical requests are stored in array a[n], and a current request is to read (113, 114), then the starting address of the request is 113, and the ending address is 114. Assuming that the hash key corresponding to 113 is 13, and the key corresponding to 113 is 14, then the stream passes through the random stream detection mode, and will first access a

[13] once. Since it is a random request, the value stored in a

[13] is not 113, so they will not be equal; then, access a

[14] once, set a

[14] to 114, and end. Therefore, the random stream filtering mode accesses the array twice in total. Since the random stream filtering mode only requires two array accesses, the processing speed is faster, thereby reducing the processing pressure of the SSD when performing high-speed random read requests. The random stream filtering mode is used to quickly judge the random stream, thereby avoiding the large overhead caused by maintaining the random stream history information.

[0292] In the embodiment of the present application, by switching different detection modes, detection can be better performed and the recognition efficiency of the sequential flow can be improved.

[0293] Please refer to Fig.10 , Fig.10 It is a schematic diagram of the overall process of a sequential flow detection method provided in an embodiment of the present application.

[0294] like Fig.10 As shown, the overall process of the sequential flow detection method includes:

[0295] start.

[0296] Step S101: Obtain a read request.

[0297] Specifically, a read request is obtained, wherein the read request includes a request tuple, and the request tuple includes a start address and an end address of the read request.

[0298] Step S102: Determine the current mode.

[0299] Specifically, the current mode is the current detection mode, wherein the current detection mode includes a random flow filtering mode or a sequential flow detection mode.

[0300] In the embodiment of the present application, the initial detection mode defaults to the random flow filtering mode.

[0301] Step S103: Query the start address through the second hash table.

[0302] The second hash table is a non-sequential stream hash table or a random stream hash table, wherein the second hash table stores nodes by conflict overwriting, and queries the starting address through the second hash table to determine whether the starting address of the current read request is located in the second hash table.

[0303] Step S104: Determine whether it is a hit.

[0304] Specifically, it is determined whether the starting address of the current read request is located in the second hash table. If so, the process proceeds to step S105: merging historical requests and switching to sequential stream filtering mode.

[0305] If not, proceed to step S120: insert the end address into the second hash table.

[0306] In some embodiments, determining whether there is a hit includes: determining whether there are m consecutive hits, that is, whether the starting address of the current read request hits multiple hash values ​​in the second hash table, that is, whether the hash value corresponding to the starting address of the current read request is the same as the multiple hash values ​​in the second hash table. If so, a hit is determined, and at this time, step S105 is entered: merge historical requests and switch to sequential flow detection mode.

[0307] If not, it is determined that there is no hit, and at this time, the process proceeds to step S120: inserting the end address into the second hash table.

[0308] Step S105: Merge historical requests and switch to sequential flow detection mode.

[0309] Specifically, the current read request is merged with the historical request, and the current detection mode is switched from the random stream filtering mode to the sequential stream detection mode.

[0310] Step S106: Query the start address through the first hash table.

[0311] Specifically, the first hash table is a sequential stream hash table, and the starting address is queried through the sequential stream hash table to determine whether the starting address exists in the first hash table.

[0312] Step S107: Determine whether it is a hit.

[0313] Specifically, it is determined whether the starting address hits the first hash table, that is, whether the hash value corresponding to the starting address exists in the first hash table. If so, it is determined that the starting address hits the first hash table. At this time, step S108 is entered: merging and deleting historical requests.

[0314] If not, it is determined that the start address does not hit the first hash table. At this time, the process proceeds to step S112: inserting the read request into the non-sequential stream linked list.

[0315] Step S108: Merge and delete historical requests.

[0316] Specifically, if the start address hits the first hash table, the current read request is merged with the historical request, and the historical request is deleted.

[0317] Step S109: Check whether the request length exceeds a threshold.

[0318] Specifically, it is determined whether the request length of the non-sequential flow linked list is greater than the length threshold. If so, the process proceeds to step S110: inserting the read request into the sequential flow linked list.

[0319] If not, proceed to step S112: insert the read request into the non-sequential flow linked list.

[0320] Step S110: insert the read request into the sequential flow linked list.

[0321] Specifically, the current read request is inserted into the sequential flow linked list. For example, the sequential flow linked list includes a sequential flow LRU table. The current read request is inserted into the sequential flow LRU table in chronological order.

[0322] It is understandable that the LRU table (Least Recently Used, LRU) is a commonly used cache replacement algorithm for managing data in the cache by giving priority to replacing the least recently used data when the cache is full and data needs to be replaced.

[0323] Step S111: Output a sequence flow request tuple.

[0324] Specifically, after the current read request is inserted into the sequence flow linked list, a request tuple of the sequence flow corresponding to the current read request is output, wherein the request tuple includes a start address and an end address of the sequence flow.

[0325] Furthermore, before outputting the sequence flow request tuple, the method further includes:

[0326] After inserting the current read request into the sequence flow linked list, determine whether the sequence flow linked list overflows. If so, delete the last read request of the sequence flow linked list; if not, output the request tuple of the sequence flow corresponding to the current read request.

[0327] Step S112: insert the read request into the non-sequential flow linked list.

[0328] Specifically, the current read request is inserted into the non-sequential flow linked list. For example, the non-sequential flow linked list includes a non-sequential flow LRU table. The current read request is inserted into the non-sequential flow LRU table in chronological order.

[0329] Step S113: Determine whether the non-sequential flow linked list overflows.

[0330] Specifically, determine whether the non-sequential flow linked list overflows, for example: determine whether the current length of the non-sequential flow linked list is greater than the maximum length. If so, it is determined that the non-sequential flow linked list overflows. At this time, enter step S114: obtain the last read request of the non-sequential flow linked list.

[0331] If the non-sequential flow linked list does not overflow, then end.

[0332] Step S114: Obtain the last read request of the non-sequential stream linked list.

[0333] Specifically, the request tuple of the last read request of the non-sequential stream linked list is obtained, that is, the starting address and the ending address of the last read request.

[0334] It can be understood that if the non-sequential stream linked list includes the first LRU table, the last read request is the read request that has not been used for the longest time, that is, the historical request that was first added to the first LRU table.

[0335] Step S115: Query the start address through the second hash table.

[0336] Specifically, the starting address of the last read request of the non-sequential stream linked list is queried through the second hash table to determine whether the starting address of the last read request exists in the second hash table.

[0337] Step S116: Determine whether it is a hit.

[0338] Specifically, determine whether the starting address of the last read request of the non-sequential stream linked list hits the second hash table, that is, whether the starting address of the last read request of the non-sequential stream linked list exists in the second hash table. If so, proceed to step S117: obtain the previous request of the request.

[0339] It can be understood that if the non-sequential stream linked list includes the first LRU table, the last read request is the read request that has not been used for the longest time, for example: the historical request that was first added to the first LRU table, and the previous request is a historical request that is closest in time to a certain request and was added to the first LRU table earlier, that is, the previous least recently used historical request.

[0340] If the starting address of the last read request of the non-sequential stream linked list does not exist in the second hash table, the process proceeds to step S118: inserting the ending address into the second hash table.

[0341] Step S117: Get the previous request of this request.

[0342] Specifically, the starting address of the previous read request of the last read request is obtained, and the process further returns to step S115, that is, the starting address of the previous read request of the last read request is queried through the second hash table to determine whether the starting address of the previous read request of the last read request exists in the second hash table. This process is repeated in this way until all historical requests of the non-sequential stream linked list are traversed.

[0343] Step S118: Insert the end address into the second hash table.

[0344] Specifically, if the starting address of the last read request of the non-sequential stream linked list does not exist in the second hash table, the ending address of the current read request is inserted into the second hash table.

[0345] Step S119: Eliminate the current read request.

[0346] Specifically, after the end address of the current read request is inserted into the second hash table, the current read request is eliminated.

[0347] By eliminating the current read request mechanism, potential sequential flows can be retained first, and the probability of identifying sequential flows can be increased under a higher random flow ratio.

[0348] Step S120: insert the end address into the second hash table.

[0349] Specifically, if the start address of the current read request does not exist in the second hash table, the end address of the current read request is inserted into the second hash table.

[0350] Finish.

[0351] It should be noted that the specific contents of some of the above steps can refer to the relevant contents in the above embodiments, which will not be repeated here.

[0352] In the embodiment of the present application, due to the use of an efficient sequential flow detection mode, historical requests are maintained through an LRU table, and a hash table is used to accelerate the search for read requests, the two steps of sequential flow detection are implemented as O(1) operations, the window size and algorithm complexity are decoupled, and the window size can be flexibly expanded to cope with workloads of different numbers of sequential flows. At the same time, the dual LRU table and unique elimination mechanism provided can efficiently identify potential sequential flows from a large number of randomly interfered flows.

[0353] In addition, due to the use of a fast random stream filtering mode, the historical window is replaced by a hash table with conflict coverage through loose constraints, which can quickly filter random requests within an acceptable request loss range and avoid performance bottlenecks under random requests.

[0354] Furthermore, by dynamically switching between the random flow filtering mode and the sequential flow detection mode, different detection modes can be executed according to the random situation of real-time requests, thereby effectively distinguishing pure random flows.

[0355] Furthermore, by judging the hash values ​​of logical addresses within a certain range to be the same, a sequential flow that is not in a strictly continuous increasing form can be identified, and the disorder problem of logical addresses caused by various reasons can be effectively avoided.

[0356] Moreover, this application effectively solves the problem of sequential flow loss caused by multi-flow concurrency and random flow interference through an efficient sequential flow detection method with a time complexity of O(1) and a space complexity of O(n). Moreover, in an embedded environment with limited performance, it can achieve the same request processing speed as PCIe Gen5 enterprise-level SSDs, and can effectively improve the cache hit rate and enhance the SSD performance under multi-flow concurrency through correct detection results.

[0357] In an embodiment of the present application, a sequential flow detection method is provided, including: obtaining a current read request, wherein the current read request corresponds to a starting address and an ending address; querying a first hash table according to the starting address to determine whether the starting address exists in the first hash table; if the starting address does not exist in the first hash table, determining that the current read request is a non-sequential flow request, and inserting the current read request into a non-sequential flow linked list, wherein the non-sequential flow linked list is used to store historical requests for non-sequential flows; if the starting address already exists in the first hash table, merging the current read request with the historical request, and increasing the request length of the historical request of the non-sequential flow linked list; determining whether the request length of the historical request of the non-sequential flow linked list is greater than a length threshold; if so, determining that the current read request is a sequential flow request, and inserting the current read request into a sequential flow linked list, wherein the sequential flow linked list is used to store historical requests for sequential flows; if not, determining that the current read request is a non-sequential flow request, and inserting the current read request into the non-sequential flow linked list.

[0358] The first hash table is queried through the starting address of the current read request. If it is determined that the current read request is a non-sequential stream request, the current read request is inserted into the non-sequential stream linked list; and, combined with the request length of the historical requests of the non-sequential stream linked list, it is determined whether the current read request is a sequential stream request, and the current read request is inserted into the sequential stream linked list. The present application can identify sequential streams interfered by random streams and improve the efficiency of identifying sequential streams.

[0359] Please refer to Fig.12 , Fig.12 It is a schematic diagram of the structure of another flash memory device provided in an embodiment of the present application.

[0360] like Fig.12 As shown, the flash memory device 100 includes one or more processors 121 and a memory 122. Fig.12 A processor 121 is taken as an example.

[0361] The processor 121 and the memory 122 may be connected via a bus or other means. Fig.12 The example of connecting through bus is taken in the following.

[0362] The processor 121 is used to provide computing and control capabilities to control the flash memory device 100 to perform corresponding tasks, for example, to control the flash memory device 100 to perform the sequential flow detection method in any one of the above method embodiments, including: obtaining a current read request, wherein the current read request corresponds to a start address and an end address; querying a first hash table according to the start address to determine whether the start address exists in the first hash table; if the start address does not exist in the first hash table, determining that the current read request is a non-sequential flow request, and inserting the current read request into a non-sequential flow linked list, wherein the non-sequential flow linked list is used to store historical requests for non-sequential flows; if the start address already exists in the first hash table, merging the current read request with the historical request, and increasing the request length of the historical request of the non-sequential flow linked list; determining whether the request length of the historical request of the non-sequential flow linked list is greater than a length threshold; if so, determining that the current read request is a sequential flow request, and inserting the current read request into the sequential flow linked list, wherein the sequential flow linked list is used to store historical requests for sequential flows; if not, determining that the current read request is a non-sequential flow request, and inserting the current read request into the non-sequential flow linked list.

[0363] The first hash table is queried through the starting address of the current read request. If it is determined that the current read request is a non-sequential stream request, the current read request is inserted into the non-sequential stream linked list; and, combined with the request length of the historical requests of the non-sequential stream linked list, it is determined whether the current read request is a sequential stream request, and the current read request is inserted into the sequential stream linked list. The present application can identify sequential streams interfered by random streams and improve the efficiency of identifying sequential streams.

[0364] The processor 121 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a hardware chip or any combination thereof; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0365] The memory 122, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as the program instructions / modules corresponding to the sequential flow detection method in the embodiment of the present application. The processor 121 can implement the sequential flow detection method in any of the following method embodiments by running the non-transitory software programs, instructions and modules stored in the memory 122. Specifically, the memory 122 may include a volatile memory (VM), such as a random access memory (RAM); the memory 122 may also include a non-volatile memory (NVM), such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD) or other non-transitory solid-state storage device; the memory 122 may also include a combination of the above-mentioned types of memory.

[0366] The memory 122 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 122 may optionally include a memory remotely arranged relative to the processor 121, and these remote memories may be connected to the processor 121 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0367] One or more modules are stored in the memory 122, and when executed by one or more processors 121, the sequential flow detection method in any of the above method embodiments is executed, for example, the above described sequential flow detection method is executed. Figure 2 The steps shown.

[0368] In the embodiment of the present application, the flash memory device 100 may also have components such as a wired or wireless network interface, a keyboard, and an input / output interface for input and output. The flash memory device 100 may also include other components for realizing device functions, which will not be described in detail here.

[0369] The present application also provides a computer-readable storage medium, such as a memory including a program code, and the program code can be executed by a processor to complete the sequential flow detection method in the above embodiment. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CDROM), a magnetic tape, a floppy disk, and an optical data storage device.

[0370] The embodiment of the present application also provides a computer program product, which includes one or more program codes, and the program codes are stored in a computer-readable storage medium. The processor of the flash memory device reads the program code from the computer-readable storage medium, and the processor executes the program code to complete the method steps of the sequential flow detection method provided in the above embodiment.

[0371] A person skilled in the art will appreciate that all or part of the steps for implementing the above embodiments may be accomplished by hardware or by hardware associated with a program code, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0372] Through the description of the above implementation methods, ordinary technicians in this field can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Ordinary technicians in this field can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0373] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as mentioned above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for detecting a sequential flow, characterized in that: The method comprises: Get the current read request, where the current read request corresponds to a start address and an end address; According to the starting address, query the first hash table to determine whether the starting address exists in the first hash table; If the starting address does not exist in the first hash table, determining that the current read request is a non-sequential stream request, and inserting the current read request into a non-sequential stream linked list, wherein the non-sequential stream linked list is used to store historical requests for non-sequential streams; If the starting address already exists in the first hash table, the current read request is merged with the historical request, and the request length of the historical request of the non-sequential stream linked list is increased; Determine whether the request length of the historical request of the non-sequential flow linked list is greater than a length threshold; If yes, determine that the current read request is a sequential flow request, and insert the current read request into a sequential flow linked list, wherein the sequential flow linked list is used to store historical requests of sequential flows; If not, it is determined that the current read request is a non-sequential stream request, and the current read request is inserted into the non-sequential stream linked list.

2. The method according to claim 1, characterized in that The non-sequential flow linked list includes a first LRU table, and the sequential flow linked list includes a second LRU table; After inserting the current read request into the non-sequential stream linked list, the method further includes: If the non-sequential stream linked list overflows, obtaining a start address and an end address corresponding to the last read request of the non-sequential stream linked list; According to the starting address corresponding to the last read request, query the second hash table to determine whether the starting address corresponding to the last read request exists in the second hash table; If yes, get the previous read request of the last read request; If not, the current read request of the non-sequential stream linked list is deleted, and the end address of the current read request is inserted into the second hash table.

3. The method according to claim 2, characterized in that The method further comprises: After obtaining a previous read request of the last read request, repeatedly querying the second hash table to determine whether a starting address of the previous read request of the last read request exists in the second hash table; If the starting address of the previous read request of the last read request exists in the second hash table, the second hash table is queried repeatedly until all read requests of the non-sequential stream linked list are traversed; If all read requests of the non-sequential stream linked list are traversed, the last read request of the non-sequential stream linked list is deleted.

4. The method according to claim 1, characterized in that: The merging of the current read request with the historical request includes: Acquire a first historical request having the same starting address as the current read request; Modifying the end address of the first historical request to the end address of the current read request to obtain a second historical request; The method further comprises: Insert the second historical request into the non-sequential flow linked list, and delete the first historical request.

5. The method according to claim 1, characterized in that The method further comprises: After the current read request is inserted into the sequence flow linked list, if the sequence flow linked list overflows, the last read request of the sequence flow linked list is deleted.

6. The method according to claim 1, characterized in that The sequence flow linked list corresponds to multiple sequence flows; The method further comprises: If the current read request is inserted into the sequence flow linked list, then the last update time of the sequence flow corresponding to the current read request is updated; If the difference between the last update time of a sequence flow and the current time is greater than the time threshold, the sequence flow is deleted.

7. The method according to claim 1, characterized in that The first hash table is used to store key-value pairs corresponding to logical block addresses, wherein the key-value pairs include a key and a hash value, and the determining whether the start address exists in the first hash table includes: Calculate the first key corresponding to the starting address; Calculate a first hash value based on the first key; Determine whether the first hash value exists in the first hash table; If the first hash value exists in the first hash table, determining that the start address exists in the first hash table; If the first hash value does not exist in the first hash table, it is determined that the start address does not exist in the first hash table.

8. The method according to claim 7, characterized in that The calculating the first key corresponding to the starting address includes: Determine the binary value corresponding to the logical block number according to the logical block number corresponding to the starting address; Shifting the binary value corresponding to the logic block number right by M bits to obtain a right-shifted binary value, wherein M is a positive integer; The binary value after right shift is converted into a decimal value, and the converted decimal value is determined as the first key corresponding to the starting address.

9. The method according to claim 7, characterized in that: The method further comprises: Calculating a second key corresponding to the end address of the current read request; Calculate a second hash value based on the second key; If the second hash value is not equal to the first hash value, and the second hash value exists in the first hash table, the current read request is discarded.

10. The method according to claim 1, characterized in that After obtaining the current read request, the method further includes: Obtaining a current detection mode, wherein the detection mode includes a random flow filtering mode or a sequential flow detection mode; If the current detection mode is the random stream filtering mode, and the current read request is identified as a sequential stream request, switching to the sequential stream detection mode, wherein the sequential stream detection mode includes: executing the steps after obtaining the current read request as claimed in claim 1; If the current detection mode is the sequential flow detection mode, and the number of current sequential flows is zero, then switch to the random flow filtering mode.

11. The method according to claim 10, characterized in that The random flow filtering mode includes: According to the starting address of the current read request, query the second hash table to determine whether the starting address exists in the second hash table; If the starting address exists in the second hash table, the current read request is merged with the historical request to obtain a merged request; If the start address does not exist in the second hash table, the end address of the current read request is inserted into the second hash table.

12. The method according to claim 11, characterized in that The second hash table is used to store key-value pairs corresponding to the logical block address, wherein the key-value pair includes a key and a hash value, the logical block address is the key of the second hash table, and each slot of the second hash table can store only one key-value pair; The determining whether the start address exists in the second hash table includes: Obtaining a third key corresponding to the starting address; Calculate a third hash value according to the third key; Determine whether the third hash value exists in the second hash table; If yes, determining that the starting address exists in the second hash table; If not, it is determined that the start address does not exist in the second hash table.

13. The method according to claim 12, characterized in that The method further comprises: When inserting the end address of the current read request into the second hash table, if a hash conflict occurs, the end address replaces the key in the second hash table, wherein the space of the second hash table is larger than the space of the non-sequential stream linked list, and the space of the second hash table is larger than the space of the sequential stream linked list.

14. A flash memory device, characterized in that: include: A processor and a memory, wherein the processor is used to execute an executable program code in the memory, and when the executable program code is executed, the processor executes instructions of the sequential flow identification method according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Method and device for detecting multiple paths of sequence flow

    CN106294211A

  • Service quality control method and device, electronic equipment and storage medium

    CN109992217A

  • METHOD, APPARATUS, AND COMPUTER PROGRAM PRODUCT FOR MANAGING Hash TABLES

    CN110109915A

  • Sequence flow identification method and device

    CN113194118A