Method for reading interference count of storage medium and electronic device
By identifying the current and last read stripes and using a temporary array to record block-level read interference counts, the problem of high read interference count resource overhead in SATA solid-state drives is solved, improving the stability and performance of the storage medium.
Patent Information
- Application Number
- CN202511508300.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2045-10-21
AI Technical Summary
Existing SATA solid-state drives (SSDs) are limited by cache and DRAM capacity, making it impossible to effectively support fine-grained read interference counting in RAID stripes. This results in high resource consumption and affects storage media performance.
By identifying whether the current and last read stripes are the same, a temporary array is used to record block-level read interference counts, and the global array is updated when the stripe is switched, so as to achieve fine-grained read interference management by block and reduce resource overhead.
It improves the stability and performance of solid-state drives, reduces write amplification, and optimizes read interference management strategies.
Smart Images

Figure CN120998276B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of solid-state drive technology, and in particular to a method for counting read interference on a storage medium and an electronic device. Background Technology
[0002] In SATA (Serial Advanced Technology Attachment) solid-state drives, read interference can be counted on a single physical block. While this can improve management accuracy and reduce write amplification, considering that each RAID (Redundant Array of Independent Disks) stripe contains 32 to 128 physical blocks, the cache and DRAM (Dynamic Random-Access Memory) capacity of existing SATA solid-state drives cannot support such fine-grained counting overhead, making it impractical for practical applications. Summary of the Invention
[0003] This application provides a method and electronic device for counting read interference in storage media, so as to at least solve the technical problem in the related art that the resource overhead of counting read interference in storage media is large, which leads to the degradation of storage media performance.
[0004] This application provides a read interference counting method for a storage medium, the storage medium including blocks and stripes, with multiple blocks forming a stripe. The method includes: responding to a stripe read operation, identifying whether the currently read stripe is the same as the previously read stripe; if the currently read stripe is different from the previously read stripe, updating the read interference count of a first array according to a first variable, wherein the first array records the read interference count of stripes in the storage medium, the first variable records the element values in a second array, the element values representing the read interference count of blocks, and the second array records the read interference count of blocks in the currently read stripe; if the currently read stripe is the same as the previously read stripe, updating the read interference count of the second array, and updating the read interference count of the first array according to the updated read interference count of the second array.
[0005] This application also provides an electronic device, comprising: a storage medium for storing a computer program, the storage medium including blocks and stripes, the blocks comprising a stripe; and a processor for executing the computer program to implement the read interference counting method of the storage medium described above.
[0006] This application identifies whether the currently read stripe is the same as the last read stripe. If they are different, the read interference count of the first array is updated according to the first variable; if they are the same, the read interference count of the second array is updated. Based on the updated read interference count of the second array, the read interference count of the first array is updated. By using the temporary array second array to achieve block-by-block counting, this solves the problem in related technologies where the read interference count of the storage medium has a large resource overhead, leading to a decrease in the performance of the storage medium. This achieves the technical effect of reducing resource overhead and improving the stability of the solid-state drive. Attached Figure Description
[0007] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0008] Figure 1 A schematic diagram of RAID striping provided for related technologies;
[0009] Figure 2 A flowchart illustrating a read interference counting method for a storage medium provided in an embodiment of this application;
[0010] Figure 3 This is a flowchart illustrating the read interference initialization process according to one embodiment of this application.
[0011] Figure 4 This is a flowchart illustrating the read interference count update process according to one embodiment of this application.
[0012] Figure 5 A block diagram of a read interference counting device for a storage medium provided for an embodiment of this application;
[0013] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0014] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0015] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0016] RAID is a disk array technology that balances storage performance, data security, and cost, achieved through data striping and distributed parity checking. RAID sizes are typically 31+1 or 63+1. During write operations, each die is considered a unit, with 32 or 64 dies forming a stripe. One die's space is used for RAID parity, storing the result of an XOR operation on the first 31 or 63 data sets. To improve concurrency, the remaining 31 or 63 dies store user data. During data recovery, a maximum of one die's worth of data can be lost per stripe.
[0017] like Figure 1 As shown, each Super Lun (Super Logical Unit Number, a type of large-granularity logical storage unit) consists of 8 different dies from 8 channels. Within a Super Die, 64 blocks with the same block number form a Super Block, and each Super Block is a RAID stripe.
[0018] In related technologies, solid-state drives (SSDs) are typically managed by setting a read interference recovery threshold for each RAID stripe due to backend resource constraints. A RAID stripe consists of multiple physical blocks. Specifically, a RAID stripe read interference threshold is set as the standard for monitoring read interference, and read interference is counted on a stripe-by-strip basis. Each time a read operation is performed on a flash page in any physical block within the RAID stripe, the corresponding read interference count is incremented. Once the count exceeds the RAID stripe read interference threshold, it is determined that the RAID stripe is about to experience data corruption. Therefore, all valid data in the RAID stripe is garbage collected and migrated to other physical blocks, thereby eliminating the impact of read interference on the data.
[0019] This read interference handling scheme needs to be designed based on the worst-case read interference that a RAID stripe can withstand, meaning that reads on the RAID stripe are concentrated on only one physical block. This means the physical block read interference threshold can only be set relatively low, leading to premature write amplification during BLKRD (Block Read), which increases the overall write amplification of the SSD and impacts the overall disk performance.
[0020] The read interference counting design is based on a physical block. Since a RAID stripe has 32 to 128 blocks, the existing cache and DRAM capacity resources of the SATA disk cannot actually support it.
[0021] To address the shortcomings of the aforementioned related technologies, this application proposes a read interference counting method and electronic device for storage media, in order to solve the problems of write amplification and performance degradation caused by premature garbage collection in the related technologies, which will be described in detail below.
[0022] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0023] Figure 2 This is a flowchart illustrating a read interference counting method for a storage medium provided in an embodiment of this application. The storage medium includes blocks and stripes, with multiple blocks forming a stripe, such as... Figure 2 As shown, the method includes the following steps:
[0024] In step S101, in response to the stripe reading operation, it is identified whether the currently read stripe is the same as the previously read stripe.
[0025] It is understood that, in the embodiments of this application, when the solid-state drive receives a read command for a specific block and word line, it first identifies whether the currently read block is the same as the previously read block. Specifically:
[0026] In this embodiment of the application, identifying whether the currently read stripe is the same as the previously read stripe includes: obtaining a second variable of the stripe, wherein the second variable records the stripe number of the previously read stripe; reading the currently read stripe number; if the currently read stripe number is the same as the previously read stripe number, then it is determined that the currently read stripe is the same as the previously read stripe; if the currently read stripe number is different from the previously read stripe number, then it is determined that the currently read stripe is different from the previously read stripe.
[0027] Specifically, if the current stripe number is exactly the same as the number recorded in the second variable, it is determined that the currently read stripe is the same stripe as the last read stripe. This means that the current read operation is a continuous or repeated access to the same data area, and the relevant read count within the stripe needs to be updated. Conversely, if the two numbers are different, it is determined that a stripe switch has occurred. The cumulative read interference of the previous stripe needs to be processed first, then the second variable is updated to the current number, and the temporary count array is reset for the new stripe, thus starting fine-grained read interference tracking for the new stripe. This comparison process is the core logic for achieving efficient and accurate read interference management. The handling methods for the current stripe number being the same as the number recorded in the second variable and the number being different are described below as steps S102 and S103. The two are parallel, and the step is determined according to the judgment result. The order of the two steps is not limited.
[0028] In step S102, if the currently read stripe is different from the last read stripe, the read interference count of the first array is updated according to the first variable. The first array records the read interference count of the stripe in the storage medium, the first variable records the element value in the second array, the element value represents the read interference count of the block, and the second array records the read interference count of the block in the currently read stripe.
[0029] The read interference count is a value used to quantify the degree of interference to a memory cell or a group of cells due to read operations. The higher the count, the greater the risk of data errors. The first read array is a global array. The second array is a temporary array. The currently read stripe is set with the second array, while the unread stripe is not set with the second array.
[0030] It is understood that, in this embodiment of the application, when it is determined that the block being read this time is different from the stripe read last time, that is, the read operation has switched from one stripe to another new stripe, a settlement operation will be performed to ensure that the read interference effect of the previous stripe is correctly recorded. Specifically, the read interference count of the first array will be updated according to the first variable, which will be described in detail below and will not be repeated here. The second array is a temporary array, which is used to record the number of read operations for each block in the stripe that is currently being read continuously. It is only used for the stripe that is currently being read, and not for all stripes, thus solving the problem of excessive DRAM resource requirements.
[0031] In this embodiment of the application, updating the read interference count of the first array according to the first variable includes: selecting a target element value from the element values of the second array; assigning the target element value to the first variable; and accumulating the assigned first variable to the read interference count of the first array.
[0032] The target element value is the maximum value among all elements in the second array.
[0033] It is understood that in this embodiment of the application, when a stripe switching occurs during a read operation, the read interference effect of the previous stripe needs to be recorded in the global count, i.e., in the first array. Specifically, firstly, the read interference count of all blocks in the second array is identified, and the maximum value is selected as the target element value. Then, this target element value is assigned to the first variable. Finally, the value of the first variable is accumulated in the first array. This accumulation operation ensures that the read interference count of the previous stripe is continuously accumulated, rather than being overwritten by the new value.
[0034] It should be noted that after the value of the first variable is accumulated into the first array, the second array and the first variable need to be reset in preparation for tracking the reading of new stripes.
[0035] In this embodiment of the application, after updating the read interference count of the first array according to the first variable, the method further includes: determining whether the read interference count recorded in the first array is less than the read interference count threshold; if the read interference count recorded in the first array is greater than or equal to the read interference count threshold, adding the currently read stripe to the recycling list and setting the recycling flag, and ending the current read counting process after recycling the currently read stripe; if the read interference count of the first array is less than the read interference count threshold, updating the previously read stripe number in the second variable of the stripe according to the currently read stripe number, wherein the second variable records the previously read stripe number.
[0036] The read interference count threshold refers to the maximum read interference value of a single block or stripe. This is a preset, fixed upper limit value, representing the maximum cumulative read interference count that a physical block can withstand. Once this value is exceeded, the data in the block is at high risk of being corrupted due to read interference. The recycling list is a system-maintained list used to record stripes or blocks that need to be garbage collected immediately due to special circumstances (such as reaching the read interference threshold, bad blocks, etc.). The recycling flag is a system flag bit. When it is set (e.g., set to 1), it indicates that there is a forced garbage collection task that needs to be executed immediately, which will trigger the solid-state drive's garbage collection engine to start the corresponding recycling process. Forced garbage collection is a garbage collection operation triggered by a specific event (such as read interference exceeding the limit). It reads the valid data in the target stripe or block and writes it to a new, healthy block, and then erases the original block, thereby eliminating the cumulative read interference.
[0037] It is understandable that after successfully updating the first array based on the first variable in this embodiment, it is necessary to assess whether the read interference risk of the stripe has reached a critical point. Specifically, it is necessary to determine whether the updated first array is less than a preset read interference count threshold. If the first array is greater than or equal to the read interference count threshold, it indicates that the stripe has accumulated excessive read interference, and the data is at risk of being corrupted. In this case, protective measures need to be taken: the stripe is added to the recycling list, and the recycling flag is set to trigger the subsequent forced garbage collection process to migrate the data. After these operations are completed, the current read counting process ends. However, if the first array is still less than the read interference count threshold, it means that the risk is still within a controllable range. Therefore, the process will not end immediately, but will continue to execute the subsequent steps to update the second variable of the stripe, in order to prepare for the stripe switching judgment of the next read operation.
[0038] In this embodiment, updating the previously read stripe number in the second variable of the stripe according to the currently read stripe number includes: obtaining the currently read stripe number and the second variable; updating the second variable of the stripe to the currently read stripe number; initializing the first variable and the second array, updating the first variable and the second array, and ending the current read counting process.
[0039] It is understood that, in this embodiment of the application, after determining that the first array is less than the read interference count threshold, the state needs to be updated to prepare for processing future read operations. First, the current stripe number read in this read operation and the current value of the second variable are obtained. Then, the value of the second variable of the stripe is updated to the current stripe number to ensure that the second variable accurately records the latest read position. In order to start fine-grained block-level read interference tracking for new stripes (or continue in the current stripe), the first variable and the second array need to be initialized. After completing this series of state updates, the current read counting process is declared over.
[0040] In this embodiment of the application, updating the first variable and the second array includes: resetting the second array and the first variable; updating the second array and updating the first variable according to the read interference count of the updated second array.
[0041] It is understood that in this embodiment of the application, by resetting the first variable to 0 and clearing all elements in the second array to zero, and at the same time updating the two newly initialized variables to reflect the impact of this read operation, specifically, setting the second array to 1 (indicating that the block has been read once) and updating the first variable accordingly to 1, the read counting process ends after completing this series of state updates. By resetting the counting state and immediately updating the record of this read operation, the impact of historical read accumulation can be eliminated, the read interference recovery can be prevented from being triggered by mistake, and the current read activity can be accurately reflected, thereby optimizing the read interference management strategy, reducing write amplification and improving system performance.
[0042] In step S103, if the currently read stripe is the same as the previously read stripe, the read interference count of the second array is updated, and the read interference count of the first array is updated according to the updated read interference count of the second array.
[0043] It is understood that, in this embodiment of the application, when it is determined that the currently read stripe is the same as the last read stripe, that is, the read operation is still continuously accessing the same stripe, the second array is first updated. This array records the read interference count of each block in the current stripe to achieve fine tracking of read operations at the block granularity. Then, based on this updated second array, it is determined whether and how to update the first array. The first array records the read interference count of each stripe in the storage medium. Through this counting method, block-level counting with low resource consumption can be achieved.
[0044] In this embodiment of the application, updating the read interference count of the first array of the currently read stripe according to the updated read interference count of the second array includes: selecting a target element value from the element values of the updated second array; assigning the target element value to a first variable; and updating the read interference count recorded in the first array according to the first variable.
[0045] It is understandable that after successfully updating the second array, this embodiment needs to assess whether the update is sufficient to affect the global read interference state. First, the values of all elements in the second array are identified, and the maximum value is selected as the target element value. Then, this target element value is assigned to the first variable to ensure that the first variable always reflects the highest read frequency of the current stripe. The first array is updated based on the value of the first variable, which realizes accurate monitoring of the scenario most likely to cause serious read interference, while avoiding frequent updates to the global array and optimizing performance and resource consumption.
[0046] In this embodiment of the application, before assigning the read interference count recorded in the second array to the first variable, the method further includes: determining whether the read interference count recorded in the second array is less than the element value of the first variable; if the read interference count recorded in the second array is less than the element value of the first variable, ending the current read counting process; if the read interference count recorded in the second array is greater than or equal to the element value of the first variable, then assigning the read interference count recorded in the second array to the first variable.
[0047] It is understandable that, after updating the second array, this embodiment of the application needs to determine whether the first variable needs to be updated. Specifically, the new value of the second array is compared with the current value of the first variable. If the new value of the second array is less than the first variable, it means that this read operation has not caused the number of reads of any block to exceed the currently known maximum value. Therefore, the first variable does not need to be updated, and the current read counting process can be ended directly, avoiding unnecessary assignment operations and improving efficiency. Conversely, if the new value of the second array is greater than or equal to the first variable, it means that the highest read frequency of the current stripe has been refreshed or leveled off. Only then is it necessary to assign this new value of the second array to the first variable to ensure that the first variable always accurately reflects the maximum number of reads in the second array, providing a correct basis for subsequent possible global count updates.
[0048] In this embodiment of the application, before updating the read interference count of the first array according to the first variable, the method further includes: determining whether the element value of the first variable is less than the update threshold; if the element value of the first variable is less than the update threshold, ending the current read counting process; if the element value of the first variable is greater than or equal to the update threshold, updating the read interference count of the first array.
[0049] The update threshold is the upper limit of the data type of the first variable (for example, if the data type of the first variable is UINT8 (unsigned 8-bit integer), then the update threshold is MAX_UINT8, which represents the maximum value that an 8-bit unsigned integer can represent).
[0050] It is understood that, in this embodiment of the application, when the accumulated element values of the first variable reach the update threshold, i.e., the upper limit of its data type, the read interference count of the first array is triggered for updating. Specifically:
[0051] In this embodiment of the application, updating the read interference count of the first array according to the first variable includes: obtaining an update threshold; accumulating the update threshold into the first array; resetting it to zero and obtaining the first variable again.
[0052] Among them, resetting to zero and re-acquiring the first variable means that after the update threshold is accumulated into the first array, the first variable is reset to zero and the accumulation continues.
[0053] It is understood that in this embodiment of the application, the read interference count of the first array is updated based on the first variable. When the first variable reaches the update threshold, the update threshold is added to the first array, and then the first variable is reset to zero and continues to accumulate. This achieves the goal of updating the read interference count of the first array based on the first variable. This mechanism achieves accurate monitoring of the scenario most likely to cause serious read interference by selecting the maximum value of the array and using a variable for accumulation judgment. At the same time, it avoids frequent updates to the global array and optimizes performance and resource consumption.
[0054] In this embodiment of the application, after updating the read interference count of the first array of the currently read stripe, the method further includes: determining whether the read interference count of the first array is less than the read interference count threshold; if the read interference count of the first array is greater than or equal to the read interference count threshold, then the currently read stripe is added to the recycling list and the recycling flag is set; after recycling the currently read stripe, the current read counting process ends; if the read interference count of the first array is less than the read interference count threshold, then the current read counting process ends.
[0055] It is understood that after successfully updating the count value of the first array, this embodiment of the application will assess whether the read interference risk of the currently read stripe has reached the critical point. Specifically, it determines whether the read interference risk of the currently read stripe has reached the critical point by judging whether the updated first array is less than the preset read interference count threshold. If the first array is still less than the read interference count threshold, it means that the risk is still within a controllable range, and the current read counting process can be terminated directly. However, if the first array is greater than or equal to the read interference count threshold, it indicates that the currently read stripe has accumulated excessive read interference, and its data integrity is seriously threatened. At this time, protective measures need to be taken: First, the stripe is added to the recycling list. Second, the recycling flag of the stripe is set to notify the background management module of the solid-state drive that the stripe needs to perform a recycling task immediately. Subsequently, the system will start a forced garbage collection process for this stripe to migrate its valid data to a new location, thereby eliminating the read interference risk. After completing this series of operations, the current read counting process ends. This mechanism ensures that when the read interference reaches a dangerous level, timely action can be taken to protect the data.
[0056] According to the read interference counting method for storage media proposed in the embodiments of this application, it is possible to identify whether the currently read stripe is the same as the last read stripe. If they are different, the read interference count of the first array is updated according to the first variable; if they are the same, the read interference count of the second array is updated. Based on the updated read interference count of the second array, the read interference count of the first array is updated. By using the temporary array second array to achieve block-by-block counting, the technical effect of reducing resource overhead and improving the stability of solid-state drives is achieved.
[0057] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0058] The read interference counting method for storage media will be further described below through a specific embodiment.
[0059] Assuming an SSD (Solid State Drive) has M RAID stripes, and each RAID stripe has N blocks, the first step is power-on initialization, such as... Figure 3 As shown:
[0060] The first array is raid_rd_cnt[M], where M is the number of RAID stripes in the SSD, and records the read interference count for each RAID stripe;
[0061] The second array is blk_rd_cnt[N], where N is the number of blocks in each RAID stripe, and records the read interference count for each blk in the currently read RAID stripe;
[0062] The first variable, max_blk_rd_cnt, records the maximum value of the elements in the second array, blk_rd_cnt.
[0063] The second variable, prev_raid, records the stripe number read last.
[0064] After initialization, the interference count update process is as follows: Figure 4 As shown, the specific steps include:
[0065] Step S301. Receive a read operation for raid[m]blk[n] (block n in stripe m).
[0066] Step S302. Determine whether the current read is on the same RAID stripe as the previous read. If yes, proceed to step S303; otherwise, proceed to step S310.
[0067] Step S303. Update the corresponding blk count, blk_rd_cnt[n]++.
[0068] Step S304. Determine whether the element value in the second array blk_rd_cnt[n] is less than the first variable max_blk_rd_cnt. If yes, end the current read counting process; otherwise, proceed to the next step S305.
[0069] Step S305. Reassign the first variable max_blk_rd_cnt to the maximum value of the elements in the second array blk_rd_cnt[n].
[0070] Step S306. Determine whether the first variable max_blk_rd_cnt is less than the maximum value of its data type UNIT8. If yes, end the current read counting process; otherwise, proceed to the next step S307.
[0071] Step S307. Update the count of the first array raid_rd_cnt[m] by adding MAX_UINT8 to the first array raid_rd_cnt[m].
[0072] Step S308. Determine whether the first array raid_rd_cnt[m] is less than the read interference counting threshold. If it is, end the current read counting process; otherwise, proceed to the next step S309.
[0073] Step S309. Add RAID stripe m to the recycling list and set the recycling flag. The RAID stripe m will be recycled in the subsequent process, and the current read counting process will end.
[0074] Step S310. Update the first array according to the stripe read count of the last read stripe, raid_rd_cnt[prev_raid] += max_blk_rd_cnt, that is, add the first variable to the second read interference array raid_rd_cnt[prev_raid].
[0075] Step S311. Determine whether the first array raid_rd_cnt[prev_raid] is less than the read interference count threshold. If not, proceed to step S312; if yes, proceed to step S313.
[0076] Step S312. Add the RAID stripe prev_blk to the recycling list and set the recycling flag, pending recycling of the stripe prev_blk in subsequent processes; if so, proceed to the next step S313.
[0077] Step S313. Update the second variable prev_raid to the RAID stripe number for this RAID iteration, i.e., the second variable prev_raid = m.
[0078] Step S314. Initialize the second array blk_rd_cnt and the first variable max_blk_rd_cnt.
[0079] Step S315. Update the corresponding element count and maximum value of the second array blk_rd_cnt, and update the first variable according to the updated second array, i.e. blk_rd_cnt[n]++; the first variable max_blk_rd_cnt = blk_rd_cnt[n].
[0080] Step S316. End this RAID stripe read counting process.
[0081] Figure 5A block diagram of a read interference counting device for a storage medium provided for embodiments of this application, as shown below. Figure 5 As shown, the device includes: an identification module 401, a first determination module 402, and a second determination module 403.
[0082] The identification module 401 is used to respond to the stripe read operation and identify whether the currently read stripe is the same as the previously read stripe. The first determination module 402 is used to update the read interference count of the first array according to the first variable if the currently read stripe is not the same as the previously read stripe. The first array records the read interference count of the stripe in the storage medium, the first variable records the element value in the second array, the element value represents the read interference count of the block, and the second array records the read interference count of the block in the currently read stripe. The second determination module 403 is used to update the read interference count of the second array if the currently read stripe is the same as the previously read stripe, and update the read interference count of the first array according to the updated read interference count of the second array.
[0083] In this embodiment of the application, the first determination module 402 is further configured to: identify the element value in the second array, select the target element value; assign the target element value to the first variable; and accumulate the first variable to the read interference count of the first array.
[0084] In this embodiment of the application, the first determination module 402 is further configured to: after updating the read interference count of the first array according to the first variable, determine whether the read interference count of the first array is less than the read interference count threshold; if the read interference count of the first array is greater than or equal to the read interference count threshold, add the currently read stripe to the recycling list and set the recycling flag; after recycling the currently read stripe, end the current read counting process; if the read interference count of the first array is less than the read interference count threshold, update the previously read stripe number in the second variable of the block according to the currently read stripe number, wherein the second variable records the previously read stripe number.
[0085] In this embodiment, the first judgment module is further configured to: obtain the number of the currently read stripe and the second variable; update the second variable of the stripe to the number of the currently read stripe; initialize the first variable and the second array, update the first variable and the second array, and end the current read counting process.
[0086] In this embodiment, the second determination module 403 is further configured to: identify the element values in the updated second array, select the target element value; assign the target element value to the first variable, and update the read interference count of the first array according to the first variable.
[0087] In this embodiment of the application, a first judgment module is further included, wherein the first judgment module is further configured to: determine whether the read interference count recorded in the second array is less than the element value of the first variable before assigning the read interference count recorded in the second array to the first variable; if the read interference count recorded in the second array is less than the element value of the first variable, end the current read counting process; if the read interference count recorded in the second array is greater than or equal to the element value of the first variable, assign the read interference count recorded in the second array to the first variable.
[0088] In this embodiment of the application, a second judgment module is further included, wherein the second judgment module is further configured to: determine whether the element value of the first variable is less than the update threshold before updating the read interference count of the first array according to the first variable; if the element value of the first variable is less than the update threshold, end the current read counting process; if the element value of the first variable is greater than or equal to the update threshold, update the read interference count of the first array.
[0089] In this embodiment of the application, the second determination module 403 is further used to: obtain the update threshold; and accumulate the update threshold into the first array.
[0090] In this embodiment of the application, the second determination module 403 is further configured to: after updating the read interference count of the first array of the currently read stripe, determine whether the read interference count of the first array is less than the read interference count threshold; if the read interference count of the first array is greater than or equal to the read interference count threshold, add the currently read stripe to the recycling list and set the recycling flag; after recycling the currently read stripe, end the current read counting process; if the read interference count of the first array is less than the read interference count threshold, end the current read counting process.
[0091] According to the read interference counting method for storage media proposed in the embodiments of this application, it is possible to identify whether the currently read stripe is the same as the last read stripe. If they are different, the read interference count of the first array is updated according to the first variable; if they are the same, the read interference count of the second array is updated. Based on the updated read interference count of the second array, the read interference count of the first array is updated. By using the temporary array second array to achieve block-by-block counting, the technical effect of reducing resource overhead and improving the stability of solid-state drives is achieved.
[0092] For a description of the features of the read interference counting device for the storage medium in the corresponding embodiment, please refer to the relevant description of the read interference counting method for the storage medium in the corresponding embodiment, which will not be repeated here.
[0093] Embodiments of this application also provide an electronic device, such as... Figure 6As shown, the system includes a storage medium 501 for storing a computer program, the storage medium 501 including blocks 5011 and stripes 5012, with multiple blocks 5011 forming a stripe 5012; and a processor 502 configured to run the computer program to execute the steps in the read interference counting method embodiment of any of the above storage media.
[0094] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in the read interference counting method embodiments of any of the above storage media when running.
[0095] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0096] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in the embodiments of the read interference counting method for any of the above storage media.
[0097] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the read interference counting method embodiments of any of the above storage media.
[0098] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0099] The above provides a detailed description of a read interference counting method and electronic device for a storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to help understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A method for counting read interference on a storage medium, characterized in that, The storage medium includes blocks and stripes, with multiple blocks forming the stripes, wherein the method includes: In response to a stripe read operation, identify whether the currently read stripe is the same as the previously read stripe; If the currently read stripe is different from the last read stripe, the read interference count of the first array is updated according to the first variable. The first array records the read interference count of the stripes in the storage medium, the first variable records the element value in the second array, the element value represents the read interference count of the block, and the second array records the read interference count of the block in the currently read stripe. Updating the read interference count of the first array according to the first variable includes selecting a target element value from the element values of the second array, assigning the target element value to the first variable, and accumulating the assigned first variable to the read interference count of the first array. The target element value is the maximum value among all element values in the second array. If the currently read stripe is the same as the last read stripe, update the read interference count of the second array, and update the read interference count of the first array according to the updated read interference count of the second array.
2. The read interference counting method for a storage medium according to claim 1, characterized in that, After updating the read interference count of the first array according to the first variable, the method further includes: Determine whether the read interference count of the first array record is less than the read interference count threshold; If the read interference count recorded in the first array is greater than or equal to the read interference count threshold, the currently read stripe is added to the recycling list and the recycling flag is set. After recycling the currently read stripe, the current read counting process ends. If the read interference count of the first array is less than the read interference count threshold, then the stripe number in the second variable of the stripe is updated according to the currently read stripe number, wherein the second variable records the stripe number read last time.
3. The read interference counting method for a storage medium according to claim 2, characterized in that, The step of updating the strip number in the second variable of the stripe according to the currently read stripe number includes: Obtain the number of the currently read strip and the second variable; The second variable in the update block is the number of the currently read stripe; Initialize the first variable and the second array, update the first variable and the second array, and end the current read count process.
4. The read interference counting method for a storage medium according to claim 1, characterized in that, The step of updating the read interference count of the first array of the currently read stripe based on the updated read interference count of the second array includes: Select the target element value from the updated element values of the second array; The target element value is assigned to the first variable, and the read interference count of the first array record is updated according to the first variable.
5. The read interference counting method for a storage medium according to claim 4, characterized in that, Before assigning the read interference count recorded in the second array to the first variable, the process also includes: Determine whether the read interference count of the second array record is less than the element value of the first variable; If the read interference count recorded in the second array is less than the element value of the first variable, the current read counting process ends. If the read interference count recorded in the second array is greater than or equal to the element value of the first variable, then the read interference count recorded in the second array is assigned to the first variable.
6. The read interference counting method for a storage medium according to claim 4, characterized in that, Before updating the read interference count of the first array based on the first variable, the method further includes: Determine whether the element value of the first variable is less than the update threshold; If the element value of the first variable is less than the update threshold, the current read counting process ends; If the element value of the first variable is greater than or equal to the update threshold, then the update threshold is obtained and accumulated into the first array.
7. The read interference counting method for a storage medium according to claim 1, characterized in that, After updating the read interference count of the first array of the currently read stripes, the following is also included: Determine whether the read interference count of the first array is less than the read interference count threshold; If the read interference count of the first array is greater than or equal to the read interference count threshold, the currently read stripe is added to the recycling list and the recycling flag is set. After recycling the currently read stripe, the current read counting process ends. If the read interference count recorded in the first array is less than the read interference count threshold, then the current read counting process ends.
8. The read interference counting method for a storage medium according to claim 1, characterized in that, The step of identifying whether the currently read stripe is the same as the previously read stripe includes: Obtain the second variable, which records the number of the last read stripe; Read the number of the currently read stripe. If the number of the currently read stripe is the same as the number of the previously read stripe, then it is determined that the currently read stripe and the previously read stripe are the same. If the number of the currently read stripe is different from the number of the previously read stripe, then it is determined that the currently read stripe is different from the previously read stripe.
9. An electronic device, characterized in that, include: A storage medium for storing a computer program, the storage medium comprising blocks and stripes, wherein a plurality of the blocks constitute the stripes; A processor, configured to execute the computer program to implement the steps of the read interference counting method for the storage medium according to any one of claims 1 to 8.
Citation Information
Patent Citations
Memory system and operating method thereof
CN112596666A
Read interference detection method and device, equipment, storage medium and program product
CN118689410A