Data reinforcement method and device for nonvolatile memory, equipment and medium
By monitoring the ambient temperature in nonvolatile memory and filtering the target data blocks using the initial error correction code, the problem of data corruption in low-temperature environments is solved, and the accuracy of data reading and memory life are improved.
Patent Information
- Application Number
- CN202411626544.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-11-13
AI Technical Summary
In low temperature environments, non-volatile memory can easily lead to data damage in data blocks during long-term reading. The prior art temperature control and timing refresh mechanisms are costly and affect the memory life, which cannot meet the needs of modern communication modules. .
By monitoring the ambient temperature, if it is lower than the first preset threshold, the initial error correction code of each data block in the nonvolatile memory is obtained, and the correction code is checked based on these codes to filter out the target data blocks that have been corrected successfully. , read and rewrite its data to complete data hardening.
Improve the accuracy of non-volatile memory data reading in low temperature environments, extend the service life of the memory, reduce the number of data rewrites to reduce the damage to the memory.
Smart Images

Figure CN119440420A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of memory technology, and in particular to a data reinforcement method, device, equipment and medium for a non-volatile memory. Background Art
[0002] Non-volatile memory has higher data storage density, faster read and write speed and lower power consumption. For example, NAND Flash is a non-volatile memory based on NAND (NOT AND) technology. At present, non-volatile memory may cause data corruption in each data block when performing long-term reading operation in a low-temperature environment. The main reason for the damage is the defects in the characteristics of non-volatile memory. The data in non-volatile memory will reduce electrons every time it is read. When it is reduced to a certain extent, the data level will flip. For example, the data logic level is high when it is above 0.9v and low when it is below 0.9v. Then, when the electron reduction causes the data voltage to drop below 0.9v, the data level will flip from 1 to 0, resulting in data reading errors. This trend will be greatly accelerated in a low temperature environment (such as -40 degrees).
[0003] Traditional avoidance methods often only use temperature control or timed refresh mechanisms, but these solutions are costly and may affect the life of non-volatile memory, and can no longer meet the needs of modern communication modules.
[0004] In summary, it can be seen that how to improve the accuracy of reading data stored in a non-volatile memory in a low-temperature environment is a problem to be solved in the art. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for data reinforcement of non-volatile memory, so as to improve the accuracy of reading data stored in non-volatile memory in a low temperature environment. The specific scheme is as follows:
[0006] In a first aspect, the present application discloses a method for data reinforcement of a non-volatile memory, comprising:
[0007] monitoring whether the current ambient temperature is lower than a first preset threshold, and if the current ambient temperature is lower than the first preset threshold, obtaining an initial error correction code of each data block in the non-volatile memory;
[0008] Performing correction code verification on each of the data blocks based on the initial error correction code to filter out a target data block whose initial error correction code indicates successful correction from each of the data blocks;
[0009] The target data stored in the target data block is read, and the target data is rewritten into the target data block to complete data reinforcement for the target data block.
[0010] Optionally, performing correction code verification on each of the data blocks based on the initial error correction code to filter out a target data block represented by the initial error correction code as successfully corrected from each of the data blocks includes:
[0011] Determining a current data block from each data block of the non-volatile memory, and judging whether the initial error correction code of the current data block indicates a successful correction;
[0012] If the initial error correction code representation of the current data block indicates successful correction, determining the current data block as a target data block;
[0013] Determining whether all the data blocks have been subjected to correction code verification;
[0014] If there is a data block that has not been checked for the correction code, determine the next data block from the data blocks in the non-volatile memory, update the next data block as the current data block, and then jump again to the step of determining whether the initial error correction code of the current data block indicates successful correction;
[0015] If the correction code verification is performed on all the data blocks, the data reinforcement process of the non-volatile memory is terminated.
[0016] Optionally, if the initial error correction code representation of the current data block is corrected successfully, determining that the current data block is a target data block includes:
[0017] If the initial error correction code of the current data block indicates that error correction exists in the current data block and that the correction is successful, determining the number of error corrections indicated by the initial error correction code;
[0018] It is determined whether the error correction number is greater than a preset correction threshold, and if the error correction number is greater than the preset correction threshold, the current data block is determined to be a target data block.
[0019] Optionally, after determining whether the initial error correction code of the current data block indicates successful correction, the method further includes:
[0020] If the initial error correction code of the current data block indicates that there is no error correction in the current data block, the current data block is determined to be a non-target data block, and then the process jumps again to the step of determining whether all the data blocks are subjected to correction code verification.
[0021] Optionally, reading the target data stored in the target data block and rewriting the target data into the target data block includes:
[0022] Obtaining the number of consecutive error correction and repair times of the target data block from the current log file of the target data block, and determining whether the number of consecutive error correction and repair times is greater than a second preset threshold;
[0023] If the number of consecutive error correction and repair times is not greater than the second preset threshold, reading the target data stored in the target data block and rewriting the target data into the target data block;
[0024] If the number of consecutive error correction and repair times is greater than the second preset threshold, the data reinforcement process for the target data block is terminated, and the target data block is determined to be a faulty data block, and the generated alarm information of the faulty data block is reported.
[0025] Optionally, after rewriting the target data into the target data block, the method further includes:
[0026] Obtaining a rewritten error correction code of the target data block;
[0027] If the rewritten error correction code indicates that there is no error correction in the target data block, the continuous error correction and repair times of the target data block are updated to 0, and a new continuous error correction and repair times are obtained to complete data reinforcement for the target data block;
[0028] If the rewritten error correction code indicates that the correction is successful, the continuous error correction and repair times of the target data block are increased to obtain a new continuous error correction and repair times, and then the process jumps again to the step of determining whether the continuous error correction and repair times is greater than a second preset threshold.
[0029] Optionally, the data hardening method of the non-volatile memory further includes:
[0030] Record various log information of each data block, and generate a current log file of each data block containing various log information; wherein the log information includes the total number of correction code checks, the number of successful corrections represented by the initial error correction code, the number of times the error correction code is generated after rewriting, the result after the last correction code check, the temperature value when the data reinforcement is completed, and the temperature value when the data reinforcement process is terminated;
[0031] A fault analysis is performed based on the current log file of the faulty data block, so as to repair the faulty data block according to the obtained analysis result.
[0032] In a second aspect, the present application discloses a data reinforcement device for a non-volatile memory, comprising:
[0033] A correction code acquisition module, used for monitoring whether the current ambient temperature is lower than a first preset threshold, and if the current ambient temperature is lower than the first preset threshold, acquiring an initial error correction code of each data block in the non-volatile memory;
[0034] A data block screening module, configured to perform correction code verification on each of the data blocks based on the initial error correction code, so as to screen out a target data block whose initial error correction code indicates successful correction from each of the data blocks;
[0035] The data reinforcement module is used to read the target data stored in the target data block and rewrite the target data into the target data block to complete data reinforcement for the target data block.
[0036] In a third aspect, the present application discloses an electronic device, comprising:
[0037] Memory, used to store computer programs;
[0038] The processor is used to execute the computer program to implement the steps of the data hardening method of the non-volatile memory disclosed above.
[0039] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed method for data hardening of a non-volatile memory are implemented.
[0040] The beneficial effects of the present application are as follows: the present application monitors whether the current ambient temperature is lower than a first preset threshold value, and if the current ambient temperature is lower than the first preset threshold value, obtains the initial error correction code of each data block in the non-volatile memory; performs correction code verification on each data block based on the initial error correction code to filter out the target data block whose initial error correction code represents successful correction from each data block; reads the target data stored in the target data block, and rewrites the target data into the target data block to complete data reinforcement for the target data block. It can be seen that, in the present application, when the current ambient temperature is lower than the first preset threshold, that is, in a low temperature environment, the initial error correction code of each data block in the non-volatile memory is obtained, and then the data block represented by the initial error correction code for successful correction is rewritten, that is, the target data block represented by the initial error correction code for successful correction is selected from each data block, the target data stored in the target data block is read, and the target data is rewritten into the target data block. It can be understood that because the initial error correction code represents successful correction, on the one hand, it indicates that the data on the target data block is correct data after correction, and on the other hand, it indicates that the physical performance of the target data block at this time is poor and data reinforcement is required. Therefore, on this basis, the data read on the target data block is correct data, and the data rewritten into the target data is also correct. Performing a data rewrite operation on the target data block can restore the physical performance of the non-volatile memory, thereby ensuring the integrity of the data. Therefore, even if the data stored in the non-volatile memory is read in a low temperature environment, the accuracy of the data reading is guaranteed, and each data reinforcement is necessary to minimize the number of data rewrites to reduce the life of the non-volatile memory due to data re-damage. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] 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 invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0042] Figure 1 A flow chart of a data reinforcement method for a non-volatile memory disclosed in this application;
[0043] Figure 2 A specific temperature reading schematic diagram disclosed in this application;
[0044] Figure 3 A schematic diagram of a specific data reinforcement process disclosed in this application;
[0045] Figure 4A schematic diagram of a specific state acquisition process disclosed in this application;
[0046] Figure 5 A specific log file reading schematic diagram disclosed in this application;
[0047] Figure 6 A schematic diagram of a data reinforcement process of a specific non-volatile memory disclosed in this application;
[0048] Figure 7 This is a schematic diagram of the structure of a data reinforcement device for a non-volatile memory disclosed in the present application;
[0049] Figure 8 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0050] 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 invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0051] Non-volatile memory has higher data storage density, faster read and write speed and lower power consumption. For example, NAND Flash is a non-volatile memory based on NAND (NOT AND) technology. At present, non-volatile memory may cause data corruption in each data block when performing long-term reading operation in a low-temperature environment. The main reason for the damage is the defects in the characteristics of non-volatile memory. The data in non-volatile memory will reduce electrons every time it is read. When it is reduced to a certain extent, the data level will flip. For example, the data logic level is high when it is above 0.9v and low when it is below 0.9v. Then, when the electron reduction causes the data voltage to drop below 0.9v, the data level will flip from 1 to 0, resulting in data reading errors. This trend will be greatly accelerated in a low temperature environment (such as -40 degrees).
[0052] Traditional avoidance methods often only use temperature control or timed refresh mechanisms, but these solutions are costly and may affect the life of non-volatile memory, and can no longer meet the needs of modern communication modules.
[0053] To this end, the present application correspondingly provides a data reinforcement solution for a non-volatile memory, which improves the accuracy of reading data stored in the non-volatile memory in a low-temperature environment.
[0054] See also Figure 1As shown, the embodiment of the present application discloses a data reinforcement method for a non-volatile memory, comprising:
[0055] Step S11: monitoring whether the current ambient temperature is lower than a first preset threshold value, and if the current ambient temperature is lower than the first preset threshold value, obtaining an initial error correction code of each data block in the non-volatile memory.
[0056] The non-volatile memory monitors the current ambient temperature after it is powered on, for example Figure 2 A specific temperature reading schematic diagram shown in the figure can open a temperature file and read a temperature value, thereby monitoring the current ambient temperature and determining whether the current ambient temperature is lower than a first preset threshold value, for example, the first preset threshold value is minus forty degrees. If the current ambient temperature is lower than the first preset threshold value, the latest log file log in the non-volatile memory is loaded, and various log information is recorded in the log file; further, for example Figure 3 A specific data reinforcement process diagram is shown, calling the driver interface to obtain the initial error correction code (Error Correction Code, i.e., ECC) of each data block in the non-volatile memory, wherein ECC technology is a technology for detecting and correcting errors in data transmission or storage. It realizes automatic detection and repair of errors by adding redundant information to the data. When a bit error occurs during data transmission or storage, the ECC encoding can detect the location of the error and automatically correct it to ensure the integrity and reliability of the data. Therefore, the obtained error correction code can characterize whether the corresponding data block has error correction and whether the error correction is successful if it exists. The data block without error correction is a data block without damage.
[0057] Step S12: performing correction code verification on each of the data blocks based on the initial error correction code, so as to select, from the data blocks, a target data block whose initial error correction code indicates successful correction.
[0058] In this embodiment, the correction code check is performed on each of the data blocks based on the initial error correction code to filter out the target data block whose correction is successfully indicated by the initial error correction code from each of the data blocks, including: determining the current data block from each of the data blocks in the non-volatile memory, and judging whether the initial error correction code of the current data block indicates a successful correction; if the initial error correction code of the current data block indicates a successful correction, determining the current data block as the target data block; judging whether all of the data blocks have been subjected to correction code check; if there is a data block that has not been subjected to correction code check, determining the next data block from each of the data blocks in the non-volatile memory, updating the next data block to the current data block, and then jumping back to the step of judging whether the initial error correction code of the current data block indicates a successful correction; if all of the data blocks have been subjected to correction code check, terminating the data reinforcement process of the non-volatile memory.
[0059] It can be understood that a data block without error correction is a data block without damage, and a data block without damage does not need data reinforcement. A damaged data block does need data reinforcement, but some data blocks are too severely damaged to be corrected successfully, so data reinforcement is not required. Therefore, the target data block in this embodiment is a data block with error correction and successful correction. It is necessary to determine the target data block one by one. If the current data block is the target data block, that is, the initial error correction code representation of the current data block is corrected successfully, then the target data block is subsequently data reinforced, that is, the target data stored in the target data block is read, and the target data is rewritten into the target data block; further, it is determined whether all the data blocks have been corrected with the correction code. If there are still data blocks that have not been corrected with the correction code, the next data block is then corrected with the correction code. For example, the data blocks can be sorted to obtain the sequence number of each data block, and it is determined whether the current data block is the last data block according to the sequence number of the current data block. If not, it means that there are still data blocks that have not been corrected with the correction code. If it is the last data block, it means that there is no data block that has not been corrected with the correction code, until all target data blocks have completed the correction code verification and data reinforcement process.
[0060] In this embodiment, if the initial error correction code of the current data block indicates that the correction is successful, then the current data block is determined to be the target data block, including: if the initial error correction code of the current data block indicates that the current data block has error correction and the correction is successful, then the number of error corrections indicated by the initial error correction code is determined; and whether the number of error corrections is greater than a preset correction threshold, if the number of error corrections is greater than the preset correction threshold, then the current data block is determined to be the target data block. According to the initial error correction code, if it is found that the current data block has error correction and the correction is successful, and there are too many ECC errors, that is, the number of error corrections indicated by the initial error correction code is greater than the preset correction threshold, it is considered that the data of the block may have been damaged, and the damaged data block needs to be re-burned later.
[0061] In this embodiment, after determining whether the initial error correction code of the current data block indicates that the correction is successful, it also includes: if the initial error correction code of the current data block indicates that the current data block does not have error correction, then determine that the current data block is a non-target data block, and then jump again to the step of determining whether all the data blocks are subjected to correction code verification. It can be understood that if the initial error correction code of the current data block indicates that the current data block does not have error correction, it means that the current data block is a normal data block and is not damaged, so data reinforcement is not required, that is, the current data block is a non-target data block.
[0062] Step S13: Read the target data stored in the target data block, and rewrite the target data into the target data block to complete data reinforcement for the target data block.
[0063] For example Figure 4 A specific status acquisition process diagram is shown, where the user or system can obtain the current status through the node value / tmp / sbl_protect_state of the temporary partition protection status file to determine whether it is in repair. When the file does not exist or the node value is 0, it is not running; when the node value is 1, it is running; when the node value is 2, a data block is being refreshed.
[0064] In this embodiment, the reading of the target data stored in the target data block and rewriting the target data into the target data block includes: obtaining the number of consecutive error correction and repair times of the target data block from the current log file of the target data block, and determining whether the number of consecutive error correction and repair times is greater than a second preset threshold; if the number of consecutive error correction and repair times is not greater than the second preset threshold, reading the target data stored in the target data block and rewriting the target data into the target data block; if the number of consecutive error correction and repair times is greater than the second preset threshold, terminating the data reinforcement process for the target data block, determining that the target data block is a faulty data block, and reporting the generated alarm information of the faulty data block. Before rewriting data on the target data block, it is necessary to determine whether the number of consecutive error correction and repair times is greater than a second preset threshold. Error correction and repair refers to performing ECC error correction and repair on the data block each time. After each data rewrite, the data block needs to be checked by ECC to see if it needs to be repaired. If necessary, ECC error correction and repair is automatically performed on the data block. If the number of consecutive error correction and repair times is greater than the second preset threshold, it means that the data block is faulty and is not suitable for data rewriting. In other words, data reinforcement cannot repair physical damage, and it is determined to be a faulty data block, and alarm information of the faulty data block is reported so that maintenance personnel can repair the faulty data block. If the number of consecutive error correction and repair times is not greater than the second preset threshold, it means that although the target data block is damaged, the physical damage can be repaired by data reinforcement, so the data rewriting process can be executed on the target data block to complete the data reinforcement.
[0065] In this embodiment, after rewriting the target data into the target data block, it also includes: obtaining a post-rewrite error correction code of the target data block; if the post-rewrite error correction code indicates that there is no error correction in the target data block, updating the continuous error correction and repair times of the target data block to 0, and obtaining a new continuous error correction and repair times to complete data reinforcement of the target data block; if the post-rewrite error correction code indicates that the correction is successful, increasing the continuous error correction and repair times of the target data block, and obtaining a new continuous error correction and repair times, and then jumping back to the step of determining whether the continuous error correction and repair times is greater than a second preset threshold. The target data block after data rewriting is subjected to ECC check again to obtain the target data block after rewriting error correction code; if the target data block after rewriting error correction code indicates that there is no error correction in the target data block, it means that the damage of the target data block has been well repaired and no ECC error correction and repair is needed, then the number of continuous error correction and repair times of the target data block is updated to 0 to obtain a new number of continuous error correction and repair times to complete data reinforcement of the target data block; if the target data block after rewriting error correction code indicates that the correction is successful, it means that ECC error correction and repair are still performed on the target data block after data rewriting, so the number of continuous error correction and repair times of the target data block is increased, that is, the number of continuous error correction and repair times is increased by 1 to obtain a new number of continuous error correction and repair times, and then the step of determining whether the number of continuous error correction and repair times is greater than the second preset threshold is jumped again until the target data block after rewriting error correction code indicates that there is no error correction in the target data block or the number of continuous error correction and repair times is greater than the second preset threshold.
[0066] In this embodiment, it also includes: recording various log information of each of the data blocks, and generating a current log file of each of the data blocks containing various log information; wherein the log information includes the total number of correction code checks, the number of successful corrections represented by the initial error correction code, the number of times the error correction code is generated after rewriting, the result after the last correction code check, the temperature value when the data reinforcement is completed, and the temperature value when the data reinforcement process is terminated; fault analysis is performed based on the current log file of the faulty data block, so as to repair the fault of the faulty data block according to the obtained analysis results. When the current ambient temperature is monitored to be lower than the first preset threshold, the ECC check phase is started to reinforce the target data block, and various log information of each data block is triggered to generate the current log file of each data block containing various log information. The specific log information includes the total number of correction code checks, the number of successful corrections represented by the initial error correction code, the number of times the error correction code is generated after rewriting, the result after the last correction code check, the temperature value when the data reinforcement is completed, and the temperature value when the data reinforcement process is terminated. Further, it can also include the total number of checks of non-volatile memory, the total number of ECC checks of each data block, the total number of errors of each data block, the total number of repairs of each data block, the total number of errors after the last repair of each data block, the last ECC check result of each data block, the temperature value of the last check, and whether the ECC check was triggered when the data reinforcement program was executed for the last time. The current log file is generated based on these log information. In order to avoid unlimited growth of the log file (Log), the log file is designed as a binary file, which only records important historical times, and the content is not easy to understand, such as Figure 5 A specific log file reading diagram is shown. The log file is opened, and the "Read Log" use case can parse the file into a readable format and output it on the console. A fault analysis is performed based on the current log file of the fault data block to repair the fault data block according to the obtained analysis results.
[0067] The beneficial effects of the present application are as follows: the present application monitors whether the current ambient temperature is lower than a first preset threshold value, and if the current ambient temperature is lower than the first preset threshold value, obtains the initial error correction code of each data block in the non-volatile memory; performs correction code verification on each data block based on the initial error correction code to filter out the target data block whose initial error correction code represents successful correction from each data block; reads the target data stored in the target data block, and rewrites the target data into the target data block to complete data reinforcement for the target data block. It can be seen that, in the present application, when the current ambient temperature is lower than the first preset threshold, that is, in a low temperature environment, the initial error correction code of each data block in the non-volatile memory is obtained, and then the data block represented by the initial error correction code for successful correction is rewritten, that is, the target data block represented by the initial error correction code for successful correction is selected from each data block, the target data stored in the target data block is read, and the target data is rewritten into the target data block. It can be understood that because the initial error correction code represents successful correction, on the one hand, it indicates that the data on the target data block is correct data after correction, and on the other hand, it indicates that the physical performance of the target data block at this time is poor and data reinforcement is required. Therefore, on this basis, the data read on the target data block is correct data, and the data rewritten into the target data is also correct. Performing a data rewrite operation on the target data block can restore the physical performance of the non-volatile memory, thereby ensuring the integrity of the data. Therefore, even if the data stored in the non-volatile memory is read in a low temperature environment, the accuracy of the data reading is guaranteed, and each data reinforcement is necessary to minimize the number of data rewrites to reduce the life of the non-volatile memory due to data re-damage.
[0068] Below Figure 6 Taking the data reinforcement process diagram of a specific non-volatile memory as an example, the present application is described accordingly. Read the current ambient temperature and start recording various log information to generate a log file; determine whether the current ambient temperature is lower than a first preset threshold. If the current ambient temperature is lower than the first preset threshold, then based on the sequence number of the data block, perform correction code verification on each data block in the non-volatile memory in turn to determine the target data block that needs to be rewritten. The specific process is as follows:
[0069] 1) Determine whether all data blocks have been verified by the correction code. If there are data blocks that have not been verified by the correction code, jump to step 2). If all data blocks have been verified by the correction code, jump to step 12);
[0070] 2) Determine data block i from each data block in the non-volatile memory, obtain the initial error correction code ECC of data block i, record the last check result after power-on, and increase the total number of ECC checks of data block i by 1;
[0071] 3) Determine whether the initial error correction code of data block i indicates successful correction;
[0072] 4) If the initial error correction code of data block i does not indicate successful correction and there is no error correction, it means that data block i does not need data reinforcement, so data block i+1 is determined from the data blocks in the non-volatile memory, and then jump to step 1);
[0073] 5) If the initial error correction code representation of data block i is corrected successfully, then the total number of correction and repair times of data block i is increased by 1, and the number of correction and repair times based on the last repair is also increased by 1;
[0074] 6) Determine whether the number of consecutive error correction and repair times n is greater than a second preset threshold value, where the second preset threshold value is, for example, 3. It is understandable that if it is the first time to perform correction and repair, the number of consecutive error correction and repair times n is 0 at this time;
[0075] 7) If the number of consecutive error correction repairs of data block i is not greater than the second preset threshold, read the target data stored in data block i, rewrite the target data into data block i, and then jump to step 9);
[0076] 8) If the number of consecutive error correction repairs of data block i is greater than the second preset threshold, the data reinforcement process for data block i is terminated, and data block i is determined to be a faulty data block, and the generated alarm information of the faulty data block is reported, and then data block i+1 is determined from the data blocks in the non-volatile memory, and then jump to step 1);
[0077] 9) determining whether the rewritten error correction code of data block i indicates that there is no error correction for data block i;
[0078] 10) If the rewritten error correction code indicates that there is no error correction for data block i, the number of consecutive error correction and repair times of data block i is updated to 0, and a new number of consecutive error correction and repair times is obtained to complete data reinforcement for data block i, and then data block i+1 is determined from the data blocks in the non-volatile memory, and then jump to step 1);
[0079] 11) If the rewritten error correction code indicates that the data block i has error correction and the correction is successful, then the continuous error correction and repair times of the data block i are increased, that is, the continuous error correction and repair times are increased by 1, and a new continuous error correction and repair times are obtained, and then jump to step 6);
[0080] 12) End the data hardening process of the non-volatile memory.
[0081] See also Figure 7 As shown, the embodiment of the present application discloses a data reinforcement device for a non-volatile memory, comprising:
[0082] A correction code acquisition module 11, used to monitor whether the current ambient temperature is lower than a first preset threshold, and if the current ambient temperature is lower than the first preset threshold, to acquire an initial error correction code of each data block in the non-volatile memory;
[0083] A data block screening module 12 is used to perform correction code verification on each of the data blocks based on the initial error correction code, so as to screen out a target data block whose initial error correction code indicates successful correction from each of the data blocks;
[0084] The data reinforcement module 13 is used to read the target data stored in the target data block and rewrite the target data into the target data block to complete data reinforcement for the target data block.
[0085] The beneficial effects of the present application are as follows: the present application monitors whether the current ambient temperature is lower than a first preset threshold value, and if the current ambient temperature is lower than the first preset threshold value, obtains the initial error correction code of each data block in the non-volatile memory; performs correction code verification on each data block based on the initial error correction code to filter out the target data block whose initial error correction code represents successful correction from each data block; reads the target data stored in the target data block, and rewrites the target data into the target data block to complete data reinforcement for the target data block. It can be seen that, in the present application, when the current ambient temperature is lower than the first preset threshold, that is, in a low temperature environment, the initial error correction code of each data block in the non-volatile memory is obtained, and then the data block represented by the initial error correction code for successful correction is rewritten, that is, the target data block represented by the initial error correction code for successful correction is selected from each data block, the target data stored in the target data block is read, and the target data is rewritten into the target data block. It can be understood that because the initial error correction code represents successful correction, on the one hand, it indicates that the data on the target data block is correct data after correction, and on the other hand, it indicates that the physical performance of the target data block at this time is poor and data reinforcement is required. Therefore, on this basis, the data read on the target data block is correct data, and the data rewritten into the target data is also correct. Performing a data rewrite operation on the target data block can restore the physical performance of the non-volatile memory, thereby ensuring the integrity of the data. Therefore, even if the data stored in the non-volatile memory is read in a low temperature environment, the accuracy of the data reading is guaranteed, and each data reinforcement is necessary to minimize the number of data rewrites to reduce the life of the non-volatile memory due to data re-damage.
[0086] Furthermore, an embodiment of the present application also provides an electronic device. Figure 8This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be considered as any limitation on the scope of use of the present application.
[0087] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the data hardening method of the non-volatile memory executed by the electronic device disclosed in any of the aforementioned embodiments.
[0088] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0089] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0090] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.
[0091] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the data reinforcement method of the non-volatile memory executed by the electronic device disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to data transmitted from an external device received by the electronic device, the data 223 can also include data collected by its own input and output interface 25.
[0092] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed non-volatile memory data hardening method is implemented. The specific steps of the method can be referred to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.
[0093] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0094] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. The steps of the method or algorithm described in conjunction with the embodiments disclosed herein can be implemented directly with hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), memory, read-only memory (ROM), electrically programmable EPROM (Erasable Programmable Read Only Memory), electrically erasable programmable EEPROM (Electrically Erasable Programmable read only memory), register, hard disk, removable disk, CD-ROM (Compact Disc Read-Only Memory), or any other form of storage medium known in the technical field.
[0095] Finally, it should 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.
[0096] The above is a detailed introduction to the data hardening method, device, equipment and medium of a non-volatile memory provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for a general technician in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for data reinforcement of a non-volatile memory, characterized in that: include: monitoring whether the current ambient temperature is lower than a first preset threshold, and if the current ambient temperature is lower than the first preset threshold, obtaining an initial error correction code of each data block in the non-volatile memory; Performing correction code verification on each of the data blocks based on the initial error correction code to filter out a target data block whose initial error correction code indicates successful correction from each of the data blocks; The target data stored in the target data block is read, and the target data is rewritten into the target data block to complete data reinforcement for the target data block.
2. The data hardening method of non-volatile memory according to claim 1, characterized in that: The performing correction code checking on each of the data blocks based on the initial error correction code to filter out a target data block represented by the initial error correction code as successfully corrected from each of the data blocks comprises: Determining a current data block from each data block of the non-volatile memory, and judging whether the initial error correction code of the current data block indicates a successful correction; If the initial error correction code representation of the current data block indicates successful correction, determining the current data block as a target data block; Determining whether all the data blocks have been subjected to correction code verification; If there is a data block that has not been checked for the correction code, determine the next data block from the data blocks in the non-volatile memory, update the next data block as the current data block, and then jump again to the step of determining whether the initial error correction code of the current data block indicates successful correction; If the correction code verification is performed on all the data blocks, the data reinforcement process of the non-volatile memory is terminated.
3. The data reinforcement method of non-volatile memory according to claim 2, characterized in that: If the initial error correction code representation of the current data block is corrected successfully, determining that the current data block is a target data block includes: If the initial error correction code of the current data block indicates that error correction exists in the current data block and that the correction is successful, determining the number of error corrections indicated by the initial error correction code; It is determined whether the error correction number is greater than a preset correction threshold, and if the error correction number is greater than the preset correction threshold, the current data block is determined to be a target data block.
4. The data hardening method of non-volatile memory according to claim 2, characterized in that: After determining whether the initial error correction code of the current data block indicates successful correction, the method further includes: If the initial error correction code of the current data block indicates that there is no error correction in the current data block, the current data block is determined to be a non-target data block, and then the process jumps again to the step of determining whether all the data blocks are subjected to correction code verification.
5. The data hardening method of non-volatile memory according to claim 1, characterized in that: The step of reading the target data stored in the target data block and rewriting the target data into the target data block includes: Obtaining the number of consecutive error correction and repair times of the target data block from the current log file of the target data block, and determining whether the number of consecutive error correction and repair times is greater than a second preset threshold; If the number of consecutive error correction and repair times is not greater than the second preset threshold, reading the target data stored in the target data block and rewriting the target data into the target data block; If the number of consecutive error correction and repair times is greater than the second preset threshold, the data reinforcement process for the target data block is terminated, and the target data block is determined to be a faulty data block, and the generated alarm information of the faulty data block is reported.
6. The data hardening method of non-volatile memory according to claim 5, characterized in that: After rewriting the target data into the target data block, the method further includes: Obtaining a rewritten error correction code of the target data block; If the rewritten error correction code indicates that there is no error correction in the target data block, the continuous error correction and repair times of the target data block are updated to 0, and a new continuous error correction and repair times are obtained to complete data reinforcement for the target data block; If the rewritten error correction code indicates that the correction is successful, the continuous error correction and repair times of the target data block are increased to obtain a new continuous error correction and repair times, and then the process jumps again to the step of determining whether the continuous error correction and repair times is greater than a second preset threshold.
7. The data hardening method of a non-volatile memory according to claim 5, characterized in that: Also includes: Record various log information of each data block, and generate a current log file of each data block containing various log information; wherein the log information includes the total number of correction code checks, the number of successful corrections represented by the initial error correction code, the number of times the error correction code is generated after rewriting, the result after the last correction code check, the temperature value when the data reinforcement is completed, and the temperature value when the data reinforcement process is terminated; A fault analysis is performed based on the current log file of the faulty data block, so as to repair the faulty data block according to the obtained analysis result.
8. A data reinforcement device for a non-volatile memory, characterized in that: include: A correction code acquisition module, used to monitor whether the current ambient temperature is lower than a first preset threshold, and if the current ambient temperature is lower than the first preset threshold, to acquire an initial error correction code of each data block in the non-volatile memory; A data block screening module, configured to perform correction code verification on each of the data blocks based on the initial error correction code, so as to screen out a target data block whose initial error correction code indicates successful correction from each of the data blocks; The data reinforcement module is used to read the target data stored in the target data block and rewrite the target data into the target data block to complete data reinforcement for the target data block.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the data hardening method for a non-volatile memory as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the steps of the data hardening method for a non-volatile memory as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
A memory device for recovering data by using a temperature equalization data recovery method
CN109358984A
Method and device for generating trial and error table of nonvolatile memory
CN112331254A
Electronic apparatus and memory management system and program
JP2019204229A
Cited By
Surgical instrument data reading method and device, equipment and medium
CN119719686A
Data hardening method and apparatus for non-volatile memory, and device and medium
WO2026103032A1