Memory read and write processing method, device, equipment and storage medium

By storing and updating the logical unit address target threshold in the P2L cache in the memory to determine whether to search the logical unit address from the P2L cache, the time waste problem caused by the host query address not being in the cache is solved and the memory read performance is improved.

CN118535488BActive Publication Date: 2024-10-15BIWIN STORAGE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410725792.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-10-15
Estimated Expiration
2044-06-06

AI Technical Summary

Technical Problem

When the logical unit address queried by the host is not in the P2L cache, the P2L cache needs to be traversed, resulting in a waste of time.

Method used

When the host writes target data to the memory, multiple logical unit addresses are stored in the P2L cache, and the logical unit address target threshold in the P2L cache is updated based on the judgment condition to determine whether to search the logical unit address from the P2L cache to avoid Address traversal not in cache.

Benefits of technology

This effectively avoids the time loss when searching for logical unit addresses that do not exist in the P2L cache, and improves memory read performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535488B_ABST
    Figure CN118535488B_ABST
Patent Text Reader

Abstract

The present invention provides a memory read and write processing method, device, equipment and storage medium, and relates to the memory technology field. The method includes: when the host writes target data to the memory, multiple logical unit addresses corresponding to the target data are stored in the P2L cache, and the P2L cache and each logical unit address are judged based on a first judgment condition and a second judgment condition to obtain a target threshold of the logical unit address in the P2L cache; when the host reads the target data from the memory, it is judged whether the target threshold of the logical unit address in the P2L cache is a legal value, and multiple corresponding target judgment results are obtained, and it is determined whether to search for each logical unit address from the P2L cache according to each target judgment result. In this way, it can avoid unnecessary time loss caused by querying the P2L cache when the logical address read by the host is not in the P2L cache, thereby improving the memory read performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of memory technology, and in particular to a memory read and write processing method, device, equipment and storage medium. Background Art

[0002] When the host reads the data corresponding to the logical unit address from the memory, it needs to traverse the P2L cache to see if the logical unit address read by the host exists. When the P2L cache is close to full, it takes about 20us. Therefore, when the logical unit address to be queried is not in the P2L cache, an additional 20us will be wasted. Summary of the invention

[0003] In view of this, the purpose of the present invention is to overcome the deficiencies in the prior art and to provide a memory read and write processing method, apparatus, device and storage medium, which are used to solve the problem that when the logical unit address queried by the host is not in the P2L cache, it is still necessary to traverse the P2L cache, thereby wasting time.

[0004] The present invention provides the following technical solutions:

[0005] In a first aspect, the present invention provides a memory read and write processing method, the method comprising:

[0006] When the host writes target data to the memory, multiple logical unit addresses corresponding to the target data are stored in the P2L cache, and the P2L cache and each of the logical unit addresses are judged based on the first judgment condition and the second judgment condition to obtain a target threshold value of the logical unit address in the P2L cache;

[0007] When the host reads the target data from the memory, it determines whether the target threshold of the logical unit address in each P2L cache is a legal value, obtains corresponding multiple target judgment results, and determines whether to search for each logical unit address from the P2L cache according to each target judgment result.

[0008] In one embodiment, the target judgment result includes a first judgment result and a second judgment result, and the target threshold of the logical unit address in the P2L cache includes a maximum target value of the logical unit address in the P2L cache and a minimum target value of the logical unit address in the P2L cache;

[0009] The determining whether to search the logical unit address from the P2L cache according to each of the target judgment results includes:

[0010] If the first judgment result is that the target threshold of the logical unit address in the P2L cache is an illegal value, searching the P2L cache for the logical unit address;

[0011] If the first judgment result is that the target threshold of the logical unit address in the P2L cache is a legal value, then determine whether the logical unit address is greater than or equal to the target minimum value of the logical unit address in the P2L cache and whether the logical unit address is less than or equal to the target maximum value of the logical unit address in the P2L cache, and obtain the second judgment result; determine whether to search the logical unit address from the P2L cache based on the second judgment result.

[0012] In one implementation, determining whether to search the logical unit address from the P2L cache according to the second judgment result includes:

[0013] If the second judgment result is that the logical unit address is greater than or equal to the target minimum value of the logical unit address in the P2L cache and the logical unit address is less than or equal to the target maximum value of the logical unit address in the P2L cache, searching the P2L cache for the logical unit address;

[0014] If the second judgment result is that the logical unit address is smaller than the target minimum value of the logical unit address in the P2L cache or the logical unit address is larger than the target maximum value of the logical unit address in the P2L cache, the logical unit address is not searched from the P2L cache.

[0015] In one embodiment, before the step of the host writing the target data to the memory, the step includes:

[0016] The memory is started to set the target threshold of the logical unit address in the P2L cache to an illegal value.

