Test method, device, terminal and storage medium

By converting storage modes in flash memory particles and combining block and page units testing methods, the problems of testing efficiency and capacity loss in the prior art are solved, and fast and low-loss flash memory tests are realized, ensuring the maximum flash memory capacity and Improved reading and writing test efficiency.

CN114360619BActive Publication Date: 2025-01-14HOSIN GLOBAL ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111677793.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2025-01-14
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

The prior art cannot take into account both the test efficiency and capacity loss when testing flash particles, resulting in reducing the overall capacity of flash particles or reducing the read and write test efficiency in the presence of many bad blocks.

Method used

By converting the storage medium into a single-layer storage mode, reading and writing tests are used to identify bad blocks in units of blocks, converting bad blocks into page units based on bad block identification, finding bad pages, and specifically locating the damaged points in multi-layer storage mode. Achieve fast and low loss read and write tests.

Benefits of technology

Reduce the wear of flash memory in single-layer storage mode, speed up testing speed, ensure maximum flash memory capacity, and improve read and write test efficiency, reducing capacity loss caused by bad block identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114360619B_ABST
    Figure CN114360619B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for testing a storage medium, comprising: converting the storage medium into a single-layer storage mode; performing a read / write test on the storage medium in units of blocks, and marking a bad block with a bad block identifier; performing a read / write test in units of pages based on the bad block identifier, and marking a bad page with a first bad page identifier; converting the storage medium into a multi-layer storage mode; determining a single-layer storage bad page in the single-layer storage mode based on the first bad page identifier, and determining a target multi-layer storage page corresponding to the single-layer storage bad page in the multi-layer storage mode; performing a read / write test on the target multi-layer storage page in units of pages, and marking a multi-layer storage bad page in the target multi-layer storage page with a second bad page identifier. The present invention also discloses a testing device, a terminal, and a storage medium. The present invention can reduce the capacity loss caused by marking bad blocks while improving the efficiency of read / write tests.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of testing technology, and in particular to a testing method, device, terminal and storage medium. Background Art

[0002] Flash memory particles may be damaged during the production process and need to be tested. The existing terminal tests include the following two types: testing flash memory particles in blocks, which can be more consistent with the erase and write rules of flash memory and easily implement various operations on flash memory particles. However, if there are many bad blocks, the overall capacity of the flash memory particles will be greatly reduced.

[0003] Testing the flash memory particles in units of pages can completely identify and mark specific bad pages, thereby maximizing the flash memory capacity, but it reduces the efficiency of reading and writing tests on the flash memory. Summary of the invention

[0004] The main purpose of the present invention is to provide a testing method, device, terminal, and computer-readable storage medium, aiming to solve the problem that the prior art cannot take into account both testing efficiency and capacity loss during testing.

[0005] To achieve the above object, the present invention provides a testing method, which comprises:

[0006] Converting the storage medium into a single-layer storage mode;

[0007] Performing a read and write test on the storage medium in units of blocks, and marking bad blocks with bad block marks;

[0008] Based on the bad block identification, a read and write test is performed in units of pages, and a first bad page identification is given to the bad page;

[0009] Converting the storage medium into a multi-layer storage mode;

[0010] Determine a single-layer storage bad page in the single-layer storage mode based on the first bad page identifier, and determine a target multi-layer storage page corresponding to the single-layer storage bad page in the multi-layer storage mode;

[0011] The target multi-layer storage page is subjected to a read and write test in units of pages, and a second bad page mark is provided for a multi-layer storage bad page in the target multi-layer storage page.

[0012] Optionally, after the step of performing a read and write test on the target multi-layer storage page in units of pages and marking a second bad page mark for a multi-layer storage bad page in the target multi-layer storage page, the step further includes:

[0013] Determine a target word line where the multi-layer storage bad page is located based on the second bad page identifier;

[0014] Pages other than the multi-layer storage bad pages on the target word line are marked with weak page marks.

[0015] Optionally, after the step of determining the target word line where the multi-layer storage bad page is located based on the second bad page identifier, the step further includes:

[0016] determining an adjacent word line of the target word line;

[0017] A weak page mark is applied to pages on the adjacent word line except for the multi-layer storage bad page.

[0018] Optionally, the step of performing a read / write test on the storage medium in units of blocks and marking bad blocks includes:

[0019] Establish a mapping block table sub-table;

[0020] The step of performing a read / write test on the storage medium in units of blocks and marking bad blocks comprises:

[0021] Reading in the mapping block table sub-tables one by one;

[0022] Each time a mapping block table sub-table is read in, a read / write test is performed on the storage medium in units of blocks based on the read mapping block table sub-table, and a bad block mark is marked.

[0023] Optionally, the step of performing a read / write test in units of pages based on the bad block identifier and marking a first bad page identifier for a bad page includes:

[0024] Establish mapping page table sub-table;

[0025] The step of performing a read / write test in units of pages based on the bad block identifier and marking a first bad page identifier for the bad page comprises:

[0026] Reading a mapping page table sub-table corresponding to the bad block based on the bad block identifier;

[0027] Each time the mapping page table sub-table is read in, a read / write test is performed on a page-by-page basis based on the bad block identifier and the read mapping page table sub-table, and a first bad page identifier is assigned to the bad page.

[0028] Optionally, the performing a read / write test on the storage medium in units of blocks and marking bad blocks includes:

[0029] Establishing a mapping block table, wherein each logical block in the mapping block table maps to a physical block;

[0030] Perform read and write tests in blocks;

[0031] Adding a bad block identifier in the mapping block table according to the block test result;

[0032] The reading and writing test is performed in units of pages based on the bad block identification, and the first bad page identification for the bad page identification includes:

[0033] Establishing a mapping page table, wherein each logical page in the mapping page table maps to a physical page;

[0034] Taking pages as units, read and write tests are performed on pages in the bad blocks marked with bad block identifiers;

[0035] A first bad page identifier is added to the logical page corresponding to the bad page in the bad block in the mapping page table.

[0036] Optionally, the testing method further comprises:

[0037] Replace the existing mapping table with the new one.

[0038] To achieve the above object, the present invention further provides a testing device, the testing device comprising:

[0039] A first conversion module, used to convert the storage medium into a single-layer storage mode;

[0040] A block test module, used to perform a read and write test on the storage medium in units of blocks, and mark bad blocks with bad block marks;

[0041] A first page test module, used for performing a read / write test in units of pages based on the bad block identifier, and marking a first bad page identifier for the bad page;

[0042] A second conversion module, used to convert the storage medium into a multi-layer storage mode;

[0043] a determination module, configured to determine a single-layer storage bad page in a single-layer storage mode based on the first bad page identifier, and determine a target multi-layer storage page corresponding to the single-layer storage bad page in a multi-layer storage mode;

[0044] The second page test module is used to perform a read and write test on the target multi-layer storage page in units of pages, and mark a second bad page mark for a multi-layer storage bad page in the target multi-layer storage page.

[0045] In addition, to achieve the above-mentioned purpose, the present invention also provides a test terminal, which includes a memory and a processor, wherein a test program is stored in the memory, and when the test program is executed by the processor, the steps of the test method described above are implemented.

[0046] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a test program is stored, and when the test program is executed by a processor, the steps of the test method described above are implemented.

[0047] Compared with the prior art, the test method, device, terminal and computer-readable storage medium provided by the present invention have the following beneficial effects: by first converting the storage medium into a single-layer storage mode, then performing a read-write test on the storage medium in units of blocks, marking a bad block with a bad block mark, performing a read-write test in units of pages based on the bad block mark, marking a bad page with a first bad page mark, the threshold voltage required to be controlled in the single-layer storage mode is less, the time consumed for reading and writing is short, and the erase and write life of the flash memory particles in the single-layer storage mode is longer. At this time, the read-write test on the block or page can reduce the wear on the flash memory and speed up the test. Then, the storage medium is converted into a multi-layer storage mode, and then the single-layer storage bad page in the single-layer storage mode is determined based on the first bad page mark, and the target multi-layer storage page corresponding to the single-layer storage bad page in the multi-layer storage mode is determined. Finally, the target multi-layer storage page is read-write tested in units of pages, and the multi-layer storage bad page in the target multi-layer storage page is marked with a second bad page mark. Perform read and write tests in single-layer storage mode to find the location of the problematic page, and then use multi-layer storage mode to specifically locate the damage point in the physical bad page. On the one hand, it can perform fast and low-loss read and write tests, and on the other hand, it can ensure the maximization of flash memory capacity, while improving the efficiency of read and write tests and reducing the capacity loss caused by identifying bad blocks. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 It is a schematic diagram of the system structure of the hardware operating environment involved in the embodiment of the present invention;

[0049] Figure 2 A schematic diagram of a flow chart of an embodiment of a testing method of the present invention;

[0050] Figure 3 This is a diagram showing an example structure of a flash memory particle according to an embodiment of the present invention;

[0051] Figure 4 An exemplary diagram of the relationship between word lines and bit lines in an embodiment of the present invention;

[0052] Figure 5 This is an example diagram of the relationship between the amount of stored data and the voltage of a storage unit in an embodiment of the present invention;

[0053] Figure 6 This is an example diagram of a mapping block representation in an embodiment of the present invention;

[0054] Figure 7 This is an example diagram of a mapping page table in a single-layer storage mode in an embodiment of the present invention;

[0055] Figure 8 This is an example diagram of a mapping page table in a multi-layer storage mode in an embodiment of the present invention;

[0056] Fig. 9This is a flow chart of another embodiment of the testing method of the present invention;

[0057] Fig.10 Schematic diagram of the three-dimensional structure of word lines and bit lines in an embodiment of the present invention;

[0058] Fig.11 This is an example diagram of identifying weak pages in a mapping page table in an embodiment of the present invention;

[0059] Fig.12 This is a flow chart of another embodiment of the testing method of the present invention;

[0060] Fig.13 A schematic diagram of a flow chart of another embodiment of the testing method of the present invention;

[0061] Fig.14 FIG. 4 is a flow chart of another embodiment of the testing method of the present invention. DETAILED DESCRIPTION

[0062] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0063] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0064] In the prior art, testing flash memory particles in blocks can be more consistent with the erase and write rules of flash memory and easily implement various operations on flash memory particles. However, if there are many bad blocks, the overall capacity of the flash memory particles will be greatly reduced.

[0065] Testing the flash memory particles in units of pages can completely identify and mark specific bad pages, thereby maximizing the flash memory capacity, but it reduces the efficiency of reading and writing tests on the flash memory.

[0066] In order to solve the above technical problems, the present invention provides a testing method. In the method, the storage medium is first converted into a single-layer storage mode, and then a read-write test is performed on the storage medium in units of blocks, a bad block identifier is marked, and a read-write test is performed in units of pages based on the bad block identifier, and a first bad page identifier is marked for the bad page. Then, the storage medium is converted into a multi-layer storage mode, and then a single-layer storage bad page in the single-layer storage mode is determined based on the first bad page identifier, and a target multi-layer storage page corresponding to the single-layer storage bad page in the multi-layer storage mode is determined. Finally, a read-write test is performed on the target multi-layer storage page in units of pages, and a second bad page identifier is marked for the multi-layer storage bad page in the target multi-layer storage page, so that a read-write test is performed in the single-layer storage mode to find the location of the page with the problem, and then the damage point in the physical bad page is specifically located through the multi-layer storage mode. On the one hand, a fast and low-loss read-write test can be performed, and on the other hand, the flash memory capacity can be maximized, and the capacity loss caused by identifying bad blocks can be reduced while improving the efficiency of read-write tests.

