CN114360628B - Flash memory detection method and device - Google Patents

Flash memory detection method and device Download PDF

Info

Publication number
CN114360628B
CN114360628B CN202210215475.7A CN202210215475A CN114360628B CN 114360628 B CN114360628 B CN 114360628B CN 202210215475 A CN202210215475 A CN 202210215475A CN 114360628 B CN114360628 B CN 114360628B
Authority
CN
China
Prior art keywords
scanning
area
scanned
data
flash memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210215475.7A
Other languages
Chinese (zh)
Other versions
CN114360628A (en
Inventor
段小康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Alibaba China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202210215475.7A priority Critical patent/CN114360628B/en
Publication of CN114360628A publication Critical patent/CN114360628A/en
Application granted granted Critical
Publication of CN114360628B publication Critical patent/CN114360628B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Read Only Memory (AREA)

Abstract

An embodiment of the present specification provides a method and an apparatus for detecting a flash memory, where the method for detecting a flash memory includes: determining an area to be scanned of a flash memory; determining a word line to be scanned in the region, and scanning the word line; according to the scheme, the word lines to be scanned are selected from the regions to be scanned for scanning, so that the scanning of all the regions to be scanned is avoided, and the scanning time is shortened.

Description

Flash memory detection method and device
Technical Field
The embodiment of the specification relates to the technical field of data storage, in particular to a flash memory detection method.
Background
NAND FLASH is also continuously updated as computer technology advances, however, the threshold voltage of NAND FLASH is also continuously changed with temperature, which results in an increased probability of data reading errors when data reading is performed using the default voltage value. Therefore, a simple and reliable method is needed to solve the above problems.
Disclosure of Invention
In view of this, embodiments of the present disclosure provide a method for detecting a flash memory. One or more embodiments of the present disclosure also relate to a flash memory detection apparatus, a computing device, a computer-readable storage medium, and a computer program, so as to solve the technical deficiencies of the prior art.
According to a first aspect of embodiments of the present specification, there is provided a method for detecting a flash memory, including:
determining an area to be scanned of a flash memory;
determining a word line to be scanned in the region, and scanning the word line;
and determining an error correction unit corresponding to the word line according to the scanning processing result, and determining a reference voltage by using the error correction unit.
Optionally, before the step of determining the area to be scanned of the flash memory is executed, the method includes:
presetting scanning duration corresponding to a scanning area of the flash memory;
dividing the scanning area into a plurality of areas to be scanned;
and determining the sub-scanning duration corresponding to each to-be-scanned area according to the scanning duration, wherein the sub-scanning duration is used for determining the scanning starting time of each to-be-scanned area.
Optionally, the method further comprises:
detecting whether a read operation exists in a host;
entering the step of determining an area to be scanned of the flash memory in case of detecting that there is a read operation;
in the event that the presence of a read operation is not detected, a sleep state is entered.
Optionally, after the step of determining the area to be scanned of the flash memory is executed, the method includes:
in the process of scanning area by area, judging the data attribute in the current area;
determining a word line to be scanned in the current area and performing scanning processing on the word line under the condition that the data attribute is thermal data;
and under the condition that the data attribute is cold data, skipping the current area and entering the next area for scanning.
Optionally, after determining the reference voltage by using the error correction unit, the method further includes:
reading data of the region based on the reference voltage;
in the event of the data read error, the data is read using a default voltage.
Optionally, the method further comprises:
updating remark information of an error correction unit in the area according to the reading result of the data in each scanning process of the flash memory, wherein the flash memory corresponds to a plurality of scanning processes;
and in each scanning process of the flash memory, taking the remark information as reference information for selecting an error correction unit.
Optionally, the updating, according to the reading result of the data, the remark information of the error correction unit in the area includes:
updating the state parameter of the area according to the reading result of the data, wherein the state parameter is used for recording the data reading error times of the area;
and under the condition that the state parameter reaches a preset parameter threshold value, marking the remark information by the error correction unit corresponding to the reference voltage.
Optionally, when the state parameter reaches a preset parameter threshold, labeling the remark information with the error correction unit corresponding to the reference voltage includes:
and if the marking times of the error correction unit reach a preset marking threshold value, setting the remark information as information which represents non-selectable.
According to a second aspect of embodiments herein, there is provided a detection apparatus of a flash memory, including:
a determination module configured to determine an area of the flash memory to be scanned;
the scanning module is configured to determine word lines to be scanned in the area and perform scanning processing on the word lines;
and the processing module is configured to determine an error correction unit corresponding to the word line according to the scanning processing result and determine a reference voltage by using the error correction unit.
According to a third aspect of embodiments herein, there is provided a computing device comprising:
a memory and a processor;
the memory is used for storing computer-executable instructions, and the processor is used for executing the computer-executable instructions, and the computer-executable instructions realize the steps of the detection method of the flash memory when being executed by the processor.
According to a fourth aspect of embodiments herein, there is provided a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the above-described method for detecting a flash memory.
According to a fifth aspect of embodiments herein, there is provided a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the method for detecting a flash memory described above.
One embodiment of the present description is implemented by determining an area of a flash memory to be scanned; determining a word line to be scanned in the determined area to be scanned, and scanning the determined word line; and determining an error correction unit corresponding to the word line according to the scanning processing result, and determining the reference voltage by using the error correction unit, wherein the selected word line in the region to be scanned is scanned, so that the scanning of the whole region to be scanned is avoided, the scanning range is reduced, the scanning time is shortened, the reference voltage is determined by using the error correction unit, the data is read by using the reference voltage subsequently, and the accuracy of data reading is improved.
Drawings
Fig. 1 is a flowchart of a method for detecting a flash memory according to an embodiment of the present disclosure;
FIG. 2 is a diagram illustrating a method for detecting a flash memory according to an embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating a processing procedure of a method for detecting a flash memory according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a detection apparatus for a flash memory according to an embodiment of the present disclosure;
fig. 5 is a block diagram of a computing device according to an embodiment of the present disclosure.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present description. This description may be implemented in many ways other than those specifically set forth herein, and those skilled in the art will appreciate that the present description is susceptible to similar generalizations without departing from the scope of the description, and thus is not limited to the specific implementations disclosed below.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It will be understood that, although the terms first, second, etc. may be used herein in one or more embodiments to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first can also be referred to as a second and, similarly, a second can also be referred to as a first without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
First, the noun terms to which one or more embodiments of the present specification relate are explained.
FLASH MEMORY (FLASH MEMORY), a form of electrically erasable programmable read-only MEMORY, allows MEMORY to be erased or written multiple times in operation. The technology is mainly used for general data storage and data exchange and transmission between a computer and other digital products, such as a memory card and a U disk, and is divided according to the grain type of a flash memory, namely an SLC flash memory, an MLC flash memory, a TLC flash memory and a QLC flash memory. SLC flash stores 1 data per cell; the MLC flash stores 2 data per cell; each unit of the TLC flash memory stores 3 data; QLC flash stores 4 data per cell.
NAND FLASH, NAND FLASH is a non-volatile memory technology that can retain data even after power is removed. Is a better storage device than a hard disk drive and is especially apparent in low capacity applications not exceeding 4 GB.
The FTL refers to a Flash Translation Layer, and is a core managed by NAND FLASH, and is used for completing the Translation from a logical address to a physical address, recovering useless data, and maintaining wear balance.
The scanning process is a continuous searching action, and global or local scanning is performed on a specific target according to a certain sequence, so as to obtain a scanning result.
And an error correction unit for correcting a unit of erroneous data generated during the transmission or storage of the data.
The reference voltage, which may also be referred to as a threshold voltage, is used for reading data and generally refers to an input voltage corresponding to a midpoint of a transition region where an output voltage in a transfer characteristic curve sharply changes with a change in the input voltage.
In the present specification, a method for detecting a flash memory is provided, and the present specification relates to a device for detecting a flash memory, a computing apparatus, and a computer-readable storage medium, which are described in detail in the following embodiments one by one.
Fig. 1 shows a flowchart of a method for detecting a flash memory according to an embodiment of the present disclosure, which specifically includes the following steps.
Step S102: an area of the flash memory to be scanned is determined.
The flash memory is a type of electrically erasable programmable read-only memory, which allows multiple erasing or writing operations, and the flash memory mentioned in this embodiment is mainly a NAND flash memory, i.e., NAND FLASH; the region to be scanned is a scannable region formed by a plurality of Word lines in NAND FLASH, the Word lines are Word lines, the Word lines form Word Line groups, the Word Line groups are Word Line groups, and each Word Line group comprises at least two Word lines; a Word Line contains one or several pages, i.e., pages, for storing data. The size of each Page is typically 16KB, which is the smallest unit of read and write operations that can be performed in flash memory. That is, if 512 bytes of data need to be read, the entire Page containing the 512 bytes of data must be read out at the flash level. The following flash memory structures such as word lines, pages, word line groups, etc. all use english expression.
Based on this, a flash memory to be scanned is determined, because the flash memory is composed of a plurality of memory cells according to a certain organization structure, the memory cells are represented by cells, the cells are the minimum working unit of the flash memory, and perform a task of data storage, a Page is composed of the plurality of cell cells in the flash memory, a Word Line is composed of the plurality of pages, and a Word Line group is composed of the plurality of Word lines, when the flash memory is scanned, the flash memory needs to be scanned in a partition manner, and an area range of the minimum unit to be scanned, that is, an area to be scanned, is determined.
Further, before the flash memory is scanned, considering that the flash memory has more Word lines, the Word lines form multiple Word Line groups, so that before the flash memory is scanned, the flash memory can be orderly scanned so as not to affect the normal read-write operation of the host, and therefore, the scanning time is preset, the flash memory is reasonably divided into multiple areas to be scanned, and the scanning time corresponding to each area to be scanned is determined, which is specifically realized as follows:
presetting scanning duration corresponding to a scanning area of the flash memory; dividing the scanning area into a plurality of areas to be scanned; and determining the sub-scanning duration corresponding to each area to be scanned according to the scanning duration, wherein the sub-scanning duration is used for determining the scanning start time of each area to be scanned.
The scanning duration refers to the time required for completing scanning of all Word Line groups, and can be set by technicians according to experience, for example, the scanning duration is set to be 24 hours or 16 hours, and when the scanning duration is set, the stability of the flash memory needs to be considered, and performance indexes, namely, the continuous reading and writing and the random reading and writing capability cannot be influenced; the sub-scanning duration refers to the scanning duration which is allocated to each area to be scanned by dividing the scanning duration according to the number of the areas to be scanned.
Based on this, according to the scanning area of the flash memory, the scanning time length required by one-time complete scanning of the scanning area is determined, then the scanning area is divided, the scanning area is divided into a plurality of areas to be scanned, namely a plurality of Word Line groups, the sub-scanning time length corresponding to each area to be scanned is distributed to each area to be scanned according to the determined scanning time length, the scanning operation of each area to be scanned is completed within the sub-scanning time length corresponding to the area to be scanned, and each area to be scanned is sequentially scanned until each area to be scanned is completed.
In a specific application, when NAND FLASH is scanned, the scanning time and the size of the area to be scanned are set first, the average consumed time of each area to be scanned is calculated, and the areas to be scanned are scanned sequentially. The schematic diagram shown in fig. 2 shows the organizational structure of the QLC in NAND FLASH. A logic unit (die) which is the smallest independent unit capable of executing the command and reporting the self state; a page (page) is the minimum unit capable of being read and written in the flash memory, and one page comprises a plurality of cells (cells); the cell is the minimum work unit and performs the task of data storage. Pages 0-3 in die-0 constitute a Word Line (Word Line), and pages 0-3 corresponding to die-0 to die-n constitute a super Word Line (super Word Line 0); one Word Line group is formed by one or more super Word lines, and one Word Line group is an area to be scanned. When the scanning task is initialized, the scanning time is set firstly. When the size of the Word Line group is set, that is, how many super Word lines are included in one Word Line group, the scanning time and the number of the super Word lines included in one Word Line group can be flexibly set in consideration of the performance indexes such as the stability of the NAND, the continuous reading and writing capability, the random reading and writing capability and the like. If the scanning time is to be shortened, the number of super Word lines contained in one Word Line group is increased. If the scanning time which does not affect the performance index setting is 24 hours, and the NAND stable time is 16 hours, the number of super Word lines contained in each Word Line group is increased when the Word Line groups are divided.
In summary, by dividing the scan area for the flash memory, each divided area to be scanned is scanned in a fixed time interval, and the size of the area to be scanned can be flexibly adjusted, so that the stability of the flash memory can be improved as much as possible, and the influence on the performance of continuous reading and writing, random reading and writing, and the like of the host during the scan operation can be reduced.
Further, after the scanning time is set and the area to be scanned is determined, the scanning process may be started, before scanning the area to be scanned, the operation state of the host computer is also detected so as not to affect the write operation of the host computer, and if it is detected that the host computer is always performing the write operation, the scanning cannot be started, which is specifically implemented as follows:
detecting whether a read operation exists in a host; entering the step of determining an area to be scanned of the flash memory in case of detecting that there is a read operation; in the event that the presence of a read operation is not detected, a sleep state is entered.
The read operation and the write operation are two corresponding operations, the read operation refers to accessing or reading an original file or data, and the write operation refers to adding or writing a new file or data. In the computer, the data in the memory is transmitted to the hard disk of the computer to be write operation, and the data on the hard disk is transmitted to the memory of the computer to be read operation; the sleep state refers to a state of stopping scanning, and in this embodiment, if it is detected that the host is always performing a write operation and not performing a read operation, the host is always in the sleep state, and only when it is detected that the host has a read operation, scanning is performed on an area to be scanned.
Based on the method, the scanning area and the scanning duration of the flash memory are set, the sub-scanning duration distributed to each area to be scanned is set, the read-write state of the host is detected immediately before the scanning operation is started, whether the read operation exists in the host currently is detected, the area to be scanned is determined under the condition that the read operation exists, the sub-scanning duration corresponding to the area to be scanned is obtained, and the area is scanned within the sub-scanning duration range; and under the condition that the existence of the read operation is not detected, entering a dormant state, not starting the scanning operation, and not starting the scanning until the existence of the read operation in the host is detected.
In summary, before starting scanning, the read-write state of the host is judged, and if the host always performs write operation, scanning is not started, so that the influence on the performance of the host is reduced, the stability of the flash memory is integrated to set scanning time, and the effectiveness and the accuracy of a scanning result are improved.
Further, after the area to be scanned is determined, the data attribute corresponding to the data in the area to be scanned needs to be determined, if the area to be scanned is hot data, the area to be scanned may be scanned, and if the area to be scanned is cold data, the current area does not need to be scanned, which is specifically implemented as follows:
in the process of scanning area by area, judging the data attribute in the current area; determining a word line to be scanned in the current area and performing scanning processing on the word line under the condition that the data attribute is thermal data; and under the condition that the data attribute is cold data, skipping the current area and entering the next area for scanning.
The data attribute refers to a data type corresponding to data in an area to be scanned, the data type comprises cold data and hot data, and the hot data refers to online data frequently accessed by a computing node; the cold data refers to data which are accessed infrequently or with low access frequency in an off-line manner, such as enterprise backup data, business and operation log data, statistical data and the like; the Word Line, is made up of multiple pages.
Based on this, in the process of scanning each area to be scanned, after the first area to be scanned is determined, the data attribute corresponding to the data stored in the current area is judged, and if the data attribute of the data which needs to be scanned is thermal data, the current area can be directly scanned; if the data attribute of the data which needs to be scanned currently is cold data, the current area does not need to be scanned, the current area is skipped over, the next area to be scanned is selected, the data attribute of the data in the area is continuously judged, if the data is hot data, the area is scanned, if the data is cold data, the area does not need to be scanned, the next area to be scanned is continuously selected for scanning operation, the operation is repeated until all the areas to be scanned are operated, namely, one round of scanning operation is completed on the flash memory.
For example, when full-disk scanning is performed, before scanning is started, the read-write operation state of the host is judged, if the host is always performing write operation, the scanning process is not started, if it is detected that the host performs read operation, scanning is started, one Word Line group which is already divided is selected, the data attribute of data in the Word Line group which needs to be scanned currently is determined through a table for recording cold data and hot data in the FTL, if the data is hot data, the current Word Line group is scanned, if the data is cold data, the next Word Line group is determined, cold data and hot data are judged, so that whether scanning is performed or not is determined, and until all the Word Line groups are judged and scanned, one round of scanning is finished.
In conclusion, the data attribute is judged before scanning, and only the area to be scanned, in which the hot data is stored, is scanned, so that the waste of resources is avoided. Because the cold data is updated less frequently and the hot data is updated more frequently, when the host computer performs a read operation, the host computer needs to scan the data read by the read operation in order to improve the accuracy of the data read by the read operation, and the cold data is not scanned if the probability of being read is lower, so that the utilization rate of resources is improved.
Step S104: and determining a word line to be scanned in the area, and scanning the word line.
The Word lines to be scanned are the Word lines to be scanned, each Word Line includes one or more pages, for example: QLC contains 4 pages, TLC contains 3 pages, MLC contains 2 pages, SLC contains 1 page; the scanning process is a continuous search operation, and performs global or local scanning on a specific target according to a certain sequence, so as to obtain a scanning result.
Based on this, when it is determined that the data stored in the region to be scanned is thermal data, the scanning process of the region to be scanned is started, a sample, that is, a word line, in the region to be scanned is determined, and the scanning process is performed on the determined word line, which can represent the determined region to be scanned as a sample. In addition, the samples may be minimized, that is, after a word line corresponding to an area to be scanned is selected, an error correction unit corresponding to a page in the word line is selected as a sample, wherein the error correction unit refers to a unit for correcting erroneous data generated during transferring or storing data.
For example, when the Word Line group to be scanned is determined, and the thermal data is determined to be stored in the Word Line group, and the thermal data is scanned, one Word Line is determined as a sample from a plurality of Word lines in the Word Line group, and then the scanning process is continued on the Word Line.
Step S106: and determining an error correction unit corresponding to the word line according to the scanning processing result, and determining a reference voltage by using the error correction unit.
The scanning processing result refers to error correction units corresponding to pages contained in the word lines, which are determined after the word lines are scanned; the error correction unit refers to a unit for correcting erroneous data generated during transmission or storage of data; the reference voltage may also be referred to as a threshold voltage, and is used for reading data, and generally refers to an input voltage corresponding to a midpoint of a transition region where an output voltage in a transmission characteristic curve changes sharply with an input voltage, reading data according to the threshold voltage, and determining whether a sample can be continuously used by recording the number of times of reading errors of the data, thereby determining the threshold voltage with a smaller number of times of reading errors.
Based on this, after the area to be scanned is scanned, that is, word lines in the area to be scanned are scanned to determine word lines, error correction units are selected from the word lines according to the determined word lines, the error correction unit corresponding to each page is determined for each page included in the word lines, the selected error correction unit is used as a sample corresponding to the area to be scanned, and reference voltage is determined according to the sample error correction unit, so that data reading is performed subsequently by using the obtained reference voltage as a parameter of default read data.
After the error correction unit is determined, the change of electrons is judged by reading bare data, and the change of electrons can be represented by '0' and '1', so that the voltage corresponding to the wave valley value is determined, the voltage corresponding to the wave valley value is the reference voltage or the threshold voltage, and the data reading accuracy can be improved by using the reference voltage to read the data.
Further, after the reference voltage is determined, data reading can be performed based on the reference voltage, the controller determines an error condition of the data reading, and if a data reading error occurs, the data reading is performed by using a default voltage value, which is specifically implemented as follows:
reading data of the region based on the reference voltage; in the event of the data read error, the data is read using a default voltage.
The controller in the flash memory judges whether a data reading error occurs, when the data is read by using a reference voltage, once the data reading error is detected, the data which is read by the error is re-read by using a default voltage, wherein the default voltage is a preset voltage value used for reading the data in the flash memory, but due to the influence of factors such as temperature, the error rate of data reading is increased when the data is read by using the preset default voltage, and therefore, the reference voltage is preferentially used when the data is read.
Based on this, after the reference voltage is determined, the reference voltage can be used for reading data of the corresponding area to be scanned, when the data are read, the corresponding controller in the flash memory detects the data reading result, if the data reading error is detected, the reference voltage is determined to be incapable of accurately reading the data, the default voltage corresponding to the flash memory is used for reading the data of the area again, and meanwhile, the number of times of the data reading error of the default voltage is recorded, and the default voltage corresponds to a sample corresponding to the area to be scanned, namely the word line and the error correction unit.
The accuracy of the reference voltage is judged by judging the error condition of data reading, the data is re-read by using the default voltage once the data reading error occurs, the number of times of the data reading error is recorded, the reliability of the selected sample is measured, and the accuracy of the data reading is improved.
Further, when data reading is performed on an area to be scanned by using a reference voltage, recording is performed each time a data reading error occurs, after scanning of an area is completed, whether a word line and an error correction unit corresponding to the area are marked is determined according to a data reading error condition, so that a reference message is provided for selection of the word line when the area is subsequently scanned, and the specific implementation is as follows:
in each scanning process of the flash memory, updating remark information of an error correction unit in the area according to the reading result of the data, wherein the flash memory corresponds to a plurality of scanning processes; and in each scanning process of the flash memory, taking the remark information as reference information for selecting an error correction unit.
In this embodiment, the remark information is that when data reading is performed on a region to be scanned by using a reference voltage, and the number of times of data reading errors is greater than half of the number of times of data reading performed on the region to be scanned, remarking is performed on a sample, such as a word line or an error correction unit, corresponding to the current reference voltage, and is used to indicate that when data reading is performed by selecting the word line or the error correction unit as the reference voltage determined by the sample, the probability of data reading errors is relatively high; the reference information is information for assisting in research or understanding, and in this embodiment, the reference information may be information that can be used as a reference condition when a sample such as a word line corresponding to an area to be scanned is determined by scanning the area to be scanned, and after the word line is remarked, when a reference voltage determined when the word line is used as a sample of the area to be scanned is used for reading data, a data reading error may occur, but the word line may still be selected as a sample.
After one scanning operation is completed for each area of the flash memory to be scanned, one round of scanning is completed. Therefore, the process of one scanning round at least comprises the following steps: determining an area to be scanned of the flash memory, determining a word line to be scanned in the area, scanning the word line, determining an error correction unit corresponding to the word line according to a scanning result, and determining a reference voltage by using the error correction unit. Correspondingly, because factors such as temperature and the like are not constant, the flash memory can be scanned for multiple times, when one time of scanning is finished, the next time of scanning can be started immediately, the scanning time can be reset, the scanning area can be divided again, and the flash memory can be continuously scanned.
Based on this, when data reading is performed on the area corresponding to the reference voltage, the result of each data reading, namely the error condition of the data reading is recorded, when the number of data reading errors of one area is greater than half of the number of data reading operations performed on the area, the remark information corresponding to the error correction unit in the area is updated, the remark information indicates that the error correction unit serves as the sample error correction unit corresponding to the area, and when data reading is performed by using the reference voltage corresponding to the area, the number of data reading errors is large. When the flash memory is scanned for the next round and the error correction unit is selected as a sample, the remark information corresponding to the error correction unit is used as reference information, and if the remark information of the error correction unit is updated once, the error correction unit can also be selected as a sample error correction unit.
In summary, after each wheel scans the flash memory, the number of data reading errors is recorded when the reference voltage is used to read data from the corresponding area, and the error correction unit is remarked, so that the device information can be used as reference information to select the sample error correction unit in the next scanning, the error correction unit which is easy to have data reading errors is prevented from being selected for many times, the number of times of sample selection errors is reduced, and the effectiveness of sample selection and the accuracy of scanning are improved.
Furthermore, considering that a region to be scanned includes a plurality of word lines, when data reading is performed, data reading needs to be performed on each error correction unit of each word line, so that multiple data reading needs to be performed on one region, after each data reading is completed, it is necessary to determine whether the data reading is in error or not, and record the number of times of data reading errors occurring in the region, and when the number of times of errors reaches a threshold, labeling the corresponding error correction unit, specifically implemented as follows:
updating the state parameter of the area according to the reading result of the data, wherein the state parameter is used for recording the data reading error times of the area; and under the condition that the state parameter reaches a preset parameter threshold value, marking the remark information by the error correction unit corresponding to the reference voltage.
The state parameter is a numerical value initial state parameter used for representing the number of times of data reading errors and is 0, the state parameter is added with 1 when one data reading error occurs, each area to be scanned corresponds to one state parameter and is used for recording the number of times of data reading errors caused by data reading operation performed in the area; the parameter threshold refers to a critical value or a highest value of the corresponding status parameter, and is determined by the number of error correction units included in the area to be scanned, and the parameter threshold is generally set to be half of the number of error correction units included in the area, such as: if the number of error correction units included in the area to be scanned is 100, the parameter threshold may be set to 50, and when the number of data reading errors in the area is greater than 50, the error correction units are marked, that is, the sample position is remarked; the marking refers to marking and recording remark information of the error correction unit, and is used for indicating that when the error correction unit is used as a sample of the area, the number of data reading errors is large, and the mark can be referred to when the sample is selected in the next scanning, so as to determine whether to select the error correction unit as the sample again.
Based on this, a corresponding parameter threshold is preset for a region to be scanned, when a reference voltage is used to read data of the region to be scanned corresponding to the region to be scanned, the number of times of data reading errors is recorded, a state parameter is updated once when the data reading errors occur, the state parameter is updated continuously when the data reading is continuously performed, the value of the state parameter is compared with the preset parameter threshold, when the value of the state parameter is greater than the parameter threshold, the number of times of sending the data reading errors is excessive, the error correction unit corresponding to the reference voltage is labeled for the first time, when the error correction unit is labeled again, the error correction unit is not selected as a sample any more when the region to be scanned is scanned for the next time, but the error correction unit is skipped, and other error correction units are selected as samples.
In summary, after each wheel scans the flash memory, the reference voltage is used to read data from the corresponding area, and the status parameter is updated when a data reading error occurs, so as to determine the validity of the error correction unit, reduce the number of times of sample selection errors, and improve the validity of sample selection and the accuracy of scanning.
Furthermore, when the number of times of marking of the error correction unit reaches the parameter threshold, the remark information of the error correction unit is set in consideration of the effectiveness of selection of the error correction unit, and the error correction unit cannot be selected when scanning is performed next time, which is specifically realized as follows:
and if the marking times of the error correction unit reach a preset marking threshold value, setting the remark information as information which represents non-selectable.
The information indicating non-selectable refers to information set for remark information of the error correction unit, and is used for indicating that when the word line is scanned and the error correction unit is selected, the error correction unit corresponding to the remark information set to indicate non-selectable cannot be selected, the error correction unit is directly skipped, and other error correction units are selected.
Based on this, each round of scanning is performed on the flash memory, and for each to-be-scanned area of the flash memory, if data reading is performed, when the value of the state parameter is greater than the parameter threshold value, it indicates that the number of times of sending data reading errors is excessive, the error correction unit corresponding to the reference voltage is labeled for the first time, and in the subsequent scanning and data reading processes of the flash memory, if the number of times of labeling of the same error correction unit reaches a fixed number, the remark information corresponding to the error correction unit is set to represent non-selectable information, and the error correction unit cannot be selected as a sample in the subsequent scanning process.
As shown in fig. 2, after selecting the Word Line0 corresponding to die-0 in the Word Line group0 to be scanned, the error correction unit, i.e., CW, corresponding to each page in the Word Line0 is selected. CW0 corresponding to pages 0-3 respectively, when bare data is read, not starting the selected four error correction units CW0, so as to determine a threshold voltage, using the threshold voltage to read the data, in the process of reading the data in the Word Line group, judging whether a data reading error occurs by a controller, finding that one error is recorded once, and using a default value to read the data of the position where the error occurs again, when one Word Line group contains 100 CWs, when the number of times of the data reading error exceeds 50 times, remarking CW0 corresponding to pages 0-3 respectively, when the next scanning still selects CW0 corresponding to pages 0-3 respectively as a sample, the number of times of the data reading error still exceeds 50 times, remarking for the second time, in the subsequent scanning process, CW0 corresponding to pages 0-3 respectively can not be selected as a sample again, this sample is skipped and the other CWs are selected as samples.
In summary, in one embodiment of the present disclosure, a word line and an error correction unit are selected as samples to determine a reference voltage, so that the samples are minimized, and the samples are collected through multiple scans each time, thereby reducing an error rate of data reading and shortening a scanning time. The stability of the flash memory and the read-write performance of the flash memory are considered fully while background scanning is carried out, the influence on the normal work of the flash memory is reduced while the determination of the reference voltage change is completed, and in addition, the scanning time is flexibly set by adjusting the size of the area to be scanned.
The following description will further describe the detection method of the flash memory by taking an application of the detection method of the flash memory provided in this specification to reading data using a threshold voltage as an example with reference to fig. 3. Fig. 3 shows a flowchart of a processing procedure of a method for detecting a flash memory according to an embodiment of the present specification, which specifically includes the following steps.
Step S302: and starting the first scanning round, initializing the flash memory, and setting scanning time to divide the area to be scanned.
During initialization, the scanning time for full-disk scanning of the flash memory is set, and the full disk is divided into a plurality of areas to be scanned.
Step S304: and judging whether the background scanning is started, if so, executing step S306, and if not, executing step S308.
And judging whether the host meets the condition of starting scanning, if the host carries out write operation all the time, not starting scanning, and if the host carries out read operation, starting scanning.
Step S306: the area to be scanned is selected.
And selecting one area from the plurality of areas to be scanned obtained by division, and scanning.
Step S308: entering a sleep state.
If the host computer carries out the write operation all the time, scanning is not started, and the host computer enters a dormant state.
Step S310: and judging whether the data attribute in the area is thermal data, if so, executing step S312, and if not, executing step S306.
And if the cold data is stored in the selected area, reselecting a plurality of areas to be scanned, selecting another area, continuing to judge, and judging that the data stored in the area is the data attribute.
Step S312: samples are selected in the region.
And selecting the word line in the region, and determining a sample error correction unit corresponding to the word line.
Step S314: the threshold voltage is determined from the selected samples.
And utilizing an error correction unit to read data to determine the threshold voltage.
Step S316: data reading is performed using the threshold voltage.
The data stored in the regions are respectively read using the threshold voltages.
Step S318: and in the case of data reading errors, reading data by using a default voltage, and recording the number of errors.
Step S320: it is determined whether the number of errors exceeds the error threshold, and if so, step S322 is performed.
And determining an error threshold according to the data reading times of the data stored in the area, and if the error times exceed the threshold, marking the selected sample.
Step S322: the sample was first noted.
Step S324: and judging whether the selected sample is remarked for the second time in the new scanning cycle, and if so, executing the step S326.
Step S326: and skipping the samples which are remarked twice when the samples are selected in the next scanning round, and selecting other samples.
One embodiment of the present description is implemented by determining an area of a flash memory to be scanned; determining a word line to be scanned in the determined area to be scanned, and scanning the determined word line; and determining an error correction unit corresponding to the word line according to the scanning processing result, and determining the reference voltage by using the error correction unit, wherein the selected word line in the region to be scanned is scanned, so that the scanning of the whole region to be scanned is avoided, the scanning range is reduced, the scanning time is shortened, the reference voltage is determined by using the error correction unit, the data is read by using the reference voltage subsequently, and the accuracy of data reading is improved.
Corresponding to the above method embodiment, the present specification further provides an embodiment of a detection apparatus for a flash memory, and fig. 4 shows a schematic structural diagram of a detection apparatus for a flash memory provided in an embodiment of the present specification. As shown in fig. 4, the apparatus includes:
a determining module 402 configured to determine an area of the flash memory to be scanned;
a scanning module 404 configured to determine a word line to be scanned in the region and perform a scanning process on the word line;
and a processing module 406 configured to determine an error correction unit corresponding to the word line according to the scan processing result, and determine the reference voltage by using the error correction unit.
The determining module 402, further configured to:
presetting scanning duration corresponding to a scanning area of the flash memory;
dividing the scanning area into a plurality of areas to be scanned;
and determining the sub-scanning duration corresponding to each to-be-scanned area according to the scanning duration, wherein the sub-scanning duration is used for determining the scanning starting time of each to-be-scanned area.
The determining module 402, further configured to:
detecting whether a read operation exists in a host;
entering the step of determining an area to be scanned of the flash memory in case of detecting that there is a read operation;
in the event that the presence of a read operation is not detected, a sleep state is entered.
The determining module 402, further configured to:
in the process of scanning area by area, judging the data attribute in the current area;
determining a word line to be scanned in the current area and performing scanning processing on the word line under the condition that the data attribute is thermal data;
and under the condition that the data attribute is cold data, skipping the current area and entering the next area for scanning.
The processing module 406 is further configured to:
reading data of the region based on the reference voltage;
in the event of the data read error, the data is read using a default voltage.
The processing module 406 is further configured to:
updating remark information of an error correction unit in the area according to the reading result of the data in each scanning process of the flash memory, wherein the flash memory corresponds to a plurality of scanning processes;
and in each scanning process of the flash memory, taking the remark information as reference information for selecting an error correction unit.
The processing module 406 is further configured to:
updating the state parameter of the area according to the reading result of the data, wherein the state parameter is used for recording the data reading error times of the area;
and under the condition that the state parameter reaches a preset parameter threshold value, marking the remark information by the error correction unit corresponding to the reference voltage.
The processing module 406 is further configured to:
and if the marking times of the error correction unit reach a preset marking threshold value, setting the remark information as information which represents non-selectable.
The above is a schematic scheme of a detection apparatus for a flash memory according to this embodiment. It should be noted that the technical solution of the detection apparatus for a flash memory belongs to the same concept as the technical solution of the detection method for a flash memory described above, and details of the technical solution of the detection apparatus for a flash memory, which are not described in detail, can be referred to the description of the technical solution of the detection method for a flash memory described above.
FIG. 5 illustrates a block diagram of a computing device 500 provided in accordance with one embodiment of the present description. The components of the computing device 500 include, but are not limited to, a memory 510 and a processor 520. Processor 520 is coupled to memory 510 via bus 530, and database 550 is used to store data.
Computing device 500 also includes access device 540, access device 540 enabling computing device 500 to communicate via one or more networks 560. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. The access device 540 may include one or more of any type of network interface (e.g., a Network Interface Card (NIC)) whether wired or wireless, such as an IEEE802.11 wireless local area network (WordLineAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present description, the above-described components of computing device 500, as well as other components not shown in FIG. 5, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 5 is for purposes of example only and is not limiting as to the scope of the present description. Those skilled in the art may add or replace other components as desired.
Computing device 500 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smartphone), wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 500 may also be a mobile or stationary server.
The processor 520 is configured to execute computer-executable instructions, and the computer-executable instructions, when executed by the processor, implement the steps of the above-mentioned flash memory detection method.
The above is an illustrative scheme of a computing device of the present embodiment. It should be noted that the technical solution of the computing device and the technical solution of the above-mentioned flash memory detection method belong to the same concept, and details that are not described in detail in the technical solution of the computing device can be referred to the description of the technical solution of the above-mentioned flash memory detection method.
An embodiment of the present specification further provides a computer-readable storage medium, which stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the method for detecting a flash memory are implemented.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the above-mentioned flash memory detection method belong to the same concept, and details that are not described in detail in the technical solution of the storage medium can be referred to the description of the technical solution of the above-mentioned flash memory detection method.
An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the method for detecting a flash memory.
The above is an illustrative scheme of a computer program of the present embodiment. It should be noted that the technical solution of the computer program and the technical solution of the above-mentioned flash memory detection method belong to the same concept, and details that are not described in detail in the technical solution of the computer program can be referred to the description of the technical solution of the above-mentioned flash memory detection method.
The foregoing description of specific embodiments has been presented for purposes of illustration and description. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The computer instructions comprise computer program code which may be in the form of source code, object code, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that, for the sake of simplicity, the foregoing method embodiments are described as a series of acts, but those skilled in the art should understand that the present embodiment is not limited by the described acts, because some steps may be performed in other sequences or simultaneously according to the present embodiment. Further, those skilled in the art should also appreciate that the embodiments described in this specification are preferred embodiments and that acts and modules referred to are not necessarily required for an embodiment of the specification.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present specification disclosed above are intended only to aid in the description of the specification. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the embodiments and the practical application, and to thereby enable others skilled in the art to best understand the specification and utilize the specification. The specification is limited only by the claims and their full scope and equivalents.

Claims (10)

1. A method for detecting a flash memory includes:
detecting whether a read operation exists in a host;
determining an area of the flash memory to be scanned in the event that a read operation is detected to be present;
entering a sleep state if no read operation is detected;
determining a word line to be scanned in the region, and scanning the word line;
and determining an error correction unit corresponding to the word line according to the scanning processing result, and determining a reference voltage by using the error correction unit.
2. The method of claim 1, the determining the region of the flash memory to be scanned step being preceded by:
presetting scanning duration corresponding to a scanning area of the flash memory;
dividing the scanning area into a plurality of areas to be scanned;
and determining the sub-scanning duration corresponding to each to-be-scanned area according to the scanning duration, wherein the sub-scanning duration is used for determining the scanning starting time of each to-be-scanned area.
3. The method of claim 2, after the step of determining the area of the flash memory to be scanned is performed, comprising:
in the process of scanning area by area, judging the data attribute in the current area;
determining a word line to be scanned in the current area and performing scanning processing on the word line under the condition that the data attribute is thermal data;
and under the condition that the data attribute is cold data, skipping the current area and entering the next area for scanning.
4. The method of claim 1, after determining the reference voltage with the error correction unit, further comprising:
reading data of the region based on the reference voltage;
in the event of the data read error, the data is read using a default voltage.
5. The method of claim 4, further comprising:
updating remark information of an error correction unit in the area according to the reading result of the data in each scanning process of the flash memory, wherein the flash memory corresponds to a plurality of scanning processes;
and in each scanning process of the flash memory, taking the remark information as reference information for selecting an error correction unit.
6. The method according to claim 5, wherein updating remark information of the error correction unit in the area according to the reading result of the data comprises:
updating the state parameter of the area according to the reading result of the data, wherein the state parameter is used for recording the data reading error times of the area;
and under the condition that the state parameter reaches a preset parameter threshold value, marking the remark information by the error correction unit corresponding to the reference voltage.
7. The method according to claim 6, wherein the labeling of the remark information on the error correction unit corresponding to the reference voltage when the state parameter reaches a preset parameter threshold includes:
and if the marking times of the error correction unit reach a preset marking threshold value, setting the remark information as information which represents non-selectable.
8. A flash memory detection apparatus, comprising:
the determining module is used for detecting whether the host has read operation; configured to determine an area of the flash memory to be scanned if the presence of a read operation is detected; entering a sleep state if no read operation is detected;
the scanning module is configured to determine word lines to be scanned in the area and perform scanning processing on the word lines;
and the processing module is configured to determine an error correction unit corresponding to the word line according to the scanning processing result and determine a reference voltage by using the error correction unit.
9. A computing device, comprising:
a memory and a processor;
the memory is configured to store computer-executable instructions and the processor is configured to execute the computer-executable instructions, which when executed by the processor implement the steps of the method for detecting a flash memory according to any one of claims 1 to 7.
10. A computer-readable storage medium storing computer-executable instructions which, when executed by a processor, implement the steps of the method of detecting a flash memory of any one of claims 1 to 7.
CN202210215475.7A 2022-03-07 2022-03-07 Flash memory detection method and device Active CN114360628B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210215475.7A CN114360628B (en) 2022-03-07 2022-03-07 Flash memory detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210215475.7A CN114360628B (en) 2022-03-07 2022-03-07 Flash memory detection method and device

Publications (2)

Publication Number Publication Date
CN114360628A CN114360628A (en) 2022-04-15
CN114360628B true CN114360628B (en) 2022-08-16

Family

ID=81094563

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210215475.7A Active CN114360628B (en) 2022-03-07 2022-03-07 Flash memory detection method and device

Country Status (1)

Country Link
CN (1) CN114360628B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115454710B (en) * 2022-11-10 2023-03-24 珠海妙存科技有限公司 Flash memory data reading method and device, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104282339A (en) * 2013-07-08 2015-01-14 群联电子股份有限公司 Read voltage setting method, control circuit and memory storage device

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7954037B2 (en) * 2005-10-25 2011-05-31 Sandisk Il Ltd Method for recovering from errors in flash memory
JP4791912B2 (en) * 2006-08-31 2011-10-12 株式会社東芝 Nonvolatile semiconductor memory device and nonvolatile memory system
CN101794622B (en) * 2010-02-10 2012-12-12 华为数字技术(成都)有限公司 Data scanning method and device for storage device
TWI523025B (en) * 2013-12-27 2016-02-21 慧榮科技股份有限公司 Data storage device and error correction method thereof
KR102578153B1 (en) * 2016-08-25 2023-09-14 에스케이하이닉스 주식회사 Memory system and operating method of the memory system
JP6674361B2 (en) * 2016-09-29 2020-04-01 キオクシア株式会社 Memory system
US10340016B2 (en) * 2017-06-26 2019-07-02 Micron Technology, Inc. Methods of error-based read disturb mitigation and memory devices utilizing the same
KR20200067848A (en) * 2017-09-30 2020-06-12 마이크론 테크놀로지, 인크. Priority idle time reading scan
US10811091B2 (en) * 2018-10-12 2020-10-20 Western Digital Technologies, Inc. Adaptive processing for read threshold voltage calibration
US11367488B2 (en) * 2018-12-11 2022-06-21 SK Hynix Inc. Memory system and method for read operation based on grouping of word lines
KR20200076403A (en) * 2018-12-19 2020-06-29 에스케이하이닉스 주식회사 Semiconductor memory device, controller, storage device having the same, and operating method thereof
KR20200118989A (en) * 2019-04-09 2020-10-19 에스케이하이닉스 주식회사 Memory system, memory controller and operating method of thereof

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104282339A (en) * 2013-07-08 2015-01-14 群联电子股份有限公司 Read voltage setting method, control circuit and memory storage device

Also Published As

Publication number Publication date
CN114360628A (en) 2022-04-15

Similar Documents

Publication Publication Date Title
CN103425597B (en) The block management method of data memory device and flash memory
EP2200045A1 (en) Method of updating contents of a multibit flash memory
US20110202709A1 (en) Optimizing storage of common patterns in flash memory
US8732385B2 (en) Non-volatile memory, controller controlling next access
CN101369463B (en) Flash memory detection classification method
US20070081401A1 (en) Apparatus for controlling flash memory and method thereof
CN101706822B (en) Method and device for improving speed of mounting journal file system
US20040246779A1 (en) Non-volatile storage device and control method thereof
CN114360628B (en) Flash memory detection method and device
CN114327258B (en) Solid state disk processing method, system, equipment and computer storage medium
US8762685B2 (en) Data writing method, memory controller and memory storage apparatus
CN112347001B (en) Verification method and device for flash memory garbage collection and electronic equipment
CN114287031A (en) Operations in memory
CN109343800B (en) Storage device management method and device and readable storage medium
CN109243517B (en) Searching method for NAND Flash bad block and solid state disk
CN106021124B (en) A kind of storage method and storage system of data
CN111356094B (en) SIM short message processing method and device
CN114625321A (en) Data writing method and device
CN113448771A (en) Memory controller and data processing method
CN116185309B (en) Data processing method and data storage device
CN113419674B (en) Data programming management method, memory and controller thereof, and computer system
CN111596859B (en) Data storage device and data processing method
KR100688463B1 (en) Method for writing and erasing data of physical memory
JPH11259359A (en) One-time rom access method
CN112765048B (en) Solid state disk garbage recycling method and system, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: Room 554, 5 / F, building 3, 969 Wenyi West Road, Wuchang Street, Yuhang District, Hangzhou City, Zhejiang Province

Applicant after: Alibaba (China) Co.,Ltd.

Address before: 310052 room 508, 5th floor, building 4, No. 699 Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant before: Alibaba (China) Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant