Flash memory binding optimization method and device, equipment and storage medium
By detecting the number of free good blocks in the flash memory bonded blocks and dynamically adjusting the bonded block combination, the bonded block constraint problem in multi-plane operation is solved, thus improving the performance and efficiency of the memory.
Patent Information
- Application Number
- CN202511733384.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-03-03
AI Technical Summary
In multi-plane operations, the effectiveness of flash memory bonding is constrained by the bonding blocks, affecting memory performance and efficiency.
By detecting the number of free good blocks in the bonded blocks, it is determined whether the flash bonding optimization conditions are met, and the combination of bonded blocks is dynamically adjusted to ensure that the difference in free good blocks between bonded blocks is consistent with the actual situation.
Real-time optimization of multi-plane operations was achieved, improving the performance and efficiency of memory execution.
Smart Images

Figure CN121597128A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of storage technology, and specifically to a flash memory bonding optimization method, apparatus, device, and storage medium. Background Technology
[0002] Multi-plane operation is a technique that improves memory efficiency and performance by operating on different planes of flash memory (such as NAND Flash) simultaneously. During multi-plane operation, the binding effect of bound blocks can limit its effectiveness.
[0003] Therefore, the problem of how to dynamically optimize flash memory bonding to ensure the performance of multi-plane operations urgently needs to be solved. Summary of the Invention
[0004] This invention provides a flash memory bonding optimization method, apparatus, device, and storage medium, which can dynamically trigger flash memory bonding optimization by utilizing the changes in good block differences between bonded blocks, thereby ensuring the performance of multi-plane operations in real time.
[0005] Firstly, this invention provides a flash memory bonding optimization method applied to a storage device. The storage device includes a flash memory module, which includes k planes and p bonding blocks. Each bonding block includes k free good blocks, where the k free good blocks come from different planes among the k planes; k is an integer greater than 1; p is a positive integer; the method includes: The number of free good blocks in each of the p bound blocks is detected to obtain the number of p free good blocks; Determine whether the flash bonding optimization conditions are met based on the number of p free good blocks; If so, determine the number of free good blocks for the k planes to obtain the number of k free good blocks; Based on the number of k free good blocks, q bound blocks are determined. Each bound block includes k free good blocks, which come from different planes among the k planes, and q is a positive integer.
[0006] Secondly, this invention provides a flash memory bonding optimization device applied to a storage device. The storage device includes a flash memory module, which includes k planes and p bonding blocks. Each bonding block includes k free good blocks, which come from different planes among the k planes; k is an integer greater than 1; p is a positive integer. The flash memory bonding optimization device includes a detection unit, a judgment unit, and a determination unit, wherein... The detection unit is used to detect the number of free good blocks in each of the p bound blocks, and obtain the number of p free good blocks; The judgment unit is used to determine whether the flash memory bonding optimization conditions are met based on the number of p free good blocks. The determining unit is configured to determine the number of free good blocks in the k planes when the flash memory binding optimization conditions are met, thereby obtaining the number of k free good blocks; and to determine q binding blocks based on the number of k free good blocks, each binding block including k free good blocks, wherein the k free good blocks come from different planes among the k planes, and q is a positive integer.
[0007] Third, embodiments of the present invention provide a storage device, which includes a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing the steps in the first aspect of the present invention, and the memory includes a flash memory module.
[0008] Fourth, embodiments of the present invention provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data interchange, wherein the computer program causes a computer to perform some or all of the steps described in the first aspect of the present invention.
[0009] Implementing the embodiments of the present invention has the following beneficial effects: As can be seen, the flash memory bonding optimization method, apparatus, device, and storage medium described in the embodiments of the present invention are applied to a storage device. The storage device includes a flash memory module, which includes k planes and p bonding blocks. Each bonding block includes k free good blocks, which come from different planes among the k planes; k is an integer greater than 1; p is a positive integer. The number of free good blocks in each of the p bonding blocks is detected to obtain the number of p free good blocks. Based on the number of p free good blocks, it is determined whether the flash memory bonding optimization condition is met. If so, the number of free good blocks in the k planes is determined to obtain the number of k free good blocks. The quantity is determined by q binding blocks based on the number of k free good blocks. Each binding block includes k free good blocks, which come from different planes among the k planes. q is a positive integer. That is, the number of p free good blocks can be used to dynamically monitor the changes in good block differences between binding blocks. When the flash binding optimization condition is met, it means that the difference in good blocks between binding blocks is large, which will affect the execution effect of multi-plane operation. That is, flash binding is dynamically optimized again based on the difference in free good blocks of each plane, so that flash binding conforms to the actual situation in real time, which helps to ensure the real-time execution effect of multi-plane. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a flowchart illustrating a flash memory bonding optimization method provided in an embodiment of the present invention; Figure 2 This is a first structural schematic diagram of a storage device provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the second structure of a storage device provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the third structure of a storage device provided in an embodiment of the present invention; Figure 5 This is a block diagram of the functional units of a flash memory bonding optimization device provided in an embodiment of the present invention. Detailed Implementation
[0012] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0013] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0014] It should be understood that the term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this document indicates that the preceding and following related objects are in an "or" relationship. In the embodiments of this invention, "multiple" refers to two or more.
[0015] In this invention, "at least one item" or similar expressions refer to any combination of these items, including any combination of a single item or multiple items. "One or more" means one or more, while "multiple" means two or more. For example, "at least one item" of a, b, or c can represent the following seven cases: a, b, c, a and b, a and c, b and c, a, b, and c. Each of a, b, and c can be an element or a set containing one or more elements.
[0016] In the embodiments of this invention, "connection" refers to various connection methods such as direct connection or indirect connection to achieve communication between devices. The embodiments of this invention do not impose any limitations on this.
[0017] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0018] In this context, a good block is a storage block that satisfies the requirements for normal read or write operations. A bad block is a storage block that cannot be read or written normally.
[0019] Among them, free good blocks are good blocks that have not been assigned to any data storage tasks.
[0020] Flash bonding involves binding several cells within a flash memory to improve read / write speed and storage efficiency.
[0021] Please see Figure 1 , Figure 1 This is a flowchart illustrating a flash memory bonding optimization method provided in an embodiment of the present invention, applied to a storage device. The storage device includes a flash memory module, which includes k planes and p bonding blocks. Each bonding block includes k free good blocks, and the k free good blocks come from different planes among the k planes; k is an integer greater than 1; p is a positive integer; the flash memory bonding optimization method includes: S101: Detect the number of free good blocks in each of the p bound blocks to obtain the number of p free good blocks.
[0022] Each of the k planes includes multiple storage blocks. Of course, these multiple storage blocks may contain good blocks or bad blocks. Good blocks may include free good blocks.
[0023] Among them, such as Figure 2 As shown, the storage device includes a flash memory module, which includes k planes and p bound blocks. Each bound block includes k free good blocks, and the k free good blocks come from different planes among the k planes; k is an integer greater than 1; p is a positive integer, that is, the k free good blocks correspond one-to-one with the k planes, and each free good block comes from one of the k planes.
[0024] In a specific implementation, the flash memory device can detect the number of free good blocks in each of the p bound blocks at a set frequency to obtain the number of p free good blocks. The set frequency can be preset or be the system default. The set frequency can be related to the attributes of the flash memory module (e.g., model, memory size, usage time, circuit structure, etc.), or it can be related to the operating environment of the flash memory module (e.g., hardware environment, and / or software environment, and / or physical environment).
[0025] S102: Determine whether the flash memory bonding optimization conditions are met based on the number of p free good blocks.
[0026] The flash binding optimization conditions can be preset or set by system default.
[0027] In practice, the number of p free good blocks can be used to determine whether the flash binding optimization conditions are met. For example, if the flash binding optimization conditions are met, it means that the difference in good blocks between the bound blocks is large, which will affect the performance of the Multi-plane operation.
[0028] S103: If so, determine the number of free good blocks for the k planes to obtain the number of free good blocks for the k planes.
[0029] In a specific implementation, when optimizing flash memory binding conditions, the number of free good blocks in each of the k planes can be counted to obtain the number of k free good blocks. Then, the number of these k free good blocks can be used to quantify the large difference in good blocks between the bound blocks.
[0030] S104: Determine q bound blocks based on the number of k free good blocks. Each bound block includes k free good blocks, which come from different planes among the k planes. q is a positive integer.
[0031] In the specific implementation, q binding blocks can be re-determined based on the number of k free good blocks. Each binding block includes k free good blocks, which come from different planes among the k planes. q is a positive integer. That is, when the flash binding optimization conditions are met, flash binding can be dynamically optimized based on the differences in free good blocks of each plane, so that flash binding conforms to the actual situation in real time, which helps to ensure the execution effect of Multi-plane in real time.
[0032] As can be seen, the flash memory bonding optimization method described in this embodiment of the invention is applied to a storage device. The storage device includes a flash memory module, which includes k planes and p bonding blocks. Each bonding block includes k free good blocks, which come from different planes among the k planes; k is an integer greater than 1; p is a positive integer. The method detects the number of free good blocks in each of the p bonding blocks to obtain the number of p free good blocks. Based on the number of p free good blocks, it determines whether the flash memory bonding optimization condition is met. If so, it determines the number of free good blocks in the k planes to obtain the number of k free good blocks. The number of k free good blocks determines q bound blocks. Each bound block includes k free good blocks, which come from different planes among the k planes. q is a positive integer. That is, the number of p free good blocks can be used to dynamically monitor the changes in good block differences between bound blocks. When the flash binding optimization condition is met, it means that the good block differences between bound blocks are large, which will affect the execution effect of multi-plane operation. That is, flash binding is dynamically optimized again based on the differences in free good blocks of each plane, so that flash binding conforms to the actual situation in real time, which helps to ensure the real-time execution effect of multi-plane.
[0033] In one possible embodiment, the above step of determining whether the flash bonding optimization condition is met based on the number of p free good blocks can be implemented as follows: The first mean square error is obtained by calculating the mean square error based on the number of p free good blocks; When the first mean square error is greater than the first set value, it is determined that the flash memory bonding optimization condition is met; When the first mean square error is less than or equal to the first set value, it is determined that the flash memory binding optimization condition is not met.
[0034] The first setting can be preset or set by the system default.
[0035] The first setting value may be related to the attributes of the flash memory module (e.g., model, memory size, usage time, circuit structure, etc.), or the first setting value may be related to the working environment of the flash memory module (e.g., hardware environment, and / or software environment, and / or physical environment).
[0036] In practice, the mean squared error can be calculated based on the number of p free good blocks to obtain the first mean squared error. If the first mean squared error is greater than the first set value, it indicates that the difference in good blocks between the bound blocks is large, which will affect the execution effect of the multi-plane operation. This indicates that the flash binding optimization condition is met. Conversely, if the first mean squared error is less than or equal to the first set value, it indicates that the difference in good blocks between the bound blocks is small, which has little impact on the execution effect of the multi-plane operation. This indicates that the flash binding optimization condition is not met, and flash binding optimization can be automatically triggered, which helps to ensure the execution effect of the multi-plane operation.
[0037] Furthermore, such as Figure 3 As shown, the storage device includes a temperature sensor, and the detection of the number of free good blocks in each of the p bound blocks includes: The temperature sensor is used to obtain the temperature value of the flash memory module, resulting in multiple temperature values. A first stable operating change value is determined based on the plurality of temperature values; The first detection frequency is determined based on the first stable change value. Based on the first detection frequency, the number of free good blocks in each of the p bound blocks is detected.
[0038] Among them, such as Figure 3 As shown, the storage device may also include a temperature sensor, which can collect the temperature value of the flash memory module at specified time intervals to obtain multiple temperature values. Each temperature value can correspond to a collection time. The specified time interval can be preset or defaulted to by the system.
[0039] Next, the first stable operating change value can be determined based on multiple temperature values. For example, the standard deviation of multiple temperature values can be determined to obtain the first standard deviation. According to the preset mapping relationship between the standard deviation and the stable operating change value, the first stable operating change value corresponding to the first standard deviation can be determined based on the mapping relationship. The stable operating change value is used to reflect the operating stability of the flash memory module. Different operating stability indicates that the internal environment of the flash memory module changes differently. If the stable operating change value is larger, it indicates that the internal environment changes more, which will have a greater impact on the execution effect of the multi-plane operation, and vice versa.
[0040] Specifically, a pre-stored mapping relationship between preset stable change values and detection frequencies can be used. This mapping relationship allows the determination of a first detection frequency corresponding to a first stable change value. The greater the change in the internal environment, the higher the detection frequency, and vice versa. This ensures the capture accuracy of the flash memory bonding optimization trigger moment and avoids frequent detection, reducing the power consumption of the storage device. Based on the first detection frequency, the number of free good blocks in each of the p bonding blocks is detected, making the detection effect appropriate to the changes in the internal environment. This helps to ensure the capture accuracy of the flash memory bonding optimization trigger moment, thereby ensuring the real-time execution effect of the Multi-plane operation.
[0041] In one possible embodiment, the above step of determining the first stable operating change value based on the plurality of temperature values can be implemented in the following manner: By fitting the multiple temperature values, a first temperature change straight line is obtained; Obtain the slope of the first temperature change line to get the first slope; The first stable change value is determined based on the first slope.
[0042] In this system, each temperature value corresponds to a sampling time. Therefore, the multiple temperature values and their corresponding sampling times can be regarded as multiple coordinate points. These multiple coordinate points are mapped to coordinate points, with the horizontal axis representing time and the vertical axis representing temperature. Based on these multiple coordinate points, a first temperature change line is obtained, and the slope of the first temperature change line is obtained. The mapping relationship between the preset slope and the stable working change value can be stored in advance. Based on the mapping relationship, the first stable working change value corresponding to the first slope is determined. That is, based on the temperature change of the flash memory module, the internal environment change of the flash memory module can be dynamically determined, which helps to ensure the capture accuracy of the flash memory binding optimization trigger time, thereby ensuring the real-time execution effect of the Multi-plane operation.
[0043] In one possible embodiment, the above step of determining q bound blocks based on the number of k free good blocks can be implemented in the following manner: Determine the minimum value among the k free good blocks to obtain the first minimum value; Determine the first optimization factor corresponding to the first stable change value of the operation; The first minimum value is optimized according to the first optimization factor to obtain q, where q is less than or equal to the first minimum value; Each of the k planes is selected from q available good blocks to obtain a set of k available good blocks; Based on the set of k free good blocks, good blocks are bound together to obtain q bound blocks.
[0044] In specific implementation, the minimum value among the number of k free good blocks can be determined to obtain the first minimum value. The mapping relationship between the preset working stability change value and the optimization factor can also be stored in advance. Then, based on the mapping relationship, the first optimization factor corresponding to the first working stability change value can be determined. Then, the first minimum value can be optimized according to the first optimization factor to obtain q, where q is less than or equal to the first minimum value. For example, the value of the first optimization factor can be an integer or a decimal. If the optimization factor can be 0, 1, or 2, then q = first minimum value - first optimization factor. Or, if the optimization factor can be 0 to 1, then q = floor(first minimum value × (1 - first optimization factor)). The function of floor is to round down.
[0045] Next, q free good blocks are selected for each of the k planes to obtain a set of k free good blocks. Then, good blocks are bound according to the set of k free good blocks to obtain q bound blocks. Since the number of bound blocks is further optimized based on the internal environment change trend, it can deeply ensure that the flash binding conforms to the actual situation in real time, that is, deeply and in real time ensure the execution effect of Multi-plane.
[0046] In one possible embodiment, it can also be implemented as follows: Determine the minimum value among the k free good blocks to obtain the second minimum value; Determine the difference between the second minimum value and p to obtain the first difference; When the first difference is greater than the second set value, it is determined that the flash memory bonding optimization condition is met; When the first difference is less than or equal to the second set value, it is determined that the flash memory binding optimization condition is not met.
[0047] The second setting value can be preset or set by the system default. The second setting value must be greater than 0.
[0048] The second setting value may be related to the attributes of the flash memory module (e.g., model, memory size, usage time, circuit structure, etc.), or the second setting value may be related to the operating environment of the flash memory module (e.g., hardware environment, and / or software environment, and / or physical environment).
[0049] In practice, the minimum value among the k free good blocks can be determined to obtain the second minimum value. Then, the difference between the second minimum value and p can be determined to obtain the first difference value. When the first difference value is greater than the second set value, it indicates that the difference in free good blocks between each plane is large, which will affect the execution effect of the multi-plane operation and determine that the flash binding optimization condition is met. Conversely, when the first difference value is less than or equal to the second set value, it indicates that the difference in free good blocks between each plane is small, which will affect the execution effect of the multi-plane operation and determine that the flash binding optimization condition is not met. Flash binding optimization can be automatically triggered, which helps to ensure the execution effect of the multi-plane operation.
[0050] Next, if the flash binding optimization conditions are met, the number of free good blocks for k planes can be determined, and then q binding blocks can be determined based on the number of free good blocks. Each binding block includes k free good blocks, which come from different planes among the k planes, where q is a positive integer. This means that when the flash binding optimization conditions are met, flash binding can be dynamically optimized again based on the differences in free good blocks among the planes, so that the flash binding conforms to the actual situation in real time, which helps to ensure the performance of Multi-plane execution in real time.
[0051] Correspondingly, a pre-stored mapping table between preset working stability change values and detection frequencies can be used. Based on this mapping relationship, a second detection frequency corresponding to the first working stability change value is determined. Then, according to the second detection frequency, the step of determining the minimum value among the k free good blocks is executed to obtain the second minimum value. The working stability change value is used to reflect the working stability of the flash memory module. Different working stability values indicate different changes in the internal environment of the flash memory module. For example, if the working stability change value is larger, it indicates a larger change in the internal environment, which has a greater impact on the execution effect of the Multi-plane operation, and vice versa. That is, the larger the change in the internal environment, the higher the detection frequency, and vice versa. This ensures the capture accuracy of the flash memory bonding optimization trigger moment, avoids frequent detection, reduces the power consumption of the storage device, and makes the detection effect suitable for the internal environment change. This helps to ensure the capture accuracy of the flash memory bonding optimization trigger moment, thereby ensuring the real-time execution effect of the Multi-plane operation.
[0052] In one possible embodiment, the steps of simultaneously executing the first detection frequency to detect the number of free good blocks in each of the p bound blocks and the second detection frequency to determine the minimum value among the k free good block numbers and obtain the second minimum value can detect whether the flash binding optimization conditions are met from two dimensions. That is, whichever dimension meets the flash binding optimization conditions first, flash binding optimization can be performed. This helps to ensure the capture accuracy of the flash binding optimization trigger moment, thereby ensuring the real-time execution effect of the Multi-plane operation.
[0053] In the synchronous execution process, one thread can execute the step of detecting the number of free good blocks in each of the p bound blocks according to the first detection frequency, while another thread executes the step of determining the minimum value among the k free good block counts according to the second detection frequency to obtain the second minimum value; or, in the synchronous execution process, one process can execute the step of detecting the number of free good blocks in each of the p bound blocks according to the first detection frequency, while another process executes the step of determining the minimum value among the k free good block counts according to the second detection frequency to obtain the second minimum value.
[0054] Please see Figure 4 , Figure 4 This is a third structural schematic diagram of a storage device according to an embodiment of the present invention. The storage device includes a processor, a memory, a communication interface, and one or more programs. The one or more programs are stored in the memory and configured to be executed by the processor. The storage device includes a flash memory module, which includes k planes and p bound blocks. Each bound block includes k free good blocks, and the k free good blocks come from different planes among the k planes; k is an integer greater than 1; p is a positive integer; the memory includes the flash memory module; the program includes instructions for performing the following steps: The number of free good blocks in each of the p bound blocks is detected to obtain the number of p free good blocks; Determine whether the flash bonding optimization conditions are met based on the number of p free good blocks; If so, determine the number of free good blocks for the k planes to obtain the number of k free good blocks; Based on the number of k free good blocks, q bound blocks are determined. Each bound block includes k free good blocks, which come from different planes among the k planes, and q is a positive integer.
[0055] The storage device may include a computer device equipped with a flash memory module, which may include at least one of the following: mobile phone, tablet computer, server, in-vehicle device, wearable device, smart home device, gateway, router, hard drive, etc., without limitation.
[0056] As can be seen, the storage device described in this embodiment of the invention includes a flash memory module, which includes k planes and p bound blocks. Each bound block includes k free good blocks, which come from different planes among the k planes; k is an integer greater than 1; p is a positive integer. The number of free good blocks in each of the p bound blocks is detected to obtain the number of p free good blocks. Based on the number of p free good blocks, it is determined whether the flash binding optimization condition is met. If so, the number of free good blocks in the k planes is determined to obtain the number of k free good blocks. Based on the number of k free good blocks, q bound blocks are determined, each of which includes k free good blocks, which come from different planes among the k planes. q is a positive integer. That is, the number of p free good blocks can be used to dynamically monitor the changes in the good block differences between the bound blocks. When the flash binding optimization condition is met, it means that the good block differences between the bound blocks are large, which will affect the execution effect of the Multi-plane operation. That is, the flash binding is dynamically optimized again based on the differences in the free good blocks of each plane, so that the flash binding conforms to the actual situation in real time, which helps to ensure the real-time execution effect of the Multi-plane operation.
[0057] The aforementioned storage device may be used to execute some or all of the steps of any of the above methods, without limitation.
[0058] Figure 5 This is a functional unit block diagram of a flash memory bonding optimization device 500 involved in an embodiment of the present invention. The flash memory bonding optimization device 500 is applied to a storage device, which includes a flash memory module. The flash memory module includes k planes and p bonding blocks. Each bonding block includes k free good blocks, and the k free good blocks come from different planes among the k planes; k is an integer greater than 1; p is a positive integer; the flash memory bonding optimization device 500 includes: a detection unit 510, a judgment unit 520, and a determination unit 530, wherein... The detection unit 510 is used to detect the number of free good blocks in each of the p bound blocks to obtain the number of p free good blocks; The judgment unit 520 is used to determine whether the flash memory bonding optimization conditions are met based on the number of p free good blocks. The determining unit 530 is configured to determine the number of free good blocks in the k planes when the flash memory bonding optimization conditions are met, thereby obtaining the number of k free good blocks; and to determine q bonding blocks based on the number of k free good blocks, wherein each bonding block includes k free good blocks, the k free good blocks coming from different planes among the k planes, and q is a positive integer.
[0059] As can be seen, the flash binding optimization device described in this embodiment of the invention is applied to a storage device. The storage device includes a flash memory module, which includes k planes and p binding blocks. Each binding block includes k free good blocks, which come from different planes among the k planes. k is an integer greater than 1, and p is a positive integer. The number of free good blocks in each of the p binding blocks is detected to obtain the number of p free good blocks. Based on the number of p free good blocks, it is determined whether the flash binding optimization condition is met. If so, the number of free good blocks in the k planes is determined to obtain the number of k free good blocks. Based on the number of k free good blocks, q binding blocks are determined. Each binding block includes k free good blocks, which come from different planes among the k planes. q is a positive integer. That is, the number of p free good blocks can be used to dynamically monitor the changes in the difference in good blocks between binding blocks. When the flash binding optimization condition is met, it means that the difference in good blocks between binding blocks is large, which will affect the execution effect of the multi-plane operation. That is, flash binding optimization is dynamically performed again based on the difference in free good blocks of each plane, so that the flash binding conforms to the actual situation in real time, which helps to ensure the execution effect of the multi-plane operation in real time.
[0060] In one possible embodiment, determining whether the flash bonding optimization condition is met based on the number of p free good blocks includes: The first mean square error is obtained by calculating the mean square error based on the number of p free good blocks; When the first mean square error is greater than the first set value, it is determined that the flash memory bonding optimization condition is met; When the first mean square error is less than or equal to the first set value, it is determined that the flash memory binding optimization condition is not met.
[0061] In one possible embodiment, the storage device includes a temperature sensor, and the detection of the number of free good blocks in each of the p bound blocks includes: The temperature sensor is used to obtain the temperature value of the flash memory module, resulting in multiple temperature values. A first stable operating change value is determined based on the plurality of temperature values; The first detection frequency is determined based on the first stable change value. Based on the first detection frequency, the number of free good blocks in each of the p bound blocks is detected.
[0062] The aforementioned flash bonding optimization device can be used to perform some or all of the steps of any of the above methods, and is not limited thereto. The aforementioned storage device may include the flash bonding optimization device.
[0063] In one possible embodiment, determining the first stable operating change value based on the plurality of temperature values includes: By fitting the multiple temperature values, a first temperature change straight line is obtained; Obtain the slope of the first temperature change line to get the first slope; The first stable change value is determined based on the first slope.
[0064] In one possible embodiment, determining q bound blocks based on the number of k free good blocks includes: Determine the minimum value among the k free good blocks to obtain the first minimum value; Determine the first optimization factor corresponding to the first stable change value of the operation; The first minimum value is optimized according to the first optimization factor to obtain q, where q is less than or equal to the first minimum value; Each of the k planes is selected from q available good blocks to obtain a set of k available good blocks; Based on the set of k free good blocks, good blocks are bound together to obtain q bound blocks.
[0065] It is understood that the functions of each program module of the flash memory bonding optimization device in this embodiment can be specifically implemented according to the methods in the above method embodiments. The specific implementation process can be referred to the relevant descriptions in the above method embodiments, and will not be repeated here.
[0066] This invention also provides a computer storage medium storing a computer program for electronic data interchange, which causes a computer to perform some or all of the steps of any of the methods described in the above method embodiments.
[0067] This invention also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments. This computer program product can be a software installation package.
[0068] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0069] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0070] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical or other forms.
[0071] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0072] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0073] If the aforementioned integrated units are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0074] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage device, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0075] The embodiments of the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A flash memory bonding optimization method, characterized in that, Applied to a storage device, the storage device including a flash memory module, the flash memory module including k planes and p bound blocks, each bound block including k free good blocks, the k free good blocks coming from different planes among the k planes; k is an integer greater than 1; p is a positive integer; the method includes: The number of free good blocks in each of the p bound blocks is detected to obtain the number of p free good blocks; Determine whether the flash bonding optimization conditions are met based on the number of p free good blocks; If so, determine the number of free good blocks for the k planes to obtain the number of k free good blocks; Based on the number of k free good blocks, q bound blocks are determined. Each bound block includes k free good blocks, which come from different planes among the k planes, and q is a positive integer.
2. The method as described in claim 1, characterized in that, The step of determining whether the flash bonding optimization conditions are met based on the number of p free good blocks includes: The first mean square error is obtained by calculating the mean square error based on the number of p free good blocks; When the first mean square error is greater than the first set value, it is determined that the flash memory bonding optimization condition is met; When the first mean square error is less than or equal to the first set value, it is determined that the flash memory bonding optimization condition is not met.
3. The method as described in claim 1 or 2, characterized in that, The storage device includes a temperature sensor, and the detection of the number of free good blocks in each of the p bound blocks includes: The temperature sensor is used to obtain the temperature value of the flash memory module, resulting in multiple temperature values. A first stable operating change value is determined based on the plurality of temperature values; The first detection frequency is determined based on the first stable change value. Based on the first detection frequency, the number of free good blocks in each of the p bound blocks is detected.
4. The method as described in claim 3, characterized in that, The step of determining the first stable operating change value based on the plurality of temperature values includes: By fitting the multiple temperature values, a first temperature change straight line is obtained; Obtain the slope of the first temperature change line to get the first slope; The first stable change value is determined based on the first slope.
5. The method as described in claim 1 or 2, characterized in that, The step of determining q bound blocks based on the number of k free good blocks includes: Determine the minimum value among the k free good blocks to obtain the first minimum value; Determine the first optimization factor corresponding to the first stable change value of the operation; The first minimum value is optimized according to the first optimization factor to obtain q, where q is less than or equal to the first minimum value; Each of the k planes is selected from q available good blocks to obtain a set of k available good blocks; Based on the set of k free good blocks, good blocks are bound together to obtain q bound blocks.
6. A flash memory bonding optimization device, characterized in that, This is applied to a storage device, which includes a flash memory module. The flash memory module includes k planes and p bound blocks. Each bound block includes k free good blocks, which come from different planes among the k planes; k is an integer greater than 1; p is a positive integer. The flash memory binding optimization device includes a detection unit, a judgment unit, and a determination unit, wherein... The detection unit is used to detect the number of free good blocks in each of the p bound blocks, and obtain the number of p free good blocks; The judgment unit is used to determine whether the flash memory bonding optimization conditions are met based on the number of p free good blocks. The determining unit is configured to determine the number of free good blocks in the k planes when the flash memory binding optimization conditions are met, thereby obtaining the number of k free good blocks; and to determine q binding blocks based on the number of k free good blocks, each binding block including k free good blocks, wherein the k free good blocks come from different planes among the k planes, and q is a positive integer.
7. The flash memory bonding optimization apparatus as described in claim 6, characterized in that, The step of determining whether the flash bonding optimization conditions are met based on the number of p free good blocks includes: The first mean square error is obtained by calculating the mean square error based on the number of p free good blocks; When the first mean square error is greater than the first set value, it is determined that the flash memory bonding optimization condition is met; When the first mean square error is less than or equal to the first set value, it is determined that the flash memory bonding optimization condition is not met.
8. The flash memory bonding optimization apparatus as described in claim 6 or 7, characterized in that, The storage device includes a temperature sensor, and the detection of the number of free good blocks in each of the p bound blocks includes: The temperature sensor is used to obtain the temperature value of the flash memory module, resulting in multiple temperature values. A first stable operating change value is determined based on the plurality of temperature values; The first detection frequency is determined based on the first stable change value. Based on the first detection frequency, the number of free good blocks in each of the p bound blocks is detected.
9. A storage device, characterized in that, The storage device includes a processor and a memory for storing one or more programs and configured to be executed by the processor, the programs including instructions for performing the steps of the method as described in any one of claims 1-5, the memory including a flash memory module.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is executed by a processor to implement the method of any one of claims 1-5.