A storage medium, its control method, and a storage device

By evenly distributing the free zone in the storage unit and setting the error code ratio, combining dynamic error code detection and adaptive error correction strategies, the contradiction between resource occupation and efficiency of the error correction mechanism is solved, and the error correction efficiency and overall performance of the storage medium are improved.

CN120045139BActive Publication Date: 2025-07-29合肥康芯威存储技术有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510503055.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-22
Publication Date
2025-07-29
Estimated Expiration
2045-04-22

AI Technical Summary

Technical Problem

The error correction mechanism of existing nonvolatile memory chips is difficult to balance between resource occupation and efficiency, affecting the reliability and performance of storage media.

Method used

By evenly distributing the free zone in the storage unit, setting the error code ratio and spatial ratio between the free zone and the storage area, dynamic error code detection and adaptive error correction strategies are adopted, and combining multi-level error correction processes, the storage resource allocation and error correction efficiency are optimized.

Benefits of technology

It realizes low resource occupation and efficient data reading, improves the error correction response speed and overall performance of storage media, and reduces resource waste and data writing unreliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045139B_ABST
    Figure CN120045139B_ABST
Patent Text Reader

Abstract

The present invention provides a storage medium, a control method thereof, and a storage device. The storage medium includes a plurality of storage page structures, and the storage page structure includes: at least one storage unit, where the storage unit includes a storage area and a free area. User data and system data are stored in the storage area, and the free area is evenly distributed in the storage unit or evenly distributed in the storage page structure, and the free area allows fill data in a preset format to be written. Wherein, the ratio of the number of error codes in the free area to the number of error codes in the storage unit is a first ratio, and the space occupancy ratio of all the free areas in the storage unit is a second ratio, and the first ratio and the second ratio are related. The present invention provides a storage medium, a control method thereof, and a storage device, which can read data with low resource occupancy and high efficiency, and the algorithm operation has high stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of storage technologies, and particularly relates to a storage medium, a control method thereof, and a storage device. Background Art

[0002] With the progress of semiconductor storage technologies, solutions based on non-volatile storage chips have gradually replaced traditional disk devices and become the dominant products in the market. Non-volatile storage chips use the number of electrons in the transistor gate to encode information. However, in practical applications, the number of electrons can change due to external factors such as programming and erasing cycles, environmental temperature fluctuations, and repeated accesses, resulting in abnormal information storage. Therefore, an error correction mechanism must be introduced.

[0003] The implementation of the error correction mechanism will occupy storage resources. Therefore, it is difficult to achieve both high error correction efficiency and low resource occupancy. Moreover, the operational stability of the error correction mechanism directly affects the reliability and storage performance of the storage medium. When implementing the error correction mechanism, it is necessary to consider the operational stability of the mechanism, the degree of occupancy of storage resources, correction efficiency, and correction accuracy. Summary of the Invention

[0004] An object of the present invention is to provide a storage medium, a control method thereof, and a storage device, which can read data with low resource occupancy and high efficiency, and have high operational stability of the algorithm.

[0005] To solve the above technical problems, the present invention is realized through the following technical solutions:

[0006] The present invention provides a storage medium, which includes a plurality of storage page structures, and the storage page structure includes:

[0007] At least one storage unit, wherein the storage unit includes a storage area and an idle area. User data and system data are stored in the storage area, and the idle area is evenly distributed in the storage unit or evenly distributed in the storage page structure, and the idle area allows filling data in a preset format to be written.

[0008] Wherein the ratio of the number of error codes in the idle area to the number of error codes in the storage unit is a first ratio, and the space occupancy ratio of all the idle areas in the storage unit is a second ratio, and the first ratio is related to the second ratio.

[0009] In an embodiment of the present invention, the system data includes a read voltage meter, a multi-level address mapping table, an initialization data table, check data, and original data. Among them, multiple read voltage data are stored in the read voltage meter, address mapping information of the user data is stored in the multi-level address mapping table, capacity data of the storage area is stored in the initialization data table, the original data is a backup data of the padding data, and the check data is check bit information of the user data. Wherein, the storage addresses of the read voltage meter, the multi-level address mapping table, the initialization data table, and the original data are preset fixed physical addresses.

[0010] In an embodiment of the present invention, the free area is the remaining storage space of the storage unit except the storage area, and the storage unit includes at least one free area.

[0011] In an embodiment of the present invention, an address management table is stored in the storage medium. Physical addresses of the storage page structure that can be directly called are stored in the address management table, allowing available physical addresses to be obtained from the address management table and data to be allocated and written to the available physical addresses.

[0012] The present invention provides a control method for a storage medium. Based on a storage medium as described above, it includes the following steps:

[0013] Generate padding data according to a preset format;

[0014] Randomly write user data into the storage area, and at the same time write the padding data into the free area and the storage area at a fixed physical address;

[0015] Synchronously read out the user data and the padding data, compare the padding data with the original data, and obtain the number of error codes of the padding data;

[0016] According to the number of error codes in the free area, obtain the number of error codes in the storage unit. Wherein, the ratio of the number of error codes in the free area to the number of error codes in the storage unit is a first ratio, and the space occupancy ratio of all the free areas in the storage unit is a second ratio, and the first ratio is related to the second ratio;

[0017] When the user data readout fails and when the number of error codes in the storage unit is less than or equal to the hard decoding error correction threshold, start the hard decoding process of the storage device;

[0018] When the user data readout fails and when the number of error codes in the storage unit is greater than the hard decoding error correction threshold, switch the read voltage and reread the user data and the padding data; and

[0019] Repeat the read step until the user data is successfully read or the available read voltages are traversed.

[0020] In an embodiment of the present invention, the control method of the storage medium further includes: when the storage medium is used for the first time, setting the capacity of each storage area in the storage medium and making the capacity of the free area greater than zero, where the capacity of the storage area is the capacity data in the initialization data table.

[0021] In an embodiment of the present invention, when the capacity of the free area is less than the first preset threshold, update the capacity of the storage area to make the capacity of the free area greater than or equal to the first preset threshold.

[0022] In an embodiment of the present invention, when the capacity of the storage area is less than the second preset threshold, convert part of the free area into the storage area until the capacity of the storage area is greater than or equal to the second preset threshold.

[0023] In an embodiment of the present invention, the control method of the storage medium further includes:

[0024] When part of the storage area or the free area is damaged, obtain the physical address of the damage and delete the physical address of the damage in the address management table;

[0025] When writing data to the storage medium, obtain any callable physical address from the address management table as the physical address for storing the data, and construct an address mapping table for the written data; and

[0026] Wherein, when multiple bad pages are in the same storage block and the multiple bad pages are continuously and centrally distributed, list the storage block as a bad block and delete the physical address of the bad block in the address management table.

[0027] The present invention provides a storage device, including:

[0028] A storage medium as described above; and

[0029] A main controller, electrically connected to the storage medium and used for writing data to and reading data from the storage medium. During the process of reading data, the main controller obtains the number of error codes in the storage page structure where the read data is located and adjusts the decoding process of the data to be read according to the number of error codes.

[0030] As described above, the present invention provides a storage medium, a control method thereof, and a storage device, which can achieve dynamic error code detection and adaptive error correction. It can not only quickly detect the error code situation of storage units, avoid the waste of resources caused by full disk scanning, improve the error correction response speed, but also reduce unnecessary error correction calculation overhead, thereby improving the error correction efficiency and reducing resource occupation. Moreover, the present invention sets a multi-level error correction strategy, which can improve the effective utilization rate of storage units, prevent data from being written into unreliable storage units, and reduce the situation where the entire storage block is scrapped due to local bad blocks. The present invention can avoid the influence of scattered bad pages on the overall performance, improve the effective capacity of the storage medium, ensure that the free area capacity always meets the error correction detection requirements, and avoid the waste caused by excessive reserved space, thereby optimizing the storage resource allocation and improving the space utilization rate. The present invention can accelerate the access speed of key data, reduce the delay caused by frequent addressing or voltage calibration, and can start the error correction process in advance during the data reading stage, reduce the calculation load of the main controller, improve the overall throughput of the storage device, and thus improve the overall performance of the storage system.

[0031] Of course, it is not necessary for any product implementing the present invention to achieve all the above-mentioned advantages simultaneously. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0033] Figure 1 It is a schematic structural diagram of an embodiment of the present invention.

[0034] Figure 2 It is a schematic distribution structure diagram of a storage area and a free area in an embodiment of the present invention.

[0035] Figure 3 It is a schematic distribution structure diagram of a storage area and a free area in another embodiment of the present invention.

[0036] Figure 4 It is a schematic structural diagram of a system block in an embodiment of the present invention.

