An automatic adjustment method, apparatus, and device for reserved space in a storage device.

By monitoring and matching the operating status information of flash memory blocks in real time, the allocation of reserved space in flash memory devices is optimized, solving the problems of insufficient resources in areas with a high proportion of bad blocks and wasted resources in areas with a low proportion of bad blocks, and achieving storage response speed and stability under high load scenarios.

CN121029098BActive Publication Date: 2026-01-06SHENZHEN LINGDECHUANG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511550510.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-28
Publication Date
2026-01-06
Estimated Expiration
2045-10-28

AI Technical Summary

Technical Problem

In existing technologies, when allocating reserved space, flash memory storage devices often have insufficient available flash memory blocks in areas with a high bad block ratio, while the reserved space in areas with a low bad block ratio remains idle. This results in wasted storage resources and data migration delays, failing to meet the storage response speed and stability requirements of high-load scenarios.

Method used

By monitoring the real-time operating status information of flash memory blocks, the storage location identifiers of bad blocks and available flash memory blocks are matched step by step. The target available flash memory blocks are determined according to the preset bad block ratio and reserved space. The bad blocks are replaced and the target available flash memory blocks are removed from the reserved space, thus optimizing the allocation of reserved space.

Benefits of technology

This improves the accuracy of identifying replaceable flash blocks, avoids insufficient or wasted available flash block reserves, and ensures storage response speed and stability under high load scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121029098B_ABST
    Figure CN121029098B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a kind of automatic adjustment method, device and equipment of storage device reserved space, comprising: real-time monitoring the operating state information of each flash memory block in storage device, operating state information includes bad block and the storage location identifier of bad block;The storage location identifier of bad block is matched with the storage location identifier of each type of available flash memory block in the preset reserved space, and the target available flash memory block of same storage location identifier is determined according to the matching result, the number of each type of available flash memory block is determined according to the preset bad block proportion corresponding to the corresponding storage location identifier and the reserved space;Bad block is replaced as target available flash memory block, and target available flash memory block is eliminated from reserved space.It improves the accuracy of determining replaceable flash memory block, avoids insufficient available flash memory block reserve or available flash memory block waste, improves the efficiency of storage location identifier, and guarantees the storage response speed and stability under high load scenario.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic digital data processing technology, and in particular to a method, apparatus, and device for automatically adjusting reserved space in a storage device. Background Technology

[0002] In current flash storage device applications (such as NAND flash memory, SSD, etc.), in order to cope with the inevitable bad block problem that will occur during long-term erasure and writing and environmental fluctuations, the device's storage function continuity and data security are usually ensured by pre-reserving space (i.e., OP space).

[0003] In related technologies, a fixed allocation mode is usually adopted when allocating reserved space, which leads to insufficient available flash memory blocks in some areas with high bad block ratios, resulting in frequent shortages of bad block replacement resources. Meanwhile, the reserved space in areas with low bad block ratios remains idle for a long time, causing a waste of storage resources. Furthermore, existing solutions often lack fine-grained flash memory location identification, resulting in inaccurate matching between bad blocks and corresponding available flash memory blocks, leading to data migration delays and failing to meet the requirements of storage response speed and stability in high-load scenarios. Summary of the Invention

[0004] This application provides an automatic adjustment method, apparatus, and device for reserved space in a storage device. It solves the problem that during storage device operation, the mismatch between the actual bad block ratio and the corresponding available flash memory block reserve prevents the device from meeting the demands for storage response speed and stability under high load scenarios. By monitoring the operating status information of each flash memory block in real time and matching the bad block storage location identifiers in the movement status information with the storage location identifiers of various types of available flash memory blocks in the preset reserved space, the accuracy of determining replaceable flash memory blocks is improved. The quantity of each type of available flash memory block is determined based on the preset bad block ratio corresponding to the storage location identifier and the reserved space, avoiding insufficient or wasted available flash memory blocks. By removing target available flash memory blocks from the reserved space, the efficiency of storage location identification is improved, fully ensuring storage response speed and stability under high load scenarios.

[0005] In a first aspect, embodiments of this application provide a method for automatically adjusting reserved space in a storage device, comprising:

[0006] Real-time monitoring of the operating status information of each flash memory block in the storage device, the operating status information including bad blocks and the storage location identifier of the bad blocks;

[0007] The storage location identifier of the bad block is matched step by step with the storage location identifier of each type of available flash memory block in the preset reserved space. The target available flash memory block with the same storage location identifier is determined according to the matching result. The number of each type of available flash memory block is determined according to the preset bad block ratio corresponding to the corresponding storage location identifier and the reserved space.

[0008] The bad block is replaced with the target usable flash memory block, and the target usable flash memory block is removed from the reserved space.

[0009] Optionally, the reserved space includes replaceable space and cache space;

[0010] Accordingly, the number of available flash memory blocks of each type is determined based on the preset bad block ratio corresponding to the corresponding storage location identifier and the reserved space, including:

[0011] The preset bad block ratios are determined as the partitioning ratios of the replaceable space. Based on the partitioning ratios, the replaceable space is divided into regions to obtain storage regions of various types.

[0012] The number of available flash blocks for each type is calculated based on the preset unit storage capacity of each type of storage region and each flash block.

[0013] Optionally, the storage location identifier includes a first-level identifier, a second-level identifier, and a third-level identifier, wherein the first-level identifier is an independent module identifier, the second-level identifier is a logical management unit identifier, and the third-level identifier is a storage unit identifier.

[0014] Optionally, the operating status information also includes the number of bad blocks and read / write performance data for each type of flash memory block. After removing the target available flash memory block from the reserved space, the information further includes:

[0015] Based on the real-time monitoring of the number of bad blocks and read / write performance data of various types of flash memory blocks, the bad block growth and read / write performance change parameters of each type of flash memory block are periodically statistically analyzed within a preset time period.

[0016] The performance of each type of flash memory block is evaluated based on the bad block growth rate, corresponding read / write performance change parameters, and corresponding preset weighting coefficients to obtain the performance evaluation value corresponding to each type of flash memory block.

[0017] If the performance evaluation value is less than the preset performance threshold, the reserved space is adjusted according to the performance evaluation value.

[0018] Optionally, adjusting the reserved space based on the performance evaluation value includes:

[0019] Determine the number of prepared flash blocks associated with the performance evaluation value, and the target storage location identifier corresponding to the performance evaluation value;

[0020] The number of flash blocks to be supplemented is calculated based on the number of prepared flash blocks and the remaining available flash blocks corresponding to the target storage location identifier in the replaceable space.

[0021] The cache space is reduced and adjusted according to the number of flash memory blocks to be replenished.

[0022] Optionally, the performance evaluation of each type of flash memory block based on the bad block growth rate, corresponding read / write performance change parameters, and corresponding preset weighting coefficients includes:

[0023] Based on the read / write duration variation parameters of the aforementioned type of flash memory block, a performance variation curve is generated, and inflection point data in each performance variation curve and the collection time interval of each inflection point data are extracted.

[0024] The performance fluctuation frequency is calculated based on each adjacent inflection point data and the corresponding collection time interval, and the inflection point data whose performance fluctuation frequency exceeds the preset frequency threshold is removed to obtain the remaining read and write performance data.

[0025] Calculate the average read / write time of the remaining read / write performance data, and evaluate the performance of each type of flash memory block based on the bad block growth rate, the corresponding average read / write time, and the corresponding preset weighting coefficient.

[0026] Optionally, before replacing the bad block with the target available flash memory block, the method further includes:

[0027] When there are multiple target available flash memory blocks, obtain the performance parameters of each target available flash memory block;

[0028] The performance parameters are matched with the damage level of bad blocks in the operating status information, and the target usable flash memory blocks that can be replaced are determined based on the matching results.

[0029] In a second aspect, embodiments of this application provide an automatic adjustment device for reserved space in a storage device, comprising:

[0030] The operation status information monitoring module is used to monitor the operation status information of each flash memory block in the storage device in real time. The operation status information includes bad blocks and the storage location identifier of the bad blocks.

[0031] The target available flash memory block determination module is used to match the storage location identifier of the bad block with the storage location identifier of each type of available flash memory block in the preset reserved space step by step, and determine the target available flash memory blocks with the same storage location identifier according to the matching result. The number of each type of available flash memory block is determined according to the preset bad block ratio corresponding to the corresponding storage location identifier and the reserved space.

[0032] A flash memory block replacement module is used to replace the bad blocks with the target usable flash memory blocks;

[0033] A target available flash memory block removal module is used to remove the target available flash memory block from the reserved space.

[0034] In a third aspect, embodiments of this application provide an electronic device, the device comprising: one or more processors; and a storage device configured to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the automatic adjustment method for reserved space in the storage device as described in the first aspect.

[0035] In a fourth aspect, embodiments of this application provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the automatic adjustment method for reserved space in a storage device as described in the first aspect.

[0036] This application embodiment monitors the operational status information of each flash memory block in the storage device in real time. The operational status information includes bad blocks and their storage location identifiers. The storage location identifiers of bad blocks are matched step-by-step with the storage location identifiers of various types of available flash memory blocks in a preset reserved space. Based on the matching results, target available flash memory blocks with the same storage location identifier are determined. The number of available flash memory blocks of each type is determined according to the preset bad block ratio and reserved space corresponding to the corresponding storage location identifier. Bad blocks are replaced with target available flash memory blocks, and target available flash memory blocks are removed from the reserved space. By monitoring the operational status information of each flash memory block in real time and matching the bad block storage location identifiers in the operational status information with the storage location identifiers of various types of available flash memory blocks in the reserved space step-by-step, the accuracy of determining replaceable flash memory blocks is improved. Determining the number of available flash memory blocks of each type based on the preset bad block ratio and reserved space corresponding to the corresponding storage location identifier avoids insufficient or wasted available flash memory blocks. By removing target available flash memory blocks from the reserved space, the efficiency of storage location identification is improved, fully ensuring storage response speed and stability under high load scenarios. Attached Figure Description

[0037] Figure 1 This is a flowchart of an automatic adjustment method for reserved space in a storage device provided in an embodiment of this application;

[0038] Figure 2 This is a schematic diagram illustrating the storage location relationship of a usable flash memory block provided in this application.

[0039] Figure 3 This is a flowchart illustrating a method for determining the number of available flash memory blocks of various types, as provided in an embodiment of this application.

[0040] Figure 4 This is a flowchart of another method for automatically adjusting the reserved space of a storage device provided in an embodiment of this application;

[0041] Figure 5 This is a flowchart of a method for reducing and adjusting cache space provided in an embodiment of this application;

[0042] Figure 6 This is a flowchart of a flash memory block performance evaluation method provided in an embodiment of this application;

[0043] Figure 7 This application provides performance variation curves for various types of flash memory blocks in its embodiments.

[0044] Figure 8 This is a schematic diagram of the structure of an automatic adjustment device for reserved space in a storage device provided in an embodiment of this application;

[0045] Figure 9 This is a schematic diagram of the structure of an automatic adjustment device for reserved space in a storage device provided in an embodiment of this application. Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0047] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0048] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0049] The automatic adjustment method, apparatus, and device for reserved space of storage devices provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.

[0050] The automatic adjustment method for reserved space in storage devices provided in this application embodiment can be used in scenarios where storage device performance and stability are guaranteed under high load environments. Based on the above application scenario, it can be understood that the executing entity of each step can be a computer device. This computer device refers to any electronic device with data computing, processing, and storage capabilities, such as mobile phones, PCs (Personal Computers), tablet computers, and other terminal devices, or it can be a server or other devices. This application embodiment does not limit this.

[0051] Figure 1 This is a flowchart illustrating an automatic adjustment method for reserved space in a storage device, as provided in an embodiment of this application. Figure 1 As shown, it includes:

[0052] Step S101: Monitor the operating status information of each flash memory block in the storage device in real time. The operating status information includes bad blocks and the storage location identifier of bad blocks.

[0053] Storage devices can refer to various types of storage hardware that use flash memory as the storage medium and require reserved space to perform core operations such as garbage collection, bad block replacement, and wear leveling to ensure performance, lifespan, and data security. Flash blocks can refer to the basic hardware modules that constitute the storage units of flash memory devices; they are the smallest operational units for data reading, writing, erasing, bad block replacement, and reserved space allocation. Reserved space can specifically refer to redundant space allocated by flash memory device manufacturers within the total storage capacity, which is not directly accessible to users and is used to ensure device performance, lifespan, and data security. Optionally, reserved space includes replaceable space and cache space. Replaceable space is used to store various types of available flash memory blocks. Cache space can be a buffer area used to temporarily store data to be written or valid data migrated from bad blocks. Operating status information refers to key data related to the functional availability and hardware ownership of flash memory blocks, collected in real time during the operation of the flash memory device, and may include information such as the number of erase / write cycles. Optionally, the operational status information includes bad blocks, their storage location identifiers, and the damage level of the bad blocks. Bad blocks refer to flash memory blocks in a flash memory device that, due to hardware wear, physical failures, data errors, or other reasons, cannot properly complete data read / write or erase operations, or cannot guarantee data storage reliability. The operational status information also includes the number of bad blocks and read / write performance data for each type of flash memory block. Read / write performance data refers to key indicators used to quantify the efficiency and stability of flash memory devices during data read and write operations, reflecting the device's data processing speed, response latency, and load tolerance. Storage location identifiers refer to identification information used to accurately locate the storage location of flash memory blocks at the hardware level. For example, the storage location of a flash memory block can be identified by block-page-column. Here, "block" locates the physical location of the flash memory block within the entire device; "page" is a specific page within a flash memory block, the basic unit for data read / write; a block typically contains 32 or 64 pages; and "column" locates a specific byte within a page, the smallest unit of the address system, used for accurately reading and writing part of the data within a page. In one embodiment, the operating status information of each flash memory block in the storage device is acquired in real time, and all flash memory blocks with bad block identifiers in the operating status information are identified as bad blocks and their associated storage location information is extracted.

[0054] Step S102: Match the storage location identifier of the bad block with the storage location identifier of each type of available flash memory block in the preset reserved space step by step. Based on the matching result, determine the target available flash memory block with the same storage location identifier. The number of available flash memory blocks of each type is determined according to the preset bad block ratio corresponding to the corresponding storage location identifier and the reserved space.

[0055] In this context, "usable flash memory blocks" refers to flash memory blocks in a flash memory device that possess normal data read / write and erase capabilities, are not marked as bad blocks, and can be scheduled for data storage or bad block replacement. "Target available flash memory blocks" can be available flash memory blocks with the same storage location identifier as bad blocks that can be used to replace them. Multiple available flash memory blocks corresponding to the same storage location identifier constitute one type of available flash memory block. The preset bad block ratio refers to the proportion of each type of bad block to the total number of bad blocks, obtained based on historical flash memory quality test results.

[0056] In one embodiment, the storage location identifier of a bad block is matched step-by-step with the storage location identifiers of various types of available flash memory blocks in a preset reserved space. For example, if the storage location identifier is "block-page-column", then the "block" corresponding to the bad block is matched with the "block" corresponding to each type of available flash memory block in the reserved space to obtain a first matching result. Then, the "page" corresponding to the bad block is matched with the "page" corresponding to each type of available flash memory block in the first matching result to obtain a second matching result. Finally, the "column" corresponding to the bad block is matched with the "column" corresponding to each type of available flash memory block in the second matching result to obtain one or more target available flash memory blocks. Optionally, to ensure that there are enough replaceable available flash memory blocks for each type of flash memory block, the number of available flash memory blocks of each type can be determined in advance based on the preset bad block ratio and reserved space corresponding to the corresponding storage location identifier.

[0057] Optionally, the storage location identifier includes a first-level identifier, a second-level identifier, and a third-level identifier. The first-level identifier is the independent module identifier, the second-level identifier is the logical management unit identifier, and the third-level identifier is the storage unit identifier. The independent module identifier distinguishes the physical chip to which the flash memory block belongs. Each independent module (die) is an independent flash memory chip with its own independent read / write control unit. The logical management unit identifier locates the logical unit within the independent module to which the flash memory block belongs, such as logical management unit 0 (lun0) and logical management unit 1 (lun1) under the independent module (die). An independent module (die) can be divided into multiple logical management units (lun), each containing an independent storage channel, and its identifier format is "independent module number + logical management unit number". The storage cell identifier (plane) is used to identify the plane of a flash memory block within its logical management unit (LUN), such as storage cell 0 (plane0) and storage cell 1 (plane1) under logical management unit 0 (LUN0). The identifier format is "independent module number + logical management unit number + storage cell number", such as independent module 1 (die1) - logical management unit 0 (LUN0) - storage cell 0 (plane0). Therefore, the storage location identifier can be represented as: independent module (die) - logical management unit (LUN) - storage cell (plane). Figure 2This is a schematic diagram illustrating the storage location relationship of a usable flash memory block provided in this application, such as... Figure 2 As shown, Figure 2 Consider a single independent module (die), where regions A, B, and C are logical management units (lun), each of which has two storage units (plane). This independent module (die) has three logical management units (lun). Let region A be logical management unit 0 (lun0), region B be logical management unit 1 (lun1), and region C be logical management unit 2 (lun2). The first column of each logical management unit (lun) is storage unit 0 (plane0), and the second column is storage unit 1 (plane1).