[0017] In one embodiment, the first judgment condition includes a storage condition of the P2L cache. When the host writes target data to the memory, multiple logical unit addresses corresponding to the target data are stored in the P2L cache. The P2L cache and each of the logical unit addresses are judged based on the first judgment condition and the second judgment condition to obtain a target threshold of the logical unit address in the P2L cache, including:

[0018] The host writes the logical unit address to the P2L cache;

[0019] Determining whether a target threshold of a logical unit address in the P2L cache is an illegal value;

[0020] If the logical unit address target threshold in the P2L cache is an illegal value, determining whether the P2L cache is empty based on the first determination condition;

[0021] If the P2L cache is empty, the logical unit address newly written by the host is updated to the target threshold of the logical unit address in the P2L cache, and the logical unit address is stored in the P2L cache.

[0022] In one embodiment, the second judgment condition includes the size of each logical unit address, the storing of multiple logical unit addresses corresponding to the target data in the P2L cache, and judging the P2L cache and each of the logical unit addresses based on the first judgment condition and the second judgment condition to obtain a target threshold of the logical unit address in the P2L cache, further includes:

[0023] After storing the logical unit address in the P2L cache, the method further comprises:

[0024] Determine whether the P2L cache is full based on the first determination condition;

[0025] If the P2L cache is full, clearing the P2L cache and re-performing the step of setting the logical unit address target threshold in the P2L cache to an illegal value;

[0026] If the P2L cache is not full, determining whether the logical unit address newly written by the host is less than the target minimum value of the logical unit address in the P2L cache based on the second judgment condition;

[0027] If the logical unit address is less than the target minimum value of the logical unit address in the P2L cache, the logical unit address is updated to the target minimum value of the logical unit address in the P2L cache, and the logical unit address is stored in the P2L cache, and the step of determining whether the P2L cache is full based on the first determination condition is re-executed;

[0028] If the logical unit address is greater than or equal to the target minimum value of the logical unit address in the P2L cache, determining whether the logical unit address is greater than the target maximum value of the logical unit address in the P2L cache based on the second determination condition;

[0029] If the logical unit address is greater than the target maximum value of the logical unit address in the P2L cache, the logical unit address is updated to the target maximum value of the logical unit address in the P2L cache, and the logical unit address is stored in the P2L cache, and the step of determining whether the P2L cache is full based on the first determination condition is re-executed;

[0030] If the logical unit address is less than or equal to the target maximum value of the logical unit address in the P2L cache, the logical unit address is stored in the P2L cache, and the step of determining whether the P2L cache is full based on the first determination condition is re-executed.

[0031] In one implementation, after determining whether the P2L cache is empty, the method further includes:

[0032] If the P2L cache is not empty, storing the logical unit address newly written by the host in the P2L cache, and re-performing the step of determining whether the P2L cache is full based on the first determination condition;

[0033] If the target threshold of the logical unit address in the P2L cache is not an illegal value, a step of determining whether the newly written logical unit address of the host is less than the target minimum value of the logical unit address in the P2L cache based on the second determination condition is performed.

[0034] In a second aspect, the present invention provides a read / write processing device for a memory, the device comprising:

[0035] A first judgment module is used for storing a plurality of logical unit addresses corresponding to the target data in a P2L cache when the host writes the target data to the memory, and judging the P2L cache and each of the logical unit addresses based on a first judgment condition and a second judgment condition to obtain a target threshold value of the logical unit address in the P2L cache;

[0036] The second judgment module is used to judge whether the target threshold of the logical unit address in each P2L cache is a legal value when the host reads the target data from the memory, and obtain corresponding multiple target judgment results for determining whether to search each logical unit address from the P2L cache according to each target judgment result.

[0037] In a third aspect, the present invention proposes a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the steps of the memory read and write processing method as described in the first aspect are implemented.

[0038] In a fourth aspect, the present invention proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the memory read and write processing method as described in the first aspect.

[0039] The memory read and write processing method, device, equipment and storage medium disclosed in the present invention stores multiple logical unit addresses corresponding to the target data in a P2L cache, and judges the P2L cache and each of the logical unit addresses based on a first judgment condition and a second judgment condition to obtain a target threshold of the logical unit address in the P2L cache; when the host reads the target data from the memory, it judges whether the target threshold of the logical unit address in each of the P2L caches is a legal value, obtains multiple corresponding target judgment results, and determines whether to search each of the logical unit addresses from the P2L cache according to each of the target judgment results. In this way, the logical unit address target threshold in the P2L cache is used to determine whether the logical unit address read by the host needs to be traversed and searched from the P2L cache, thereby avoiding the time loss of traversing the P2L cache when searching for a logical unit address that does not exist in the P2L cache, and improving the read performance of the memory.

[0040] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and understandable, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0042] Figure 1 A first flow chart of the memory read and write processing method proposed by the present invention is shown;