[0067] like Figure 1 As shown, Figure 1 It is a schematic diagram of the system structure of the hardware operating environment involved in the embodiment of the present invention.

[0068] The terminal of the embodiment of the present invention can be a terminal device with computing capability, or a PC, or a smart phone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a portable computer, or other mobile terminal devices with display capabilities.

[0069] like Figure 1 As shown, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0070] Optionally, the terminal may also include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like. Among them, sensors include light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display screen according to the brightness of the ambient light, and the proximity sensor may turn off the display screen and / or backlight when the mobile terminal is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile terminal (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; of course, the mobile terminal may also be equipped with other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which will not be repeated here.

[0071] Those skilled in the art will understand that Figure 1 The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0072] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module and a test program.

[0073] exist Figure 1 In the terminal shown, the network interface 1004 is mainly used to connect to the backend server and perform data communication with the backend server; the user interface 1003 is mainly used to connect to the client (user end) and perform data communication with the client; and the processor 1001 can be used to call the test program stored in the memory 1005 and perform the following operations:

[0074] Converting the storage medium into a single-layer storage mode;

[0075] Performing a read and write test on the storage medium in units of blocks, and marking bad blocks with bad block marks;

[0076] Based on the bad block identification, a read and write test is performed in units of pages, and a first bad page identification is given to the bad page;

[0077] Converting the storage medium into a multi-layer storage mode;

[0078] Determine a single-layer storage bad page in the single-layer storage mode based on the first bad page identifier, and determine a target multi-layer storage page corresponding to the single-layer storage bad page in the multi-layer storage mode;

[0079] The target multi-layer storage page is subjected to a read and write test in units of pages, and a second bad page mark is provided for a multi-layer storage bad page in the target multi-layer storage page.

[0080] Further, the processor 1001 may call the test program stored in the memory 1005, and also perform the following operations:

[0081] Determine a target word line where the multi-layer storage bad page is located based on the second bad page identifier;

[0082] Pages other than the multi-layer storage bad pages on the target word line are marked with weak page marks.

[0083] Further, the processor 1001 may call the test program stored in the memory 1005, and also perform the following operations:

[0084] determining an adjacent word line of the target word line;

[0085] A weak page mark is applied to pages on the adjacent word line except for the multi-layer storage bad page.

[0086] Further, the processor 1001 may call the test program stored in the memory 1005, and also perform the following operations:

[0087] Establish a mapping block table sub-table;

[0088] Reading in the mapping block table sub-tables one by one;

[0089] Each time a mapping block table sub-table is read in, a read / write test is performed on the storage medium in units of blocks based on the read mapping block table sub-table, and a bad block mark is marked.

[0090] Further, the processor 1001 may call the test program stored in the memory 1005, and further perform the following operations:

[0091] Establish mapping page table sub-table;

[0092] Reading a mapping page table sub-table corresponding to the bad block based on the bad block identifier;

[0093] Each time the mapping page table sub-table is read in, a read / write test is performed on a page-by-page basis based on the bad block identifier and the read mapping page table sub-table, and a first bad page identifier is assigned to the bad page.

[0094] Further, the processor 1001 may call the test program stored in the memory 1005, and also perform the following operations:

[0095] Establishing a mapping block table, wherein each logical block in the mapping block table maps to a physical block;

[0096] Perform read and write tests in blocks;

[0097] Adding a bad block identifier in the mapping block table according to the block test result;

[0098] Establishing a mapping page table, wherein each logical page in the mapping page table maps to a physical page;

[0099] Taking pages as units, read and write tests are performed on pages in the bad blocks marked with bad block identifiers;

[0100] A first bad page identifier is added to the logical page corresponding to the bad page in the bad block in the mapping page table.

[0101] Further, the processor 1001 may call the test program stored in the memory 1005, and further perform the following operations:

[0102] Replace the existing mapping table with the new one.

[0103] Reference Figure 2 , Figure 2 This is a flow chart of an embodiment of a testing method of the present invention. In some embodiments, the testing method includes:

[0104] Step S10, converting the storage medium into a single-layer storage mode.

[0105] In some embodiments, during testing, the storage medium may be first converted to a single-layer storage mode, and the storage medium may be converted between a single-layer storage mode and a multi-layer storage mode by setting a corresponding voltage. The single-layer storage mode requires fewer threshold voltages to be controlled, and the time spent on reading and writing is short. The storage medium of the present invention refers to a medium having a data storage function, and in the embodiments, the storage medium is described as a flash memory.

[0106] Specifically, Figure 3 and Figure 4 As shown, Figure 3 This is a diagram showing an example structure of a flash memory particle according to an embodiment of the present invention; Figure 4 The figure is an example of the relationship between word lines and bit lines in the embodiment of the present invention. There are several Planes in the flash memory particle, each Plane is composed of multiple Blocks, and each Block is composed of multiple Pages.

[0107] A wordline WL (Wordline) corresponds to one or several Pages, which depends on whether the storage mode of the flash memory is a single-layer storage mode or a multi-layer storage mode. For the single-layer storage mode SLC, one wordline corresponds to one Page; the multi-layer storage mode includes at least a double-layer storage mode (MLC), a triple-layer storage mode (TLC), etc. For the multi-layer storage mode, a wordline in MLC corresponds to 2 Pages (Lower Page and Upper Page), and TLC corresponds to 3 Pages (Lower Page, Middle Page, Upper Page). The size of a Page corresponds to the number of storage cells on the wordline, and also to the number of bitlines BL (Bitline).

