Data reading method, system, device and medium
By counting cache hit rates, automatic switching between multi-plane reads and single-plane reads is achieved, solving the problem of degraded random read performance of NAND memory chips and improving random read performance.
Patent Information
- Application Number
- CN202111343953.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-14
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2041-11-14
AI Technical Summary
In the prior art, in the case of random reads of NAND memory chips, multi-plane read operations lead to performance degradation and inability to effectively hit the cache, thus affecting random read performance.
By counting cache hit rates, automatic switching between multi-plane reads and single-plane reads is achieved, and the read strategy is dynamically adjusted based on the cache hit rate to improve random read performance.
By dynamically adjusting the read strategy, the random read performance of the NAND memory chip is improved, the read time is reduced, and the data reading efficiency is improved.
Smart Images

Figure CN114138688B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage, and in particular to a data reading method, system, device and storage medium. Background Art
[0002] NAND memory chips can be divided into dies, planes, blocks, and pages. A die is a small square on a wafer, and a chip can contain several dies. The concept of die arises due to varying flash processes and technologies. Common names include Mono Die, A Die, and B Die. A chip contains N dies, and a die can include different numbers of planes depending on the model. A plane is the smallest unit that NAND can operate on based on read, write, and erase commands. A plane is a storage matrix containing several blocks. A block is the smallest erase unit of NAND Flash, and a block contains several pages. A page is the smallest read and write unit of a NAND chip, and a page contains several bytes.
[0003] In order to improve the sequential read performance in the prior art, when executing a page read operation within a plane, multi-plane reads are actually performed. That is, no matter which plane in the DIE is initiated for the read operation, such as reading plane0-page0, the data on page0 in all planes in the DIE will actually be read to the page register corresponding to each plane (each plane has its own independent page register). After the read of all planes is completed (read alignment is completed), the data in the plane0-page0 register actually read will be transferred to the DDR.
[0004] Since each page consists of multiple PBAs, for example, four, although the minimum NAND read unit is a page, the host actually reads in PBA units, meaning the data actually transferred from the register to the DDR is the amount of data corresponding to the PBA. Since reads are sequential, subsequent PBAs will also be pages within the DIE until the data on all planes of the page is read and the next page is cut. Since data on other planes has already been read into the page register when a page is read, subsequent reads can be transferred directly from the page register to the corresponding DDR (i.e., a cache hit), saving NAND read time.
[0005] However, in the case of random reads, PBA is not read sequentially, but randomly, and it is difficult to hit the cache. At this time, reading data from other planes not only does not improve performance, but it also increases the alignment time of multi-plane reads, lengthens the random read time, and affects the random read performance. Summary of the Invention
[0006] In view of this, in order to overcome at least one aspect of the above problems, an embodiment of the present invention provides a data reading method, comprising the following steps:
[0007] Counting the number of read requests received within a first preset time period and the number of cache hits;
[0008] Calculating a cache hit rate using the number of read requests and the number of cache hits;
[0009] In response to receiving a new read request, determining the DIE, the plane, and the page corresponding to the data to be read according to the physical address carried in the new read request;
[0010] A number of planes to be read under the corresponding DIE are determined according to the cache hit rate, and data in a page with the same number as the corresponding page in each plane to be read is read into the cache.
[0011] In some embodiments, determining a number of planes to be read under the corresponding DIE according to the cache hit rate, and reading data in a page with the same number as the corresponding page in each plane to be read into the cache, further includes:
[0012] In response to the cache hit rate being less than a threshold, only data in a page corresponding to a plane corresponding to the data to be read is read into the cache.
[0013] In some embodiments, further comprising:
[0014] In response to receiving a read request again after the second preset time period, determining the plane number and the page number corresponding to the current data to be read according to the physical address carried in the read request received again;
[0015] The data in the page with the same number as the page corresponding to the currently read data in each plane under the corresponding DIE is read into the cache.
[0016] In some embodiments, determining a number of planes to be read under the corresponding DIE according to the cache hit rate, and reading data in a page with the same number as the corresponding page in each plane to be read into the cache, further includes:
[0017] In response to the cache hit rate being not less than a threshold, data in a page having the same number as the corresponding page in each plane under the corresponding DIE is read into the cache.
[0018] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a data reading system, comprising:
[0019] A statistics module configured to count the number of read requests received and the number of cache hits within a first preset time period;
[0020] A calculation module configured to calculate a cache hit rate using the number of read requests and the number of cache hits;
[0021] a determination module configured to, in response to receiving a new read request, determine a DIE, a corresponding plane, and a corresponding page corresponding to the data to be read according to a physical address carried in the new read request;
[0022] The reading module is configured to determine a number of planes to be read under the corresponding DIE according to the cache hit rate, and read data in a page with the same number as the corresponding page in each plane to be read into the cache.
[0023] In some embodiments, the reading module is further configured to:
[0024] In response to the cache hit rate being less than a threshold, only data in a page corresponding to a plane corresponding to the data to be read is read into the cache.
[0025] In some embodiments, the reading module is further configured to:
[0026] In response to receiving a read request again after the second preset time period, determining the DIE, the plane, and the page corresponding to the current data to be read according to the physical address carried in the read request received again;
[0027] The data in the page with the same number as the page corresponding to the currently read data in each plane under the corresponding DIE is read into the cache.
[0028] In some embodiments, the reading module is further configured to:
[0029] In response to the cache hit rate being not less than a threshold, data in a page having the same number as the corresponding page in each plane under the corresponding DIE is read into the cache.
[0030] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a computer device, including:
[0031] at least one processor; and
[0032] A memory storing a computer program that can be run on the processor, wherein the processor executes the steps of any one of the data reading methods described above when executing the program.
[0033] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the data reading methods described above are performed.
[0034] The present invention has one of the following beneficial technical effects: the solution proposed in the present invention realizes automatic switching between multi-plane reading and single-plane reading by counting the cache hit rate when reading data, thereby improving random read performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying any creative work.
[0036] Figure 1 A schematic diagram of a flow chart of a data reading method provided by an embodiment of the present invention;
[0037] Figure 2 A schematic structural diagram of a data reading system provided by an embodiment of the present invention;
[0038] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention;
[0039] Figure 4 A schematic structural diagram of a computer-readable storage medium provided for an embodiment of the present invention. DETAILED DESCRIPTION
[0040] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.
[0041] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. Subsequent embodiments will not explain this one by one.
[0042] According to one aspect of the present invention, an embodiment of the present invention provides a data reading method, such as Figure 1 As shown, it may include the steps of:
[0043] S1, counting the number of read requests received and the number of cache hits within a first preset time period;
[0044] S2, calculating a cache hit rate using the number of read requests and the number of cache hits;
[0045] S3, in response to receiving a new read request, determining the DIE, the plane, and the page corresponding to the data to be read according to the physical address carried in the new read request;
[0046] S4, determining a number of planes to be read under the corresponding DIE according to the cache hit rate, and reading data in a page with the same number as the corresponding page in each plane to be read into the cache.
[0047] The solution proposed in the present invention realizes automatic switching between multi-plane reading and single-plane reading by counting the cache hit rate when reading data, thereby improving random read performance.
[0048] In some embodiments, in step S1, the number of read requests received within a first preset time period and the number of cache hits are counted. Specifically, the initial default reading method is multi-plane reading, that is, the data in the page with the same number as the corresponding page in each plane under the corresponding DIE is read into the cache. At this time, the count statistics of the number of read requests and the number of read completions can be increased respectively, and the number of read requests that hit the cache can be counted, so as to perform step S2 to calculate the cache hit rate.
[0049] In some embodiments, determining a number of planes to be read under the corresponding DIE according to the cache hit rate, and reading data in a page with the same number as the corresponding page in each plane to be read into the cache, further includes:
[0050] In response to the cache hit rate being less than a threshold, only data in the page corresponding to the to-be-read data is read into the cache.
[0051] Specifically, when the cache hit rate is lower than the threshold, it indicates that the type of the read request is a random read. In this case, it can be switched to a single-plane read, that is, only the data in the page corresponding to the data to be read is read into the cache.
[0052] In some embodiments, determining a number of planes to be read under the corresponding DIE according to the cache hit rate, and reading data in a page with the same number as the corresponding page in each plane to be read into the cache, further includes:
[0053] In response to the cache hit rate being not less than a threshold, data in a page having the same number as the corresponding page in each plane under the corresponding DIE is read into the cache.
[0054] Specifically, when the cache hit rate is higher than the threshold, it indicates that the type of read request is sequential read. At this time, it can be switched to multi-plane read, that is, the data in the page with the same number as the corresponding page in each plane under the corresponding DIE is read into the cache.
[0055] In some embodiments, further comprising:
[0056] In response to receiving a read request again after the second preset time period, determining the plane number and the page number corresponding to the current data to be read according to the physical address carried in the read request received again;
[0057] The data in the page with the same number as the page corresponding to the currently read data in each plane under the corresponding DIE is read into the cache.
[0058] Specifically, when the read IO stops or no read occurs within a short unit time (such as 1s) or after a certain period of time (such as 1h), it automatically switches back to multi-plane reading, that is, the read request is received again after the second preset time period, and then it switches to the default multi-plane reading, and the relevant counts used to calculate the cache command rate are cleared. In this way, when a read request is received again, the DIE, the corresponding plane and the corresponding page corresponding to the current data to be read can be determined based on the physical address it carries, and then the data in the page with the same number as the page corresponding to the current data to be read in each plane under the corresponding DIE is read into the cache. When multi-plane reading, continue to calculate the cache hit rate within a unit time (such as 1 minute), and repeat.
[0059] The solution proposed in the present invention realizes automatic switching between multi-plane reading and single-plane reading by counting the cache hit rate when reading data, thereby improving random read performance.
[0060] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a data reading system 400, such as Figure 2 As shown, including:
[0061] A statistics module 401 is configured to count the number of read requests received and the number of cache hits within a first preset time period;
[0062] A calculation module 402 is configured to calculate a cache hit rate using the number of read requests and the number of cache hits;
[0063] The determination module 403 is configured to, in response to receiving a new read request, determine the DIE, the plane, and the page corresponding to the data to be read according to the physical address carried in the new read request;
[0064] The reading module 404 is configured to determine a number of planes to be read under the corresponding DIE according to the cache hit rate, and read data in a page with the same number as the corresponding page in each plane to be read into the cache.
[0065] In some embodiments, the reading module 404 is further configured to:
[0066] In response to the cache hit rate being less than a threshold, only data in a page corresponding to a plane corresponding to the data to be read is read into the cache.
[0067] In some embodiments, the reading module 404 is further configured to:
[0068] In response to receiving a read request again after the second preset time period, determining the DIE, the plane, and the page corresponding to the current data to be read according to the physical address carried in the read request received again;
[0069] The data in the page with the same number as the page corresponding to the currently read data in each plane under the corresponding DIE is read into the cache.
[0070] In some embodiments, the reading module 404 is further configured to:
[0071] In response to the cache hit rate being not less than a threshold, data in a page having the same number as the corresponding page in each plane under the corresponding DIE is read into the cache.
[0072] The solution proposed in the present invention realizes automatic switching between multi-plane reading and single-plane reading by counting the cache hit rate when reading data, thereby improving random read performance.
[0073] Based on the same inventive concept, according to another aspect of the present invention, Figure 3 As shown, an embodiment of the present invention further provides a computer device 501, including:
[0074] at least one processor 520; and
[0075] The memory 510 stores a computer program 511 that can be run on the processor. When the processor 520 executes the program, the following steps are performed:
[0076] Counting the number of read requests received within a first preset time period and the number of cache hits;
[0077] Calculating a cache hit rate using the number of read requests and the number of cache hits;
[0078] In response to receiving a new read request, determining the DIE, the plane, and the page corresponding to the data to be read according to the physical address carried in the new read request;
[0079] A number of planes to be read under the corresponding DIE are determined according to the cache hit rate, and data in a page with the same number as the corresponding page in each plane to be read is read into the cache.
[0080] In some embodiments, determining a number of planes to be read under the corresponding DIE according to the cache hit rate, and reading data in a page with the same number as the corresponding page in each plane to be read into the cache, further includes:
[0081] In response to the cache hit rate being less than a threshold, only data in a page corresponding to a plane corresponding to the data to be read is read into the cache.
[0082] In some embodiments, further comprising:
[0083] In response to receiving a read request again after the second preset time period, determining the DIE, the plane, and the page corresponding to the current data to be read according to the physical address carried in the read request received again;
[0084] The data in the page with the same number as the page corresponding to the currently read data in each plane under the corresponding DIE is read into the cache.
[0085] In some embodiments, determining a number of planes to be read under the corresponding DIE according to the cache hit rate, and reading data in a page with the same number as the corresponding page in each plane to be read into the cache, further includes:
[0086] In response to the cache hit rate being not less than a threshold, data in a page having the same number as the corresponding page in each plane under the corresponding DIE is read into the cache.
[0087] The solution proposed in the present invention realizes automatic switching between multi-plane reading and single-plane reading by counting the cache hit rate when reading data, thereby improving random read performance.
[0088] Based on the same inventive concept, according to another aspect of the present invention, Figure 4 As shown, an embodiment of the present invention further provides a computer-readable storage medium 601, which stores computer program instructions 610. The computer program instructions 610 are executed by a processor to perform the following steps:
[0089] Counting the number of read requests received within a first preset time period and the number of cache hits;
[0090] Calculating a cache hit rate using the number of read requests and the number of cache hits;
[0091] In response to receiving a new read request, determining the DIE, the plane, and the page corresponding to the data to be read according to the physical address carried in the new read request;
[0092] A number of planes to be read under the corresponding DIE are determined according to the cache hit rate, and data in a page with the same number as the corresponding page in each plane to be read is read into the cache.
[0093] In some embodiments, determining a number of planes to be read under the corresponding DIE according to the cache hit rate, and reading data in a page with the same number as the corresponding page in each plane to be read into the cache, further includes:
[0094] In response to the cache hit rate being less than a threshold, only data in a page corresponding to a plane corresponding to the data to be read is read into the cache.
[0095] In some embodiments, further comprising:
[0096] In response to receiving a read request again after the second preset time period, determining the DIE, the plane, and the page corresponding to the current data to be read according to the physical address carried in the read request received again;
[0097] The data in the page with the same number as the page corresponding to the currently read data in each plane under the corresponding DIE is read into the cache.
[0098] In some embodiments, determining a number of planes to be read under the corresponding DIE according to the cache hit rate, and reading data in a page with the same number as the corresponding page in each plane to be read into the cache, further includes:
[0099] In response to the cache hit rate being not less than a threshold, data in a page having the same number as the corresponding page in each plane under the corresponding DIE is read into the cache.
[0100] The solution proposed in the present invention realizes automatic switching between multi-plane reading and single-plane reading by counting the cache hit rate when reading data, thereby improving random read performance.
[0101] Finally, it should be noted that a person skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant 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.
[0102] Furthermore, it should be appreciated that the computer-readable storage media (eg, memory) herein can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory.
[0103] It will also be appreciated by those skilled in the art that the various exemplary physical blocks, modules, circuits and algorithmic steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given of the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or hardware depends on specific applications and the design constraints imposed on the entire system. Those skilled in the art can implement the function in various ways for each specific application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the embodiments of the present invention.
[0104] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope of the embodiments disclosed in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless expressly limited to the singular.
[0105] It should be understood that, as used herein, the singular forms "a" and "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" is intended to include any and all possible combinations of one or more of the associated listed items.
[0106] The serial numbers of the embodiments disclosed in the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0107] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by a program instructing the relevant hardware, 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.
[0108] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples. Within the spirit of the embodiments of the present invention, the technical features of the above embodiments or different embodiments may be combined, and there are many other variations of different aspects of the above embodiments of the present invention, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the scope of protection of the embodiments of the present invention.
Claims
1. A data reading method, characterized in that: The following steps are involved: Counting the number of read requests received and the number of cache hits within a first preset time period; Calculating a cache hit rate using the number of read requests and the number of cache hits; In response to receiving a new read request, determining the DIE, the plane, and the page corresponding to the data to be read according to the physical address carried in the new read request; Determine a number of planes to be read under the corresponding DIE according to the cache hit rate, and read data in a page with the same number as the corresponding page in each plane to be read into the cache, wherein, in response to the cache hit rate being less than a threshold, it indicates that the type of the new read request is a random read, and switch to single-plane read, and only read data in a corresponding page under the plane corresponding to the data to be read into the cache; In response to receiving a read request again after the second preset time period, determining the DIE, the corresponding plane, and the corresponding page corresponding to the data to be read according to the physical address carried in the read request received again, clearing the relevant counts used to calculate the cache hit rate and switching to multi-plane read, and reading data from the page with the same number as the page corresponding to the data to be read in each plane under the corresponding DIE into the cache; In response to the cache hit rate being not less than the threshold, it indicates that the type of the new read request is sequential read, and the read is switched to multi-plane read, and the data in the page with the same number as the corresponding page in each plane under the corresponding DIE is read into the cache.
2. A data reading system, characterized in that: include: A statistics module configured to count the number of read requests received and the number of cache hits within a first preset time period; A calculation module configured to calculate a cache hit rate using the number of read requests and the number of cache hits; a determination module configured to, in response to receiving a new read request, determine a DIE, a corresponding plane, and a corresponding page corresponding to the data to be read according to a physical address carried in the new read request; a reading module configured to determine a number of planes to be read under the corresponding DIE according to the cache hit rate, and read data in a page with the same number as the corresponding page in each plane to be read into the cache; The read module is also configured to: In response to the cache hit rate being less than the threshold, indicating that the type of the new read request is a random read, switching to single-plane read, and only reading data in the page corresponding to the plane corresponding to the data to be read into the cache; In response to receiving a read request again after the second preset time period, determining the DIE, the plane, and the page corresponding to the data to be read according to the physical address carried in the read request received again, clearing the relevant counts used to calculate the cache hit rate and switching to multi-plane read, and reading data from the page with the same number as the page corresponding to the data to be read in each plane under the corresponding DIE into the cache; In response to the cache hit rate being not less than the threshold, it indicates that the type of the new read request is sequential read, and the read is switched to multi-plane read, and the data in the page with the same number as the corresponding page in each plane under the corresponding DIE is read into the cache.
3. A computer device comprising: at least one processor; as well as A memory storing a computer program that can be run on the processor, wherein the processor performs the steps of the method according to claim 1 when executing the program.
4. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to claim 1 are performed.
Citation Information
Patent Citations
Reading delay reducing method and device, computer equipment and storage medium
CN108920387A
Cache hit ratio determination method, apparatus, device, and readable storage medium
CN109388550A
Method, apparatus and computer program product for managing input / output operations
CN111104054A