[0043] Figure 2 A second flow chart of the memory read and write processing method proposed by the present invention is shown;

[0044] Figure 3 A third flow chart of the memory read and write processing method proposed by the present invention is shown;

[0045] Figure 4 A fourth flow chart of the memory read and write processing method proposed by the present invention is shown;

[0046] Figure 5 A fifth flow chart of the memory read and write processing method proposed by the present invention is shown;

[0047] Figure 6 A sixth flow chart of the memory read and write processing method proposed by the present invention is shown;

[0048] Figure 7A seventh flow chart of the memory read and write processing method proposed by the present invention is shown;

[0049] Figure 8 A schematic structural diagram of a memory read / write processing device proposed by the present invention is shown. DETAILED DESCRIPTION

[0050] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0051] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. In contrast, when an element is referred to as being "directly on" another element, there is no intermediate element. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.

[0052] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0053] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of the template are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0055] Example 1

[0056] The disclosed embodiment provides a memory read and write processing method for solving the problem that when the logical unit address queried by the host is not in the P2L cache, the host still needs to traverse the P2L cache, thereby wasting time.

[0057] See also Figure 1 The memory read and write processing method includes steps S101 to S102, and each step will be described in detail below.

[0058] Step S101, when the host writes target data to the memory, multiple logical unit addresses corresponding to the target data are stored in the P2L cache, and the P2L cache and each of the logical unit addresses are judged based on the first judgment condition and the second judgment condition to obtain a target threshold of the logical unit address in the P2L cache.

[0059] In this embodiment, when the host writes a set of target data to the memory, multiple logical unit addresses (LUA) corresponding to the target data will also be written into the physical address-to-logical address mapping (P2L) cache in sequence accordingly, and the P2L cache space is limited, so the LUA target threshold in the P2L cache will be continuously updated as the LUA is written into the P2L cache in sequence. At the same time, the P2L cache and each logical unit address can be judged according to multiple judgment conditions, and the LUA target threshold in the P2L cache is continuously updated. When the target data is written, the final LUA target threshold in the P2L cache is obtained.

[0060] See also Figure 2 In a specific embodiment, before the host writes the target data to the memory, it includes steps S1 to S2, and each step is described in detail below.

[0061] Step S1, the memory is started.

[0062] Step S2, setting the target threshold of the logical unit address in the P2L cache to an illegal value.

[0063] In this embodiment, the host needs to start the memory before writing target data to the memory. When the memory is powered on, the LUA written by the host when the memory was powered off last time may have been recorded in the P2L cache. At this time, the LUA recorded in the P2L cache has nothing to do with the LUA written by the host this time. Therefore, the LUA target threshold recorded in the P2L cache at this time is first obtained and set to an illegal value.

[0064] It should be noted that setting the LUA target threshold in the current P2L cache to an illegal value means setting the LUA target threshold in the current P2L cache to a value outside the range of LUA accessed by the host. In this embodiment, the illegal value may be 4294967295, the hexadecimal of 4294967295 is 0xFFFFFFFF, one LUA represents 4K, and 4294967295 LUAs represent 16383G. If the maximum capacity that the memory can provide is smaller than the illegal value, the LUA range that the host can access is the memory capacity range, so the LUA accessed by the host cannot be the illegal value.

[0065] See also Figure 3 In a specific embodiment, the first judgment condition includes the storage status of the P2L cache. When the host writes target data to the memory, multiple logical unit addresses corresponding to the target data are stored in the P2L cache, and the P2L cache and each of the logical unit addresses are judged based on the first judgment condition and the second judgment condition, including steps S3 to S6. Each step is described in detail below.

[0066] Step S3: the host writes the logical unit address to the P2L cache.

[0067] In this embodiment, after the currently set LUA threshold is set to an illegal value in step S2, the host writes LUA to the P2L cache.

[0068] Step S4, determining whether the target threshold of the logical unit address in the P2L cache is an illegal value.

[0069] In this embodiment, it is determined whether the LUA target threshold in the P2L cache that has been set at this time is an illegal value, so as to facilitate the subsequent update of the LUA target threshold in the P2L cache.

[0070] Step S5: If the target threshold of the logical unit address in the P2L cache is an illegal value, judging whether the P2L cache is empty based on the first judgment condition.

[0071] In this embodiment, if the LUA target threshold in the P2L cache is an illegal value, it is determined whether the P2L cache is empty based on the storage status of the P2L cache.

[0072] Step S6: If the P2L cache is empty, the logical unit address newly written by the host is updated to the target threshold of the logical unit address in the P2L cache, and the logical unit address is stored in the P2L cache.

[0073] In this embodiment, if the P2L cache is empty, a LUA newly written by the host is updated as the LUA target threshold, and the LUA is stored in the P2L cache.