[0058] Step S103: Replace the bad blocks with the target usable flash memory blocks and remove the target usable flash memory blocks from the reserved space.

[0059] In one embodiment, valid data in bad blocks is migrated to target available flash memory blocks. After the replacement is completed, the status information of the storage device is updated in a timely manner, the used target available flash memory blocks are removed from the reserved space, and the quantity and type information of the remaining available flash memory blocks in the reserved space are updated.

[0060] This application embodiment monitors the operational status information of each flash memory block in the storage device in real time. The operational status information includes bad blocks and their storage location identifiers. The storage location identifiers of bad blocks are matched step-by-step with the storage location identifiers of various types of available flash memory blocks in a preset reserved space. Based on the matching results, target available flash memory blocks with the same storage location identifier are determined. The number of available flash memory blocks of each type is determined according to the preset bad block ratio and reserved space corresponding to the corresponding storage location identifier. Bad blocks are replaced with target available flash memory blocks, and target available flash memory blocks are removed from the reserved space. By monitoring the operational status information of each flash memory block in real time and matching the bad block storage location identifiers in the operational status information with the storage location identifiers of various types of available flash memory blocks in the preset reserved space step-by-step, the accuracy of determining replaceable flash memory blocks is improved. Determining the number of available flash memory blocks of each type based on the preset bad block ratio and reserved space corresponding to the corresponding storage location identifier avoids insufficient or wasted available flash memory blocks. By removing target available flash memory blocks from the reserved space, the efficiency of storage location identification is improved, fully ensuring storage response speed and stability under high load scenarios.

[0061] Optionally, before replacing bad blocks with the target available flash memory blocks, the method further includes: if there are multiple target available flash memory blocks, obtaining the performance parameters of each target available flash memory block; matching each performance parameter with the damage level of bad blocks in the running status information, and determining the replaceable target available flash memory blocks based on the matching results.

[0062] The damage level of bad blocks refers to the severity of how bad blocks are classified based on their inability to perform normal data read / write, erase operations, or ensure data storage reliability. This can be categorized as: minor damage, moderate damage, and severe damage. Minor damage may only affect the read / write speed of some data, but overall functionality can still be maintained; moderate damage may lead to frequent data errors and a significant decrease in read / write performance; severe damage means that the flash memory block is almost completely unable to perform normal data operations.

[0063] In one embodiment, if there are multiple target available flash memory blocks, the read / write speed, erase time, error rate, and other performance parameters of each target available flash memory block are obtained. When these performance parameters are matched with the damage level of bad blocks, if the bad block is slightly damaged, a target available flash memory block with performance parameters that are close to but slightly better than the bad block can be selected for replacement to ensure the overall performance stability of the storage device; if the bad block is moderately or severely damaged, a target available flash memory block with performance parameters that are significantly better than the bad block should be selected first.

[0064] This application embodiment obtains the performance parameters of each target available flash memory block when there are multiple target available flash memory blocks; matches each performance parameter with the damage level of bad blocks in the running status information; and determines the replaceable target available flash memory blocks based on the matching results. This can maximize the overall lifespan of available flash memory blocks in the reserved space while ensuring the reliability of the storage device.

[0065] Figure 3 This is a flowchart illustrating a method for determining the number of available flash memory blocks of various types, as provided in an embodiment of this application. Figure 3 As shown, it includes:

[0066] Step S201: Determine the proportion of each preset bad block as the partitioning ratio of the replaceable space, and perform regional partitioning of the replaceable space based on the partitioning ratio to obtain storage regions of various types.

[0067] Step S202: Calculate the number of available flash blocks of each type based on the preset unit storage capacity of each type of storage area and flash block.

[0068] The preset unit storage capacity can refer to the amount of data that each flash memory block can store. In one embodiment, when determining the number of available flash memory blocks of each type, the proportion of each type of bad block to the total number of bad blocks is determined based on historical flash memory quality test results. It is understood that a larger preset bad block proportion indicates a higher probability or quantity of flash memory failure for the corresponding type, requiring more available flash memory blocks, and the proportion of the corresponding type of available flash memory blocks in the replaceable space should also be relatively large. Therefore, the preset bad block proportion can be directly determined as the partitioning ratio of the replaceable space. The replaceable space is divided into different areas according to the partitioning ratio, with each area corresponding to one type of available flash memory block. For example, if the preset bad block proportion for Independent Module 0 - Logic Management Unit 0 - Storage Unit 0 is 5%, then 5% of the replaceable space is allocated to this type of available flash memory block. The number of flash memory blocks that can be accommodated in each type of storage area is calculated based on the amount of data that each flash memory block can store. For example, if the size of a certain type of storage area is 100MB and each flash memory block is 1MB, then this area can accommodate 100 available flash memory blocks of that type.

[0069] In this embodiment, the proportion of each preset bad block is determined as the division ratio of the replaceable space. Based on the division ratio, the replaceable space is divided into regions to obtain storage regions of various types. Based on the preset unit storage amount of each type of storage region and flash memory block, the number of available flash memory blocks of each type is calculated, which ensures that the number of available flash memory blocks of each type meets the bad block replacement requirements and avoids resource waste.