[0108] For a storage unit of the same area, a single-layer and a multi-layer storage unit can store different amounts of data, and the amount of data stored in each storage unit leads to different capacities, PE numbers (erase and write times), and read and write times of flash memory particles. The write operation of flash memory is to write electrons into the storage unit, and the read operation is to read the voltage in the storage unit using a reference voltage. Figure 5 As shown, Figure 5 FIG. 1 is an example diagram of the relationship between the amount of stored data and the voltage of a storage unit in an embodiment of the present invention, wherein the horizontal axis represents the threshold voltage and the vertical axis represents the amount of stored data of the storage unit. Figure 5 As shown in a, for SLC, a storage cell stores two states, and it can be considered that the storage cell has two threshold voltages. When the sampled voltage value falls within the range of 1, it is considered to be 1, and when it falls within the range of 0, it is considered to be 0. Figure 5 As shown in b and c in Figure 1, for MLC or TLC, more storage states mean more threshold voltages. The more electrons a storage cell is divided into, the more precise the control of the number of electrons entering is required when writing, so the longer the writing time is; similarly, when reading, it is necessary to try to use different reference voltages to read, which prolongs the reading time to a certain extent. The more electrons written into the storage cell, the easier it is to wear out the material (insulating layer) of the storage cell, causing the threshold voltage bias to produce a read error.

[0109] Step S20, performing a read and write test on the storage medium in units of blocks, and marking bad blocks.

[0110] Based on the above steps, in a single-layer storage mode, the storage medium can be tested in units of blocks. In block-level testing, the original test data can be written into the block, and then the data is read out from the block and compared with the original test data by XOR. The XOR result is used to determine whether the data has errors. If there are errors, it means that the integrity of the data has been destroyed during the data storage process, and the block is a bad block. When a block is determined to be a bad block, a bad block identifier is identified. Generally speaking, a bad block identifier is a pre-set identifier character used to identify a block as a bad block. The identifier character can be stored in a set position in the block to identify the bad block. Of course, the bad block identifiers of all bad blocks can also be stored in the same position.

[0111] In some embodiments, Figure 6 As shown, Figure 6 This is an example diagram of a mapping block table in an embodiment of the present invention. In a single-layer storage mode, a mapping block table can be established, in which each logical block in the block table maps to a physical block. Read and write tests are performed in units of blocks. It can be understood that Figure 6 In order to simply and directly gather the bad blocks in one place, in actual situations, the bad blocks and normal blocks are mixed together in the block table. In some embodiments, the bad blocks and normal blocks can be kept mixed together in the mapping block table; in some embodiments, the mapping block table can also be sorted and updated when all block tests are completed, and the bad blocks can be gathered in one place and separated from the normal blocks.

[0112] In some embodiments, it is also possible not to establish an additional mapping block table, but to directly read the block identification codes one by one to test the blocks. When the test result is a bad block, a bad block identification is added to a preset position in the bad block, thereby implementing the bad block identification step. It is also possible to store the block identification codes of all bad blocks themselves in a unified preset position that is not limited to the bad block itself, and use the block identification code itself as the bad block identification.

[0113] Step S30, performing a read / write test in units of pages based on the bad block identifier, and marking the bad page as a first bad page identifier.

[0114] After completing the block-based test, the blocks with bad test results can be determined. At this time, the blocks with bad test results can be further tested to determine which pages in the bad blocks are bad pages. For blocks with no problems in the block test results, there is no need to repeat the test again, thereby improving the test efficiency. The first bad page mark refers to the bad page mark added by the page test in the single-layer storage mode.

[0115] Specifically, Figure 7 As shown, Figure 7 1 is an example diagram of a mapping page table in a single-layer storage mode in an embodiment of the present invention. In some embodiments, in a single-layer storage mode, a mapping page table 1 is established, that is, Figure 7The mapping page table shown. At this time, the entire flash memory particle is no longer subjected to read and write tests. At this time, according to the bad block identifier in the block table, the read and write tests are performed in the marked bad blocks in sequence with the pages in the mapping page table 1 as units, the bad pages in the bad blocks are found, and the first bad page identifier is added to the corresponding logical page of the mapping page table 1. In the single-layer storage mode, the erase and write life of the flash memory particles is relatively long. At this time, the read and write test of the block or page can reduce the wear on the flash memory and speed up the test.

[0116] In addition, in some embodiments, it is not necessary to establish an additional mapping page table. After the bad block is determined based on the bad block identification, the page identification code in the bad block is used to test each page one by one, and a bad page identification is added to the page whose test result is a bad page. The bad page identification can also be associated with the page identification code in a unified storage location outside the bad page, or the page identification codes of all bad pages can be stored in a unified bad page identification code storage location, thereby completing the first bad page identification of the bad page.

[0117] Step S40, converting the storage medium into a multi-layer storage mode.

[0118] After completing the page test in the single-layer storage mode, the bad page in the single-layer storage mode can be determined and the bad page in the single-layer storage mode can be marked as the first bad page. At this time, it is necessary to determine the page in the multi-layer storage mode corresponding to the bad page in the single-layer storage mode and test it to determine the bad page in the multi-layer storage mode corresponding to the bad page in the single-layer storage mode. Therefore, it is necessary to convert the storage medium from the single-layer storage mode to the multi-layer storage mode.

[0119] Step S50: determining a single-layer storage bad page in the single-layer storage mode based on the first bad page identifier, and determining a target multi-layer storage page corresponding to the single-layer storage bad page in the multi-layer storage mode.

