Read interference processing method and device, electronic equipment and storage medium
By setting the first recycling queue and the second recycling queue, the data recycling order is optimized according to the number of data reads and the physical block allocation mechanism, which solves the low efficiency problem of traditional read interference monitoring and achieves efficient data recycling and storage device stability.
Patent Information
- Application Number
- CN202510633900.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-09-19
AI Technical Summary
Traditional read disturb monitoring methods result in low data recovery efficiency in physical blocks, causing waste of storage resources.
By setting a first recycling queue and a second recycling queue, physical blocks are placed in different queues according to the number of data reads and the physical block allocation mechanism, and data is recycled in queue priority order.
Improves the recovery efficiency of physical blocks and ensures data reliability and storage device stability.
Smart Images

Figure CN120669903A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data storage technology, and in particular to a read disturbance processing method, device, electronic device and storage medium. Background Art
[0002] Read disturb is a characteristic of flash memory cells. Reading data from a flash memory cell has little effect on the voltage offset of that cell, but it can cause uncorrectable read disturb errors in other unread flash memory cells in the same physical block. Traditional read disturb monitoring methods set a physical block read disturb threshold as the read disturb monitoring standard and count read disturbs per physical block. Each time a flash memory page in a physical block is read, the read disturb count corresponding to that physical block is incremented by one. Once the count exceeds the physical block read disturb threshold, data corruption is detected in that physical block, and all valid data in that physical block is migrated to other physical blocks, eliminating the impact of read disturb on the data. Because the amount of data that needs to be recovered at any one time is large, the recovery time is long, resulting in low data recovery efficiency in the physical block and a waste of storage resources. Summary of the Invention
[0003] The present application provides a read disturb processing method, device, electronic device and storage medium to at least solve the problem in the related art that the recovery time is long, resulting in low recovery efficiency of data in physical blocks and waste of storage resources.
[0004] The present application provides a read disturb processing method, which is applied to a storage device, wherein the storage device includes at least a first physical block. The read disturb processing method includes:
[0005] In response to receiving the read reclaim request, reading data in the first physical block;
[0006] Recording the number of data reads of the first physical block, and placing the first physical block into a first recycling queue or a second recycling queue based on the number of data reads and a physical block allocation mechanism, wherein the first recycling queue and the second recycling queue are both queues for pre-data recycling;
[0007] Determine whether the second recycling queue is empty;
[0008] If the second recycling queue is not empty, data is recycled from the first physical blocks in the second recycling queue in sequence according to the order in which the first physical blocks enter the second recycling queue until the second recycling queue is empty;
[0009] If the second recycling queue is empty and the first recycling queue is not empty, data is recycled for the first physical blocks in the first recycling queue in sequence according to the order in which the first physical blocks enter the first recycling queue until the first recycling queue is empty.
[0010] The present application further provides a read disturb processing apparatus, which is applied to a storage device, wherein the storage device includes at least a first physical block, and the read disturb processing apparatus includes:
[0011] a reading module, the reading module being configured to read data in the first physical block in response to receiving a read reclaim request;
[0012] A recording module, the recording module is used to record the number of times data of the first physical block is read;
[0013] a placement module, the placement module being configured to place the first physical block into a first recycling queue or a second recycling queue based on the number of data reads and a physical block allocation mechanism, wherein the first recycling queue and the second recycling queue are both queues for pre-data recycling;
[0014] A judgment module, which is used to judge whether the second recycling queue is empty;
[0015] The recycling module is used to, if the second recycling queue is not empty, sequentially recycle data from the first physical blocks in the second recycling queue according to the order in which the first physical blocks enter the second recycling queue until the second recycling queue is empty;
[0016] The recycling module is further configured to, if the second recycling queue is empty and the first recycling queue is not empty, sequentially recycle data from the first physical blocks in the first recycling queue in the order in which the first physical blocks enter the first recycling queue until the first recycling queue is empty.
[0017] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing at least the following steps of a read disturbance processing method when executing the computer program:
[0018] In response to receiving the read reclaim request, reading data in the first physical block;
[0019] Recording the number of data reads of the first physical block, and placing the first physical block into a first recycling queue or a second recycling queue based on the number of data reads and a physical block allocation mechanism, wherein the first recycling queue and the second recycling queue are both queues for pre-data recycling;
[0020] Determine whether the second recycling queue is empty;
[0021] If the second recycling queue is not empty, data is recycled from the first physical blocks in the second recycling queue in sequence according to the order in which the first physical blocks enter the second recycling queue until the second recycling queue is empty;
[0022] If the second recycling queue is empty and the first recycling queue is not empty, data is recycled for the first physical blocks in the first recycling queue in sequence according to the order in which the first physical blocks enter the first recycling queue until the first recycling queue is empty.
[0023] The present application further provides a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, wherein when the computer program is executed by a processor, at least the following steps of the read disturb processing method are implemented:
[0024] In response to receiving the read reclaim request, reading data in the first physical block;
[0025] Recording the number of data reads of the first physical block, and placing the first physical block into a first recycling queue or a second recycling queue based on the number of data reads and a physical block allocation mechanism, wherein the first recycling queue and the second recycling queue are both queues for pre-data recycling;
[0026] Determine whether the second recycling queue is empty;
[0027] If the second recycling queue is not empty, data is recycled from the first physical blocks in the second recycling queue in sequence according to the order in which the first physical blocks enter the second recycling queue until the second recycling queue is empty;
[0028] If the second recycling queue is empty and the first recycling queue is not empty, data is recycled for the first physical blocks in the first recycling queue in sequence according to the order in which the first physical blocks enter the first recycling queue until the first recycling queue is empty.
[0029] The present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, it at least implements the following steps of the read disturbance processing method:
[0030] In response to receiving the read reclaim request, reading data in the first physical block;
[0031] Recording the number of data reads of the first physical block, and placing the first physical block into a first recycling queue or a second recycling queue based on the number of data reads and a physical block allocation mechanism, wherein the first recycling queue and the second recycling queue are both queues for pre-data recycling;
[0032] Determine whether the second recycling queue is empty;
[0033] If the second recycling queue is not empty, data is recycled from the first physical blocks in the second recycling queue in sequence according to the order in which the first physical blocks enter the second recycling queue until the second recycling queue is empty;
[0034] If the second recycling queue is empty and the first recycling queue is not empty, data is recycled for the first physical blocks in the first recycling queue in sequence according to the order in which the first physical blocks enter the first recycling queue until the first recycling queue is empty.
[0035] Through the present application, the first physical block is placed in the first recycling queue or the second recycling queue according to the number of reads, which solves the problem of read interference caused by frequent reading of the physical block, and achieves the technical effect of ensuring data reliability and stability of the storage device; according to the priority difference between the first recycling queue and the second recycling queue, data is recycled preferentially for the first physical block in the second recycling queue, which solves the technical problem of low physical block recycling efficiency caused by recycling high-risk and low-risk physical blocks at the same time, and achieves the technical effect of improving physical block recycling efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0037] Figure 1 This is a flowchart of a read disturbance processing method in one embodiment of the present application;
[0038] Figure 2 A detailed flowchart of placing a first physical block into a first recycling queue or a second recycling queue based on the number of reads in one embodiment of the present application;
[0039] Figure 3 A detailed flow chart of data recycling for a first physical block in a first recycling queue or a second recycling queue in one embodiment of the present application;
[0040] Figure 4 A schematic diagram of data migration for reclaiming data on a first physical block in a first recycling queue or a second recycling queue in one embodiment of the present application;
[0041] Figure 5 This is a logic block diagram of a read disturbance processing method in one embodiment of the present application;
[0042] Figure 6 This is a structural block diagram of a read disturbance processing device in one embodiment of the present application;
[0043] Figure 7 This is a diagram of the internal structure of an electronic device in one embodiment of the present application. DETAILED DESCRIPTION
[0044] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0045] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0046] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0047] Example 1
[0048] In one embodiment, Figure 1 、 Figure 5 As shown, a read disturb processing method is provided, which is applied to a storage device, wherein the storage device includes at least a first physical block. The read disturb processing method includes:
[0049] In response to receiving the read reclaim request, reading data in the first physical block;
[0050] Recording the number of data reads of the first physical block, and placing the first physical block into a first recycling queue or a second recycling queue based on the number of data reads and a physical block allocation mechanism, wherein the first recycling queue and the second recycling queue are both queues for pre-data recycling;
[0051] Determine whether the second recycling queue is empty;
[0052] If the second recycling queue is not empty, data is recycled from the first physical blocks in the second recycling queue in sequence according to the order in which the first physical blocks enter the second recycling queue until the second recycling queue is empty;
[0053] If the second recycling queue is empty and the first recycling queue is not empty, data is recycled for the first physical blocks in the first recycling queue in sequence according to the order in which the first physical blocks enter the first recycling queue until the first recycling queue is empty.
[0054] Specifically, the first physical block is a physical block used for normal operation, and the second physical block is a redundant physical block used to store data in the event of an error in a normal physical block. The first physical block is placed in the first recycling queue or the second recycling queue based on the number of reads, thereby resolving the issue of read interference caused by frequent reads of physical blocks and achieving the technical effect of ensuring data reliability and storage device stability. Based on the priority difference between the first recycling queue and the second recycling queue, data is preferentially recycled from the first physical block in the second recycling queue, resolving the technical issue of low physical block recycling efficiency caused by simultaneously recycling both high-risk and low-risk physical blocks, thereby achieving the technical effect of improving physical block recycling efficiency.
[0055] In one embodiment, Figure 2 As shown, recording the number of data reads of the first physical block and placing the first physical block into the first recycling queue or the second recycling queue based on the number of data reads and the physical block allocation mechanism includes:
[0056] Recording a first data read count of a first physical block, wherein the first data read count indicates a data read count before the first physical block enters a first recycling queue;
[0057] Determine a first physical block to be reclaimed in the first physical block according to the first data read count, and put the first physical block to be reclaimed into a first reclaim queue;
[0058] Recording a second data read count of the first physical block to be reclaimed, wherein the second data read count represents the number of data reads after the first physical block to be reclaimed enters the first reclaim queue;
[0059] A second physical block to be reclaimed in the first physical block to be reclaimed is determined according to the second data read count, and the second physical block to be reclaimed is placed in a second reclaim queue.
[0060] Specifically, a first physical block to be recycled in the first physical block is determined according to the first number of reads, and the first physical block to be recycled is placed in a first recycling queue to avoid read interference of the first physical block to be recycled; a second physical block to be recycled in the first physical block to be recycled is determined according to the second number of reads, and the second physical block to be recycled is placed in a second recycling queue, thereby improving the recycling efficiency of the physical blocks.
[0061] In one embodiment, Figure 2 As shown, the number of data reads of the first physical block is recorded, and based on the number of data reads and the physical block allocation mechanism, the first physical block is placed in the first recycling queue or the second recycling queue, further comprising:
[0062] Recording a first data read count of a first physical block, wherein the first data read count indicates a data read count before the first physical block enters a first recycling queue;
[0063] Determine a first physical block to be reclaimed in the first physical block according to the first data read count, and put the first physical block to be reclaimed into a first reclaim queue;
[0064] Performing a test on the first recycling queue to obtain a test result;
[0065] According to the detection result, determining whether a read disturb error occurs in the first physical block to be reclaimed in the first reclaim queue;
[0066] If a read disturbance error occurs in the first physical block to be reclaimed, the first physical block to be reclaimed is determined as the second physical block to be reclaimed, and the second physical block to be reclaimed is placed in a second reclaim queue.
[0067] Specifically, the first recycling queue is detected by PR (Patrol Read) technology, so that when the second reading number meets the conditions or a read interference error occurs in the first physical block to be recycled, the first physical block to be recycled is placed in the second recycling queue and processed first, thereby ensuring the reliability of the data in the storage device.
[0068] In one embodiment, recording the first data read count of the first physical block includes:
[0069] Each time the data in the first physical block is read, 1 is added to the number of times the first data was read the previous time, wherein the initial value of the number of times the first data was read is 0;
[0070] Determining a first physical block to be reclaimed in the first physical block according to the first data read count, and placing the first physical block to be reclaimed into a first reclaim queue, including:
[0071] Determining a current first data read count of a first physical block;
[0072] Obtaining a first target value, and comparing the current first data read count with the first target value, wherein the first target value is a parameter used to determine whether to put the first physical block into the first recycling queue, and the first target value is a positive integer;
[0073] In response to the current first data read count being less than the first target value, continuing to record the first data read count of the first physical block until the current first data read count is equal to the first target value;
[0074] In response to the current first data read count being equal to the first target value, the first physical block is determined as a first physical block to be reclaimed, and the first physical block to be reclaimed is placed in a first reclaim queue.
[0075] Specifically, assuming the first target value is 100, when the first data reading times increases from 0 to 100 one by one, the corresponding first physical block is placed in the first recycling queue to avoid read interference caused by frequent reading of the physical block, thereby ensuring the reliability of the data in the storage device.
[0076] In one embodiment, recording the second data read count of the first physical block to be reclaimed includes:
[0077] Each time the data to be reclaimed in the first physical block to be reclaimed is read once, the number of times the second data was read the last time is subtracted by 1, wherein the initial value of the number of times the second data was read is the first target value;
[0078] Determining a second physical block to be reclaimed in the first physical block to be reclaimed according to the second data read count, and placing the second physical block to be reclaimed into a second reclaim queue, including:
[0079] Determine the current second data read count of the first physical block to be reclaimed;
[0080] Obtaining a second target value, and comparing the current second data read count with the second target value, wherein the second target value is a parameter used to determine whether to put the first to-be-reclaimed physical block in the first recycling queue into the second recycling queue, the second target value is a positive integer, and the second target value is less than the first target value;
[0081] In response to the current second data read count being greater than the second target value, continuing to record the second data read count of the first physical block to be reclaimed until the current second data read count is equal to the second target value;
[0082] In response to the current second data read count being equal to the second target value, the first physical block to be reclaimed is determined as the second physical block to be reclaimed, and the second physical block to be reclaimed is placed in a second reclaim queue.
[0083] Specifically, assuming that the second target value is 30, when the value of the second data reading times decreases one by one from 100 to 30, the corresponding first physical block to be recycled is placed in the second recycling queue, shortening the waiting time of the physical block in the first recycling queue and effectively balancing the relationship between the reading times of the physical block and the recycling priority.
[0084] In one embodiment, Figure 3 、 Figure 4 As shown, the storage device further includes at least a cache block and a second physical block, and the read disturbance processing method further includes:
[0085] Acquire a storage flag of the data in the first physical block, wherein the storage flag is used to indicate a storage location of the data in the first physical block, and the storage location includes the second physical block and the cache block;
[0086] In response to the value of the storage flag being the first state value, determining the storage location to be the second physical block;
[0087] In response to the value of the storage flag being a second state value, the storage location is determined to be a cache block, wherein the first state value is different from the second state value.
[0088] Specifically, the storage location of the data is determined according to the storage flag so as to be read from the corresponding storage location.
[0089] In one embodiment, Figure 3 、 Figure 4 As shown, data recycling is performed on the first physical block in the first recycling queue or the second recycling queue, including:
[0090] Reading the data to be reclaimed in the first physical block and storing the data to be reclaimed in the cache block;
[0091] In response to the data to be reclaimed being successfully stored in the cache block, changing the storage address of the data to be reclaimed from the address of the first physical block to the address of the cache block, and changing the value of the storage flag from the first state value to the second state value;
[0092] Reading the data to be reclaimed in the first physical block and storing the data to be reclaimed in the second physical block;
[0093] In response to the successful storage of the data to be reclaimed in the second physical block, the storage address of the data to be reclaimed is changed from the address of the cache block to the address of the second physical block, and the value of the storage flag is changed from the second state value to the first state value, and the data to be reclaimed in the first physical block and the cache block are deleted.
[0094] Specifically, the temporary scheduling of cache blocks during read recovery effectively reduces the read latency during read recovery.
[0095] Furthermore, in response to receiving the read reclaim request, reading data in the first physical block includes:
[0096] Split the read recovery request into multiple page-level read command nodes;
[0097] For a single page level read command, the number of reads of the first physical block is increased by 1;
[0098] The number of reads of the first physical block is stored in a first storage area in a 24-bit granularity zone and divided into high bits and low bits, wherein the high bits in the 24-bit granularity zone are high 16 bits, and the low bits in the 24-bit granularity zone are low 8 bits, and the first storage area is a dynamic random access memory;
[0099] Obtain the total number of reads of the first physical block by shifting the upper 16 bits of the read count of the first physical block left by 8 bits and adding the lower 8 bits of the read count to the lower 16 bits.
[0100] Determine whether the total number of reads of the first physical block reaches a target threshold, where the target threshold is a parameter indicating whether to transfer the number of reads of the first physical block recorded in the upper order of the 24-bit granularity area to the second storage area, where the second storage area is a flash memory;
[0101] If the target threshold is reached, the number of reads of the first physical block recorded in the upper order of the 24-bit granularity area is transferred from the first storage area to the second storage area.
[0102] Specifically, if the total number of reads of the first physical block reaches the target threshold, the upper 16 bits of the read count of the first physical block are transferred to the flash memory, and the lower 8 bits only need to be recorded in the dynamic random access memory. This can reduce the dynamic random access memory space occupied by the cache physical block read count, and at the same time save the flash memory storage space.
[0103] It should be understood that although Figure 1 、 Figure 2 、 Figure 3 、 Figure 4 、 Figure 5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 、 Figure 2 、 Figure 3 、 Figure 4 、 Figure 5 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0104] Example 2
[0105] In one embodiment, Figure 6 As shown, a read disturbance processing device is provided, which is applied to a storage device, wherein the storage device includes at least a first physical block, and the read disturbance processing device includes:
[0106] a reading module, the reading module being configured to read data in the first physical block in response to receiving a read reclaim request;
[0107] A recording module, the recording module is used to record the number of times data of the first physical block is read;
[0108] a placement module, the placement module being configured to place the first physical block into a first recycling queue or a second recycling queue based on the number of data reads and a physical block allocation mechanism, wherein the first recycling queue and the second recycling queue are both queues for pre-data recycling;
[0109] A judgment module, which is used to judge whether the second recycling queue is empty;
[0110] The recycling module is used to, if the second recycling queue is not empty, sequentially recycle data from the first physical blocks in the second recycling queue according to the order in which the first physical blocks enter the second recycling queue until the second recycling queue is empty;
[0111] The recycling module is further configured to, if the second recycling queue is empty and the first recycling queue is not empty, sequentially recycle data from the first physical blocks in the first recycling queue in the order in which the first physical blocks enter the first recycling queue until the first recycling queue is empty.
[0112] In one embodiment, the recording module and the placement module are further configured to:
[0113] Recording a first data read count of a first physical block, wherein the first data read count indicates a data read count before the first physical block enters a first recycling queue;
[0114] Determine a first physical block to be reclaimed in the first physical block according to the first data read count, and put the first physical block to be reclaimed into a first reclaim queue;
[0115] Recording a second data read count of the first physical block to be reclaimed, wherein the second data read count represents the number of data reads after the first physical block to be reclaimed enters the first reclaim queue;
[0116] A second physical block to be reclaimed in the first physical block to be reclaimed is determined according to the second data read count, and the second physical block to be reclaimed is placed in a second reclaim queue.
[0117] In one embodiment, the recording module and the placement module are further configured to:
[0118] Recording a first data read count of a first physical block, wherein the first data read count indicates a data read count before the first physical block enters a first recycling queue;
[0119] Determine a first physical block to be reclaimed in the first physical block according to the first data read count, and put the first physical block to be reclaimed into a first reclaim queue;
[0120] Performing a test on the first recycling queue to obtain a test result;
[0121] According to the detection result, determining whether a read disturb error occurs in the first physical block to be reclaimed in the first reclaim queue;
[0122] If a read disturbance error occurs in the first physical block to be reclaimed, the first physical block to be reclaimed is determined as the second physical block to be reclaimed, and the second physical block to be reclaimed is placed in a second reclaim queue.
[0123] In one embodiment, the recording module is further configured to:
[0124] Each time the data in the first physical block is read, 1 is added to the number of times the first data was read the previous time, wherein the initial value of the number of times the first data was read is 0;
[0125] The placement module is also used to:
[0126] Determining a current first data read count of a first physical block;
[0127] Obtaining a first target value, and comparing the current first data read count with the first target value, wherein the first target value is a parameter used to determine whether to put the first physical block into the first recycling queue, and the first target value is a positive integer;
[0128] In response to the current first data read count being less than the first target value, continuing to record the first data read count of the first physical block until the current first data read count is equal to the first target value;
[0129] In response to the current first data read count being equal to the first target value, the first physical block is determined as a first physical block to be reclaimed, and the first physical block to be reclaimed is placed in a first reclaim queue.
[0130] In one embodiment, the recording module is further configured to:
[0131] Each time the data to be reclaimed in the first physical block to be reclaimed is read once, the number of times the second data was read the last time is subtracted by 1, wherein the initial value of the number of times the second data was read is the first target value;
[0132] The placement module is also used to:
[0133] Determine the current second data read count of the first physical block to be reclaimed;
[0134] Obtaining a second target value, and comparing the current second data read count with the second target value, wherein the second target value is a parameter used to determine whether to put the first to-be-reclaimed physical block in the first recycling queue into the second recycling queue, the second target value is a positive integer, and the second target value is less than the first target value;
[0135] In response to the current second data read count being greater than the second target value, continuing to record the second data read count of the first physical block to be reclaimed until the current second data read count is equal to the second target value;
[0136] In response to the current second data read count being equal to the second target value, the first physical block to be reclaimed is determined as the second physical block to be reclaimed, and the second physical block to be reclaimed is placed in a second reclaim queue.
[0137] In one embodiment, the storage device further includes at least a cache block and a second physical block, and the read disturb processing apparatus further includes:
[0138] an acquisition module, the acquisition module being used to acquire a storage flag of the data in the first physical block, wherein the storage flag is used to indicate a storage location of the data in the first physical block, and the storage location includes the second physical block and the cache block;
[0139] a determining module, configured to determine that the storage location is a second physical block in response to a value of the storage flag being a first state value;
[0140] The determination module is further configured to determine that the storage location is a cache block in response to the value of the storage flag being a second state value, wherein the first state value is different from the second state value.
[0141] In one embodiment, the recycling module is further configured to:
[0142] Reading the data to be reclaimed in the first physical block and storing the data to be reclaimed in the cache block;
[0143] In response to the data to be reclaimed being successfully stored in the cache block, changing the storage address of the data to be reclaimed from the address of the first physical block to the address of the cache block, and changing the value of the storage flag from the first state value to the second state value;
[0144] Reading the data to be reclaimed in the first physical block and storing the data to be reclaimed in the second physical block;
[0145] In response to the successful storage of the data to be reclaimed in the second physical block, the storage address of the data to be reclaimed is changed from the address of the cache block to the address of the second physical block, and the value of the storage flag is changed from the second state value to the first state value, and the data to be reclaimed in the first physical block and the cache block are deleted.
[0146] The specific definition of the read disturb processing device can be found in the definition of the read disturb processing method above and will not be repeated here. Each module in the read disturb processing device described above can be implemented in whole or in part via software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in an electronic device in hardware form, or can be stored in a memory in the electronic device in software form, so that the processor can call and execute the corresponding operations of each module.
[0147] Example 3
[0148] In one embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are performed:
[0149] In response to receiving the read reclaim request, reading data in the first physical block;
[0150] Recording the number of data reads of the first physical block, and placing the first physical block into a first recycling queue or a second recycling queue based on the number of data reads and a physical block allocation mechanism, wherein the first recycling queue and the second recycling queue are both queues for pre-data recycling;
[0151] Determine whether the second recycling queue is empty;
[0152] If the second recycling queue is not empty, data is recycled from the first physical blocks in the second recycling queue in sequence according to the order in which the first physical blocks enter the second recycling queue until the second recycling queue is empty;
[0153] If the second recycling queue is empty and the first recycling queue is not empty, data is recycled for the first physical blocks in the first recycling queue in sequence according to the order in which the first physical blocks enter the first recycling queue until the first recycling queue is empty.
[0154] When the program instructions are read and executed by one or more processors, they can also perform operations corresponding to the various steps in the above method embodiments. Please refer to the above description and will not be repeated here. Figure 7 , which exemplarily shows the architecture of an electronic device, which may specifically include a processor 710, a video display adapter 711, a disk drive 712, an input / output interface 713, a network interface 714, and a memory 720. The processor 710, video display adapter 711, disk drive 712, input / output interface 713, network interface 714, and memory 720 may be communicatively connected via a communication bus 730.
[0155] Among them, the processor 710 can be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in this application.
[0156] The memory 720 can be implemented in the form of a read-only memory (ROM), a random access memory (RAM), a static storage device, a dynamic storage device, etc. The memory 720 can store an operating system 721 for controlling the operation of the electronic device 700, and a basic input and output system (BIOS) 722 for controlling the low-level operations of the electronic device 700. In addition, a web browser 723, a data storage management 724, and an icon font processing system 725, etc. can also be stored. The above-mentioned icon font processing system 725 can be an application program that specifically implements the operations of the aforementioned steps in the embodiment of the present application. In short, when the technical solution provided by the present application is implemented by software or firmware, the relevant program code is stored in the memory 720 and is called and executed by the processor 710.
[0157] The input / output interface 713 is used to connect input / output modules to implement information input and output. The input / output modules can be configured as components in the device (not shown in the figure) or can be externally connected to the device to provide corresponding functions. Input devices may include a keyboard, mouse, touch screen, microphone, various sensors, etc., and output devices may include a display, speaker, vibrator, indicator light, etc.
[0158] The network interface 714 is used to connect to a communication module (not shown) to enable communication between the device and other devices. The communication module can communicate via a wired method (such as USB, network cable, etc.) or a wireless method (such as mobile network, WiFi, Bluetooth, etc.).
[0159] The bus 730 comprises a pathway for transmitting information between the various components of the device (eg, the processor 710 , the video display adapter 711 , the disk drive 712 , the input / output interface 713 , the network interface 714 , and the memory 720 ).
[0160] In addition, the electronic device 700 can also obtain information on specific collection conditions from the virtual resource object collection condition information database 741 for use in condition judgment, etc.
[0161] It should be noted that although the electronic device 700 shown above only includes a processor 710, a video display adapter 711, a disk drive 712, an input / output interface 713, a network interface 714, a memory 720, a bus 730, etc., in a specific implementation, the electronic device may also include other components necessary for normal operation. In addition, it will be understood by those skilled in the art that the above device may only include the components necessary to implement the solution of the present application, and does not necessarily include all the components shown in the figure.
[0162] Through the description of the above implementation methods, it can be seen that those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling an electronic device (which can be a personal computer, a cloud server, or a network device, etc.) to execute the methods of each embodiment of the present application or certain parts of the embodiments.
[0163] Example 4
[0164] In response to receiving the read reclaim request, reading data in the first physical block;
[0165] Recording the number of data reads of the first physical block, and placing the first physical block into a first recycling queue or a second recycling queue based on the number of data reads and a physical block allocation mechanism, wherein the first recycling queue and the second recycling queue are both queues for pre-data recycling;
[0166] Determine whether the second recycling queue is empty;
[0167] If the second recycling queue is not empty, data is recycled from the first physical blocks in the second recycling queue in sequence according to the order in which the first physical blocks enter the second recycling queue until the second recycling queue is empty;
[0168] If the second recycling queue is empty and the first recycling queue is not empty, data is recycled for the first physical blocks in the first recycling queue in sequence according to the order in which the first physical blocks enter the first recycling queue until the first recycling queue is empty.
[0169] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0170] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0171] The above embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
[0172] Example 5
[0173] In one embodiment, a computer program product is provided, wherein a computer program is stored on the product, and when the computer program is executed by a processor, the following steps are performed:
[0174] In response to receiving the read reclaim request, reading data in the first physical block;
[0175] Recording the number of data reads of the first physical block, and placing the first physical block into a first recycling queue or a second recycling queue based on the number of data reads and a physical block allocation mechanism, wherein the first recycling queue and the second recycling queue are both queues for pre-data recycling;
[0176] Determine whether the second recycling queue is empty;
[0177] If the second recycling queue is not empty, data is recycled from the first physical blocks in the second recycling queue in sequence according to the order in which the first physical blocks enter the second recycling queue until the second recycling queue is empty;
[0178] If the second recycling queue is empty and the first recycling queue is not empty, data is recycled for the first physical blocks in the first recycling queue in sequence according to the order in which the first physical blocks enter the first recycling queue until the first recycling queue is empty.
[0179] In one embodiment, a non-volatile computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0180] In response to receiving the read reclaim request, reading data in the first physical block;
[0181] Recording the number of data reads of the first physical block, and placing the first physical block into a first recycling queue or a second recycling queue based on the number of data reads and a physical block allocation mechanism, wherein the first recycling queue and the second recycling queue are both queues for pre-data recycling;
[0182] Determine whether the second recycling queue is empty;
[0183] If the second recycling queue is not empty, data is recycled from the first physical blocks in the second recycling queue in sequence according to the order in which the first physical blocks enter the second recycling queue until the second recycling queue is empty;
[0184] If the second recycling queue is empty and the first recycling queue is not empty, data is recycled for the first physical blocks in the first recycling queue in sequence according to the order in which the first physical blocks enter the first recycling queue until the first recycling queue is empty.
[0185] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program. The computer program can be stored in a computer program product. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods.
[0186] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0187] The above embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A read disturb processing method, applied to a storage device, wherein the storage device includes at least a first physical block, characterized in that: The method comprises: In response to receiving a read reclaim request, reading data in the first physical block; Recording the number of data reads of the first physical block, and placing the first physical block into a first recycling queue or a second recycling queue based on the number of data reads and a physical block allocation mechanism, wherein the first recycling queue and the second recycling queue are both queues for pre-data recycling; Determine whether the second recycling queue is empty; If the second recycling queue is not empty, data is recycled for the first physical blocks in the second recycling queue in sequence according to the order in which the first physical blocks enter the second recycling queue until the second recycling queue is empty; if the second recycling queue is empty and the first recycling queue is not empty, data is recycled for the first physical blocks in the first recycling queue in sequence according to the order in which the first physical blocks enter the first recycling queue until the first recycling queue is empty.
2. The method according to claim 1, characterized in that The recording of the number of data reads of the first physical block and placing the first physical block into a first recycling queue or a second recycling queue based on the number of data reads and a physical block allocation mechanism includes: Recording a first data read count of the first physical block, wherein the first data read count indicates a data read count before the first physical block enters the first recycling queue; Determine a first physical block to be reclaimed in the first physical block according to the first data read count, and put the first physical block to be reclaimed into the first reclaim queue; Recording a second data read count of the first physical block to be reclaimed, wherein the second data read count indicates a data read count after the first physical block to be reclaimed enters the first reclaim queue; A second physical block to be reclaimed in the first physical block to be reclaimed is determined according to the second data read count, and the second physical block to be reclaimed is placed in the second reclaim queue.
3. The method according to claim 1, characterized in that The recording of the number of data reads of the first physical block and placing the first physical block into a first recycling queue or a second recycling queue based on the number of data reads and a physical block allocation mechanism further includes: Recording a first data read count of the first physical block, wherein the first data read count indicates a data read count before the first physical block enters the first recycling queue; Determine a first physical block to be reclaimed in the first physical block according to the first data read count, and put the first physical block to be reclaimed into the first reclaim queue; Performing a test on the first recycling queue to obtain a test result; Determining, based on the detection result, whether a read disturb error occurs in the first physical block to be reclaimed in the first reclaim queue; If a read disturbance error occurs in the first physical block to be reclaimed, the first physical block to be reclaimed is determined as the second physical block to be reclaimed, and the second physical block to be reclaimed is placed in the second reclaim queue.
4. The method according to claim 2, characterized in that The recording of the first data read count of the first physical block includes: Each time the data in the first physical block is read, 1 is added to the number of first data reads last time, wherein the initial value of the first data read number is 0; The determining a first physical block to be reclaimed in the first physical block according to the first data read count, and placing the first physical block to be reclaimed into the first reclaim queue, includes: Determining a current first data read count of the first physical block; Obtaining a first target value, and comparing the current first data read count with the first target value, wherein the first target value is a parameter used to determine whether to put the first physical block into the first recycling queue, and the first target value is a positive integer; In response to the current first data read count being less than the first target value, continuing to record the first data read count of the first physical block until the current first data read count is equal to the first target value; In response to the current first data read count being equal to the first target value, the first physical block is determined as the first physical block to be reclaimed, and the first physical block to be reclaimed is placed in the first reclaim queue.
5. The method according to claim 4, characterized in that: The recording of the second data read count of the first physical block to be reclaimed includes: Each time the data to be reclaimed in the first physical block to be reclaimed is read, the number of times the second data was read last time is subtracted by 1, wherein the initial value of the number of times the second data was read is the first target value; The determining, according to the second data read count, a second physical block to be reclaimed in the first physical block to be reclaimed, and placing the second physical block to be reclaimed into the second reclaim queue includes: Determining a current second data read count of the first physical block to be reclaimed; Obtaining a second target value, and comparing the current second data read count with the second target value, wherein the second target value is a parameter used to determine whether to place the first to-be-reclaimed physical block in the first reclaim queue into the second reclaim queue, the second target value is a positive integer, and the second target value is less than the first target value; in response to the current second data read count being greater than the second target value, continuing to record the second data read count of the first to-be-reclaimed physical block until the current second data read count equals the second target value; In response to the current second data read count being equal to the second target value, the first physical block to be reclaimed is determined as the second physical block to be reclaimed, and the second physical block to be reclaimed is placed in the second reclaim queue.
6. The method according to claim 1, characterized in that The storage device further includes at least a cache block and a second physical block, and the method further includes: Acquire a storage flag of the data in the first physical block, wherein the storage flag is used to indicate a storage location of the data in the first physical block, and the storage location includes the second physical block and the cache block; In response to the value of the storage flag being a first state value, determining that the storage location is the second physical block; In response to the value of the storage flag being a second state value, determining that the storage location is the cache block, wherein the first state value is different from the second state value.
7. The method according to claim 6, characterized in that Recycling data on the first physical block in the first recycling queue or the second recycling queue includes: Reading the data to be reclaimed in the first physical block, and storing the data to be reclaimed in the cache block; In response to the data to be reclaimed being successfully stored in the cache block, changing the storage address of the data to be reclaimed from the address of the first physical block to the address of the cache block, and changing the value of the storage flag from the initial state value to the second state value; Reading the data to be reclaimed in the first physical block, and storing the data to be reclaimed in the second physical block; In response to the data to be reclaimed being successfully stored in the second physical block, the storage address of the data to be reclaimed is changed from the address of the cache block to the address of the second physical block, and the value of the storage flag is changed from the second state value to the first state value, and the data to be reclaimed in the first physical block and the cache block are deleted.
8. A read disturbance processing apparatus, applied to a storage device, wherein the storage device includes at least a first physical block, characterized in that: The device comprises: a reading module, configured to read data in the first physical block in response to receiving a read reclaim request; a recording module, configured to record a number of times data of the first physical block is read; a placement module, configured to place the first physical block into a first recycling queue or a second recycling queue based on the number of data reads and a physical block allocation mechanism, wherein the first recycling queue and the second recycling queue are queues for pre-data recycling; A judging module, configured to judge whether the second recycling queue is empty; a recycling module configured to, if the second recycling queue is not empty, sequentially recycle data from the first physical blocks in the second recycling queue in the order in which the first physical blocks enter the second recycling queue until the second recycling queue is empty; The recycling module is further configured to, if the second recycling queue is empty and the first recycling queue is not empty, sequentially recycle data from the first physical blocks in the first recycling queue in the order in which the first physical blocks enter the first recycling queue until the first recycling queue is empty.
9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the read disturbance processing method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the read disturbance processing method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Read interference counting method of storage component and electronic equipment
CN120977358A