[0037] Figure 5 It is a flowchart of a control method of a storage medium in an embodiment of the present invention.

[0038] Figure 6 It is a schematic structural diagram of a storage device in an embodiment of the present invention.

[0039] In the figure: 100, storage medium; 110, storage block; 111, system block; 112, read voltage meter; 113, address management table; 114, multi-level address mapping table; 115, initialization data table; 120, storage page structure; 130, storage unit; 131, storage area; 132, free area; 200, main controller; 300, memory; 310, control firmware. Detailed implementation manners

[0040] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0041] The storage medium 100 provided by the present invention is a flash memory, and specifically may be a NAND flash memory. Please refer to Figure 1 and Figure 3 As shown, the storage medium 100 includes a plurality of storage blocks 110. The storage block 110 is a physical block of the flash memory. The storage block 110 includes a plurality of storage page structures 120. The storage page structure 120 is a physical page of the flash memory. Among them, the storage page structure 120 includes at least one storage unit 130. The storage unit 130 is the smallest unit for the storage device to perform data decoding. As Figure 2 and Figure 3 shown, the storage unit 130 includes at least one storage area 131 and at least one free area 132. Among them, the storage area 131 is used to store user data and system data, and the free area 132 is used to store padding data with known content. The known stored content is reflected in a fixed data format or a known data sequence. The user data is the data written by the host computer into the storage medium 100.

[0042] Please refer to Figures 1 to 4As shown, in an embodiment of the present invention, the system data includes a read voltage meter 112, a multi-level address mapping table 114, an initialization data table 115, check data, and original data. The read voltage meter 112 stores multiple read voltage data. The multi-level address mapping table 114 stores the address mapping information of user data. The multi-level address mapping table 114 includes a first address mapping table and a second address mapping table. The first address mapping table is used to store the mapping relationship between the physical address and the logical address of the written data. The second address mapping table is used to store the mapping relationship between the physical address and the logical address of the first address mapping table. The stored data in the initialization data table 115 includes multiple capacity data of the storage area 131. The capacity data of the storage area 131 is the capacity value that the storage area 131 can be selectively set. The original data is the backup data of the filled data. When the filled data is written into the free area 132, a copy of the filled data is written into the area of the fixed physical address in the storage device as the original data. The check data is the check bit information of the user data. In this embodiment, the user data can be encoded by LDPC code to generate the check bits of the user data as the check data of the user data. Both the user data and the check data are stored in the storage area 131. In this embodiment, the data sequences of the user data and the check data are continuously distributed respectively, and the user data and the check data are adjacent to each other. In this embodiment, the storage addresses of the read voltage meter 112, the multi-level address mapping table 114, the initialization data table 115, and the original data are preset fixed physical addresses. Specifically, the storage block 110 of the predetermined physical address can be divided into a system block 111, and the system data such as the read voltage meter 112, the multi-level address mapping table 114, and the initialization data table 115 are stored in the system block 111. The system block 111 is only used to store system data. In this embodiment, a part of the storage blocks 110 of the predetermined physical address can be set as a backup block, and the original data is stored in the backup block. The physical addresses of the backup block and the system block 111 can be entered into the storage medium 100 before the device leaves the factory.

[0043] Please refer to Figure 1 and Figure 2 As shown, in an embodiment of the present invention, the storage unit 130 includes, for example, 1 storage area 131 and 1 free area 132. For the storage page structure 120 with multiple storage units 130, the sizes of the multiple storage units 130 are equal, and in the storage page structure 120, the free area 132 is evenly distributed in the storage page structure 120. For the storage page structure 120 of this embodiment, the storage page structure 120 includes, for example, 1 storage unit 130. In this embodiment, the storage area 131 can be a continuous physical address as Figure 2 shown. The free area 132 can be as Figure 2A continuous physical address as shown. The storage area 131 and the free area 132 are adjacent to each other. It should be noted that the capacity of the storage page structure 120 is the rated capacity. Therefore, after determining the size of the storage area 131, the remaining space in the storage unit 130 except for the storage area 131 is the total capacity of the free area 132.