[0120] A single-layer storage bad page refers to a single-layer storage page that fails the test result in the single-layer storage mode and has the first bad page mark added. The target multi-layer storage page refers to the multi-layer storage page corresponding to the single-layer storage bad page in the multi-layer storage mode. The page size in the flash memory chip is generally fixed (can be 4K or 8K or 16K), assuming it is 4K. In the single-layer storage mode, a logical page is associated with a 4K physical page, that is, a logical page is associated with a word line; when converted to the multi-layer storage mode, a physical page becomes 8K or 12K, so a physical page will be associated with two or three logical pages, that is, multiple logical pages share a word line.

[0121] Step S60, performing a read and write test on the target multi-layer storage page in units of pages, and marking a second bad page mark for a multi-layer storage bad page in the target multi-layer storage page.

[0122] Specifically, the second bad page mark refers to the bad page mark added by the page test in the multi-layer storage mode. Figure 8 As shown, Figure 8 This is an example diagram of a mapping page table in a multi-layer storage mode in an embodiment of the present invention. In some embodiments, a mapping page table in a multi-layer storage mode can be established to test in units of pages. In the multi-layer storage mode, according to the first bad page identifier in the mapping page table 1, the marked physical page is found, and the read and write tests are performed in the marked physical page in units of pages in the mapping page table 2 (i.e., the mapping page table in the multi-layer storage mode), the bad page in the multi-layer storage mode is found, and the bad page identifier is added to the corresponding logical page of the mapping page table 2. When the flash memory is reading and writing, when it is detected that there is a bad page mark in the logical page in the page table, the physical address corresponding to the page will be skipped, and the next page will be read and written directly. In the single-layer storage mode, a read and write test is performed to find the location of the page with the problem, and then the damage point in the physical bad page is specifically located through the multi-layer storage mode. On the one hand, a fast and low-loss read and write test can be performed, and on the other hand, the flash memory capacity can be maximized. In some embodiments, the test method of the present invention can also include step S70, replacing the existing mapping table with a newly created mapping table. Specifically, in the above test process, after establishing the mapping table and marking the bad blocks / pages, the previous table can be hidden or deleted, and only one mapping table can be used to replace the original mapping block / page table with the latest established mapping block / page table, thereby reducing the number of mapping tables and avoiding affecting the storage capacity. The subsequent mapping table has more complete and comprehensive mapping information, which facilitates the management of storage space. In the subsequent reading and writing process, only one mapping table needs to be read, which improves the reading and writing speed.

[0123] In the storage medium testing method of the present invention, the storage medium is first converted into a single-layer storage mode, and then the storage medium is subjected to a read-write test in units of blocks, a bad block is marked with a bad block mark, and a read-write test is performed in units of pages based on the bad block mark, and a first bad page mark is marked for the bad page. The threshold voltage required to be controlled in the single-layer storage mode is less, and the time consumed for reading and writing is short. The erasing and writing life of the flash memory particles in the single-layer storage mode is longer. At this time, the read-write test of the block or page can reduce the wear on the flash memory and can speed up the test. Then the storage medium is converted into a multi-layer storage mode, and then the single-layer storage bad page in the single-layer storage mode is determined based on the first bad page mark, and the target multi-layer storage page corresponding to the single-layer storage bad page in the multi-layer storage mode is determined. Finally, the target multi-layer storage page is subjected to a read-write test in units of pages, and a second bad page mark is marked for the multi-layer storage bad page in the target multi-layer storage page. Perform read and write tests in single-layer storage mode to find the location of the problematic page, and then use multi-layer storage mode to specifically locate the damage point in the physical bad page. On the one hand, it can perform fast and low-loss read and write tests, and on the other hand, it can ensure the maximization of flash memory capacity, while improving the efficiency of read and write tests and reducing the capacity loss caused by identifying bad blocks.

[0124] Reference Fig. 9 , Fig. 9 This is a flow chart of another embodiment of the testing method of the present invention. In some embodiments, the process after step S60 includes:

[0125] Step S80, determining a target word line where the multi-layer storage bad page is located based on the second bad page identifier.

[0126] The target word line refers to the word line where each multi-layer storage bad page with the second bad page identifier is located in the multi-layer storage mode. The location of each multi-layer storage bad page can be determined first, and then the word line where each multi-layer storage bad page is located, that is, the target word line, can be determined. When there is one multi-layer storage bad page, or when multiple multi-layer storage bad pages are on the same word line, the corresponding target word line is one; when there are multiple multi-layer storage bad pages and they are distributed on at least two different word lines, there are more than two target word lines.

[0127] Step S90 , marking weak pages on the target word line except for the multi-layer storage bad page.

[0128] Specifically, Fig.10 As shown, Fig.10Schematic diagram of the three-dimensional structure of word lines and bit lines in an embodiment of the present invention. The intersection of bit lines and word lines constitutes a storage unit in a page. The underlying logic of a bad page is the error of a storage unit, which is mainly caused by the wear of the storage unit due to multiple erasing and writing, resulting in errors in the internally stored data. Therefore, when writing data, if the threshold voltage in the flash memory does not change, the storage unit with excessive wear may have electrons escaping when writing data, resulting in data overflow and disturbing the read and write voltage of the storage unit near the storage unit. Therefore, after marking the bad page to ensure capacity, the affected page can be further selected. The affected page is defined as a weak page. The weak page can be read and written normally, but it is more likely to have errors in subsequent data reading and writing than other normal pages. In the multi-layer storage mode, multiple logical pages share a word line, so the page on the same word line as the bad page is classified as a weak page. Therefore, in some embodiments, the page on the target word line except the multi-layer storage bad page can be marked with a weak page identifier. Among them, the weak page identifier refers to the identification character used to identify the above-mentioned weak page.

