Memory storage device detection method and non-transient computer readable recording medium
Patent Information
- Application Number
- CN202410940225.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-07-15
Smart Images

Figure CN118506847B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage technology, and in particular to a detection method for a memory storage device and a non-transient computer-readable recording medium. Background Art
[0002] Digital cameras, mobile phones and MP3s have grown rapidly in the past few years, causing consumers' demand for storage media to increase rapidly. Rewritable non-volatile memory is most suitable for portable electronic products such as notebook computers because of its characteristics of data non-volatility, power saving, small size, no mechanical structure, and fast access speed. Solid-state drives are a type of memory storage device that uses flash memory as storage media. Therefore, the flash memory industry has become a very popular part of the electronics industry in recent years.
[0003] Writing or reading data in the flash memory requires addressing first. Usually, addressing requires 5-6 addressing parameters to be issued and input into the addressing register for decoding. In the address decoding logic, the address and the storage unit are one-to-one corresponding. Once the address decoding logic fails, a large-scale rewrite error will occur, causing the entire flash memory to be discarded.
[0004] In view of this, how to solve or improve the above problems is the goal that those skilled in the art are committed to. Summary of the invention
[0005] The present invention provides a detection method for a memory storage device, which can judge whether there is an error in the addressing process by reading a comparison tuple to see whether the test data in the reference tuple can be read, and can determine the location where the addressing anomaly occurs.
[0006] In an exemplary embodiment of the present invention, a detection method for a memory storage device is provided, wherein the memory storage device includes a rewritable non-volatile memory module, and the rewritable non-volatile memory module includes a plurality of physical tuples. The method includes: selecting a physical tuple as a reference tuple in the physical tuples, determining a plurality of physical addresses according to a physical address of the reference tuple and a plurality of preset address offsets, and using the physical tuples corresponding to the physical addresses as a plurality of comparison tuples; writing test data into the reference tuple; reading a first comparison tuple in the comparison tuple according to a first physical address in the physical address to obtain a first reading result; and judging whether an addressing abnormality occurs according to the first reading result and the test data.
[0007] By reading the reading result and the test data of the comparison tuple, it is determined whether there is an error in the addressing process of the first physical address.
[0008] In an exemplary embodiment of the present invention, the step of determining multiple physical addresses according to the physical address of the reference tuple and multiple preset address offsets includes obtaining a physical address determined according to each preset address offset to determine a difference bit with the physical address of the reference tuple.
[0009] In an exemplary embodiment of the present invention, the step of selecting a physical tuple from a plurality of physical tuples as a reference tuple includes selecting a physical tuple with a smallest physical address from the plurality of physical tuples as the reference tuple.
[0010] By selecting the entity tuple with the smallest entity address as the reference tuple, a larger or maximum range detection of the memory storage device is performed.
[0011] In an exemplary embodiment of the present invention, the method further includes performing an erase operation on the reference metagroup and the comparison metagroup before the step of writing the test data into the reference metagroup.
[0012] By performing the erasing operation on the reference tuple and the comparison tuple, it is possible to avoid the data originally stored in the reference tuple or the comparison tuple affecting the subsequent reading result, thereby affecting the detection result.
[0013] In an exemplary embodiment of the present invention, a physical tuple is selected from a plurality of physical tuples as a reference tuple, and the step of determining a plurality of physical addresses based on a physical address of the reference tuple and a plurality of preset address offsets includes: determining the number of a plurality of preset address offsets based on the number of the plurality of physical tuples; and determining a plurality of physical addresses based on the plurality of preset address offsets so as to sequentially offset the difference bits of the physical address from the reference tuple by one bit at a time.
[0014] In an exemplary embodiment of the present invention, the step of determining whether an addressing abnormality occurs based on a first read result and test data includes: obtaining a difference between the number of bits in the first read result and the number of bits in the same bit state in the test data, and if the difference does not exceed a predetermined threshold, determining that an addressing abnormality occurs.
[0015] Whether there is an error in the addressing process is determined by reading the comparison tuple to see whether the test data in the reference tuple can be read.
[0016] In an exemplary embodiment of the present invention, the method also includes: determining whether the first comparison tuple is the last comparison tuple in the comparison tuple; if the first comparison tuple is not the last comparison tuple, reading the second comparison tuple in the comparison tuple according to the second physical address in the physical address to obtain a second read result; and determining whether an addressing exception occurs based on the second read result and the test data.
[0017] By reading the reading result and test data of each comparison tuple, it is determined whether there is an error in the addressing process of the physical address of each comparison tuple.
[0018] In an exemplary embodiment of the present invention, if the difference does not exceed a predetermined threshold, the step of determining whether an addressing abnormality has occurred includes: determining the difference bit between the first physical address and the physical address of the reference tuple as an abnormal bit; and marking the physical tuple related to the abnormal bit among multiple physical tuples as abnormal.
[0019] The abnormal bit is determined according to the difference bit between the physical address of the abnormal comparison tuple and the physical address of the reference tuple, the position where the addressing abnormality occurs in the memory storage device is judged according to the abnormal bit, and the position where the addressing abnormality occurs can be abnormally marked.
[0020] In an exemplary embodiment of the present invention, the method further includes establishing a valid entity address table to record entity addresses corresponding to entity tuples that do not carry the abnormal mark, so as to perform data storage operations.
[0021] By establishing a valid physical address table, data can be stored in physical addresses without abnormalities according to the valid physical address table, thereby effectively improving the stability and usage flexibility of the memory storage device.
[0022] An exemplary embodiment of the present invention provides a non-transitory computer-readable recording medium, wherein the non-transitory computer-readable recording medium stores instructions that are loaded by a processor to execute the steps of the detection method of a memory storage device.
[0023] Based on the above, the present invention provides a detection method for a memory storage device and a non-transient computer-readable recording medium, which can determine whether there is an error in the addressing process by reading whether the comparison tuple can read the test data in the reference tuple, and can determine the location where the addressing anomaly occurs, thereby avoiding the inability to access the storage device when the addressing anomaly occurs in the storage device, thereby effectively improving the stability and flexibility of use of the memory storage device.
[0024] In order to make the above features and advantages of the present invention more clearly understood, embodiments are given below with reference to the accompanying drawings for detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings are included to provide a further understanding of the present invention and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the present invention and together with the description serve to explain the principles of the present invention.
[0026] Figure 1 is a schematic diagram of a memory storage device according to an exemplary embodiment of the present invention;
[0027] Figure 2 is a flow chart of a detection method of a memory storage device according to an exemplary embodiment of the present invention;
[0028] Figure 3 is a flow chart of a detection method of a memory storage device according to another exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0029] Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Whenever possible, the same reference numerals are used in the drawings and the description to refer to the same or like parts.
[0030] The ordinal numbers used in the specification and claims of this application, such as "first", "second", etc., are used to modify elements. They themselves do not imply or represent any previous ordinal numbers of the element or elements, nor do they represent the order of one element and another element, or the order of the manufacturing method. The use of these ordinal numbers is only used to make a component with a certain name clearly distinguishable from another component with the same name. The same words may not be used in the claims and the specification. Accordingly, the first component in the specification may be the second component in the claims. It should be noted that the following embodiments can replace, reorganize, and mix the technical features of several different embodiments to complete other embodiments without departing from the spirit of the present disclosure.
[0031] Figure 1 is a schematic diagram of a memory storage device according to an exemplary embodiment of the present invention. Figure 1 In general, a memory storage device (also referred to as a storage device) includes an input / output (I / O) interface 101, a rewritable non-volatile memory module 103, and a control circuit 102. The memory storage device is usually used together with a host system (not shown) so that the host system can send an addressing command through the I / O interface 101 and through the address register 104 to write data to the memory storage device or read data from the memory storage device.
[0032] The I / O interface 101 is coupled to the host system and is used to receive and identify commands and data sent by the host system. In other words, the commands and data sent by the host system are sent to the control circuit 102 through the I / O interface 101 .
[0033] The control circuit 102 is used to execute multiple logic gates or control instructions implemented in hardware or firmware form and perform operations such as writing, reading and erasing data in the rewritable non-volatile memory module 103 according to the instructions of the host system. In an exemplary embodiment, the control circuit 102 can issue other types of instructions of the host system to the rewritable non-volatile memory module 103 to instruct the execution of corresponding operations.
[0034] In an exemplary embodiment, the rewritable non-volatile memory module 103 may be a non-volatile memory storage device such as an SD card, a CF card or an embedded storage device. The embedded storage device includes various types of embedded storage devices that directly couple the memory module to a substrate of a host system, such as an embedded MMC (embedded MMC) and / or an embedded Multi Chip Package (embedded Multi ChipPackage, eMCP).
[0035] The rewritable non-volatile memory module 103 is coupled to the control circuit 102 and is used to store data written by the host system. The rewritable non-volatile memory module 103 can be a single-level cell (SLC) NAND flash memory module (i.e., a flash memory module that can store 1 data bit in one storage cell), a multi-level cell (MLC) NAND flash memory module (i.e., a flash memory module that can store 2 data bits in one storage cell), a triple level cell (TLC) NAND flash memory module (i.e., a flash memory module that can store 3 data bits in one storage cell), a quad level cell (QLC) NAND flash memory module (i.e., a flash memory module that can store 4 data bits in one storage cell), other flash memory modules, or other memory modules with the same characteristics.
[0036] Each read and write of the rewritable non-volatile memory module 103 needs to be completed through the addressing register 104. When a bit addressing exception occurs in the addressing register 104, the addressing register 104 will appear to be unable to write data, that is, the bits in some bytes cannot be expressed as two states (0 or 1) in terms of numerical value, and can only be constant in one state in terms of numerical value (for example, constant at 1 or constant at 0).
[0037] At this time, if the host system is unaware of the abnormality, an error will occur in which data is repeatedly written to the same physical address. Since the physical properties of the rewritable non-volatile memory module 103 cannot be directly rewritten, when a bit addressing abnormality occurs in the addressing register 104, the entire rewritable non-volatile memory module 103 cannot be used anymore.
[0038] This solution provides a detection method for a memory storage device. Figure 2 is a flow chart of a detection method of a memory storage device according to an exemplary embodiment of the present invention.
[0039] S201, selecting a physical tuple in a rewritable non-volatile memory module as a reference tuple, determining multiple physical addresses according to a physical address of the reference tuple and multiple preset address offsets, and using physical tuples corresponding to the physical addresses as multiple comparison tuples.
[0040] S202: Write the test data into the reference tuple.
[0041] S203 , reading each comparison tuple respectively according to the physical address of each comparison tuple.
[0042] S204 , judging whether an addressing anomaly occurs in the physical address of each comparison tuple according to the read result of each comparison tuple and the test data.
[0043] Whether addressing anomalies occur in the physical addresses of each comparison tuple is determined through the reading results and test data of each comparison tuple.
[0044] In the process of reading and writing, the memory storage device can be addressed not only by block address and page address, but also by logical unit group address (LUN address), column address and row address. Therefore, the present application can be executed with logical unit group, physical block, physical page, column or row as a physical tuple. Figure 2 The detection method.
[0045] Figure 3 1 is a flow chart of a method for detecting a memory storage device according to an exemplary embodiment of the present invention. The memory storage device includes a rewritable non-volatile memory module, and the rewritable non-volatile memory module includes a plurality of entity tuples. Each process of the method can be adjusted according to the implementation situation, and is not limited thereto.
[0046] In step S301, a physical tuple is selected from the physical tuples as a reference tuple. In one embodiment, a physical tuple with the smallest physical address may be selected from a plurality of physical tuples as a reference tuple.
[0047] By selecting a physical group with the smallest physical address in the rewritable non-volatile memory module group as a reference group, a larger or maximum range detection of the memory storage device is performed.
[0048] The following specifically describes how to determine multiple physical addresses according to the physical address of the reference tuple and multiple preset address offsets, and use multiple physical tuples corresponding to the multiple physical addresses as multiple comparison tuples in combination with step S302 to step S303.
[0049] In step S302, the number of preset address offsets is determined according to the number of physical elements in the rewritable non-volatile memory module group.
[0050] Each preset address offset can determine a comparison tuple, so the number of preset address offsets is determined by the number of required comparison tuples. The more the total number of physical tuples, the more address bits are used, and the more comparison tuples are needed for abnormality detection. Since each bit can represent 2 addresses (0 or 1), the number of address bits used by the rewritable non-volatile memory module can be obtained as the number of preset address offsets through a logarithmic function according to the number of physical tuples.
[0051] In an exemplary embodiment, the current addressing target includes 16 physical blocks and the physical address of the reference block is 0b0000.
[0052] According to the number of physical blocks (Flash Block Num) and the logarithmic function of Formula 1, the number of address bits used by the rewritable non-volatile memory module is obtained as the number of preset address offsets, which is also the number of contrast blocks (Contrast Block Num). The following is Formula 1:
[0053]
[0054] When the number of physical blocks is 16, it can be seen from Formula 1 that the number of address bits used by the physical block is 4. The number of comparison blocks (the number of preset address offsets) required to detect the state of each address bit is 4, and each comparison block can be, for example, Contrast Block0, Contrast Block1, Contrast Block2 and ContrastBlock3.
[0055] In step S303 , a plurality of physical addresses are determined according to a plurality of preset address offsets, so as to sequentially offset the difference bits between the physical addresses and the reference tuple by one bit, and the physical tuples corresponding to the plurality of physical addresses are used as a plurality of comparison tuples.
[0056] In an exemplary embodiment, a physical address determined according to each predetermined address offset may be obtained to determine a difference bit between the physical address of the reference tuple and the physical address of the reference tuple, so as to detect the state of each address bit respectively.
[0057] In an exemplary embodiment, the address distances that increase exponentially are used as multiple preset address offsets, and the physical address of the reference tuple is used as the starting bit, and the physical addresses of the comparison tuples are obtained from near to far according to the preset address offsets. There is a difference bit between the physical address of each comparison tuple obtained and the physical address of the reference tuple, and each difference bit is offset by one bit in sequence.
[0058] Specifically, following the above-mentioned embodiment, which takes 16 physical blocks and the physical address of the reference block as 0b0000 as an example, in an exemplary embodiment, the physical address of each contrast block (Contrast Block address) can be obtained according to the number of contrast blocks, Formula 2 and the physical address of the reference block (ReferBlock address). Formula 2 is as follows:
[0059] ,in
[0060]
[0061] Among them, To obtain multiple preset address offsets, and it can be determined through step 302 that the number of preset address offsets is 4, so the physical address 0b0000 of the reference block is used as the starting bit, and the physical blocks with distances of 2, 4, 8 and 16 (i.e. 0001, 0010, 0100 and 1000) from the reference block are used as comparison blocks, and the physical addresses of the comparison blocks are obtained by performing an OR operation on the preset address offset and the physical address of the reference block. The physical addresses of each comparison block are as follows:
[0062] Contrast Block0 address=0001| 0b0000=0b0001
[0063] Contrast Block1 address=0010| 0b0000=0b0010
[0064] Contrast Block2 address=0100| 0b0000=0b0100
[0065] Contrast Block3 address=1000| 0b0000=0b1000
[0066] Further, the physical address (0b0001, 0b0010, 0b0100, 0b1000) determined according to each preset address offset may be obtained to determine a difference bit with the physical address (0b0000) of the reference block.
[0067] First, the physical address 0b0001 is obtained by the address offset of 2, and the corresponding physical block is used as the contrast block 0, and the first difference bit between the physical address 0b0001 of the contrast block and the physical address 0b0000 of the reference block is obtained;
[0068] Next, the physical address 0b0010 is obtained from the address offset of 4, and the corresponding physical block is used as the contrast block Contrast block 1, and the second difference bit between the physical address 0b0010 of the contrast block and the physical address 0b0000 of the reference block is obtained, wherein the first difference bit is different from the second difference bit, and the second difference bit is shifted left by one bit compared to the first difference bit;
[0069] Next, the physical address 0b0100 is obtained by the address offset of 8, and the corresponding physical block is used as the contrast block Contrast block 2, and the third difference bit between the physical address 0b0100 of the contrast block and the physical address 0b0000 of the reference block is obtained, wherein the first difference bit, the second difference bit and the third difference bit are different, and the third difference bit is shifted left by one bit compared to the second difference bit;
[0070] Finally, the physical address 0b1000 can be obtained from the address offset of 16, and the corresponding physical block is used as the comparison block Contrast block 3, and the fourth difference bit between the physical address 0b1000 of the comparison block and the physical address 0b0000 of the reference block is obtained, wherein the first difference bit, the second difference bit, the third difference bit and the fourth difference bit are different, and the fourth difference bit is shifted left by one bit compared to the third difference bit.
[0071] In another embodiment, the number of contrast blocks is 4 and the physical address of the reference block is 0b0001. Taking the physical address 0b0001 of the reference block as the starting bit, the physical blocks with distances of 2, 4, 8 and 16 (i.e., 0001, 0010, 0100 and 1000) from the reference block are used as contrast blocks. The contrast blocks and the physical addresses of the contrast blocks can be obtained according to the number of contrast blocks, formula 2 and the physical address of the reference block. The physical addresses of the contrast blocks are as follows:
[0072] Contrast Block0 address=0001|0b0001=0b0001
[0073] Contrast Block1 address=0010|0b0001=0b0011
[0074] Contrast Block2 address=0100|0b0001=0b0101
[0075] Contrast Block3 address=1000|0b0001=0b1001
[0076] Among them, the physical address 0b0001 obtained by the address offset of 2 is the same as the physical address of the reference block, so the smallest starting address 0b0000 is selected as a replacement. According to multiple preset address offsets, the physical address 0b0000 of the contrast block 0, the physical address 0b0011 of the contrast block 1, the physical address 0b0101 of the contrast block 2 and the physical address 0b1001 of the contrast block 3 are determined in sequence. The physical address of each contrast block has a difference bit with the physical address of the reference block, and each difference bit is offset by one bit.
[0077] In the above embodiment, the power of 2 in formula 2 is used to perform an OR operation with the physical address of the reference block to obtain the difference bits of the physical address of the reference block, which are shifted by one bit in sequence, and the physical blocks corresponding to each physical address are used as comparison blocks.
[0078] In step S304 , an erase operation is performed on the reference tuple and each comparison tuple to clear the data on the reference tuple and each comparison tuple.
[0079] By performing the erasing operation on the reference tuple and the comparison tuple, it is possible to avoid the data originally stored in the reference tuple or the comparison tuple affecting the subsequent reading result, thereby affecting the detection result.
[0080] In step S305 , the test data is written into the reference tuple.
[0081] In step S306 , a comparison tuple is selected from each comparison tuple as a current comparison tuple, and the current comparison tuple is read according to a physical address of the current comparison tuple to obtain a first reading result.
[0082] In step S307 , it is determined whether the difference between the first read result and the number of bits in the same bit state in the test data does not exceed a predetermined threshold.
[0083] As described above, since a bit can be numerically represented as two bit states ("0" or "1"), in an exemplary embodiment, the number of bits in the read result of the current comparison tuple and the test data whose bit state is the same as "0" can be counted, and the difference in the number of bits in the two whose bit state is the same as "0" can be calculated, and it is determined whether this difference does not exceed a predetermined threshold to determine whether an addressing abnormality occurs.
[0084] In another exemplary embodiment, the number of bits in the read result of the current comparison tuple and the test data with the same bit state of "1" can be counted, and the difference in the number of bits in the same bit state of "1" can be calculated, and it can be determined whether the difference does not exceed a predetermined threshold to determine whether an addressing abnormality occurs.
[0085] In an exemplary embodiment, the predetermined threshold value may be set to 10, and the number of bits with a bit state of "0" in the reading result of the current comparison tuple is counted as, for example, 100, and the number of bits with a bit state of "0" in the test data is counted as, for example, 98. The difference in the number of bits with a bit state of "0" between the two is calculated to be 2. This difference does not exceed the predetermined threshold value (10), indicating that the reading result of the current comparison tuple is highly similar to the test data. At this time, it can be determined that an addressing anomaly has occurred.
[0086] In another embodiment, the number of bits with a bit state of "1" in the reading result of the current comparison tuple is counted as, for example, 100, and the number of bits with a bit state of "1" in the test data is counted as, for example, 20, and the difference in the number of bits with a bit state of "1" between the two is calculated to be 80, then this difference far exceeds the predetermined threshold value (10), indicating that the reading result of the current comparison tuple is not similar to the test data, and at this time, it can be determined that no addressing abnormality occurs.
[0087] The smaller the difference between the first read result and the number of bits in the same bit state in the test data, the higher the similarity between the data read by the current comparison tuple and the test data, the higher the possibility of repeatedly writing data to the same physical address, and the greater the possibility of addressing anomalies. The user can set the predetermined threshold based on experience, and the present invention is not limited thereto.
[0088] If the difference between the read result of the current comparison tuple and the number of bits with the same bit state in the test data does not exceed the predetermined threshold, it is determined that an addressing anomaly occurs. In step S308, the difference bit between the physical address of the current comparison tuple and the physical address of the reference tuple is determined as an abnormal bit.
[0089] In one embodiment, if the physical address of the current comparison tuple with an addressing exception is 0010, and the physical address of the reference tuple is 0000. Since the address difference between the physical addresses of the comparison tuples and the reference tuple is only 1 bit, the difference bit can be determined as the bit with an exception (i.e., the abnormal bit) according to the physical address (0010) of the current comparison tuple and the physical address (0000) of the reference tuple. In this embodiment, the abnormal bit is the second bit from right to left in the physical address.
[0090] In step S311 , it is determined whether the current comparison tuple is the last comparison tuple in the comparison tuples.
[0091] If the current comparison tuple is the last comparison tuple in the comparison tuples, the test ends in step S312 .
[0092] If the current comparison tuple is not the last comparison tuple, return to step S307 and continue to read the remaining comparison tuples to determine whether there are other bits with addressing anomalies, until all comparison tuples are read one by one and it is determined whether addressing anomalies occur one by one, and the test ends.
[0093] After the test is finished, in step S309 , the physical tuples related to the abnormal bits in the rewritable non-volatile memory module are marked as abnormal.
[0094] After the abnormal bit is determined, the entity addresses related to the abnormal bit cannot be addressed normally, so the entity tuples corresponding to the entity addresses related to the abnormal bit cannot be used, and the entity tuples related to the abnormal bit are marked as abnormal.
[0095] In one embodiment, following the aforementioned embodiment in which the abnormal bit is the second bit from right to left in the physical address, the physical tuples related to the abnormal bit include physical tuples whose physical addresses are 0010, 0011, 0110, 0111, 1010, 1011, 1110, and 1111, respectively, that is, all physical addresses involving abnormal bit jumps cannot be addressed normally.
[0096] Furthermore, the entity tuples whose entity addresses are 0010, 0011, 0110, 0111, 1010, 1011, 1110, 1111 may be marked as abnormal, and the host system will no longer write data to the entity tuples whose entity addresses are 0010, 0011, 0110, 0111, 1010, 1011, 1110, 1111.
[0097] In step S310 , a valid entity address table is established to record entity addresses corresponding to entity tuples that do not carry abnormal tags, so as to perform data storage operations.
[0098] After executing the above-mentioned exception processing, a valid entity address table can be established to record the entity addresses corresponding to the entity tuples that do not carry exception marks. In this embodiment, the entity addresses are 0000, 0001, 0100, 0101, 1000, 1001, 1100, and 1101, which correspond to entity tuples that do not carry exception marks. The above-mentioned entity addresses do not involve addressing of exception bits when writing data.
[0099] The host system can perform data storage operations based on the physical addresses corresponding to the physical tuples that do not carry exception marks recorded in the valid physical address table. Although half of the physical tuples that carry exception marks are lost as storage space, the host system can still write data to the physical addresses corresponding to other physical tuples that do not carry exception marks, ensuring that the rewritable non-volatile memory module can be used normally without discarding the entire rewritable non-volatile memory module.
[0100] By establishing a valid physical address table, data can be stored in physical addresses without abnormalities according to the valid physical address table, thereby effectively improving the stability and usage flexibility of the memory storage device.
[0101] If the difference between the read result of the current comparison tuple and the number of bits in the same bit state in the test data exceeds a predetermined threshold, it is determined that no abnormality occurs in the addressing.
[0102] In step S311 , it is determined whether the current comparison tuple is the last comparison tuple in the comparison tuples.
[0103] If the current comparison tuple is the last comparison tuple in the comparison tuples, the test ends in step S312 .
[0104] If the current comparison tuple is not the last comparison tuple, return to step S307 and continue to read the remaining comparison tuples to determine whether an addressing anomaly occurs, until all comparison tuples are read one by one and it is determined whether an addressing anomaly occurs one by one, and the test ends.
[0105] In another exemplary embodiment, the detection method of the memory storage device can also be performed in units of physical pages. In this exemplary embodiment, the physical tuple can be a physical page.
[0106] Specifically, an example is given in which each physical block in the rewritable non-volatile memory module includes 32 physical pages, and a physical page with a smaller physical address, such as a physical address of 0x00000, is selected as a reference page.
[0107] Similarly, the number of preset address offsets, that is, the number of comparison pages, can be obtained according to the number of physical pages using Formula 3. The following is Formula 3:
[0108]
[0109] When the number of physical pages Flash Page Num is 32, it can be known from Formula 3 that the number of contrast pages ContrastPage Num is 5, and the contrast pages may be, for example, Contrast Page 0, Contrast Page 1, Contrast Page 2, Contrast Page 3, and Contrast Page 4.
[0110] In an exemplary embodiment, the physical address (Contrast Page address) of each contrast page can be obtained according to the number of contrast pages, Formula 4 and the physical address (ReferPage address) of the reference page. Formula 4 is as follows:
[0111] ,in
[0112]
[0113] The physical address of the reference page (Refer Page address) is 0x00000, and the physical addresses of the comparison pages are as follows:
[0114] Contrast Page 0 address=00001| Refer Page address
[0115] Contrast Page 1 address=00010| Refer Page address
[0116] Contrast Page 2 address=00100| Refer Page address
[0117] Contrast Page 3 address=01000| Refer Page address
[0118] Contrast Page 4 address=10000| Refer Page address
[0119] In this embodiment, according to the physical address (0x00001, 0x00010, 0x00100, 0x01000, 0x10000) determined by each predetermined address offset, a difference bit between the physical address (0x00000) of the reference page is determined.
[0120] In this embodiment, the reference page and the comparison page are blank pages, the test data is written into the reference page, and the reading operation is performed on each comparison page in sequence according to the physical address of each comparison page to obtain the reading result of each comparison page.
[0121] The read results of each comparison page and the test data are compared respectively to determine whether the difference between the read results of each comparison page and the number of bits in the same bit state in the test data does not exceed a predetermined threshold, so as to determine whether an addressing abnormality occurs.
[0122] In an exemplary embodiment, the number of bits in the read result of the current comparison page and the test data with the same bit state of "0" can be counted, and the difference in the number of bits in the same bit state of "0" can be calculated, and it can be determined whether the difference does not exceed a predetermined threshold to determine whether an addressing abnormality occurs.
[0123] In another exemplary embodiment, the number of bits in the read result of the current comparison page and the test data with the same bit state of "1" can be counted, and the difference in the number of bits in the same bit state of "1" between the two can be calculated, and it can be determined whether the difference does not exceed a predetermined threshold to determine whether an addressing abnormality occurs.
[0124] If the difference between the read result of the current comparison page and the number of bits in the same bit state in the test data exceeds a predetermined threshold, it is determined that no addressing anomaly occurs, and the read operation is continued on other comparison pages until all comparison pages are read one by one and it is determined whether an addressing anomaly occurs, and the test is terminated.
[0125] If the difference between the read result of the current comparison page and the number of bits in the same bit state in the test data does not exceed a predetermined threshold, it is determined that an addressing anomaly occurs.
[0126] In one embodiment, taking the current comparison page as comparison page Contrast Page3 (physical page address is 0x01000) as an example, if the difference between the read result read from comparison page Contrast Page3 and the number of bits in the same bit state in the test data does not exceed a predetermined threshold, it is determined based on the difference bit that an addressing abnormality occurs in the fourth bit from the right to the left.
[0127] At this time, due to the page-level addressing anomaly, only the SLC mode can be used to perform access operations on the rewritable non-volatile memory module that is originally an MLC, TLC or QLC NAND type.
[0128] After performing exception processing on the physical address involved in the above-mentioned abnormal bit, the host system can still use the SLC mode to perform access operations on the physical page corresponding to the valid physical address, that is, the rewritable non-volatile memory module is used as an SLC NAND flash memory module to perform subsequent access operations.
[0129] In some embodiments, the above detection steps can be selected to be executed when more errors occur during the reading and writing process of the memory storage device, or the memory storage device can be regularly self-tested. For example, a predetermined time interval can be set to execute the above detection steps on the memory storage device, and the location where the addressing anomaly occurs on the memory storage device can be determined through detection, and a valid physical address table is established to record the physical addresses where no anomalies occur, so that data can be stored in the physical addresses where no anomalies occur, so as to effectively improve the stability and flexibility of use of the memory storage device.
[0130] An embodiment of the present application also provides a non-transient computer-readable recording medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method of the aforementioned embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0131] 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 application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), and includes a number of instructions for a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0132] In summary, the exemplary embodiments of the present invention provide a detection method for a memory storage device and a non-transient computer-readable recording medium, which can determine whether there is an error in the addressing process by reading whether the comparison tuple can read the test data in the reference tuple, and can determine the location where the addressing anomaly occurs, thereby avoiding the inability to access the storage device when the addressing anomaly occurs in the storage device, thereby effectively improving the stability and flexibility of use of the memory storage device.
[0133] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A detection method for a memory storage device, wherein the memory storage device comprises a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module comprises a plurality of entity tuples, It is characterized in that The method comprises: Selecting an entity tuple as a reference tuple from the plurality of entity tuples, and determining a plurality of entity addresses according to the entity address of the reference tuple and a plurality of preset address offsets; wherein Obtaining a physical address determined according to each of the plurality of preset address offsets to determine a difference bit with the physical address of the reference tuple; and Determine the number of the plurality of preset address offsets according to the number of the plurality of physical tuples, and determine the plurality of physical addresses according to the plurality of preset address offsets, so as to sequentially offset the difference bits between the physical addresses of the reference tuples by one bit; taking the multiple entity tuples corresponding to the multiple entity addresses as multiple comparison tuples; Writing test data into the reference tuple; Reading a first comparison tuple among the plurality of comparison tuples according to a first physical address among the plurality of physical addresses to obtain a first reading result; and Determine whether an addressing anomaly occurs according to the first reading result and the test data.
2. The detection method according to claim 1, It is characterized in that The step of selecting the entity tuple from the plurality of entity tuples as the reference tuple further comprises: An entity tuple with the smallest entity address is selected from the multiple entity tuples as the reference tuple.
3. The detection method according to claim 1, It is characterized in that The method further comprises: Before the step of writing the test data into the reference metagroup, an erasing operation is performed on the reference metagroup and the plurality of comparison metagroups.
4. The detection method according to claim 1, It is characterized in that The step of determining whether an addressing abnormality occurs according to the first reading result and the test data includes: The difference between the first read result and the number of bits in the same bit state in the test data is obtained, and if the difference does not exceed a predetermined threshold, it is determined that an addressing abnormality occurs.
5. The detection method according to claim 1, It is characterized in that The method further comprises: Determining whether the first comparison tuple is the last comparison tuple among the multiple comparison tuples; If the first comparison tuple is not the last comparison tuple, reading a second comparison tuple in the plurality of comparison tuples according to a second physical address in the plurality of physical addresses to obtain a second reading result; and Determine whether an addressing abnormality occurs according to the second reading result and the test data.
6. The detection method according to claim 4, It is characterized in that If the difference does not exceed the predetermined threshold, the step of determining that an addressing anomaly occurs includes: Determine a difference bit between the first physical address and the physical address of the reference tuple as an abnormal bit; An entity tuple related to the abnormal bit in the multiple entity tuples is marked as abnormal.
7. The detection method according to claim 6, It is characterized in that The method further comprises: A valid entity address table is established to record entity addresses corresponding to entity tuples that do not carry the abnormal mark, so as to perform data storage operations.
8. A non-transitory computer-readable recording medium storing instructions, which are loaded by a processor to execute the detection method according to any one of claims 1 to 7.