[0074] See also Figure 4 In a specific embodiment, the second judgment condition includes the size of each logical unit address, the multiple logical unit addresses corresponding to the target data are stored in the P2L cache, and the P2L cache and each logical unit address are judged based on the first judgment condition and the second judgment condition to obtain the target threshold of the logical unit address in the P2L cache, and also includes steps S7 to S13. Each step is described in detail below.

[0075] Step S7: determining whether the P2L cache is full based on the first determination condition.

[0076] In this embodiment, after the LUA is stored in the P2L cache in step S6, it is determined whether the P2L cache is full based on the storage status of the P2L cache.

[0077] Step S8: If the P2L cache is full, clear the P2L cache, and re-execute the step of setting the target threshold of the logical unit address in the P2L cache to an illegal value.

[0078] In this embodiment, if the P2L cache is full, the P2L cache is cleared, and step S2 is re-entered to execute step S2 and subsequent steps. By setting the logical unit address target threshold in the P2L cache to an illegal value in step S2, the LUA target threshold when the P2L cache is full is set to an illegal value, and then the next round of updating the LUA target threshold of writing LUA into the P2L cache in sequence can be started.

[0079] Step S9: If the P2L cache is not full, determine whether the logical unit address newly written by the host is less than the target minimum value of the logical unit address in the P2L cache based on the second judgment condition.

[0080] In this embodiment, if the P2L cache is not full, it is determined based on the size of each LUA whether the LUA newly written by the host is smaller than the P2L cache LUA target minimum value in the currently set P2L cache LUA target threshold.

[0081] Step S10: If the logical unit address is less than the target minimum value of the logical unit address in the P2L cache, the logical unit address is updated to the target minimum value of the logical unit address in the P2L cache, and the logical unit address is stored in the P2L cache, and the step of determining whether the P2L cache is full based on the first determination condition is re-executed.

[0082] In this embodiment, if the LUA newly written by the host is less than the LUA target minimum value in the currently set LUA target threshold, the currently set LUA target minimum value in the P2L cache is replaced with the newly written LUA, that is, the newly written LUA is updated as the new LUA target minimum value in the P2L cache, and the newly written LUA is stored in the P2L cache, and step S7 is re-entered to execute step S7 and subsequent steps, so as to update the LUA target threshold in the P2L cache according to the continuous comparison of the LUAs written by subsequent hosts in sequence and the storage status of the P2L cache, until all LUAs corresponding to the target data are written, and the final updated LUA target threshold in the P2L cache is obtained.

[0083] Step S11: if the logical unit address is greater than or equal to the target minimum value of the logical unit address in the P2L cache, determine whether the logical unit address is greater than the target maximum value of the logical unit address in the P2L cache based on the second judgment condition.

[0084] In this embodiment, if the LUA newly written by the host is greater than or equal to the LUA target minimum value in the currently set LUA target threshold, it is determined based on the size of each LUA whether the LUA newly written by the host is greater than the LUA target maximum value in the LUA target threshold.

[0085] Step S12: If the logical unit address is greater than the target maximum value of the logical unit address in the P2L cache, the logical unit address is updated to the target maximum value of the logical unit address in the P2L cache, and the logical unit address is stored in the P2L cache, and the step of determining whether the P2L cache is full based on the first determination condition is re-executed.

[0086] In this embodiment, if the LUA newly written by the host is greater than the LUA target maximum value in the currently set LUA target threshold, the currently set LUA target maximum value in the P2L cache is replaced with the newly written LUA, that is, the newly written LUA is updated as the new LUA target maximum value in the P2L cache, and the newly written LUA is stored in the P2L cache, and step S7 is re-entered to execute step S7 and subsequent steps, so as to update the LUA target threshold in the P2L cache based on continuous comparisons of the LUAs written by subsequent hosts in sequence and the storage status of the P2L cache, until all LUAs corresponding to the target data are written, and the final updated LUA target threshold in the P2L cache is obtained.

[0087] Step S13: if the logical unit address is less than or equal to the target maximum value of the logical unit address in the P2L cache, the logical unit address is stored in the P2L cache, and the step of determining whether the P2L cache is full based on the first determination condition is re-executed.

[0088] In this embodiment, if the LUA newly written by the host is less than or equal to the LUA target maximum value in the currently set LUA target threshold, the newly written LUA is stored in the P2L cache, and step S7 is re-entered to execute step S7 and subsequent steps, so as to update the LUA target threshold in the P2L cache based on the continuous comparison of the LUAs written by subsequent hosts and the storage status of the P2L cache, until all LUAs corresponding to the target data are written, and the final updated LUA target threshold in the P2L cache is obtained.

[0089] See also Figure 5 In a specific embodiment, after step S4, step S14 is also included, and after step S5, step S15 is also included. Each step is described in detail below.

[0090] Step S14: if the target threshold of the logical unit address in the P2L cache is not an illegal value, a step of determining whether the newly written logical unit address of the host is less than the target minimum value of the logical unit address in the P2L cache based on the second determination condition is executed.

[0091] In this embodiment, after step S4, if the LUA target threshold is not an illegal value, the step of judging whether the newly written logical unit address of the host is less than the target minimum value of the logical unit address in the P2L cache based on the second judgment condition in step S9 and subsequent steps are executed, thereby updating the LUA target threshold in the P2L cache based on continuous comparison of the LUAs written by subsequent hosts in sequence and the storage status of the P2L cache until all LUAs corresponding to the target data are written, and the final updated LUA target threshold in the P2L cache is obtained.

[0092] Step S15: if the P2L cache is not empty, the logical unit address newly written by the host is stored in the P2L cache, and the step of determining whether the P2L cache is full based on the first determination condition is re-executed.

[0093] In this embodiment, after step S5, if the P2L cache is not empty, the LUA newly written by the host is stored in the P2L cache, and step S7 is re-entered to execute step S7 and subsequent steps, so as to update the LUA target threshold in the P2L cache based on continuous comparison of the LUAs written by subsequent hosts in sequence and the storage status of the P2L cache, until all LUAs corresponding to the target data are written, and the final updated LUA target threshold in the P2L cache is obtained.

[0094] Please see again Figure 1 In step S102, when the host reads the target data from the memory, it determines whether the target threshold of the logical unit address in each of the P2L caches is a legal value, obtains corresponding multiple target judgment results, and determines whether to search for each of the logical unit addresses from the P2L cache according to each of the target judgment results.

[0095] In this embodiment, when the host reads target data from the memory, it is necessary to obtain the corresponding data according to the LUA read by the host. When the host reads the LUA, it can determine whether to search the LUA from the P2L cache according to the target judgment result of whether the LUA target threshold of the P2L cache at this time is an illegal value. In this way, it is pre-determined whether it is necessary to traverse the P2L cache to search for a certain LUA, which can avoid wasting reading time and improve the read performance of the memory.

[0096] It should be noted that the LUA target threshold used for judgment at this time is the LUA target threshold updated after the target data is written. For example, if the LUA corresponding to the target data written by the host includes LUA1, LUA2, LUA 3, LUA4, and LUA5, during the judgment period, LUA1 is first updated to the LUA target threshold, then LUA3 is updated to the LUA target maximum value, and later LUA5 is updated to the LUA target maximum value. Therefore, when the LUA target thresholds obtained after the target data is written are LUA3 and LUA5, when the host reads the target data, it is judged based on LUA3 and LUA5 to determine whether to search the read LUA from the P2L cache.

[0097] See also Figure 6 In a specific embodiment, the target judgment result includes a first judgment result and a second judgment result, and the logical unit address target threshold includes a maximum value of the logical unit address target in the P2L cache and a minimum value of the logical unit address target in the P2L cache; determining whether to search the logical unit address from the P2L cache based on the target judgment result includes steps S1021 to S1022, and each step is described in detail below.

[0098] Step S1021: if the first judgment result is that the target threshold of the logical unit address in the P2L cache is an illegal value, then the logical unit address is searched from the P2L cache.

[0099] In this embodiment, if the LUA target threshold in the P2L cache is an illegal value, it can be known that the LUA range in the P2L cache cannot be determined at present, and therefore it is necessary to search from the P2L cache.

[0100] Step S1022: If the first judgment result is that the target threshold of the logical unit address in the P2L cache is a legal value, then determine whether the logical unit address is greater than or equal to the target minimum value of the logical unit address in the P2L cache and whether the logical unit address is less than or equal to the target maximum value of the logical unit address in the P2L cache, and obtain the second judgment result; determine whether to search the logical unit address from the P2L cache according to the second judgment result.

[0101] In this embodiment, if the LUA target threshold in the P2L cache is not an illegal value, that is, the LUA target threshold in the P2L cache is a legal value, then it is continued to be determined whether the LUA read by the host at this time is greater than or equal to the minimum LUA target value in the P2L cache and less than or equal to the maximum LUA target value in the P2L cache, thereby obtaining a second judgment result, and based on the second judgment result, it is continued to determine whether it is necessary to traverse the P2L cache to search for the LUA.

[0102] See also Figure 7 In a specific embodiment, determining whether to search the logical unit address from the P2L cache according to the second judgment result includes steps S701 to S702, and each step is described in detail below.

[0103] Step S701: If the second judgment result is that the logical unit address is greater than or equal to the target minimum value of the logical unit address in the P2L cache and the logical unit address is less than or equal to the target maximum value of the logical unit address in the P2L cache, then the logical unit address is searched from the P2L cache.

[0104] In this embodiment, if the LUA read by the host is greater than or equal to the minimum LUA target value in the P2L cache and less than or equal to the maximum LUA target value in the P2L cache, it can be determined that the LUA read by the host exists in the P2L cache, so it is necessary to traverse the P2L cache for search.

[0105] Step S702: If the second judgment result is that the logical unit address is smaller than the target minimum value of the logical unit address in the P2L cache or the logical unit address is larger than the target maximum value of the logical unit address in the P2L cache, the logical unit address is not searched from the P2L cache.

[0106] In this embodiment, if the LUA read by the host is less than the minimum LUA target value in the P2L cache or greater than the maximum LUA target value in the P2L cache, it can be determined that the LUA read by the host has been cleared after being written to the P2L cache and now does not exist in the P2L cache. Therefore, there is no need to traverse the P2L cache for search, avoiding wasting time traversing the P2L cache and improving read performance.

[0107] The memory read and write processing method proposed in this embodiment is that when the host writes target data to the memory, multiple logical unit addresses corresponding to the target data are stored in the P2L cache, and the P2L cache and each of the logical unit addresses are judged based on the first judgment condition and the second judgment condition to obtain the target threshold of the logical unit address in the P2L cache; when the host reads the target data from the memory, it judges whether the target threshold of the logical unit address in each of the P2L caches is a legal value, obtains multiple corresponding target judgment results, and determines whether to search for each of the logical unit addresses from the P2L cache according to each of the target judgment results. In this way, the LUA target threshold is used to determine whether the LUA read by the host needs to be traversed and searched from the P2L cache, thereby avoiding the time loss of traversing the P2L cache when searching for LUA that does not exist in the P2L cache, and improving the read performance of the memory.

[0108] Example 2

[0109] In addition, the present disclosure provides a memory read and write processing device 800, see Figure 8 , the device comprises:

[0110] The first judgment module 801 is used for storing a plurality of logical unit addresses corresponding to the target data in a P2L cache when the host writes the target data to the memory, and judging the P2L cache and each of the logical unit addresses based on a first judgment condition and a second judgment condition to obtain a target threshold value of the logical unit address in the P2L cache;

[0111] The second judgment module 802 is used to judge whether the target threshold of the logical unit address in each P2L cache is a legal value when the host reads the target data from the memory, obtain corresponding multiple target judgment results, and determine whether to search each logical unit address from the P2L cache according to each target judgment result.

[0112] In one embodiment, the target judgment result includes a first judgment result and a second judgment result, and the target threshold of the logical unit address in the P2L cache includes a maximum target value of the logical unit address in the P2L cache and a minimum target value of the logical unit address in the P2L cache; the second judgment module 802 is also used to search the logical unit address from the P2L cache if the first judgment result is that the target threshold of the logical unit address in the P2L cache is an illegal value; if the first judgment result is that the target threshold of the logical unit address in the P2L cache is a legal value, determine whether the logical unit address is greater than or equal to the minimum target value of the logical unit address in the P2L cache and whether the logical unit address is less than or equal to the maximum target value of the logical unit address in the P2L cache, and obtain the second judgment result; determine whether to search the logical unit address from the P2L cache according to the second judgment result.

[0113] In one embodiment, the second judgment module 802 is further used to search the logical unit address from the P2L cache if the second judgment result is that the logical unit address is greater than or equal to the target minimum value of the logical unit address in the P2L cache and the logical unit address is less than or equal to the target maximum value of the logical unit address in the P2L cache; if the second judgment result is that the logical unit address is less than the target minimum value of the logical unit address in the P2L cache or the logical unit address is greater than the target maximum value of the logical unit address in the P2L cache, then the logical unit address is not searched from the P2L cache.

[0114] In one implementation, the first determination module 801 is further used for starting the memory to set a target threshold of a logical unit address in the P2L cache to an illegal value.

[0115] In one embodiment, the first judgment condition includes the storage status of the P2L cache, and the first judgment module 701 is further used for the host to write the logical unit address to the P2L cache; to judge whether a target threshold of the logical unit address in the P2L cache is an illegal value; if the target threshold of the logical unit address in the P2L cache is an illegal value, to judge whether the P2L cache is empty based on the first judgment condition; if the P2L cache is empty, to update the newly written logical unit address of the host to the target threshold of the logical unit address in the P2L cache, and to store the logical unit address in the P2L cache.

