A storage device and a data block erasing method thereof
By maintaining multiple lists of data blocks in the storage device and performing step-by-step erasure operations, the problem of low data block erasure efficiency is solved, high-priority data access is supported during the erasure process, and the performance of the storage device is improved.
Patent Information
- Application Number
- CN202411305781.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2044-09-18
AI Technical Summary
As the stacking height of storage devices increases, the height of metal vias also increases, leading to a decrease in data block erasure efficiency. Traditional data block erasure schemes do not support insert write operations during the erasure process, affecting the data storage and access performance of storage devices.
By maintaining multiple lists of data blocks in the storage device, recording data blocks for different erasure steps, and issuing target erasure commands to execute step-by-step erasure operations, high-priority data access operations are allowed to be performed after each step.
While ensuring the reliability of the erase operation, it reduces data access latency and improves the overall performance of the storage device.
Smart Images

Figure CN119248189B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of semiconductor, more particularly, to a storage device and a data block erasing method thereof. BACKGROUND
[0002] With the increase of the corresponding stack height of the storage device, the height of the metal via is higher, which leads to the decrease of the data block erasing efficiency, the increase of the data block erasing time in the storage device, and the traditional data erasing scheme does not support the insertion of the write operation in the data block erasing process, which causes the erasing operation to block the related data write operation and affects the data storage and access performance of the storage device. SUMMARY
[0003] Therefore, the embodiments of the present application provide a storage device and a data block erasing method thereof, which record the data blocks in different erasing steps through the data block lists, so as to realize the step-by-step erasing of the data blocks, so that the storage device can perform the high-priority data access operation after the execution of the erasing operation of a certain step, which reduces the time delay of the data access while ensuring the reliability of the erasing operation and improves the overall performance of the storage device.
[0004] In a first aspect, the embodiments of the present application provide a data block erasing method of a storage device, which comprises:
[0005] determining a target data block from a plurality of data block lists, the plurality of data block lists comprising a first data block list and at least one second data block list, the first data block list being used to record the data blocks which have not executed the erasing operation, and the second data block list being used to record the data blocks which have executed one or more steps of the erasing operation;
[0006] issuing a target erasing instruction of the target data block to execute the corresponding erasing operation on the target data block, the target erasing instruction having a corresponding target step;
[0007] recording the target data block which has executed the erasing operation in a target data block list, the target data block list being a second data block list which records the completion of the erasing operation of the target step.
[0008] Further, the method further comprises:
[0009] inquiring an execution state;
[0010] in response to the execution state being execution completion, executing a received data operation request, the instruction type of the data operation request being a write operation or a read operation.
[0011] Further, the inquiring of the execution state comprises:
[0012] querying the execution state from a corresponding state register, the execution state being switched when starting to execute the target erasing instruction or a check of the target step corresponding erasing operation, the check of the target erasing instruction or the target step corresponding erasing operation being used to determine whether the target data block reaches an expected erasing state.
[0013] Further, the determining the target data block from the plurality of data block lists comprises:
[0014] determining a data block list to be erased according to a number of data blocks in each of the data block lists;
[0015] determining the target data block from the data block list to be erased.
[0016] Further, the target step is a last step erasing operation, and the target data block list is a second data block list used to record free data blocks.
[0017] Further, the method further comprises:
[0018] querying an execution result of the target data block, the execution result comprising erasing success and erasing failure, the execution result being updated after a check of the target step corresponding erasing operation.
[0019] In a second aspect, an embodiment of the present application provides a storage device, the storage device comprising:
[0020] a storage medium comprising a plurality of data blocks used to store data;
[0021] a controller used to execute the method as described above.
[0022] Further, the storage medium has a corresponding state register used to store an execution state and / or an execution result of an erasing operation of a data block in the storage medium.
[0023] In a third aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, the computer program being executed by a processor to implement the method as described above.
[0024] In a fourth aspect, an embodiment of the present application provides a computer program product, when the computer program product is run on a computer, the computer program product causes the computer to execute the method as described above.
[0025] The embodiment of the present application determines a target data block from a plurality of data block lists, and issues a target erasing instruction of the target data block, executes an erasing operation corresponding to a target step indicated by the target erasing instruction on the target data block, and records the target data block after the erasing operation in a target data block list, wherein the plurality of data block lists include a first data block list for recording data blocks without executing the erasing operation and at least one second data block list for recording data blocks executing one or more steps of the erasing operation. Thus, the embodiment of the present application can record different erasing steps of the data blocks through the data block lists, and then issues and executes different next step instructions for the data blocks in different erasing steps, so as to realize the step-by-step erasing of the data blocks, so that the storage device can execute the data access operation with high priority after executing the erasing operation of a certain step, reduces the time delay of the data access while ensuring the reliability of the erasing operation, and improves the overall performance of the storage device. BRIEF DESCRIPTION OF DRAWINGS
[0026] The above and other objects, features and advantages of the present application will become more apparent from the following description when taken in conjunction with the accompanying drawings, in which:
[0027] Figure 1 is a flowchart of a data block erasing method of a storage device according to an embodiment of the present application;
[0028] Figure 2 is a flowchart of another data block erasing method of a storage device according to an embodiment of the present application;
[0029] Figure 3 is a schematic diagram of an updating process of a data block list according to an embodiment of the present application;
[0030] Figure 4 is a flowchart of another data block erasing method of a storage device according to an embodiment of the present application;
[0031] Figure 5 is a schematic diagram of a storage device according to an embodiment of the present application;
[0032] Figure 6 is a schematic diagram of a data block erasing device of a storage device according to an embodiment of the present application. DETAILED DESCRIPTION
[0033] The present application is described below based on embodiments, but the present application is not limited to only these embodiments. In the following detailed description of the present application, some specific details are described in detail. The present application can also be completely understood without the description of these details by those skilled in the art. In order to avoid confusion of the essence of the present application, the well-known methods, processes, flows, elements and circuits are not described in detail.
[0034] Moreover, it is to be understood that the drawings provided herein are for illustrative purposes and are not necessarily to scale.
[0035] Unless the context clearly requires otherwise, throughout the description, the words "comprise," "comprising," and the like are to be construed in an inclusive sense as opposed to an exclusive or exhaustive sense; that is to say, in the sense of "including, but not limited to."
[0036] In the description of the present application, it should be understood that the terms "first", "second" and the like are used to describe various components, but not necessarily indicate or imply relative importance. In addition, in the description of the present application, unless otherwise specified, the meaning of "a plurality of" is two or more.
[0037] The embodiments of the present application mainly take the storage device as a solid state disk as an example for detailed description, it should be understood that the storage device of the present application can also be other solid state storage device, such as SD card and the like.
[0038] The solid state disk is a kind of hard disk using non-volatile memory to store data, usually realized by using flash memory technology. The solid state disk is composed of a control unit and a storage unit. Among them, the storage unit adopts flash memory, such as NAND type flash memory. The control unit is responsible for data reading, writing and erasing operation, as well as error correction, garbage collection and wear leveling functions, to ensure the service life of the solid state disk.
[0039] NAND flash memory is a kind of non-volatile storage technology, which can keep data unchanged even in the case of power failure. NAND flash memory is a kind of storage medium commonly used in solid state storage devices (such as USB flash drive, solid state disk SSD, SD card, etc.). The basic storage unit of NAND flash memory is composed of metal-oxide-semiconductor field effect transistor (MOSFET), which contains a floating gate (Floating Gate) or charge storage layer. The floating gate or charge storage layer is located below the control gate (Control Gate) and is separated by an insulating layer. This floating gate or charge storage layer is the place where the charge is really stored, and the presence or absence of charge determines the state of the storage unit.
[0040] Data is stored in NAND flash memory as electric charge, and the amount of stored charge is controlled by the voltage applied to the control gate. When the voltage of the control gate is high enough, electrons can pass through the thin oxide layer under the floating gate from the source to the floating gate, a process known as programming (writing). If the voltage of the control gate is not high enough to allow electrons to pass through the oxide layer, the charge of the floating gate will be maintained until an erase operation empties it. Data reading is achieved by detecting whether the charge on the floating gate exceeds a certain threshold voltage Vth. If there is enough charge on the floating gate, the threshold voltage rises, so that when the control gate applies a standard read voltage, the transistor is in the off state, which represents data "0". Conversely, if there is no charge or little charge on the floating gate, the transistor is in the on state, which represents data "1". Further, the erase operation of NAND is usually performed in units of data blocks.
[0041] Figure 1 is a flowchart of a data block erase method of a storage device according to an embodiment of the present application. The data block erase method of the storage device according to the embodiment of the present application can be executed by a controller of the storage device, as shown in Figure 1 The data block erase method of the storage device according to the embodiment of the present application includes the following steps:
[0042] Step S110, determining a target data block from a plurality of data block lists. The plurality of data block lists include a first data block list and at least one second data block list, the first data block list is used to record data blocks that have not performed an erase operation, and the second data block list is used to record data blocks that have performed one or more erase operations.
[0043] The data block erase process according to the embodiment of the present application is performed through multiple erase operations, and each erase operation has a corresponding verify operation. That is, the embodiment of the present application divides the entire data block erase process with a relatively long execution time into multiple independent erase steps, and the execution time of each erase step is relatively short. After the end of each erase step, the storage device can first execute a high-priority data operation request, such as a data write request or a data read request, and after the corresponding data operation of the data operation request is executed, the data erase operation of the related data block can be further executed according to the needs of the storage device. Thus, the embodiment realizes reducing the time delay of data access without affecting the data erase operation, and improves the overall performance of the storage device.
[0044] Further, in the embodiment, the data blocks in each erasing progress are recorded by different data block lists. For example, assuming that the erasing steps of the predetermined data block include N steps (N≥2), the data blocks in the erasing progress of 0 (i.e. the data blocks that need to be erased but have not yet performed the erasing operation) can be recorded by the data block list list-0, the data blocks in the erasing progress of 1 (i.e. the data blocks that have performed the first step of the erasing operation) can be recorded by the data block list list-1, and the data blocks in the erasing progress of i (1≤i≤N) (i.e. the data blocks that have performed the i step of the erasing operation) can be recorded by the data block list list-i. Further, if a group of data blocks has undergone N steps of the erasing operation and passed the verification (i.e. the group of data blocks has reached the expected erasing state), the group of data blocks is recorded in the data block list list-N, i.e. the data block list list-N records the data blocks in the free state (Free Block).
[0045] In an optional implementation, the embodiment can determine the end node of each step by setting the erasing time length of each step. For example, when the time of controlling the data block to perform the erasing operation (e.g. the voltage maintaining time of the word line where the data block is located) reaches the erasing time threshold of the corresponding step, it is determined that the erasing operation of the current step is completed, and the data blocks performing the erasing operation are verified, and the execution state of these data blocks is updated to the execution completion state. In other optional implementations, the embodiment can also determine that the erasing operation of the current step is completed by the number of erasing pulses, and the embodiment does not limit how to set the end node of each erasing step, which can be set according to specific needs. The process of maintaining the voltage of the word line (Word Line, WL) where the data block is located for a period of time to allow the electrons to escape from the floating gate (Floating Gate, FG) to the substrate (Substrate) through the tunnel oxide layer is called an erasing pulse.
[0046] For another example, when the erasing pulse is completed, it is determined that the erasing operation of the current step is completed, and the data blocks performing the erasing operation are verified, and the execution state of these data blocks is updated to the execution completion state.
[0047] In an alternative implementation, the embodiment of the present application can determine the target data block currently performing the erasing operation according to the current performance requirement of the storage device and / or the number of data blocks in each data block list. Alternatively, the embodiment of the present application can determine the data block list to be erased according to the number of data blocks in each data block list, and determine the target data block from the data block list to be erased. For example, if the number of data blocks in the data block list list-N is small, i.e. the number of data blocks in the idle state is small, and the number of data blocks in the data block list list-N-1 is relatively large, in order to increase the number of required idle data blocks as soon as possible, the current erasing operation can select a corresponding number of target data blocks from the data block list list-N-1, and perform the Nth step erasing operation. Further alternatively, the embodiment of the present application can select a predetermined number of target data blocks from the data block list with the largest number of data blocks, or from the previous data block list corresponding to the data block list with the smallest number of data blocks, or calculate the difference between the ith data block list and the (i+1)th data block list, and determine a predetermined number of target data blocks from the ith data block list corresponding to the largest difference. It should be understood that the embodiment does not limit the way of selecting the target data block from which data block list, which can be set according to the specific application scenario and the requirement of the storage device. Further, the embodiment does not limit the number of selected target data blocks, which can be determined based on the number supported by the performance of the storage device or the current required number.
[0048] In step S120, the target erasing instruction of the target data block is issued to perform the corresponding erasing operation on the target data block, and the target erasing instruction has the corresponding target step. Further, the target erasing instruction further includes the address information of the target data block.
[0049] In the embodiment, after the controller selects a predetermined number of target data blocks from the data block list list-i to be erased, the target erasing instruction of the target data block is issued to the storage medium. The target erasing instruction has the corresponding target step (i+1) and the address information of the target data block.
[0050] Optionally, the storage medium, after receiving the target erasing instruction, determines the target data block according to the address information in the target erasing instruction, updates the execution state to a busy state (Busy), and initializes the circuit required for the erasing operation of the target data block, and then performs pre-charging, that is, sets the voltage of the control gate (CG) of the storage unit in the target data block to a first voltage (for example, 0V, or set according to actual needs), pre-charges the bit line (BL) where the storage unit in the target data block is located to a second voltage (for example, 0V or other intermediate voltage, that is, between 0 and a third voltage), so as to reduce the current consumption during erasing, and then enters the erasing stage, that is, raises the word line to the third voltage and keeps it at the third voltage for a period of time, so as to allow the electrons to escape from the floating gate to the substrate through the tunnel oxide layer. It should be understood that the first voltage, the second voltage and the third voltage are set according to the erasing operation requirements of the actual data block.
[0051] Further, when the erasing time of the current erasing operation of the target data block reaches the erasing time threshold value corresponding to the target step (i+1), the verification operation of the current erasing step is performed, and it is determined that the current erasing operation is completed, and the storage medium updates the execution state to a ready state (Ready), that is, the next erasing operation or other data operation request can be performed. Further optionally, the verification operation corresponding to each erasing step is to verify whether the target data block reaches the expected erasing state, for example, whether all the storage units in the target data block are completely erased, etc. After verification, the execution result (Pass / Fail) is updated, that is, the execution result of the storage medium is updated after the verification of the erasing operation of the target step. Wherein, the execution result includes erasing success (Pass) and erasing failure (Fail), and the erasing success represents that the target data block reaches the expected erasing state after the erasing operation of the target step, and the erasing failure represents that the target data block does not reach the expected erasing state after the erasing operation of the target step.
[0052] In an optional implementation, the embodiment records the execution state and the execution result of the storage medium through the state register. Optionally, the execution state and the execution result of the storage medium can be stored in the same state register, or can be stored in different state registers, and the embodiment does not limit this. Further, the storage medium updates the execution state in the corresponding state register from the busy state (Busy) to the ready state (Ready) after triggering the verification of the target step.
[0053] In step S130, the target data block after the erasing operation is recorded in the target data block list. Wherein, the target data block list is a second data block list recording the completion of the erasing operation of the target step.
[0054] In an alternative implementation, the controller of the storage device queries the execution status of the storage medium, and in response to the execution status being execution complete, records the target data block on which the erasing operation is completed in the target data block list. For example, assuming that the target data block is a data block in the data block list list-0, after the target data block completes the first step of the erasing operation, the target data block is recorded in the data block list list-1, and the target data block is deleted from the data block list list-0.
[0055] Further, if the execution status of the storage medium is recorded in the corresponding status register, the controller of the storage device can periodically query the status register to query the execution status of the storage medium from the status register. The execution status of the storage medium is switched when starting to execute the target erasing instruction or performing the verification of the erasing operation corresponding to the target step. The storage medium controls the execution status in the status register to switch to the busy state (Busy) when starting to execute the target erasing instruction, and controls the execution status in the status register to switch to the ready state (Ready) when performing the verification of the erasing operation corresponding to the target step. When the controller of the storage device queries the execution status recorded in the status register to be the ready state (Ready), it is determined that the erasing operation of the current target step is completed, and the target data block on which the erasing operation is completed is recorded in the target data block list.
[0056] Further alternatively, if the storage device has a high-priority data operation request to be processed, when the controller of the storage device queries the execution status of the storage medium to be the ready state (Ready), the received data operation request can be executed. The instruction type corresponding to the data operation request is a write operation or a read operation, or can be other data operation requests, and the embodiment does not limit the type of data operation request. Thus, the embodiment of the application can record the data blocks in different erasing steps through the data block lists, thereby realizing step-by-step erasing of the data blocks, so that the storage device can execute a high-priority data access operation after completing the erasing operation of a certain step, thereby reducing the time delay of data access.
[0057] Further, in the embodiment, the erasing step of the predetermined data block includes N steps, if the target step is the last step of the erasing operation, i.e., the Nth step of the erasing operation, the target data block list is the second data block list for recording the idle data block. Further, since the whole erasing process of the data block is divided into N steps, the data block cannot reach the expected erasing state before the Nth step of the erasing operation is performed, i.e., the execution result of the checking operation corresponding to each step is usually erasing failure, thus the controller of the storage device can only query the execution result of the data block after the last step of the erasing operation, i.e., the Nth step of the erasing operation, is performed, to determine whether the data block is successfully erased after the whole erasing process is completed. In other optional implementations, the embodiment can also query the execution result after each step of the erasing operation is performed, and the embodiment does not limit the timing or period of the query of the execution result by the controller of the storage device.
[0058] The embodiment of the application can determine the target data block from the plurality of data block lists, and issue the target erasing instruction of the target data block, to perform the erasing operation corresponding to the target step indicated by the target erasing instruction on the target data block, and record the target data block after the erasing operation is performed in the target data block list, wherein the plurality of data block lists include the first data block list for recording the data block without performing the erasing operation and the at least one second data block list for recording the data block performing one or more steps of the erasing operation. Thus, the embodiment of the application can record the different erasing steps of the data block by each data block list, and then issue and perform different next step instructions for the data block in different erasing steps, so as to realize the step-by-step erasing of the data block, so that the storage device can perform the data access operation with high priority after the erasing operation of a certain step is performed, to reduce the time delay of the data access while ensuring the reliability of the erasing operation, and improve the overall performance of the storage device.
[0059] Figure 2 is a flowchart of another data block erasing method of the storage device according to the embodiment of the application. Figure 3 is a schematic diagram of the updating process of the data block list according to the embodiment of the application. The embodiment is used to describe the whole erasing process of the same group of target data blocks including N steps of the erasing operation, taking N=2, i.e., the whole erasing process of the data block is divided into two steps of the erasing operation. As shown in Figure 3 , the controller of the storage device maintains the data block list list-0 without performing the erasing operation, the data list list-1 performing the first step of the erasing operation, and the data block list list-2 in the idle state. It should be understood that the embodiment does not limit the specific value of N, which can be set according to the actual application requirement. Referring to Figure 2 and Figure 3The data block erasing method of the storage device includes the following steps:
[0060] In step S210, the controller of the storage device determines target data blocks b1-bm (m≥1) to be erased from the data block storage list list-0 (i.e. the data block list not subjected to the erasing operation) according to the requirement, and issues a first-step erasing operation instruction of the target data blocks b1-bm to the storage medium.
[0061] In step S220, the storage medium determines the target data blocks b1-bm according to the address information in the first-step erasing operation instruction.
[0062] In step S230, the first-step erasing operation instruction is executed on the target data blocks b1-bm.
[0063] In step S240, a check operation is performed on the first-step erasing operation instruction, and the execution state and the execution result are updated.
[0064] Optionally, the storage medium receives the first-step erasing instruction, determines the target data blocks b1-bm according to the address information in the first-step erasing instruction, updates the execution state to a busy state (Busy), and initializes the circuit required for the erasing operation of the target data blocks b1-bm, and then performs pre-charging, i.e. sets the voltage of the control gate (CG) of the storage unit in the target data blocks b1-bm to a first voltage (e.g. 0V, or set according to the actual requirement), pre-charges the bit line (BL) where the storage unit in the target data blocks is located to a second voltage (e.g. 0V or other intermediate voltage, i.e. between 0 and a third voltage), so as to reduce the current consumption during the erasing, and then enters the erasing stage, i.e. raises the word line to a third voltage, and maintains this third voltage for a period of time, so as to allow the electrons to escape from the floating gate to the substrate through the tunnel oxide layer. Further, when the erasing time of the current erasing operation of the target data blocks b1-bm reaches the erasing time threshold corresponding to the first-step erasing operation, a check operation of the first-step erasing operation is performed, and it is determined that the current erasing operation is completed, and the storage medium updates the execution state to a ready state (Ready), i.e. the next erasing operation or other data operation request can be performed.
[0065] Further optionally, it is checked whether the target data blocks b1-bm reach the expected erasing state, e.g. whether all the storage units in the target data blocks b1-bm are completely erased, etc. After the check, the execution result (Pass / Fail) is updated.
[0066] Step S250, the controller queries the execution state of the storage medium, and records the target data blocks b1-bm into the data block list list-1 and deletes the target data blocks b1-bm from the data block list list-0 to update the data block list list-0 when the execution state is a ready state. For reference Figure 3 .
[0067] Step S260, in response to the execution state being ready, a second-step erase operation instruction of the target data blocks b1-bm is sent. It should be understood that after step S250 is executed, other erase operations of target data blocks can be executed, or high-priority data operation requests can be executed and completed, and the storage medium is in the ready state.
[0068] Further, the controller determines the target data blocks b1-bm from the data block list list-1 according to current requirements, and sends a second-step erase operation instruction of the target data blocks b1-bm to the storage medium.
[0069] Step S270, the storage medium determines the target data blocks b1-bm according to address information in the second-step erase operation instruction.
[0070] Step S280, the second-step erase operation instruction is executed on the target data blocks b1-bm.
[0071] Step S290, a verification operation is performed on the second-step erase operation instruction, and the execution state and the execution result are updated. The specific erase operation and the updating mode of the execution state and the execution result are similar to those of the first-step erase operation, and are not described herein.
[0072] Step S2A0, the controller queries the execution state and the execution result of the storage medium, and records the target data blocks b1-bm into the data block list list-2 (i.e., the data block list list-2 of the idle state blocks) and deletes the target data blocks b1-bm from the data block list list-1 to update the data block list list-1 when the execution state is ready and the execution result is erase success. For reference Figure 3 .
[0073] In an optional implementation, if the controller queries the execution state of the storage medium and the execution state is busy, the storage medium is currently in the process of the erase operation or in the process of executing other data operation requests.
[0074] Further, if the execution result of the check is that the erasing fails after the last step of erasing operation is performed on the data block, the controller can control the retry operation on the data block, for example, re-add the data block to the data block list list-0 to perform the erasing operation on the data block again. In another optional implementation, the controller can also determine the data block with the final erasing failure as a bad block and add it to the bad block list. It should be understood that the embodiment does not limit the processing manner of the data block with the final erasing failure.
[0075] The embodiment mainly takes the target erasing instruction carrying the erasing step of the target data block issued by the controller as an example for description, and in other optional implementations, the storage medium of the embodiment can also record the erasing step corresponding to the data block, and after receiving the target erasing instruction of the data block, the corresponding erasing operation is performed according to the erasing step of the data block recorded by the storage medium.
[0076] The embodiment determines the target data block from the plurality of data block lists, issues the target erasing instruction of the target data block, performs the erasing operation corresponding to the target step indicated by the target erasing instruction on the target data block, and records the target data block after the erasing operation in the target data block list, wherein the plurality of data block lists include a first data block list for recording data blocks without performing the erasing operation and at least one second data block list for recording data blocks performing one or more steps of the erasing operation. Thus, the embodiment can record different erasing steps of the data block through the data block lists, and then issue and perform different next step instructions for the data blocks in different erasing steps, so as to realize the step-by-step erasing of the data block, so that the storage device can perform the high-priority data access operation after performing the erasing operation of a certain step, thereby reducing the time delay of the data access while ensuring the reliability of the erasing operation, and improving the overall performance of the storage device.
[0077] Figure 4 is another flowchart of the data block erasing method of the storage device of the embodiment. The embodiment is used to describe the process of the controller performing the data block erasing method, and still takes N=2, that is, the entire erasing process of the data block is divided into two steps of erasing as an example. As shown in Figure 4 The data block erasing method of the storage device of the embodiment includes the following steps:
[0078] In step S310, when the high-priority data operation is performed or the certain step of the erasing operation of the data block is performed and there is no high-priority data operation to be performed, the target data block is determined from one of the data block lists according to the requirement.
[0079] Step S320, judging whether the list where the target data block is located is the data block list list-0. If the list where the target data block is located is not the data block list list-0, it is located in the data block list list-1. If the list where the target data block is located is the data block list list-0, step S330 is executed. If the list where the target data block is located is the data block list list-1, step S410 is executed.
[0080] Step S330, when the list where the target data block is located is list-0, issuing the first step erase operation instruction to the storage medium.
[0081] Step S340, the storage medium determines the target data block according to the address information in the first step erase operation instruction.
[0082] Step S350, executing the first step erase operation instruction on the target data block.
[0083] Step S360, performing a check operation on the first step erase operation instruction and updating the execution state and the execution result.
[0084] Step S370, the controller sends an instruction to query the execution state to the storage medium. In an optional implementation, the controller queries the state register corresponding to the storage medium to obtain the execution state. The state register is used to store the current execution state of the storage medium.
[0085] Step S380, the storage medium returns the execution state to the controller. After receiving the instruction of the controller to query the execution state, the storage medium obtains the execution state from the state register and feeds back to the controller.
[0086] Step S390, in response to the current execution state of the storage medium being execution completed, recording the target data block into the data block list list-1. Further, when the current execution state of the storage medium is busy state, it indicates that the storage medium is executing corresponding operation and it cannot execute new data operation.
[0087] Step S400, receiving a data operation request.
[0088] Step S400', executing the data operation request.
[0089] If a high-priority data operation request, such as a data write request, is received between steps S310-S390 or after step S390, the controller performs the data operation corresponding to the data operation request by controlling the storage medium when the query determines that the execution state of the storage medium is the execution completion state. It should be understood that the specific data write operation and data read operation can be any data write operation and data read operation developed by existing or future technology, and the embodiment does not describe the specific data operation process of the controller and the storage medium in detail.
[0090] After the data operation request is executed, if the storage device still has data block erasing requirements, the process is repeated from step S310.
[0091] In step S410, the controller issues a second-step erasing operation instruction when the list in which the target data block is located is list-1.
[0092] In step S420, the storage medium determines the target data block according to the address information in the second-step erasing operation instruction.
[0093] In step S430, the second-step erasing operation is performed on the target data block.
[0094] In step S440, a verification operation is performed on the second-step erasing operation, and the execution state and execution result are updated.
[0095] In step S450, the controller sends an instruction to the storage medium to query the execution state and execution result.
[0096] In step S460, the storage medium returns the execution state and execution result to the controller.
[0097] In step S470, the target data block is recorded in the data block list list-2 when the execution state is execution completion and the execution result is erasing success, and the target data block is recorded in the bad block list when the execution result is erasing failure.
[0098] It should be understood that the process of the controller and the storage medium in the embodiment performing the erasing operation corresponding to each erasing step is similar to the embodiment shown in Figure 2 and Figure 3 and will not be described in detail here.
[0099] Further, after step S470 is executed, if a high-priority data operation request is received, the controller and the storage medium can preferentially perform the data operation corresponding to the data operation request, and if there is no unexecuted high-priority data operation request and there is a data block erasing operation requirement, the data block erasing process can be repeated from step S310.
[0100] The embodiment of the present application determines a target data block from a plurality of data block lists, and issues a target erasing instruction of the target data block, executes an erasing operation corresponding to a target step indicated by the target erasing instruction on the target data block, and records the target data block after the erasing operation in a target data block list. The plurality of data block lists include a first data block list for recording data blocks without erasing operation and at least one second data block list for recording data blocks after one or more steps of erasing operation. Thus, the embodiment of the present application can record different erasing steps of data blocks in different data block lists, and issue and execute different next step instructions for data blocks in different erasing steps, so as to realize step-by-step erasing of data blocks, so that the storage device can execute high-priority data access operation after the erasing operation of a certain step is executed, reduce the time delay of data access while ensuring the reliability of the erasing operation, and improve the overall performance of the storage device.
[0101] Figure 5 is a schematic diagram of the storage device of the embodiment of the present application. As shown in Figure 5 The storage device 5 of the embodiment of the present application includes a controller 51 and a storage medium 52. The storage medium 52 includes a plurality of data blocks for storing data. The controller 51 manages the erasing operation of the data blocks in the storage medium 52 step by step. Optionally, the controller 51 determines a target data block from a plurality of data block lists, issues a target erasing instruction of the target data block to the storage medium 52 to execute a corresponding erasing operation on the target data block, and records the target data block after the erasing operation in a target data block list. The plurality of data block lists include a first data block list and at least one second data block list, the first data block list is used to record data blocks without erasing operation, and the second data block list is used to record data blocks after one or more steps of erasing operation. The target erasing instruction has a corresponding target step. The target data block list is a second data block list recording the completion of the erasing operation of the target step. If the target step is the last step of erasing operation, the target data block list is a second data block list for recording idle data blocks.
[0102] In an optional implementation, the controller 51 queries the execution state of the storage medium 52, and executes the received data operation request in response to the execution state being completed. The instruction type corresponding to the data operation request can be a write operation or a read operation, or other data access mode, which is not limited in the embodiment.
[0103] Further, the execution state of the storage medium 52 can be stored in a state register (not shown in the figure) arranged inside the storage medium 52. The controller 51 can also query the execution state of the storage medium 52 from the corresponding state register. The execution state of the storage medium 52 is switched when starting to execute the target erasing instruction or when executing the check of the erasing operation corresponding to the target step. The check of the erasing operation is used to determine whether the target data block reaches the expected erasing state. Optionally, the control state register switches the execution state to the busy state when the storage medium 52 starts to execute the target erasing instruction, and switches the execution state to the execution completion state when executing the check of the erasing operation corresponding to the target step.
[0104] Further, the state register of the embodiment can also be used to record the execution result of the storage medium 52. The execution result includes erasing success and erasing failure, and the execution result is updated after executing the check of the erasing operation corresponding to the target step. Further, if the target data block reaches the expected erasing state after executing the target step, the execution result is erasing success, otherwise, the execution result is erasing failure. In another optional implementation, the embodiment can also use a register other than the state register to store the execution result, and the embodiment is not limited thereto.
[0105] Further, the controller 51 is also used to query the execution result of the target data block. After the last step of the erasing operation of the target data block is executed, if the corresponding execution result is erasing success, the target data block is recorded to the data block list corresponding to the idle state data block, and if the erasing failure, the target data block is recorded to the bad block list or recorded to the first data list to make the target data block execute the erasing operation again.
[0106] It should be noted that the product described above can execute the method provided by the embodiment of the present application, has the corresponding function modules and beneficial effects of the execution method, and the technical details not described in the embodiment can be referred to the method provided by the embodiment of the present application.
[0107] The storage device of the embodiment of the present application determines a target data block from a plurality of data block lists, and issues a target erasing instruction of the target data block to perform an erasing operation corresponding to a target step indicated by the target erasing instruction on the target data block, and records the target data block after the erasing operation in a target data block list, wherein the plurality of data block lists include a first data block list for recording data blocks without performing erasing operation and at least one second data block list for recording data blocks performing one or more steps of erasing operation. Thus, the embodiment of the present application can record different erasing steps of data blocks in each data block list, and then issue and perform different next step instructions for data blocks in different erasing steps, so as to realize step-by-step erasing of data blocks, so that the storage device can perform high-priority data access operation after performing the erasing operation of a certain step, and reduce the time delay of data access. Meanwhile, since the erasing operation of each step of the data block is independent, after the execution state of each erasing step is fed back, the high-priority data access operation is performed, and the reliability of the data block erasing is not affected, that is, the storage device of the embodiment can reduce the time delay of data access while ensuring the reliability of the data block erasing operation. Furthermore, the embodiment actively manages the erasing of the data block in steps by the controller, and further improves the data response efficiency.
[0108] Figure 6 is a schematic diagram of a data block erasing device of the storage device of the embodiment of the present application. As shown in Figure 6 the data block erasing device 6 of the storage device of the embodiment of the present application includes a determining unit 61, an instruction issuing unit 62 and an updating unit 63.
[0109] The determining unit 61 is configured to determine a target data block from a plurality of data block lists, the plurality of data block lists including a first data block list and at least one second data block list, the first data block list being used for recording data blocks without performing erasing operation, and the second data block list being used for recording data blocks performing one or more steps of erasing operation. The instruction issuing unit 62 is configured to issue a target erasing instruction of the target data block to perform a corresponding erasing operation on the target data block, the target erasing instruction having a corresponding target step. The updating unit 63 is configured to record the target data block after the erasing operation in a target data block list, the target data block list being a second data block list recording the erasing operation of the target step. Optionally, the target step is the last step of erasing operation, and the target data block list is a second data block list for recording idle data blocks.
[0110] In an optional implementation, the erasing apparatus 6 further comprises a first querying unit configured to query an execution state, and in response to the execution state being execution completion, execute a received data operation request, the data operation request corresponding to an instruction type of a write operation or a read operation.
[0111] In an optional implementation, the first querying unit is further configured to query the execution state from a corresponding state register, the execution state being switched when starting to execute the target erasing instruction or a verification of an erasing operation corresponding to the target step, the verification of the erasing operation being used to determine whether the target data block reaches an expected erasing state.
[0112] In an optional implementation, the determining unit 61 is further configured to determine a data block list to be erased according to a number of data blocks in each of the data block lists, and determine the target data block from the data block list to be erased.
[0113] In an optional implementation, the erasing apparatus 6 further comprises a second querying unit configured to query an execution result of the target data block, the execution result including erasing success and erasing failure, the execution result being updated after a verification of an erasing operation corresponding to the target step.
[0114] The storage device of the embodiment of the present application determines a target data block from a plurality of data block lists, and issues a target erasing instruction of the target data block, executes an erasing operation corresponding to a target step indicated by the target erasing instruction on the target data block, and records the target data block after executing the erasing operation in a target data block list, wherein the plurality of data block lists include a first data block list used to record data blocks not executing an erasing operation and at least one second data block list used to record data blocks executing one or more steps of erasing operation. Thus, the embodiment of the present application can record different erasing steps of data blocks through each data block list, and then issue and execute different next step instructions for data blocks in different erasing steps, thereby realizing step-by-step erasing of data blocks, so that the storage device can execute a high-priority data access operation after executing an erasing operation of a certain step, thereby reducing the time delay of data access. Meanwhile, since the erasing operation of each step of the data block is independent, after feeding back an execution state of execution completion in each erasing step, the high-priority data access operation is executed, which does not affect the reliability of data block erasing, that is, the storage device of the embodiment can ensure the reliability of data block erasing operation while reducing the time delay of data access. Furthermore, the embodiment actively manages the erasing of data blocks in steps through the controller, thereby further improving the data response efficiency.
[0115] Another embodiment of the present application relates to a non-volatile storage medium for storing a computer readable program for causing a computer to execute some or all of the above-mentioned method embodiments.
[0116] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned method embodiments can be completed by a program instructing relevant hardware, the program being stored in a storage medium and including a plurality of instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the method described in the embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media capable of storing program codes.
[0117] The above merely provides preferred embodiments of the present application but is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for erasing data blocks in a storage device, characterized in that, The method includes: The target data block is determined from multiple data block lists, which include a first data block list and multiple second data block lists. The first data block list is used to record data blocks that have not been erased. The multiple second data block lists are used to record data blocks that have been erased in one or more steps. Each erase operation has a corresponding erase duration or number of erase pulses. A target erase instruction for the target data block is issued to perform a corresponding erase operation on the target data block, and the target erase instruction has a corresponding target step; The target data block that has completed the erasure operation is recorded in the target data block list, which is a second data block list that records the erasure operation that has completed the target step. Determining the target data block from multiple data block lists includes: Select a predetermined number of target data blocks from the list of data blocks with the most data blocks; or Select a predetermined number of target data blocks from the list of data blocks corresponding to the previous erase operation in the list of data blocks with the fewest data blocks; or Calculate the difference in the number of data blocks between each data block list and the corresponding data block list for the next erasure operation, and determine a predetermined number of target data blocks from the data block list corresponding to the largest difference; The storage device includes a storage medium, the execution state of the storage medium is recorded through a status register, and the method further includes: After the verification of the target step is triggered, the execution status in the status register is updated from busy to completed. In response to receiving a data operation request and finding that the execution status of the storage medium is complete, the data operation request is executed.
2. The method according to claim 1, characterized in that, The instruction type corresponding to the data operation request is either a write operation or a read operation.
3. The method according to claim 2, characterized in that, The query execution status includes: The execution status is queried from the corresponding status register. The execution status is switched when the target erase instruction is started or when the erase operation corresponding to the target step is checked. The check of the erase operation is used to determine whether the target data block has reached the expected erase state.
4. The method according to claim 1, characterized in that, Determining the target data block from a list of multiple data blocks includes: The list of data blocks to be erased is determined based on the number of data blocks in each of the aforementioned data block lists; The target data block is determined from the list of data blocks to be erased.
5. The method according to claim 1, characterized in that, The target step is the final erase operation, and the target data block list is a second data block list used to record free data blocks.
6. The method according to claim 1, characterized in that, The method further includes: The execution result of the target data block is queried. The execution result includes erase success and erase failure. The execution result is updated after the erase operation corresponding to the target step is verified.
7. A storage device, characterized in that, The storage device includes: A storage medium, the storage medium comprising a plurality of data blocks for storing data; A controller for performing the method as described in any one of claims 1-6.
8. The storage device according to claim 7, characterized in that, The storage medium has a corresponding status register, which is used to store the execution status and / or execution result of the erasure operation of the data block in the storage medium.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-6.
10. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Memory system performing multi-step erase operation based on stored metadata
US20140226404A1