[0129] In some embodiments, step S80 may further include:

[0130] Step S100, determining adjacent word lines of the target word line;

[0131] Step S110 , marking weak pages on the adjacent word lines except for the multi-layer storage bad pages.

[0132] It can be understood that, on the one hand, multiple logical pages share a word line in the multi-layer storage mode, so the page on the same word line as the bad page is classified as a weak page; on the other hand, the overall flash memory particles exist in three dimensions, so the word lines adjacent to the problematic word line will also be affected, so the pages on the word lines adjacent to the word lines in rows and columns are also classified as weak pages. Therefore, after determining the target word line, the word lines adjacent to the target word line within the spatial range can be determined, that is, the adjacent word lines. There may be multi-layer storage bad pages marked with the second bad page mark on the adjacent word lines, or there may be no multi-layer storage bad pages. The multi-layer storage pages other than the multi-layer storage bad pages on the adjacent word lines can be marked with weak page marks.

[0133] The pages with weak page marks determined by the above test method process do not directly participate in the user's data reading and writing, but are used as spare pages. When the normal page capacity is insufficient or garbage collection is performed, the cold data in the normal page is stored in the weak page. Cold data can be identified using the LFU (Least Frequently Used) algorithm or the LRU (Least recently used) algorithm.

[0134] In some embodiments, Fig.11 As shown, Fig.11This is an example diagram of identifying a weak page in a mapping page table in an embodiment of the present invention. The weak page identifier can be added by establishing a mapping page table, or the weak page identifier can be identified in a mapping page table in an existing multi-layer storage mode.

[0135] In some embodiments, the weak page identifier can also be identified by identifying the weak page identifier at a preset position in the weak page, or by setting an association between the weak page identifier and the page identifier code itself at a unified preset position, or by adding the page identifier code of the weak page to a preset weak page identifier storage position.

[0136] In the above test method, the target word line where the multi-layer storage bad page is located is determined based on the second bad page identification; the pages on the target word line other than the multi-layer storage bad page are identified with a weak page identification. The adjacent word lines of the target word line are determined; the pages on the adjacent word lines other than the multi-layer storage bad page are identified with a weak page identification. In the above manner, without affecting the storage capacity, the pages with defective storage capacity can be identified, and a more comprehensive test result can be obtained, which is convenient for the management of the storage space in the later stage.

[0137] Reference Fig.12 , Fig.12 FIG. 1 is a flow chart of another embodiment of the testing method of the present invention. In some implementations, step S20 includes step S120 before step S20, establishing a sub-table of the mapping block table.

[0138] Mapping block table sub-table refers to establishing a mapping block table based on some blocks. In some implementations, the mapping table will be too large due to too many storage blocks. Therefore, multiple small mapping block tables, i.e., mapping block table sub-tables, can be established. When reading and writing blocks during the test process, the mapping block table sub-tables in the range of the corresponding blocks are written. If there are 0-100 blocks in the flash memory, then establish a mapping block table sub-table for 0-20, a mapping block table sub-table for 21-40, a mapping block table sub-table for 41-60, a mapping block table sub-table for 61-80, and a mapping block table sub-table for 81-100. It can be understood that the mapping block table sub-table can be established during the production process and directly read during the test process, or it can be specially established based on the test requirements when there are test requirements, and then read and tested after establishment.

[0139] Step S20 includes:

[0140] Step S21, reading in the mapping block table sub-tables one by one;

[0141] Step S22: Each time a mapping block table sub-table is read in, a read / write test is performed on the storage medium in units of blocks based on the read mapping block table sub-table, and a bad block mark is marked.

[0142] Based on the above test method, when performing read and write tests in blocks, first read in the mapping block table sub-table corresponding to blocks 0-20, perform read and write tests on blocks 0-20, and identify the bad blocks for the test results of blocks 0-20. After completion, read in the remaining mapping block table sub-tables of other block ranges in turn, and repeat the test process of blocks 0-20.

[0143] Based on the above test method, the bad block identification can be identified for each mapping block table sub-table based on the test result of the mapping block table sub-table, or the bad block identification can be uniformly identified for all blocks. Specifically, in some embodiments, for each mapping block table sub-table, during the test process, a new mapping block table sub-table can be established, and the bad block identification can be added to the new mapping block table sub-table. When the test is completed, the read-in mapping block table sub-table is replaced with the new mapping block table sub-table. In some embodiments, during the test process, only a new mapping block table can be established, and the new mapping block table includes the mapping relationship of all blocks. During the test, when reading each mapping block table sub-table for testing, all bad block identifications are added to the new mapping sub-table. When all mapping block table sub-table tests are completed, all mapping block table sub-tables are replaced with the newly established mapping block table.

[0144] In the above test method, a mapping block table sub-table is established; the mapping block table sub-tables are read one by one; each time a mapping block table sub-table is read, a read and write test is performed on the storage medium in units of blocks based on the read mapping block table sub-table, and a bad block mark is marked. Through the above method, the test can be performed based on the partition, avoiding the influence of the data reading and writing speed due to the excessive volume of the mapping block table, improving the data reading and writing speed, and thus improving the test speed.

[0145] Reference Fig.13 , Fig.13 This is a flow chart of another embodiment of the test method of the present invention. In some embodiments, before step S30, the method includes:

[0146] Step S130, establishing a mapping page table sub-table.