[0044] Please refer to Figure 1 and Figure 3 as shown. As Figure 3 shown, the storage unit 130 includes, for example, 4 storage areas 131 and 4 free areas 132. The free areas 132 are evenly distributed in the storage unit 130. Specifically, the free areas 132 and the storage areas 131 are distributed at intervals. And in the storage unit 130, the sizes of the multiple storage areas 131 are equal, that is, the multiple free areas 132 are equally spaced. In this embodiment, the storage page structure 120 includes at least one storage unit 130. When determining the size of the storage area 131, taking the storage page structure 120 as a unit, determine the total capacity of the multiple storage areas 131 in the storage page structure 120, and then divide it equally into the capacity of a single storage area 131. In the present invention, when multiple free areas 132 are set, the capacities of the multiple free areas 132 can be equal, or can be distributed according to a preset regular pattern, such as an arithmetic progression distribution, or can also be set according to the reliability of the storage unit, dividing the physical addresses with low reliability into the free area 132, or dividing the free area 132 and the storage area 131 according to the reliability of the storage bit, so that the reliability of the storage area 131 and the free area 132 is similar. The reliability of the storage bit can be reflected by the number of times the flip of this storage bit is corrected. Because the unit with more times of being corrected for bit flipping has lower reliability, and vice versa, the unit with fewer times of being corrected has higher reliability.

[0045] Please refer to Figures 1 to 3As shown in the figure, the present invention manages the ranges of the storage area 131 and the free area 132 through physical addresses. In an embodiment of the present invention, the physical addresses of the storage area 131 and the free area 132 are determined when the storage medium 100 is used for the first time and will not change anymore. Specifically, before leaving the factory, the physical addresses of the storage area 131 and the free area 132 can be arranged. Specifically, when leaving the factory, the storage area 131 and the free area 132 are solidified and a static address mapping table is formed, which can not only eliminate the addressing overhead of dynamic address allocation during operation and improve the access speed, but also exclude bad pages through testing to ensure that all available storage areas 131 or all available free areas 132 meet the reliability standards. In another embodiment of the present invention, during the use process of the storage medium 100, the physical addresses of the storage area 131 and the free area 132 change dynamically to maintain the storage efficiency of the storage medium 100. For example, when the damaged proportion in the storage area 131 is relatively high, part of the free area 132 can be divided into the storage area 131 to reduce the proportion of the free area 132 in the storage unit 130 and increase the proportion of the storage area 131 in the storage unit 130. Another example is that when there are continuous and concentrated damage types in the storage area 131, part of the area of the free area 132 can be allocated for the use of the storage area 131. In the present invention, the system data further includes an address management table 113, and the physical addresses of the storage page structures 120 that can be directly called are stored in the address management table 113, and the physical addresses of the data written into the storage medium 100 are recorded in the address management table 113. Specifically, the physical address ranges of the storage area 131 and the free area 132 that each storage page structure 120 can be called are stored in the address management table 113. When the storage page structure 120 is damaged, the physical address of the bad page can be deleted from the address management table 113 to avoid misusing. In other embodiments of the present invention, a bad block table can also be set, and the address information of bad blocks and the address information of bad pages are stored in the bad block table. When calling the storage device, the physical addresses in the bad block table are not called.

[0046] Please refer to Figures 1 to 3 As shown in the figure, in the present invention, the ratio of the number of error codes in the free area 132 to the number of error codes in the storage unit 130 is the first ratio, and the space ratio of all the free areas 132 in the storage unit 130 is the second ratio, and the first ratio and the second ratio are related. In this embodiment, the first ratio and the second ratio are equal. Based on knowing the number of error codes in the free area 132, the number of error codes in the storage unit 130 can be further obtained. And the ratio of the number of error codes in the storage unit 130 to the number of error codes in the storage page structure 120 is the third ratio, and the space ratio of the storage unit 130 in the storage page structure 120 is the fourth ratio, and the third ratio and the fourth ratio are related. In this embodiment, the third ratio and the fourth ratio are equal.

[0047] Please refer to Figures 1 to 5As shown in the figure, the present invention also provides a control method for a storage medium 100, including steps S100 to S700.

[0048] Step S100: Generate padding data in a preset format.

[0049] Step S200: Randomly write user data into the storage area 131, and at the same time write the padding data into the free area 132 and the storage area 131 with a fixed physical address.

[0050] Step S300: Synchronously read out the user data and the padding data, compare the padding data with the original data, and obtain the number of error codes of the padding data.

[0051] Step S400: Obtain the number of error codes in the storage unit 130 according to the number of error codes in the free area 132, where the ratio of the number of error codes in the free area 132 to the number of error codes in the storage unit 130 is the first ratio, and the space occupancy ratio of all free areas 132 in the storage unit 130 is the second ratio, and the first ratio is related to the second ratio.

