Flash memory decoding method, system and equipment and computer readable storage medium
By acquiring the real-time wear data of the flash memory and the corresponding relationship between the set wear data and the decoding rate, and adjusting the decoding rate to match the wear data, the problem of high power consumption and short life of the flash memory is solved, and lower power consumption and longer flash memory life are achieved.
Patent Information
- Application Number
- CN202411996688.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-03-28
AI Technical Summary
The prior art has high power consumption and short flash memory life in the flash memory decoding process, making it difficult to effectively reduce decoding power consumption and improve flash memory life.
By obtaining the correspondence between the real-time wear data of the flash memory and the set wear data and the decoding rate, the target decoding rate corresponding to the real-time wear data is determined, and the real-time decoding rate is adjusted to reduce the difference with the target decoding rate, and finally decoding the flash memory according to the adjusted decoding rate.
It effectively reduces the power consumption of flash decoding, improves the life of flash memory, and avoids the mismatch of a single low bit rate with flash wear data.
Smart Images

Figure CN119718771A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of solid-state hard disks, and more specifically, to a flash memory decoding method, system, device, and computer-readable storage medium. Background Art
[0002] The principle of Nand Flash (flash memory storage medium) is to record data by presenting different voltage values with different charges stored in the storage unit. However, due to the electrical characteristics of Nand (flash memory) particles, the characteristics of the storage charge of the storage unit change during its life cycle, so the flash memory cannot guarantee the permanent preservation of the stored data, so ECC (Error Checking and Correcting) needs to be applied to the flash memory for error correction. For example, using a single low-bit rate check matrix to decode the flash memory can ensure successful decoding, but there will be a mismatch between the decoding and the flash memory, resulting in high decoding power consumption and reduced flash memory life.
[0003] In summary, how to reduce the decoding power consumption of the flash memory and increase the life of the flash memory is an urgent problem to be solved by those skilled in the art. Summary of the invention
[0004] The purpose of this application is to provide a flash memory decoding method, which can solve the technical problem of how to reduce the decoding power consumption of the flash memory and improve the life of the flash memory to a certain extent. The application also provides a flash memory decoding system, an electronic device and a computer-readable storage medium.
[0005] In order to achieve the above objectives, this application provides the following technical solutions:
[0006] A flash memory decoding method, comprising:
[0007] Get real-time wear data of flash memory;
[0008] Obtaining a correspondence between set flash memory wear data and a decoding rate, wherein the higher the wear degree reflected by the flash memory wear data, the lower the corresponding decoding rate;
[0009] According to the corresponding relationship, determining a target decoding rate corresponding to the real-time wear data;
[0010] Adjusting the real-time decoding rate of the flash memory to reduce the difference between the real-time decoding rate and the target decoding rate;
[0011] The adjusted real-time decoding rate is used as the final decoding rate, and the flash memory is decoded according to the final decoding rate.
[0012] In an exemplary embodiment, it further includes:
[0013] Determine the maximum decoding rate to be set;
[0014] Use the maximum decode rate as the initial decode rate for the flash memory.
[0015] In an exemplary embodiment, obtaining real-time wear data of the flash memory includes:
[0016] Determine the real-time erasing and writing times of the flash memory, and count the number of read errors of the flash memory within the real-time erasing and writing times;
[0017] The real-time erase and write times and the read error times are used as the real-time wear data of the flash memory.
[0018] In an exemplary embodiment, before adjusting the real-time decoding rate of the flash memory, the method further includes:
[0019] According to the corresponding relationship, detecting whether the real-time wear data matches the real-time decoding rate;
[0020] If the real-time wear data matches the real-time decoding rate, detecting whether the read error count value exceeds a first set threshold;
[0021] If the number of read errors exceeds the first set threshold, the step of adjusting the real-time decoding rate of the flash memory is performed;
[0022] If the real-time wear data does not match the real-time decoding rate, the step of adjusting the real-time decoding rate of the flash memory is performed.
[0023] In an exemplary embodiment, the adjusting the real-time decoding rate of the flash memory to reduce the difference between the real-time decoding rate and the target decoding rate includes:
[0024] In response to the target decoding rate being lower than the real-time decoding rate, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate is selected from the set decoding rates as a to-be-selected decoding rate;
[0025] Using the to-be-selected decoding rate as the real-time decoding rate;
[0026] Send a read command to the flash memory;
[0027] Get the read result of the flash memory;
[0028] Parsing the reading result to obtain a parsing result;
[0029] In response to the analysis result indicating that the flash memory read fails, or in response to the analysis result indicating that the flash memory read succeeds and the number of error bits is greater than a second set threshold, detecting whether the real-time decoding rate is consistent with the minimum decoding rate;
[0030] If the real-time decoding rate is inconsistent with the minimum decoding rate, then among the set decoding rates, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate is selected as the candidate decoding rate, the candidate decoding rate is used as the real-time decoding rate, and the step of sending a read command to the flash memory is returned to execution;
[0031] If the real-time decoding rate is consistent with the minimum decoding rate, read error correction is performed on the flash memory, and the real-time decoding rate is adjusted according to the read error correction result.
[0032] In an exemplary embodiment, performing read error correction on the flash memory and adjusting the real-time decoding rate according to the read error correction result includes:
[0033] Increasing the counted number of read errors;
[0034] Perform read error correction on flash memory;
[0035] If the read error correction is successful, and the number of error bits in response to the read error correction is greater than the third set threshold and the real-time decoding rate is inconsistent with the minimum decoding rate, then among the set decoding rates, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate is selected as the to-be-selected decoding rate, the to-be-selected decoding rate is used as the real-time decoding rate, and the step of sending the read command to the flash memory is returned to execution;
[0036] If the read error correction fails and in response to the real-time decoding rate being inconsistent with the minimum decoding rate, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate is selected as a candidate decoding rate from the set decoding rates, the candidate decoding rate is used as the real-time decoding rate, and the step of sending a read command to the flash memory is returned to execution;
[0037] If the read error correction fails and in response to the real-time decoding rate being consistent with the minimum decoding rate, the flash memory is rebuilt and error corrected.
[0038] In an exemplary embodiment, the adjusting the real-time decoding rate of the flash memory to reduce the difference between the real-time decoding rate and the target decoding rate includes:
[0039] Perform data inspection on the flash memory to obtain the data inspection result;
[0040] In response to the data inspection result indicating that the flash memory read fails, or in response to the data inspection result indicating that the flash memory read succeeds and the number of error bits is greater than a fourth set threshold, detecting whether the real-time decoding rate is consistent with the minimum decoding rate;
[0041] If the real-time decoding rate is inconsistent with the minimum decoding rate, then among the set decoding rates, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate is selected as the candidate decoding rate, and the candidate decoding rate is used as the real-time decoding rate. The process returns to the step of performing data inspection on the flash memory to obtain the data inspection result.
[0042] A flash memory decoding system, comprising:
[0043] A first acquisition module, used for acquiring real-time wear data of the flash memory;
[0044] A second acquisition module is used to acquire a correspondence between set flash memory wear data and a decoding rate, wherein the higher the wear degree reflected by the flash memory wear data, the lower the corresponding decoding rate;
[0045] A first determination module, configured to determine a target decoding rate corresponding to the real-time wear data according to the corresponding relationship;
[0046] A first adjustment module, used for adjusting the real-time decoding rate of the flash memory to reduce the difference between the real-time decoding rate and the target decoding rate;
[0047] The first decoding module is used to use the adjusted real-time decoding rate as the final decoding rate and decode the flash memory according to the final decoding rate.
[0048] An electronic device, comprising:
[0049] Memory for storing computer programs;
[0050] A processor is used to implement the steps of any of the flash memory decoding methods described above when executing the computer program.
[0051] A computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above flash memory decoding methods.
[0052] The present application provides a flash memory decoding method, which obtains the real-time wear data of the flash memory; obtains the corresponding relationship between the set flash memory wear data and the decoding rate, wherein the higher the wear degree reflected by the wear data of the flash memory, the lower the corresponding decoding rate; according to the corresponding relationship, determines the target decoding rate corresponding to the real-time wear data; adjusts the real-time decoding rate of the flash memory to reduce the difference between the real-time decoding rate and the target decoding rate; uses the adjusted real-time decoding rate as the final decoding rate, and decodes the flash memory according to the final decoding rate. In the present application, the higher the wear degree reflected by the wear data of the flash memory, the lower the corresponding decoding rate, and the lower the decoding rate, the greater the proportion of the check bit, and the stronger the error correction capability. In this way, according to the corresponding relationship, the target decoding rate corresponding to the real-time wear data is determined, and the real-time decoding rate of the flash memory is adjusted to reduce the difference between the real-time decoding rate and the target decoding rate, which is equivalent to adjusting the real-time decoding rate of the flash memory to the target decoding rate that matches the real-time wear data, avoiding the situation where a single low bit rate does not match the flash memory wear data, reducing the decoding power consumption and increasing the life of the flash memory. The flash memory decoding system, electronic device and computer-readable storage medium provided by the present application also solve the corresponding technical problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0054] Figure 1 A flowchart of a flash memory decoding method provided in an embodiment of the present application;
[0055] Figure 2 A schematic diagram of adjusting the real-time decoding rate according to the read operation and the read error correction;
[0056] Figure 3 A schematic diagram of adjusting the real-time decoding rate according to the data inspection result;
[0057] Figure 4 A schematic diagram of the structure of a flash memory decoding system provided in an embodiment of the present application;
[0058] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0059] Figure 6 Another structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0061] See also Figure 1 , Figure 1 A flowchart of a flash memory decoding method provided in an embodiment of the present application.
[0062] A flash memory decoding method provided in an embodiment of the present application may include the following steps:
[0063] Step S101: Acquire real-time wear data of the flash memory.
[0064] In practical applications, taking into account that as the flash memory is used, that is, as the flash memory life cycle progresses, the degree of wear of the flash memory increases, the higher the check bit required for decoding the flash memory, that is, the lower the decoding rate needs to be, so the degree of wear of the flash memory will affect the decoding rate of the flash memory. Therefore, it is necessary to obtain the real-time wear data of the flash memory so that the decoding rate of the flash memory can be adjusted later according to the real-time wear data.
[0065] In specific application scenarios, real-time wear data refers to the latest wear data of the flash memory. The type of wear data can be flexibly selected according to actual needs. For example, in the process of obtaining the real-time wear data of the flash memory, the real-time erase and write times of the flash memory can be determined, and the read error times of the flash memory within the real-time erase and write times can be counted; the real-time erase and write times and the read error times are used as the real-time wear data of the flash memory, and the larger the real-time erase and write times and the read error times, the higher the degree of flash memory wear.
[0066] Step S102: Obtaining a correspondence between set flash memory wear data and a decoding rate, wherein the higher the wear degree reflected by the flash memory wear data, the lower the corresponding decoding rate.
[0067] Step S103: Determine the target decoding rate corresponding to the real-time wear data according to the corresponding relationship.
[0068] In practical applications, various decoding rates supported by the flash memory can be pre-set. This code rate can be the code rate when performing LDPC (LowDensity Parity-Check Code) operations, etc., and according to the rule that the higher the wear degree reflected by the wear data of the flash memory, the lower the corresponding decoding rate, the wear data of the flash memory is matched with the set decoding rate to form a corresponding relationship between the wear data of the flash memory and the decoding rate, that is, the corresponding relationship between the wear data of the flash memory and the decoding rate is a negative correlation. In this way, after obtaining the real-time wear data, the target decoding rate corresponding to the real-time wear data can be determined according to the corresponding relationship. The target decoding rate is also the most suitable decoding rate for the current decoding of the flash memory. It should be noted that the corresponding relationship can be determined according to the number of erases and writes, as shown in Table 1, and a>b>c.
[0069] Table 1 Correspondence between flash memory erase and write times and decoding rate
[0070]
[0071] In specific application scenarios, considering that the initial wear level of the flash memory is low, the maximum decoding rate can be applied to decode the flash memory, so the set maximum decoding rate can also be determined; in the early stage of the life of the flash memory, the maximum decoding rate is used as the initial decoding rate of the flash memory, that is, in the initial stage of applying the flash memory, the flash memory needs to be decoded according to the maximum decoding rate to avoid the initial decoding rate of the flash memory being too low, resulting in the decoding power consumption not matching the wear level of the flash memory, thus affecting the life of the flash memory.
[0072] Step S104: adjusting the real-time decoding rate of the flash memory to reduce the difference between the real-time decoding rate and the target decoding rate.
[0073] Step S105: taking the adjusted real-time decoding rate as the final decoding rate, and decoding the flash memory according to the final decoding rate.
[0074] In actual applications, after determining the target decoding rate corresponding to the real-time wear data, the real-time decoding rate of the flash memory can be adjusted to reduce the difference between the real-time decoding rate and the target decoding rate. That is, if the target decoding rate is higher than the real-time decoding rate, the real-time decoding rate is increased to make the real-time decoding rate close to the target decoding rate. If the target decoding rate is lower than the real-time decoding rate, the real-time decoding rate is reduced to make the real-time decoding rate close to the target decoding rate. In this process, the real-time decoding rate can be directly adjusted to the target decoding rate, or the real-time decoding rate can be gradually changed to make the real-time decoding rate close to the target decoding rate. After adjusting the real-time decoding rate, the adjusted real-time decoding rate can be used as the final decoding rate, and the flash memory can be decoded according to the final decoding rate.
[0075] In a specific application scenario, before adjusting the real-time decoding rate of the flash memory, if the real-time decoding rate of the flash memory matches the real-time wear data, there is no need to adjust the real-time decoding rate. Therefore, it is also possible to detect whether the real-time wear data and the real-time decoding rate match according to the corresponding relationship. For example, it is possible to detect whether the real-time decoding rate is consistent with the target decoding rate. If they are consistent, it is determined that the real-time wear data and the real-time decoding rate match. If they are inconsistent, it is determined that the real-time wear data and the real-time decoding rate do not match. If the real-time wear data matches the real-time decoding rate, it is detected whether the number of read errors exceeds the first set threshold. The first set threshold can be flexibly determined, for example, the first set threshold can be 200, 220, etc.; if the number of read errors exceeds the first set threshold, the step of adjusting the real-time decoding rate of the flash memory is executed; if the number of read errors does not exceed the first set threshold, it means that the real-time decoding rate can cope with the real-time wear data of the flash memory, and the real-time decoding rate does not need to be adjusted; if the real-time wear data and the real-time decoding rate do not match, the step of adjusting the real-time decoding rate of the flash memory is executed.
[0076] In a specific application scenario, in the process of adjusting the real-time decoding rate of the flash memory to reduce the difference between the real-time decoding rate and the target decoding rate, the real-time decoding rate can be adjusted in sequence according to the set decoding rate, and whether the adjusted real-time decoding rate is adapted to the flash memory can be detected according to the reading result of the flash memory, that is, in response to the target decoding rate being lower than the real-time decoding rate, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate is selected from the set decoding rates as the to-be-selected decoding rate; the to-be-selected decoding rate is used as the real-time decoding rate, that is, the to-be-selected decoding rate is used as the adjusted real-time decoding rate, so that the real-time decoding rate can only be reduced by one level at a time, thereby gradually adjusting the real-time decoding rate to the target decoding rate or near the target decoding rate; sending a read command to the flash memory; obtaining the reading result of the flash memory; parsing the reading result to obtain the parsing result; in response to the parsing result indicating that the reading of the flash memory fails, or in response to the parsing result indicating that the reading of the flash memory is successful and the number of error bits (Error Bit) is greater than a second set threshold value, the second set threshold value can be determined according to actual needs, for example, the second set threshold value can be 200, 220, etc., then it is detected whether the real-time decoding rate is consistent with the minimum decoding rate; if the real-time decoding rate is inconsistent with the minimum decoding rate, it indicates that the real-time decoding rate can be further reduced, and a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate can be selected from the set decoding rates as the to-be-selected decoding rate, and the to-be-selected decoding rate is used as the real-time decoding rate, and the step of sending a read command to the flash memory is returned to; if the real-time decoding rate is consistent with the minimum decoding rate, it indicates that the real-time decoding rate cannot be reduced, and the flash memory can be read and corrected, and the real-time decoding rate is adjusted according to the read and corrected result.
[0077] From this implementation process, it can be seen that when the target decoding rate is lower than the real-time decoding rate, the present application first selects the decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate from the set decoding rate as the candidate decoding rate, and uses the candidate decoding rate as the real-time decoding rate to reduce the real-time decoding rate by one level; then, the adjusted real-time decoding rate can be detected based on the read result of the flash memory to determine whether it is suitable for the flash memory, and the real-time decoding rate can be further reduced based on the detection result until the real-time decoding rate can no longer be reduced; the real-time decoding rate is reduced step by step, which can avoid the opening of the real-time decoding rate and the flash memory wear data being incompatible due to excessive adjustment, and the adjusted real-time decoding rate is verified by the read result of the flash memory after each reduction, which can ensure that the adjusted real-time decoding rate is definitely suitable for the flash memory wear data. In addition, when the real-time decoding rate is consistent with the minimum decoding rate, the flash memory can also be read and corrected, and the real-time decoding rate can be adjusted based on the read error correction result, so as to further make the real-time decoding rate adapt to the flash memory according to the read error correction result.
[0078] In specific application scenarios, when performing read error correction on the flash memory and adjusting the real-time decoding rate according to the read error correction results, the statistical read error count value can be increased; read error correction is performed on the flash memory, such as performing FRT (Fixed Read Tables) 1, FRT2, FRT3, retryall (decoding), soft decode (soft decoding) and other operations on the flash memory; if the read error correction is successful, that is, FRT1, FRT2, FRT3, retryall, soft If any of the error correction operations such as decoding is successful, and the number of error bits in response to the read error correction is greater than the third set threshold and the real-time decoding rate is inconsistent with the minimum decoding rate, the third set threshold can be determined according to actual needs, for example, the third set threshold can be 200, 220, etc., then in the set decoding rates, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate is selected as the candidate decoding rate, and the candidate decoding rate is used as the real-time decoding rate, and the step of sending a read command to the flash memory is returned; if the number of error bits in the read error correction is less than the third set threshold, the read operation can be completed directly; if the read error correction fails and the real-time decoding rate is inconsistent with the minimum decoding rate, then in the set decoding rates, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate is selected as the candidate decoding rate, and the candidate decoding rate is used as the real-time decoding rate, and the step of sending a read command to the flash memory is returned; if the read error correction fails and the real-time decoding rate is consistent with the minimum decoding rate, the flash memory is rebuilt for error correction. The whole process is as follows: Figure 2 shown.
[0079] In a specific application scenario, in the process of adjusting the real-time decoding rate of the flash memory to reduce the difference between the real-time decoding rate and the target decoding rate, the real-time decoding rate can be adjusted according to the data inspection result, that is, the flash memory can be inspected to obtain the data inspection result; in response to the data inspection result indicating that the flash memory reading failed, or in response to the data inspection result indicating that the flash memory reading was successful and the number of error bits was greater than the fourth set threshold, the fourth set threshold can be determined according to actual needs, such as the fourth set threshold can be 200, 220, etc., then detect whether the real-time decoding rate is consistent with the minimum decoding rate; if the real-time decoding rate is inconsistent with the minimum decoding rate, then from the set decoding rates, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate is selected as the candidate decoding rate, and the candidate decoding rate is used as the real-time decoding rate, and the step of performing data inspection on the flash memory to obtain the data inspection result is returned. Correspondingly, in response to the data inspection result indicating that the flash memory reading was successful and the number of error bits was less than or equal to the fourth set threshold, or the real-time decoding rate is consistent with the minimum decoding rate, subsequent processing of the inspection data can be performed, such as data migration, etc. Figure 3 shown.
[0080] In practical applications, considering that the encoding rate of the flash memory will also affect the decoding rate, in the process of determining the target decoding rate corresponding to the real-time wear data according to the corresponding relationship, the decoding rate can be determined according to the encoding rate. Assuming that the real-time decoding rate still needs to be reduced, the target encoding rate corresponding to the real-time wear data can be determined, and the first decoding rate corresponding to the target encoding rate can be determined, such as using the decoding rate of the same size as the target encoding rate as the first decoding rate, etc.; according to the corresponding relationship, the second decoding rate corresponding to the real-time wear data is determined; detect whether the first decoding rate is lower than the second decoding rate, if the first decoding rate is lower than the second decoding rate, the first decoding rate is used as the target decoding rate, if the first decoding rate is higher than the second decoding rate, the second decoding rate is used as the target decoding rate. In this way, the determined target decoding rate must be the minimum value of the first decoding rate corresponding to the target encoding rate and the second decoding rate determined by the corresponding relationship, so that the target decoding rate must be lower than or equal to the target encoding rate. In this way, even if the flash memory uses different encoding rates, the present application can also use the target decoding rate to complete the flash memory decoding process, ensuring the stable operation of the flash memory decoding.
[0081] It should be noted that when the target decoding rate is higher than the real-time decoding rate, when adjusting the real-time decoding rate, it is necessary to select a decoding rate that is higher than the real-time decoding rate and has the smallest difference with the real-time decoding rate from the set decoding rate as the candidate decoding rate, and use the candidate decoding rate as the real-time decoding rate. The real-time decoding rate can still be adjusted in combination with the read operation and the read error correction process, and this application does not make specific restrictions here. It should also be noted that the flash memory decoding method of this application is also applicable to storage devices composed of flash memory such as SSD (Solid State Disk).
[0082] The present application provides a flash memory decoding method, which obtains real-time wear data of the flash memory; obtains the corresponding relationship between the set flash memory wear data and the decoding rate, wherein the higher the wear degree reflected by the wear data of the flash memory, the lower the corresponding decoding rate; according to the corresponding relationship, determines the target decoding rate corresponding to the real-time wear data; adjusts the real-time decoding rate of the flash memory to reduce the difference between the real-time decoding rate and the target decoding rate; uses the adjusted real-time decoding rate as the final decoding rate, and decodes the flash memory according to the final decoding rate. In the present application, the higher the wear degree reflected by the wear data of the flash memory, the lower the corresponding decoding rate, and the lower the decoding rate, the greater the proportion of the check bit, and the stronger the error correction capability. In this way, according to the corresponding relationship, the target decoding rate corresponding to the real-time wear data is determined, and the real-time decoding rate of the flash memory is adjusted to reduce the difference between the real-time decoding rate and the target decoding rate, which is equivalent to adjusting the real-time decoding rate of the flash memory to the target decoding rate that matches the real-time wear data, avoiding the situation where a single low bit rate does not match the flash memory wear data, reducing the decoding power consumption and increasing the life of the flash memory.
[0083] See also Figure 4 , Figure 4 A schematic diagram of the structure of a flash memory decoding system provided in an embodiment of the present application.
[0084] A flash memory decoding system provided in an embodiment of the present application may include:
[0085] A first acquisition module 101 is used to acquire real-time wear data of the flash memory;
[0086] The second acquisition module 102 is used to acquire the corresponding relationship between the set flash memory wear data and the decoding rate, wherein the higher the wear degree reflected by the flash memory wear data, the lower the corresponding decoding rate;
[0087] A first determination module 103 is used to determine a target decoding rate corresponding to the real-time wear data according to the corresponding relationship;
[0088] A first adjustment module 104, used to adjust the real-time decoding rate of the flash memory to reduce the difference between the real-time decoding rate and the target decoding rate;
[0089] The first decoding module 105 is configured to use the adjusted real-time decoding rate as a final decoding rate and decode the flash memory according to the final decoding rate.
[0090] A flash memory decoding system provided in an embodiment of the present application may further include:
[0091] The first setting module is used to determine a set maximum decoding rate; and use the maximum decoding rate as an initial decoding rate of the flash memory.
[0092] In a flash memory decoding system provided by an embodiment of the present application, a first acquisition module may include:
[0093] The first acquisition unit is used to determine the real-time erasing and writing times of the flash memory, and to count the number of read errors of the flash memory within the real-time erasing and writing times range; and to use the real-time erasing and writing times and the number of read errors as the real-time wear data of the flash memory.
[0094] A flash memory decoding system provided in an embodiment of the present application may further include:
[0095] The first detection module is used to detect whether the real-time wear data matches the real-time decoding rate according to the corresponding relationship before the first adjustment module adjusts the real-time decoding rate of the flash memory; if the real-time wear data matches the real-time decoding rate, then detect whether the number of read errors exceeds the first set threshold; if the number of read errors exceeds the first set threshold, then execute the step of adjusting the real-time decoding rate of the flash memory; if the real-time wear data does not match the real-time decoding rate, then execute the step of adjusting the real-time decoding rate of the flash memory.
[0096] In a flash memory decoding system provided by an embodiment of the present application, the first adjustment module may include:
[0097] A first selection unit is used for selecting, in response to the target decoding rate being lower than the real-time decoding rate, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate from the set decoding rates as a to-be-selected decoding rate;
[0098] A first setting unit, configured to use the to-be-selected decoding rate as the real-time decoding rate;
[0099] A first sending unit, used for sending a read command to the flash memory;
[0100] A second acquisition unit, used to acquire a reading result of the flash memory;
[0101] A first parsing unit, used to parse the reading result to obtain a parsing result;
[0102] The first detection unit is used to detect whether the real-time decoding rate is consistent with the minimum decoding rate in response to the analysis result indicating that the reading of the flash memory fails, or in response to the analysis result indicating that the reading of the flash memory is successful and the number of error bits is greater than a second set threshold; if the real-time decoding rate is inconsistent with the minimum decoding rate, then from the set decoding rates, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate is selected as the candidate decoding rate, the candidate decoding rate is used as the real-time decoding rate, and the step of sending a read command to the flash memory is returned to execute; if the real-time decoding rate is consistent with the minimum decoding rate, read error correction is performed on the flash memory, and the real-time decoding rate is adjusted according to the read error correction result.
[0103] A flash memory decoding system provided by an embodiment of the present application, wherein a first detection unit can be used to: increase the statistical number of read errors; perform read error correction on the flash memory; if the read error correction is successful, and the number of error bits in response to the read error correction is greater than a third set threshold and the real-time decoding rate is inconsistent with the minimum decoding rate, then among the set decoding rates, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate is selected as the candidate decoding rate, the candidate decoding rate is used as the real-time decoding rate, and the step of sending a read command to the flash memory is returned; if the read error correction fails and in response to the real-time decoding rate being inconsistent with the minimum decoding rate, then among the set decoding rates, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate is selected as the candidate decoding rate, the candidate decoding rate is used as the real-time decoding rate, and the step of sending a read command to the flash memory is returned; if the read error correction fails and in response to the real-time decoding rate being consistent with the minimum decoding rate, the flash memory is reconstructed and error corrected.
[0104] In a flash memory decoding system provided by an embodiment of the present application, the first adjustment module may include:
[0105] The first inspection unit is used to perform data inspection on the flash memory and obtain a data inspection result;
[0106] The second detection unit is used to detect whether the real-time decoding rate is consistent with the minimum decoding rate in response to the data inspection result indicating that the flash memory read fails, or in response to the data inspection result indicating that the flash memory read is successful and the number of error bits is greater than a fourth set threshold; if the real-time decoding rate is inconsistent with the minimum decoding rate, then from the set decoding rates, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate is selected as the candidate decoding rate, the candidate decoding rate is used as the real-time decoding rate, and the step of returning to execute data inspection on the flash memory to obtain the data inspection result is returned.
[0107] The present application also provides an electronic device and a computer-readable storage medium, both of which have the corresponding effects of the flash memory decoding method provided in the embodiment of the present application. Figure 5 , Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0108] An electronic device provided in an embodiment of the present application includes a memory 201 and a processor 202. The memory 201 stores a computer program. When the processor 202 executes the computer program, the steps of the flash memory decoding method described in any of the above embodiments are implemented.
[0109] See also Figure 6, another electronic device provided in the embodiment of the present application may also include: an input port 203 connected to the processor 202, for transmitting commands input from the outside to the processor 202; a display unit 204 connected to the processor 202, for displaying the processing results of the processor 202 to the outside; a communication module 205 connected to the processor 202, for realizing communication between the electronic device and the outside. The display unit 204 can be a display panel, a laser scanning display, etc.; the communication method adopted by the communication module 205 includes but is not limited to mobile high-definition link technology (Mobile High-Definition Link, MHL), Universal Serial Bus (Universal Serial Bus, USB), High-Definition Multimedia Interface (High-DefinitionMultimedia Interface, HDMI), wireless connection: wireless fidelity technology (WIreless Fidelity, WiFi), Bluetooth communication technology, low-power Bluetooth communication technology, and communication technology based on IEEE802.11s.
[0110] An embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the flash memory decoding method described in any of the above embodiments are implemented.
[0111] The computer-readable storage medium involved in this application includes random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs (Compact Disc Read-Only Memory), or any other form of storage medium known in the technical field.
[0112] A computer program product provided in an embodiment of the present application includes a computer program / instruction, which, when executed by a processor, implements the steps of the flash memory decoding method described in any of the above embodiments.
[0113] For the description of the relevant parts of a flash memory decoding system, an electronic device, and a computer-readable storage medium provided in the embodiments of the present application, please refer to the detailed description of the corresponding parts in a flash memory decoding method provided in the embodiments of the present application, which will not be repeated here. In addition, the parts of the above technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive elaboration.
[0114] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device 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 device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0115] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A flash memory decoding method, characterized in that: include: Get real-time wear data of flash memory; Obtaining a correspondence between set flash memory wear data and a decoding rate, wherein the higher the wear degree reflected by the flash memory wear data, the lower the corresponding decoding rate; According to the corresponding relationship, determining a target decoding rate corresponding to the real-time wear data; Adjusting the real-time decoding rate of the flash memory to reduce the difference between the real-time decoding rate and the target decoding rate; The adjusted real-time decoding rate is used as the final decoding rate, and the flash memory is decoded according to the final decoding rate.
2. The method according to claim 1, characterized in that Also includes: Determine the maximum decoding rate to be set; Use the maximum decode rate as the initial decode rate for the flash memory.
3. The method according to claim 1, characterized in that: The step of obtaining real-time wear data of the flash memory includes: Determine the real-time erasing and writing times of the flash memory, and count the number of read errors of the flash memory within the real-time erasing and writing times; The real-time erase and write times and the read error times are used as the real-time wear data of the flash memory.
4. The method according to claim 3, characterized in that Before adjusting the real-time decoding rate of the flash memory, the method further includes: According to the corresponding relationship, detecting whether the real-time wear data matches the real-time decoding rate; If the real-time wear data matches the real-time decoding rate, detecting whether the read error count value exceeds a first set threshold; If the number of read errors exceeds the first set threshold, the step of adjusting the real-time decoding rate of the flash memory is performed; If the real-time wear data does not match the real-time decoding rate, the step of adjusting the real-time decoding rate of the flash memory is performed.
5. The method according to claim 4, characterized in that The step of adjusting the real-time decoding rate of the flash memory to reduce the difference between the real-time decoding rate and the target decoding rate includes: In response to the target decoding rate being lower than the real-time decoding rate, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate is selected from the set decoding rates as a to-be-selected decoding rate; Using the to-be-selected decoding rate as the real-time decoding rate; Send a read command to the flash memory; Get the read result of the flash memory; Parsing the reading result to obtain a parsing result; In response to the analysis result indicating that the flash memory read fails, or in response to the analysis result indicating that the flash memory read succeeds and the number of error bits is greater than a second set threshold, detecting whether the real-time decoding rate is consistent with the minimum decoding rate; If the real-time decoding rate is inconsistent with the minimum decoding rate, then among the set decoding rates, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate is selected as the candidate decoding rate, the candidate decoding rate is used as the real-time decoding rate, and the step of sending a read command to the flash memory is returned to execution; If the real-time decoding rate is consistent with the minimum decoding rate, read error correction is performed on the flash memory, and the real-time decoding rate is adjusted according to the read error correction result.
6. The method according to claim 5, characterized in that The step of performing read error correction on the flash memory and adjusting the real-time decoding rate according to the read error correction result includes: Increasing the counted number of read errors; Perform read error correction on flash memory; If the read error correction is successful, and the number of error bits in response to the read error correction is greater than the third set threshold and the real-time decoding rate is inconsistent with the minimum decoding rate, then among the set decoding rates, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate is selected as the to-be-selected decoding rate, the to-be-selected decoding rate is used as the real-time decoding rate, and the step of sending the read command to the flash memory is returned to execution; If the read error correction fails and in response to the real-time decoding rate being inconsistent with the minimum decoding rate, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate is selected as a candidate decoding rate from the set decoding rates, the candidate decoding rate is used as the real-time decoding rate, and the step of sending a read command to the flash memory is returned to execution; If the read error correction fails and in response to the real-time decoding rate being consistent with the minimum decoding rate, the flash memory is rebuilt and error corrected.
7. The method according to claim 4, characterized in that The step of adjusting the real-time decoding rate of the flash memory to reduce the difference between the real-time decoding rate and the target decoding rate includes: Perform data inspection on the flash memory to obtain the data inspection result; In response to the data inspection result indicating that the flash memory read fails, or in response to the data inspection result indicating that the flash memory read succeeds and the number of error bits is greater than a fourth set threshold, detecting whether the real-time decoding rate is consistent with the minimum decoding rate; If the real-time decoding rate is inconsistent with the minimum decoding rate, then among the set decoding rates, a decoding rate that is lower than the real-time decoding rate and has the smallest difference with the real-time decoding rate is selected as the candidate decoding rate, and the candidate decoding rate is used as the real-time decoding rate. The process returns to the step of performing data inspection on the flash memory to obtain the data inspection result.
8. A flash memory decoding system, characterized in that: include: A first acquisition module, used for acquiring real-time wear data of the flash memory; A second acquisition module is used to acquire a correspondence between set flash memory wear data and a decoding rate, wherein the higher the wear degree reflected by the flash memory wear data, the lower the corresponding decoding rate; A first determination module, configured to determine a target decoding rate corresponding to the real-time wear data according to the corresponding relationship; A first adjustment module, used for adjusting the real-time decoding rate of the flash memory to reduce the difference between the real-time decoding rate and the target decoding rate; The first decoding module is used to use the adjusted real-time decoding rate as the final decoding rate and decode the flash memory according to the final decoding rate.
9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the flash memory decoding method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the flash memory decoding method according to any one of claims 1 to 7 are implemented.