[0070] Figure 4 This is a flowchart of another method for automatically adjusting the reserved space of a storage device provided in an embodiment of this application, such as... Figure 4 As shown, it includes:

[0071] Step S301: Based on the real-time monitored bad block count and read / write performance data of each type of flash memory block, periodically calculate the bad block growth and read / write performance change parameters of each type of flash memory block within a preset time period.

[0072] The bad block growth rate refers to the difference between the sum of newly added bad blocks and the number of previously existing bad blocks within a preset time period, minus the number of previously existing bad blocks. Read / write performance variation parameters reflect the changes in the read / write performance of flash memory blocks within a preset time period, such as the rate of change in read / write speed and the increase or decrease in response latency.

[0073] In one embodiment, the operating status of various types of flash memory blocks is continuously monitored, bad block count and read / write performance data are collected, and statistics are performed according to a preset time period, such as hourly statistics on the bad block growth and read / write performance changes of various types of flash memory blocks within the past 10 minutes, and the number of newly added bad blocks and the change in the total number of bad blocks within 10 minutes are calculated. For read / write performance changes, the rate of change of indicators such as read / write speed and response latency can be calculated by comparing read / write performance data at different points in time within the past 10 minutes.

[0074] Step S302: Based on the bad block growth rate, corresponding read / write performance change parameters, and corresponding preset weighting coefficients of each type of flash memory block, the performance evaluation value corresponding to each type of flash memory block is obtained.

[0075] The preset weighting coefficients can be weight values ​​assigned to parameters such as bad block growth and read / write performance changes based on actual needs and application scenarios. Different weighting coefficients reflect the importance of these parameters in performance evaluation. For example, if bad block growth has a greater impact on storage device performance, then a higher weighting coefficient can be assigned to it. The performance evaluation value can refer to a numerical value that reflects the performance changes of various types of flash memory blocks within a preset time period.

[0076] In one embodiment, the bad block growth rate and read / write performance variation parameters are weighted and calculated according to preset weighting coefficients to obtain a performance evaluation value corresponding to each flash memory block type. For example, a mapping relationship between the bad block growth rate range and the weighting coefficients, as well as a mapping relationship between the read / write performance variation parameter range and the weighting coefficients, are preset. A first weighting coefficient is determined based on the range to which the bad block growth rate belongs, and a second weighting coefficient is determined based on the range to which the read / write performance variation parameters belong. The first weighting coefficient and the second weighting coefficient are summed to obtain the performance evaluation value corresponding to the corresponding flash memory block type.

[0077] Step S303: If the performance evaluation value is less than the preset performance threshold, adjust the reserved space according to the performance evaluation value.

[0078] The preset threshold is a critical value used to determine whether automatic adjustment of reserved space needs to be triggered. When the performance evaluation value exceeds this threshold, it indicates that the performance of the current storage device may be severely affected, requiring automatic adjustment of the reserved space. In one embodiment, the calculated performance evaluation value is compared with the preset threshold. If the performance evaluation value exceeds the preset threshold, the automatic adjustment mechanism for reserved space is triggered to reallocate and adjust the reserved space to ensure the performance and stability of the storage device. If the performance evaluation value does not exceed the preset threshold, the operating status of each type of flash memory block continues to be monitored, and no automatic adjustment of reserved space is performed.

[0079] This application embodiment periodically calculates the bad block growth and read / write performance changes of each type of flash memory block within a preset time period based on real-time monitoring of the number of bad blocks and read / write performance data. It then evaluates the performance of each type of flash memory block based on the bad block growth, corresponding read / write performance changes, and preset weighting coefficients, obtaining a performance evaluation value for each block type. If the performance evaluation value is less than a preset performance threshold, the reserved space is adjusted accordingly. This effectively avoids storage response speed degradation and stability issues caused by bad block growth and performance decay, improving the adaptability and reliability of storage devices under high-load scenarios.

[0080] Figure 5 This is a flowchart of a method for reducing and adjusting cache space provided in an embodiment of this application, as shown below. Figure 5 As shown, it includes:

[0081] Step S3031: Determine the number of preparatory flash blocks associated with the performance evaluation value, and the target storage location identifier corresponding to the performance evaluation value.

[0082] Step S3032: Calculate the number of flash blocks to be supplemented based on the number of prepared flash blocks and the remaining available flash blocks corresponding to the target storage location identifier in the replaceable space.

[0083] Step S3033: Adjust the cache space by reducing its size according to the number of flash memory blocks to be replenished.

[0084] The number of reserve flash blocks refers to the number of flash blocks that need to be added or replaced based on performance evaluation results. This number can be estimated based on the current performance of the storage device and the potential increase in bad blocks and performance degradation in the future. Since different performance evaluation values ​​correspond to different numbers of reserve flash blocks for different flash types, and different flash types correspond to different target storage location identifiers, different performance evaluation values ​​correspond to different target storage location identifiers. The target storage location identifier clarifies the specific location within the storage device where the corresponding type of reserve flash block should be located, such as a specific die, logical management unit (LUN), or storage unit (plane).

[0085] In one embodiment, the number of reserve flash blocks associated with the performance evaluation value and the target storage location identifier corresponding to the performance evaluation value are determined. The number of remaining available flash blocks corresponding to the target storage location identifier in the replaceable space is compared. That is, the difference between the number of reserve flash blocks and the number of remaining available flash blocks corresponding to the target storage location identifier in the replaceable space is calculated. If the calculation result is greater than 0, it can be considered that the number of remaining available flash blocks is insufficient, and sufficient flash blocks need to be allocated from other locations or obtained through other means to meet the demand. At this time, the cache space can be reduced and adjusted according to the number of flash blocks to be supplemented. That is, by reducing the cache space, a portion of storage resources can be released for use when the reserved space is insufficient.