[0147] Mapping page table sub-table refers to establishing a mapping page table based on part of the block or part of the page of the block. Based on the above test method, in order to improve the data reading and writing speed and improve the test efficiency, a mapping page table sub-table can be established in a manner similar to the mapping block table sub-table. When establishing a mapping sub-table, a mapping block table can be used and associated with multiple mapping page table sub-tables, that is, all blocks use a mapping block table, and a mapping page table sub-table is associated with one or more blocks. When reading and writing, the entire mapping block table is read, and then the corresponding page table is read according to the block to be read and written. Of course, in some embodiments, sub-table processing can be performed at the block and page levels at the same time, and a mapping block table sub-table is associated with multiple mapping page table sub-tables.

[0148] Step S30 includes:

[0149] Step S31, reading a mapping page table sub-table corresponding to the bad block based on the bad block identifier;

[0150] Step S32, each time the mapping page table sub-table is read, a read / write test is performed on a page basis based on the bad block identifier and the read mapping page table sub-table, and a first bad page identifier is assigned to the bad page.

[0151] Based on the above test method, after reading in the entire mapping block table or reading in the mapping block table sub-tables one by one to complete the block-level test, the bad block is determined based on the bad block identifier, the mapping page table sub-table corresponding to the bad block is determined, and the mapping page table sub-table corresponding to the bad block is read in. Since a mapping page table sub-table is associated with one or more blocks, the bad block corresponding to the bad block identifier is determined from the mapping page table sub-table, and the page of the bad block is read and written in units of pages, and the page with a bad page as the test result is marked as the first bad page identifier. It can be understood that each bad block can be read and tested once for the mapping page table sub-table, and the same mapping page table sub-table may be read multiple times due to the existence of multiple bad blocks, but each time it is read in, different bad blocks are tested in units of pages.

[0152] In the above test method, a mapping page table sub-table is established; a mapping page table sub-table corresponding to a bad block is read based on the bad block identifier; each time a mapping page table sub-table is read, a read and write test is performed in units of pages based on the bad block identifier and the read mapping page table sub-table, and a first bad page identifier is used for the bad page identifier. In the above manner, a test is performed based on a mapping page table sub-table, thereby avoiding the influence of a large mapping page table volume on the data read and write speed, improving the data read and write speed, and thus improving the test speed.

[0153] Reference Fig.14 , Fig.14 Schematic diagram of another embodiment of the test method of the present invention. In some embodiments, step S20 includes:

[0154] Step S23, establishing a mapping block table, wherein each logical block in the mapping block table maps to a physical block;

[0155] Step S24, performing a read and write test in blocks;

[0156] Step S25, adding a bad block identifier in the mapping block table according to the block test result;

[0157] Step S30 includes:

[0158] Step S33, establishing a mapping page table, wherein each logical page in the mapping page table maps to a physical page;

[0159] Step S34, performing a read and write test on the pages in the bad block identified by the bad block identifier in units of pages;

[0160] Step S35, adding a first bad page identifier to the logical page corresponding to the bad page in the bad block in the mapping page table.

[0161] Specifically, based on the above test method, in a single-layer storage mode, a mapping block table can be established, in which each logical block in the block table maps to a physical block. Read and write tests are performed in units of blocks. In some embodiments, bad blocks and normal blocks can be kept mixed together in the mapping block table; in some embodiments, the mapping block table can also be sorted and updated when all block tests are completed, and the bad blocks can be concentrated in one place and separated from the normal blocks.

[0162] After completing the block-based test, the blocks with bad test results can be determined. At this time, the blocks with bad test results can be further tested to determine which pages in the bad blocks are bad pages. For blocks with no problems in the block test results, there is no need to repeat the test again, thereby improving the test efficiency. The first bad page mark refers to the bad page mark added by the page test in the single-layer storage mode.

[0163] like Figure 7 As shown, in some embodiments, in the single-layer storage mode, a mapping page table 1 is established, that is, Figure 7 The mapping page table shown. At this time, the entire flash memory particle is no longer subjected to read and write tests. At this time, according to the bad block identifier in the block table, the read and write tests are performed in the marked bad blocks in sequence with the pages in the mapping page table 1 as units, the bad pages in the bad blocks are found, and the first bad page identifier is added to the corresponding logical page of the mapping page table 1. In the single-layer storage mode, the erase and write life of the flash memory particles is relatively long. At this time, the read and write test of the block or page can reduce the wear on the flash memory and speed up the test.

[0164] It can be understood that in some embodiments, establishing a mapping block table and / or a mapping page table during the test process can also be expressed in the form of a sub-table, that is, establishing a mapping block table sub-table and / or establishing a mapping page table sub-table, and replacing the original mapping table with the newly established sub-table, wherein the method of establishing the sub-table can refer to the above embodiment and will not be repeated here.

[0165] In the above test method, a mapping block table is established, wherein each logical block in the mapping block table corresponds to a mapping physical block; read and write tests are performed in units of blocks; a mapping page table is established, wherein each logical page in the mapping page table corresponds to a mapping physical page; read and write tests are performed on pages in bad blocks identified with bad block identifiers in units of pages; and a first bad page identifier is added to the logical page corresponding to the bad page in the bad block in the mapping page table. A bad block identifier is added to the mapping block table according to the block test result; in the above manner, by establishing a mapping block table or a mapping page table to perform testing and identification, it is convenient to identify, record and manage bad blocks, and achieve better test result management effects.

[0166] In addition, the invention also provides a testing device.

[0167] The testing device of the present invention comprises:

[0168] A first conversion module, used to convert the storage medium into a single-layer storage mode;

[0169] A block test module, used to perform a read and write test on the storage medium in units of blocks, and mark bad blocks with bad block marks;

[0170] A first page test module, used for performing a read / write test in units of pages based on the bad block identifier, and marking a first bad page identifier for the bad page;