[0116] In one embodiment, the second judgment condition includes the size of each logical unit address, and the first judgment module 801 is further used to clear the P2L cache if the P2L cache is full, and re-execute the step of setting the target threshold of the logical unit address in the P2L cache to an illegal value; if the P2L cache is not full, determine whether the newly written logical unit address of the host is less than the target minimum value of the logical unit address in the P2L cache based on the second judgment condition; if the logical unit address is less than the target minimum value of the logical unit address in the P2L cache, update the logical unit address to the target minimum value of the logical unit address in the P2L cache, store the logical unit address in the P2L cache, and re-execute the step of determining whether the P2L cache is full based on the first judgment condition; If the logical unit address is greater than or equal to the target minimum value of the logical unit address in the P2L cache, then based on the second judgment condition, determine whether the logical unit address is greater than the target maximum value of the logical unit address in the P2L cache; if the logical unit address is greater than the target maximum value of the logical unit address in the P2L cache, then update the logical unit address to the target maximum value of the logical unit address in the P2L cache, store the logical unit address in the P2L cache, and re-execute the step of determining whether the P2L cache is full based on the first judgment condition; if the logical unit address is less than or equal to the target maximum value of the logical unit address in the P2L cache, then store the logical unit address in the P2L cache, and re-execute the step of determining whether the P2L cache is full based on the first judgment condition.

[0117] In one embodiment, the first judgment module 801 is further used to store the logical unit address newly written by the host into the P2L cache if the P2L cache is not empty, and re-execute the step of determining whether the P2L cache is full based on the first judgment condition; if the target threshold of the logical unit address in the P2L cache is not an illegal value, execute the step of determining whether the logical unit address newly written by the host is less than the target minimum value of the logical unit address in the P2L cache based on the second judgment condition.

[0118] The device provided in the embodiment of the present disclosure can execute the steps of the target detection test method provided in Example 1, which will not be described again to avoid repetition.

[0119] The read / write processing device of the memory proposed in this embodiment, when the host writes the target data to the memory, stores the multiple logical unit addresses corresponding to the target data in the P2L cache, and judges the P2L cache and each of the logical unit addresses based on the first judgment condition and the second judgment condition to obtain the target threshold of the logical unit address in the P2L cache; when the host reads the target data from the memory, it judges whether the target threshold of the logical unit address in each of the P2L caches is a legal value, obtains the corresponding multiple target judgment results, and determines whether to search each of the logical unit addresses from the P2L cache according to each of the target judgment results. In this way, the LUA target threshold is used to determine whether the LUA read by the host needs to be traversed and searched from the P2L cache, thereby avoiding the time loss of traversing the P2L cache when searching for the LUA that does not exist in the P2L cache, and improving the read performance of the memory.

[0120] Example 3

[0121] In addition, an embodiment of the present disclosure provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the memory read and write processing method described in Embodiment 1 is implemented.

[0122] The device provided in the embodiment of the present disclosure can execute the steps of the memory read and write processing method provided in Example 1, which will not be described again to avoid repetition.

[0123] Example 4

[0124] The embodiment of the present disclosure provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the memory read and write processing method described in Embodiment 1 is implemented.

[0125] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0126] The computer-readable storage medium provided in this embodiment can implement the read and write processing method of the memory provided in Embodiment 1, and will not be described again here to avoid repetition.

[0127] In all examples shown and described herein, any specific values ​​should be interpreted as merely exemplary and not as limiting, and thus other examples of the exemplary embodiments may have different values.

[0128] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0129] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A memory read and write processing method, characterized in that: The method comprises: When the host writes target data to the memory, multiple logical unit addresses corresponding to the target data are stored in the P2L cache, and the P2L cache and each of the logical unit addresses are judged based on the first judgment condition and the second judgment condition to obtain a target threshold value of the logical unit address in the P2L cache; When the host reads the target data from the memory, it determines whether the target threshold of the logical unit address in each of the P2L caches is a legal value, obtains a corresponding plurality of target determination results, and determines whether to search for each of the logical unit addresses from the P2L cache according to each of the target determination results; Wherein, before the step of the host writing the target data to the memory, it includes: The memory is started, and a target threshold of a logical unit address in the P2L cache is set to an illegal value; The first judgment condition includes the storage condition of the P2L cache. When the host writes target data to the memory, multiple logical unit addresses corresponding to the target data are stored in the P2L cache. The P2L cache and each of the logical unit addresses are judged based on the first judgment condition and the second judgment condition to obtain a target threshold of the logical unit address in the P2L cache, including: The host writes the logical unit address to the P2L cache; Determining whether a target threshold of a logical unit address in the P2L cache is an illegal value; If the logical unit address target threshold in the P2L cache is an illegal value, determining whether the P2L cache is empty based on the first determination condition; If the P2L cache is empty, the logical unit address newly written by the host is updated to the target threshold of the logical unit address in the P2L cache, and the logical unit address is stored in the P2L cache.