[0086] This application embodiment determines the number of reserve flash blocks associated with the performance evaluation value, and the target storage location identifier corresponding to the performance evaluation value; calculates the flash blocks to be supplemented based on the number of reserve flash blocks and the remaining available flash blocks corresponding to the target storage location identifier in the replaceable space; and adjusts the cache space by reducing it based on the number of flash blocks to be supplemented, which can be adjusted at any time according to the actual operation of the storage device to ensure the stability and efficiency of the storage system.

[0087] Figure 6 This is a flowchart of a flash memory block performance evaluation method provided in an embodiment of this application, such as... Figure 6 As shown, it includes:

[0088] Step S3021: Generate a performance change curve based on the read / write duration change parameters of the flash memory block of the type, and extract the inflection point data in each performance change curve, as well as the collection time interval of each inflection point data.

[0089] Step S3022: Calculate the performance fluctuation frequency based on the data of each adjacent inflection point and the corresponding acquisition time interval, and remove the inflection point data whose performance fluctuation frequency exceeds the preset frequency threshold to obtain the remaining read and write performance data.

[0090] Step S3023: Calculate the average read / write time of the remaining read / write performance data, and evaluate the performance of each type of flash memory block based on the bad block growth rate, the corresponding average read / write time, and the corresponding preset weighting coefficient.

[0091] The performance change curve refers to a curve plotted based on the read / write duration changes of different types of flash memory blocks, which can intuitively reflect the changes in read / write performance of flash memory blocks at different points in time. Inflection point data refers to the data at obvious turning points in the performance change curve. The sampling time interval refers to the time difference between two adjacent inflection point data, which can reflect the frequency of performance changes.

[0092] In one embodiment, Figure 7This application provides performance variation curves for various types of flash memory blocks, such as... Figure 7 As shown, firstly, read / write duration variation parameters for each type of flash memory block are collected. Based on these parameters, performance variation curves are generated, such as performance variation curves for type A, type B, and type C flash memory blocks. By analyzing these performance variation curves, inflection point data (A, B, C, D, E, and F) are identified, and the collection time interval for these inflection point data is recorded, such as the time interval between inflection point B and inflection point C. Based on each adjacent inflection point data and the corresponding collection time interval, the frequency of performance fluctuations can be calculated. Inflection point data with performance fluctuation frequencies exceeding a preset frequency threshold are removed to avoid interference from these abnormal data in subsequent performance evaluations. Finally, the average read / write duration of the remaining read / write performance data after removal is calculated. Based on the bad block growth rate, corresponding average read / write duration, and corresponding preset weighting coefficients, the performance of each type of flash memory block is evaluated.

[0093] This application's embodiments generate performance change curves based on read / write duration variation parameters of different types of flash memory blocks, extract inflection point data from each performance change curve, and the collection time interval for each inflection point data; calculate the performance fluctuation frequency based on each adjacent inflection point data and the corresponding collection time interval, and remove inflection point data whose performance fluctuation frequency exceeds a preset frequency threshold to obtain the remaining read / write performance data; calculate the average read / write duration of the remaining read / write performance data, and evaluate the performance of each type of flash memory block based on the bad block growth rate, the corresponding average read / write duration, and the corresponding preset weight coefficients, thereby achieving accurate evaluation of flash memory block performance. Consequently, the accuracy of cache space adjustment is improved, fully ensuring the stability and efficiency of the storage system.

[0094] Figure 8 This is a schematic diagram of an automatic adjustment device for reserved space in a storage device provided in an embodiment of this application. Figure 8 As shown, including;

[0095] The operation status information monitoring module 41 is used to monitor the operation status information of each flash memory block in the storage device in real time. The operation status information includes bad blocks and the storage location identifier of the bad blocks.

[0096] The target available flash memory block determination module 42 is used to match the storage location identifier of the bad block with the storage location identifier of each type of available flash memory block in the preset reserved space step by step, and determine the target available flash memory block with the same storage location identifier according to the matching result. The number of each type of available flash memory block is determined according to the preset bad block ratio corresponding to the corresponding storage location identifier and the reserved space.

[0097] Flash memory block replacement module 43 is used to replace the bad block with the target usable flash memory block;

[0098] The target available flash memory block removal module 44 is used to remove the target available flash memory block from the reserved space.

[0099] This application embodiment monitors the operational status information of each flash memory block in the storage device in real time. The operational status information includes bad blocks and their storage location identifiers. The storage location identifiers of bad blocks are matched step-by-step with the storage location identifiers of various types of available flash memory blocks in a preset reserved space. Based on the matching results, target available flash memory blocks with the same storage location identifier are determined. The number of available flash memory blocks of each type is determined according to the preset bad block ratio and reserved space corresponding to the corresponding storage location identifier. Bad blocks are replaced with target available flash memory blocks, and target available flash memory blocks are removed from the reserved space. By monitoring the operational status information of each flash memory block in real time and matching the bad block storage location identifiers in the operational status information with the storage location identifiers of various types of available flash memory blocks in the reserved space step-by-step, the accuracy of determining replaceable flash memory blocks is improved. Determining the number of available flash memory blocks of each type based on the preset bad block ratio and reserved space corresponding to the corresponding storage location identifier avoids insufficient or wasted available flash memory blocks. By removing target available flash memory blocks from the reserved space, the efficiency of storage location identification is improved, fully ensuring storage response speed and stability under high load scenarios.

[0100] In one possible embodiment, the reserved space includes replaceable space and cache space, and further includes a module for calculating the number of available flash memory blocks, used for:

[0101] The preset bad block ratios are determined as the partitioning ratios of the replaceable space. Based on the partitioning ratios, the replaceable space is divided into regions to obtain storage regions of various types.

[0102] The number of available flash blocks for each type is calculated based on the preset unit storage capacity of each type of storage area and each flash block.

[0103] In one possible embodiment, the storage location identifier includes a first-level identifier, a second-level identifier, and a third-level identifier, wherein the first-level identifier is an independent module identifier, the second-level identifier is a logical management unit identifier, and the third-level identifier is a storage unit identifier.

[0104] In one possible embodiment, the system further includes a reserved space adjustment module and a performance evaluation module, wherein the performance evaluation module is used for:

[0105] Based on the real-time monitoring of the number of bad blocks and read / write performance data of various types of flash memory blocks, the bad block growth and read / write performance change parameters of each type of flash memory block are periodically statistically analyzed within a preset time period.

[0106] The performance of each type of flash memory block is evaluated based on the bad block growth rate, corresponding read / write performance change parameters, and corresponding preset weighting coefficients to obtain the performance evaluation value corresponding to each type of flash memory block.

[0107] The reserved space adjustment module is used to adjust the reserved space according to the performance evaluation value when the performance evaluation value is less than the preset performance threshold.

[0108] In one possible embodiment, the reserved space adjustment module is specifically used for:

[0109] Determine the number of prepared flash blocks associated with the performance evaluation value, and the target storage location identifier corresponding to the performance evaluation value;

[0110] The number of flash blocks to be supplemented is calculated based on the number of prepared flash blocks and the remaining available flash blocks corresponding to the target storage location identifier in the replaceable space;

[0111] The cache space is reduced and adjusted according to the number of flash memory blocks to be replenished.

[0112] In one possible embodiment, the performance evaluation value module is specifically used for:

[0113] Based on the read / write duration variation parameters of the aforementioned type of flash memory block, a performance variation curve is generated, and inflection point data in each performance variation curve and the collection time interval of each inflection point data are extracted.

[0114] The performance fluctuation frequency is calculated based on each adjacent inflection point data and the corresponding collection time interval, and the inflection point data whose performance fluctuation frequency exceeds the preset frequency threshold is removed to obtain the remaining read and write performance data.

[0115] Calculate the average read / write time of the remaining read / write performance data, and evaluate the performance of each type of flash memory block based on the bad block growth rate, the corresponding average read / write time, and the corresponding preset weighting coefficient.

[0116] In one possible embodiment, the target available flash block determination module 42 is further configured to:

[0117] When there are multiple target available flash memory blocks, obtain the performance parameters of each target available flash memory block;

[0118] The performance parameters are matched with the damage level of bad blocks in the operating status information, and the target usable flash memory blocks that can be replaced are determined based on the matching results.

[0119] This application also provides an electronic device, which can integrate an automatic adjustment device for reserved space of a storage device provided in this application. Figure 9 This is a schematic diagram of an automatic adjustment device for reserved space in a storage device provided in an embodiment of this application. (Refer to...) Figure 9 The automatic adjustment device for the reserved space of the storage device includes: an input device 53, an output device 54, a memory 52, and one or more processors 51; the memory 52 is used to store one or more programs; when one or more programs are executed by one or more processors 51, the one or more processors 51 implement the automatic adjustment method for the reserved space of the storage device as provided in the above embodiments. The input device 53, output device 54, memory 52, and processor 51 can be connected via a bus or other means. Figure 9 Taking the example of a connection between China and Israel via a bus.

[0120] The memory 52, as a computing device readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the automatic adjustment method for reserved space in the storage device provided in any embodiment of this application. The memory 52 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the device, etc. Furthermore, the memory 52 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 52 may further include memory remotely located relative to the processor 51, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0121] Input device 53 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the device. Output device 54 may include display devices such as a display screen.

[0122] The processor 51 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 52, thereby realizing the above-mentioned method for automatically adjusting the reserved space of the storage device.

[0123] The automatic adjustment device, equipment, and computer for the reserved space of the storage device provided above can be used to execute the automatic adjustment method for the reserved space of the storage device provided in any of the above embodiments, and have corresponding functions and beneficial effects.

[0124] This application embodiment also provides a storage medium for storing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to execute an automatic adjustment method for reserved space in a storage device as provided in the above embodiment. The automatic adjustment method for reserved space in a storage device includes: real-time monitoring of the operating status information of each flash memory block in the storage device, the operating status information including bad blocks and the storage location identifier of the bad blocks; performing step-by-step matching of the storage location identifier of the bad blocks with the storage location identifiers of each type of available flash memory block in a preset reserved space; determining target available flash memory blocks with the same storage location identifier based on the matching result, the number of each type of available flash memory block being determined based on the preset bad block ratio corresponding to the corresponding storage location identifier and the reserved space; replacing the bad blocks with the target available flash memory blocks, and removing the target available flash memory blocks from the reserved space.

[0125] Storage medium – any type of memory device or storage device. The term “storage medium” is intended to include: mounting media, such as CD-ROMs, floppy disks, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disks or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. Furthermore, storage media may reside in a first computer system in which a program is executed, or may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term “storage medium” can include two or more storage media that may reside in different locations (e.g., in different computer systems connected via a network). Storage media may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.

[0126] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the automatic adjustment method for the reserved space of the storage device as described above, but can also perform related operations in the automatic adjustment method for the reserved space of the storage device provided in any embodiment of this application.

[0127] The automatic adjustment device, apparatus, and storage medium for the reserved space of the storage device provided in the above embodiments can execute the automatic adjustment method for the reserved space of the storage device provided in any embodiment of this application. For technical details not described in detail in the above embodiments, please refer to the automatic adjustment method for the reserved space of the storage device provided in any embodiment of this application.