[0171] A second conversion module, used to convert the storage medium into a multi-layer storage mode;

[0172] a determination module, configured to determine a single-layer storage bad page in a single-layer storage mode based on the first bad page identifier, and determine a target multi-layer storage page corresponding to the single-layer storage bad page in a multi-layer storage mode;

[0173] The second page test module is used to perform a read and write test on the target multi-layer storage page in units of pages, and mark a second bad page mark for a multi-layer storage bad page in the target multi-layer storage page.

[0174] The specific implementation of the testing device of the present invention can refer to the various embodiments of the testing method of the present invention, which will not be described in detail here.

[0175] In addition, the present invention also provides a test terminal.

[0176] The test terminal includes a processor and a memory. The memory stores a test program. When the test program is executed by the processor, the steps of the test method described above are implemented.

[0177] Among them, the method implemented when the test program running on the processor is executed can refer to the various embodiments of the test method of the present invention, and will not be repeated here.

[0178] In addition, an embodiment of the present invention further provides a computer-readable storage medium.

[0179] A test program is stored on the computer-readable storage medium of the present invention, and the test program implements the steps of the test method described above when executed by a processor.

[0180] Among them, the method implemented when the test program running on the processor is executed can refer to the various embodiments of the test method of the present invention, and will not be repeated here.

[0181] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0182] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0183] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0184] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for testing a storage medium, characterized in that: The test method includes: Converting the storage medium into a single-layer storage mode; Performing a read and write test on the storage medium in units of blocks, and marking bad blocks with bad block marks; Based on the bad block identification, a read and write test is performed in units of pages, and a first bad page identification is given to the bad page; Converting the storage medium into a multi-layer storage mode; Determine a single-layer storage bad page in the single-layer storage mode based on the first bad page identifier, and determine a target multi-layer storage page corresponding to the single-layer storage bad page in the multi-layer storage mode; The target multi-layer storage page is subjected to a read and write test in units of pages, and a second bad page mark is provided for a multi-layer storage bad page in the target multi-layer storage page.

2. The testing method according to claim 1, characterized in that: After the step of performing a read / write test on the target multi-layer storage page in units of pages and marking a second bad page mark for a multi-layer storage bad page in the target multi-layer storage page, the following steps are further included: Determine a target word line where the multi-layer storage bad page is located based on the second bad page identifier; Pages other than the multi-layer storage bad pages on the target word line are marked with weak page marks.

3. The testing method according to claim 2, characterized in that: After the step of determining the target word line where the multi-layer storage bad page is located based on the second bad page identifier, the step further includes: determining an adjacent word line of the target word line; A weak page mark is applied to pages on the adjacent word line except for the multi-layer storage bad page.

4. The testing method according to claim 1, characterized in that: The step of performing a read / write test on the storage medium in units of blocks and marking bad blocks includes: Establish mapping block table sub-table; The step of performing a read / write test on the storage medium in units of blocks and marking bad blocks comprises: Reading in the mapping block table sub-tables one by one; Each time a mapping block table sub-table is read in, a read / write test is performed on the storage medium in units of blocks based on the read mapping block table sub-table, and a bad block mark is marked.

5. The testing method according to claim 1, characterized in that: The step of performing a read / write test in units of pages based on the bad block identification and marking a first bad page identification for the bad page comprises: Establish mapping page table sub-table; The step of performing a read / write test in units of pages based on the bad block identifier and marking a first bad page identifier for the bad page comprises: Reading a mapping page table sub-table corresponding to the bad block based on the bad block identifier; Each time the mapping page table sub-table is read in, a read / write test is performed on a page-by-page basis based on the bad block identifier and the read mapping page table sub-table, and a first bad page identifier is assigned to the bad page.

6. The testing method according to any one of claims 1 to 5, characterized in that: The reading and writing test of the storage medium is performed in units of blocks, and the bad block identification is performed. The bad block identification includes: Establishing a mapping block table, wherein each logical block in the mapping block table maps to a physical block; Perform read and write tests in blocks; Adding a bad block identifier in the mapping block table according to the block test result; The reading and writing test is performed in units of pages based on the bad block identification, and the first bad page identification for the bad page identification includes: Establishing a mapping page table, wherein each logical page in the mapping page table maps to a physical page; Taking pages as units, read and write tests are performed on pages in the bad blocks marked with bad block identifiers; A first bad page identifier is added to the logical page corresponding to the bad page in the bad block in the mapping page table.

7. The testing method according to claim 6, characterized in that: The test method also includes: Replace the existing mapping table with the new one.

8. A testing device, characterized in that: The testing device comprises: A first conversion module, used to convert the storage medium into a single-layer storage mode; A block test module, used to perform a read and write test on the storage medium in units of blocks, and mark bad blocks with bad block marks; A first page test module, used for performing a read / write test in units of pages based on the bad block identifier, and marking a first bad page identifier for the bad page; A second conversion module, used to convert the storage medium into a multi-layer storage mode; a determination module, configured to determine a single-layer storage bad page in a single-layer storage mode based on the first bad page identifier, and determine a target multi-layer storage page corresponding to the single-layer storage bad page in a multi-layer storage mode; The second page test module is used to perform a read and write test on the target multi-layer storage page in units of pages, and mark a second bad page mark for a multi-layer storage bad page in the target multi-layer storage page.

9. A test terminal, characterized in that: The test terminal includes a memory and a processor. The memory stores a test program. When the test program is executed by the processor, the steps of the test method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a test program, and when the test program is executed by a processor, the steps of the test method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method for generating flash memory identification code

    CN101567218A

  • Flash memory equipment detection method and apparatus thereof

    CN104091617A