[0052] Step S500: When the user data readout fails and the number of error codes in the storage unit 130 is less than or equal to the hard decoding error correction threshold, start the hard decoding process of the storage device.

[0053] Step S600: When the user data readout fails and the number of error codes in the storage unit 130 is greater than the hard decoding error correction threshold, switch the readout voltage and reread the user data and the padding data.

[0054] Step S700: Loop and reread the steps until the user data is successfully read out or all available readout voltages are traversed.

[0055] Please refer to Figures 1 to 5 As shown in the figure, in an embodiment of the present invention, when writing user data to the storage medium 100, step S100 is executed. In step S100, the content or format of the padding data is designed in advance by the designer. In this embodiment, the padding data is generated by setting algorithm variables. In this embodiment, in step S200, before writing the user data to the storage medium 100, the user data is scrambled and then encoded to obtain the parity bits of the user data as the verification data. The encoding method can be LDPC code. The user data, the verification data, and the padding data are synchronously written into the storage medium 100. The user data and the verification data are stored in the storage area 131, the padding data is written into and fills the free area 132, and at the same time, the padding data is backed up as the original data and written into the backup block. Among them, when writing data, an address mapping table of the data is generated and filled into the system block 111. It should be noted that the free area 132 can be filled by repeatedly filling in the padding data.

[0056] Please refer to Figures 1 to 5 As shown, in an embodiment of the present invention, in step S300, when reading user data, the read voltage is first set. The read voltage can be the default voltage or the most suitable read voltage calculated by the system itself in the offline state. The factors affecting whether the read voltage is the most suitable read voltage include temperature and the wear degree of the storage medium 100. Specifically, the voltage for reading the host data for the first time can be obtained by machine training in the offline state of the memory, or a comparison table of voltage parameters can be generated through verification tests before leaving the factory to obtain the read voltage to be used under each temperature range and the wear degree of the storage medium 100. According to the temperature and the wear degree of the storage medium 100, the most suitable read voltage for reading the host data for the first time is determined. Read the user data, fill data, and original data according to the read voltage, compare the fill data and the original data, and obtain the number of flipped bits of the fill data compared to the original data as the number of error codes of the fill data. In this embodiment, the number of error codes existing in all the free areas 132 in the storage unit 130 is obtained.

[0057] Please refer to Figures 1 to 5 As shown, in an embodiment of the present invention, in step S400, the first ratio and the second ratio are equal. When the second ratio is known, according to the first ratio and the number of error codes of all the free areas 132 in the storage unit 130, the number of error codes of the storage unit 130 can be obtained. The space occupancy ratio of the storage unit 130 in the storage page structure 120 is the fourth ratio, and the ratio of the number of error codes of the storage unit 130 to the number of error codes of the storage page structure 120 is the third ratio, and the third ratio and the fourth ratio are equal. Therefore, according to the number of error codes of the storage unit 130 and the fourth ratio, the number of error codes of the storage page structure 120 is obtained. For example, if the number of error bits in the free area 132 is 10, then for the Figure 2 storage page structure 120, according to the byte ratio of the free area 132 in the storage unit 130, the number of error bits of the storage unit 130 is obtained. For example, if the free area 132 accounts for 1 / 4 of the storage area 131 domain of the storage unit 130, then the number of error bits of the storage unit 130 is 40. And as Figure 3 shown, the number of error bits of each free area 132 is obtained respectively, for example, 10, 1, 5, and 4. Then the number of error codes of all the free areas 132 in the storage unit 130 is 20. And if the free area 132 accounts for 1 / 4 of the storage area 131 domain of the storage unit 130, then the number of error codes of the storage unit 130 is 80. And so on.