[0128] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the claims.

Claims

1. A method for automatically adjusting the reserved space of a storage device, characterized in that, The application comprises: Real-time monitoring of the running state information of each flash block in the storage device, wherein the running state information comprises bad blocks, storage location identifiers of the bad blocks, the number of bad blocks of each type of flash block, and read-write performance data; Sequentially matching the storage location identifiers of the bad blocks with the storage location identifiers of each type of available flash block in the pre-set reserved space, determining the target available flash block with the same storage location identifier according to the matching result, and determining the number of each type of available flash block according to the pre-set bad block proportion corresponding to the corresponding storage location identifier and the reserved space; Replacing the bad blocks with the target available flash block and removing the target available flash block from the reserved space, periodically counting the bad block growth and read-write performance change parameters of each type of flash block within a pre-set time period according to the real-time monitored bad block number and read-write performance data of each type of flash block, generating a performance change curve based on the read-write time length change parameters of the type of flash block, extracting the inflection point data in each performance change curve and the collection time interval of each inflection point data, calculating the performance fluctuation frequency according to each adjacent inflection point data and the corresponding collection time interval, and removing the inflection point data with the performance fluctuation frequency exceeding the pre-set frequency threshold, obtaining the remaining read-write performance data, calculating the average read-write time length of the remaining read-write performance data, and performing performance evaluation on each type of flash block according to the bad block growth of each type of flash block and the corresponding average read-write time length and the corresponding pre-set weight coefficient, obtaining the performance evaluation value corresponding to each type of flash block, and adjusting the reserved space according to the performance evaluation value in the case that the performance evaluation value is less than the pre-set performance threshold.

2. The method of claim 1, wherein, The reserved space comprises replaceable space and cache space. Correspondingly, determining the number of each type of available flash block according to the pre-set bad block proportion corresponding to the corresponding storage location identifier and the reserved space comprises: Determining each pre-set bad block proportion as a segmentation proportion of the replaceable space, regionally segmenting the replaceable space based on the segmentation proportion to obtain each type of storage region, and calculating the number of each type of available flash block based on the each type of storage region and the pre-set unit storage amount of the flash block. The storage location identifier comprises a first-level identifier, a second-level identifier, and a third-level identifier, the first-level identifier is an independent module identifier, the second-level identifier is a logical management unit identifier, and the third-level identifier is a storage unit identifier.

3. The method of claim 1, wherein, The adjusting the reserved space according to the performance evaluation value comprises:

4. The method of claim 2, wherein, Determining the number of pre-prepared flash blocks associated with the performance evaluation value and the target storage location identifier corresponding to the performance evaluation value; Calculating the number of flash blocks to be supplemented according to the number of pre-prepared flash blocks and the remaining available flash block corresponding to the target storage location identifier in the replaceable space; Adjusting the cache space by reducing according to the number of flash blocks to be supplemented. Before the replacing the bad blocks with the target available flash block, the method further comprises:

5. The method of claim 1, wherein, In the case that the number of target available flash blocks is multiple, obtaining the performance parameters of each target available flash block. ​ The performance parameters are matched with damage levels of the bad blocks in the running state information, and a replaceable target available flash memory block is determined according to a matching result.

6. An apparatus for automatically adjusting the reserved space of a storage device, characterized by, The method comprises the following steps: A running state information monitoring module is configured to monitor running state information of each flash memory block in a storage device in real time, wherein the running state information comprises bad blocks, storage location identifiers of the bad blocks, a number of bad blocks of each type of flash memory block, and read-write performance data; A target available flash memory block determining module is configured to perform a step-by-step matching of the storage location identifiers of the bad blocks with storage location identifiers of each type of available flash memory block in a preset reserved space, and determine a target available flash memory block with the same storage location identifier according to a matching result, wherein the number of each type of available flash memory block is determined according to a preset bad block proportion corresponding to the respective storage location identifier and the reserved space; A flash memory block replacing module is configured to replace the bad blocks with the target available flash memory block; A target available flash memory block eliminating module is configured to eliminate the target available flash memory block from the reserved space; A performance evaluation module is configured to periodically count a bad block growth amount and a read-write performance change parameter of each type of flash memory block within a preset time length according to the number of bad blocks and the read-write performance data of each type of flash memory block monitored in real time, generate a performance change curve based on the read-write time length change parameter of the type of flash memory block, extract inflection point data in each performance change curve and a collection time interval of each inflection point data, calculate a performance fluctuation frequency according to each adjacent inflection point data and the corresponding collection time interval, eliminate the inflection point data with a performance fluctuation frequency exceeding a preset frequency threshold, obtain remaining read-write performance data, calculate an average read-write time length of the remaining read-write performance data, perform performance evaluation on each type of flash memory block according to the bad block growth amount of the type of flash memory block and the corresponding average read-write time length and a corresponding preset weight coefficient, and obtain a performance evaluation value corresponding to each type of flash memory block, and adjust the reserved space according to the performance evaluation value in a case where the performance evaluation value is less than a preset performance threshold.

7. An electronic device, comprising: The device includes one or more processors; a storage device configured to store one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the automatic adjustment method of the reserved space of the storage device according to any one of claims 1-5.

8. A storage medium storing computer-executable instructions, wherein: The computer executable instructions, when executed by a computer processor, are configured to perform the automatic adjustment method of the reserved space of the storage device according to any one of claims 1-5.

Citation Information

Patent Citations

  • Storage system, file storage and reading method and terminal equipment

    CN111506262A

  • Bad block processing method and device, electronic equipment and storage medium

    CN115525217A