2. The memory read and write processing method according to claim 1, characterized in that: The target judgment result includes a first judgment result and a second judgment result, and the target threshold of the logical unit address in the P2L cache includes a maximum target value of the logical unit address in the P2L cache and a minimum target value of the logical unit address in the P2L cache; The determining whether to search for each of the logical unit addresses from the P2L cache according to each of the target judgment results includes: searching for the logical unit address from the P2L cache if the first judgment result is that the target threshold of the logical unit address in the P2L cache is an illegal value; If the first judgment result is that the target threshold of the logical unit address in the P2L cache is a legal value, then determine whether the logical unit address is greater than or equal to the target minimum value of the logical unit address in the P2L cache and whether the logical unit address is less than or equal to the target maximum value of the logical unit address in the P2L cache, and obtain the second judgment result; determine whether to search the logical unit address from the P2L cache based on the second judgment result.

3. The memory read and write processing method according to claim 2, characterized in that: The determining whether to search the logical unit address from the P2L cache according to the second judgment result includes: If the second judgment result is that the logical unit address is greater than or equal to the target minimum value of the logical unit address in the P2L cache and the logical unit address is less than or equal to the target maximum value of the logical unit address in the P2L cache, searching the P2L cache for the logical unit address; If the second judgment result is that the logical unit address is smaller than the target minimum value of the logical unit address in the P2L cache or the logical unit address is larger than the target maximum value of the logical unit address in the P2L cache, the logical unit address is not searched from the P2L cache.

4. The memory read and write processing method according to claim 1, characterized in that: The second judgment condition includes the size of each of the logical unit addresses, the storing of the multiple logical unit addresses corresponding to the target data in the P2L cache, and judging the P2L cache and each of the logical unit addresses based on the first judgment condition and the second judgment condition to obtain a target threshold of the logical unit address in the P2L cache, further comprising: After storing the logical unit address in the P2L cache, the method further comprises: determining whether the P2L cache is full based on the first determination condition; If the P2L cache is full, clearing the P2L cache and re-performing the step of setting the logical unit address target threshold in the P2L cache to an illegal value; If the P2L cache is not full, determining whether the logical unit address newly written by the host is less than the target minimum value of the logical unit address in the P2L cache based on the second judgment condition; If the logical unit address is less than the target minimum value of the logical unit address in the P2L cache, the logical unit address is updated to the target minimum value of the logical unit address in the P2L cache, and the logical unit address is stored in the P2L cache, and the step of determining whether the P2L cache is full based on the first determination condition is re-executed; If the logical unit address is greater than or equal to the target minimum value of the logical unit address in the P2L cache, determining whether the logical unit address is greater than the target maximum value of the logical unit address in the P2L cache based on the second determination condition; If the logical unit address is greater than the target maximum value of the logical unit address in the P2L cache, the logical unit address is updated to the target maximum value of the logical unit address in the P2L cache, and the logical unit address is stored in the P2L cache, and the step of determining whether the P2L cache is full based on the first determination condition is re-executed; If the logical unit address is less than or equal to the target maximum value of the logical unit address in the P2L cache, the logical unit address is stored in the P2L cache, and the step of determining whether the P2L cache is full based on the first determination condition is re-executed.

5. The memory read and write processing method according to claim 4, characterized in that: After determining whether the P2L cache is empty, the method further includes: If the P2L cache is not empty, storing the logical unit address newly written by the host in the P2L cache, and re-performing the step of determining whether the P2L cache is full based on the first determination condition; If the target threshold of the logical unit address in the P2L cache is not an illegal value, a step of determining whether the newly written logical unit address of the host is less than the target minimum value of the logical unit address in the P2L cache based on the second determination condition is performed.

6. A memory read / write processing device, characterized in that: The device comprises: A first judgment module is used for storing a plurality of logical unit addresses corresponding to the target data in a P2L cache when the host writes the target data to the memory, and judging the P2L cache and each of the logical unit addresses based on a first judgment condition and a second judgment condition to obtain a target threshold value of the logical unit address in the P2L cache; A second judgment module is used for judging whether the target threshold of the logical unit address in each of the P2L caches is a legal value when the host reads the target data from the memory, and obtaining corresponding multiple target judgment results for determining whether to search for each of the logical unit addresses from the P2L cache according to each of the target judgment results; The first judgment module is also used for starting the memory and setting the target threshold of the logical unit address in the P2L cache to an illegal value; Among them, the first judgment condition includes the storage status of the P2L cache, and the first judgment module is also used for the host to write the logical unit address to the P2L cache; judge whether the logical unit address target threshold in the P2L cache is an illegal value; if the logical unit address target threshold in the P2L cache is an illegal value, judge whether the P2L cache is empty based on the first judgment condition; if the P2L cache is empty, update the logical unit address newly written by the host to the logical unit address target threshold in the P2L cache, and store the logical unit address in the P2L cache.

7. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the steps of the memory read and write processing method as claimed in any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium, characterized in that: It stores a computer program, which, when executed by a processor, implements the steps of the memory read and write processing method as claimed in any one of claims 1 to 5.