[0058] Please refer to Figures 1 to 5As shown, it should be noted that as the storage medium 100 is used, some storage locations in the storage medium 100 may be damaged. In the present invention, when obtaining the first ratio to the fourth ratio, the values of the second ratio and the fourth ratio are obtained according to the actually available storage addresses in the current storage page structure 120. In this embodiment, when the storage medium 100 is used for the first time, a capacity data can be selected from the initialization data table 115 as the capacity of the storage area 131. Specifically, when the storage medium 100 is used for the first time, the capacity of each storage area 131 in the storage medium 100 is set, and the capacity of the free area 132 is made greater than zero. When the number of bad pages in the storage area 131 increases, when the free area 132 can store at least one set of filling data, the physical addresses of part of the free area 132 are transferred to the storage area 131 for use, and the physical addresses of the corresponding storage area 131 and the corresponding free area 132 in the address management table 113 are modified. In this embodiment, a first preset threshold can be set. When the capacity of the free area 132 is less than the first preset threshold, the capacity of the storage area 131 is updated so that the capacity of the free area 132 is greater than or equal to the first preset threshold. In another embodiment of the present invention, a second preset threshold can be set. When the capacity of the storage area 131 is less than the second preset threshold, part of the free area 132 is converted into the storage area 131 until the capacity of the storage area 131 is greater than or equal to the second preset threshold.

[0059] Please refer to Figures 1 to 5As shown, it should be noted that the space management of the storage area 131 and the free area 132 can be achieved through the address management table 113. In this embodiment, when a part of the storage area 131 or the free area 132 is damaged, the damaged physical address is obtained, and the damaged physical address is deleted from the address management table 113. Among them, when there are multiple consecutive damaged areas in the storage page structure 120, the corresponding storage page structure 120 can be directly set as a bad page. Specifically, a first damage threshold for the continuous damaged area is set. When the capacity of the continuous damaged area reaches the first damage threshold, the current storage page structure 120 can be set as a bad page. Or, a second damage threshold is set. When the total length of the damaged areas in the storage page structure 120 reaches the second damage threshold, the current storage page structure 120 can be set as a bad page. Or, damage thresholds for the storage area 131 and the free area 132 are respectively set. When the damage degree of the storage area 131 and / or the free area 132 reaches the damage threshold, the current storage page structure 120 can be set as a bad page. The above-mentioned multiple implementation manners can be implemented together or selected for execution. It should be noted that when writing data to the storage medium 100, any callable physical address is obtained from the address management table 113 as the physical address for storing the data, and an address mapping table for writing the data is constructed. In the present invention, when multiple bad pages are in the same storage block 110 and the multiple bad pages are continuously and concentratedly distributed, the storage block 110 is listed as a bad block, and the physical addresses of the bad block are deleted from the address management table 113. In this embodiment, the maximum number of bad pages that can exist in the storage block 110 can be limited by setting a quantity threshold for the continuous distribution of bad pages. When the number of bad pages reaches the threshold, the storage block 110 can be set as a bad block.

[0060] Please refer to Figures 1 to 5 As shown, in an embodiment of the present invention, in step S500, after the decoding of the hard decoding process fails, step S600 is executed. In step S600, the switching of the read voltage can be completed by replacing the read voltage in the read voltage table. In step S700, traversing the read voltages means that each read voltage in the read voltage table is used. Each time user data is read, the error code number of the current storage page structure 120 is re-obtained, and step S500 is returned. If the hard decoding is successful, that is, the user data is successfully read, or the user data still cannot be read after traversing the read voltages, the decoding can be ended or the soft decoding process can be started. In this embodiment, if all hard decodings fail or the soft decoding fails, the current storage unit 130 is damaged.

[0061] Please refer to Figure 1 、 Figure 2 and Figure 6As shown in the figure, the present invention also provides a storage device, which includes the storage medium 100 and the main controller 200 provided by the present invention. The main controller 200 is electrically connected to the storage medium 100 and is used to write data to and read data from the storage medium 100. During the process of reading data, the main controller 200 obtains the number of error codes in the storage page structure 120 where the read data is located, and adjusts the decoding process of the data to be read according to the number of error codes. In this embodiment, the storage device may further include a memory 300, and the control firmware 310 is stored in the memory 300. When the main controller 200 calls the control firmware 310, the control method for the storage medium 100 provided by the present invention is implemented.

[0062] The embodiments of the present invention disclosed above are only used to help explain the present invention. The embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made according to the content of this specification. These embodiments are selected and specifically described in this specification to better explain the principle and practical application of the present invention, so that those skilled in the relevant art can understand and utilize the present invention well. The present invention is only limited by the claims and their full scope and equivalents.

Claims

1. A storage medium, characterized in that, The storage medium includes a plurality of storage page structures, and the storage page structure includes: At least one storage unit, where the storage unit includes a storage area and a free area. User data and system data are stored in the storage area, and the free area is evenly distributed in the storage unit or evenly distributed in the storage page structure, and the free area allows fill data in a preset format to be written; Wherein the ratio of the number of error codes in the free area to the number of error codes in the storage unit is a first ratio, and the space occupancy of all the free areas in the storage unit is a second ratio, and the first ratio is equal to the second ratio; Wherein, the storage medium is configured to: When the user data readout fails and when the number of error codes in the storage unit is less than or equal to the hard decoding error correction threshold, start the hard decoding process of the storage medium; When the user data readout fails and when the number of error codes in the storage unit is greater than the hard decoding error correction threshold, switch the read voltage and reread the user data and the fill data; and Repeat the rereading step until the user data is successfully read out or all available read voltages are traversed.

2. The storage medium according to claim 1, characterized in that, The system data includes a read voltage table, a multi-level address mapping table, an initialization data table, check data, and original data. Among them, a plurality of read voltage data are stored in the read voltage table, address mapping information of the user data is stored in the multi-level address mapping table, capacity data of the storage area is stored in the initialization data table, the original data is a backup data of the fill data, and the check data is check bit information of the user data. The storage addresses of the read voltage table, the multi-level address mapping table, the initialization data table, and the original data are preset fixed physical addresses.

3. A storage medium according to claim 1, characterized in that, The free area is the remaining storage space of the storage unit except the storage area, and the storage unit includes at least one free area.

4. A storage medium according to claim 1, characterized in that, An address management table is stored in the storage medium, and the physical addresses of the storage page structures that can be directly called are stored in the address management table, allowing an available physical address to be obtained from the address management table and data to be allocated and written to the available physical address.

5. A control method for a storage medium, based on a storage medium as described in claim 1, characterized in that, Including the following steps: Generate fill data in a preset format; Randomly write user data into the storage area, and at the same time write the fill data into the free area and the storage area with a fixed physical address; Synchronously read out the user data and the fill data, compare the fill data with the original data, and obtain the number of error codes of the fill data; According to the number of error codes in the free area, obtain the number of error codes in the storage unit, where the ratio of the number of error codes in the free area to the number of error codes in the storage unit is a first ratio, and the space occupancy of all the free areas in the storage unit is a second ratio, and the first ratio is related to the second ratio; When the user data readout fails and when the number of error codes in the storage unit is less than or equal to the hard decoding error correction threshold, start the hard decoding process of the storage medium; When the reading of the user data fails, and when the number of error codes of the storage unit is greater than the hard decoding error correction threshold, switch the reading voltage and reread the user data and the padding data; and Repeat the rereading step until the user data is successfully read or all available reading voltages have been traversed.

6. The control method of a storage medium according to claim 5, characterized in that, The control method of the storage medium further includes: when the storage medium is used for the first time, set the capacity of each storage area in the storage medium and make the capacity of the free area greater than zero, where the capacity of the storage area is the capacity data in the initialization data table.

7. The control method of a storage medium according to claim 6, characterized in that, When the capacity of the free area is less than a first preset threshold, update the capacity of the storage area so that the capacity of the free area is greater than or equal to the first preset threshold.

8. The control method of a storage medium according to claim 6, characterized in that, When the capacity of the storage area is less than a second preset threshold, convert part of the free area into the storage area until the capacity of the storage area is greater than or equal to the second preset threshold.

9. The control method of a storage medium according to claim 5, characterized in that The control method of the storage medium further includes: When part of the storage area or the free area is damaged, obtain the physical addresses of the damaged areas and delete the physical addresses of the damaged areas in the address management table; The storage medium includes a plurality of storage page structures. When there are a plurality of consecutive physical addresses of the damaged areas in the storage page structure, set the storage page structure as a bad page; When writing data to the storage medium, obtain any available physical address from the address management table as the physical address for storing the data, and construct an address mapping table for the written data; and Wherein, when a plurality of bad pages are in the same storage block and the plurality of bad pages are continuously concentrated, list the storage block as a bad block and delete the physical addresses of the bad block in the address management table.

10. A storage device, characterized in that, Includes: A storage medium according to claim 1; And A main controller, electrically connected to the storage medium and used for writing data to and reading data from the storage medium. During the process of reading data, the main controller obtains the number of error codes of the storage page structure where the read data is located and regulates the decoding process of the data to be read according to the number of error codes.

Citation Information

Patent Citations

  • Data storage systems and methods for improved data relocation based on read-level voltages associated with error recovery

    CN110955385A

  • Data processing method and device of storage chip, computer equipment and storage medium

    CN112162935A