Method for optimizing data retention capability of NAND flash memory, electronic equipment and storage medium

By updating the firmware program through detection time and temperature, the data retention capability of NAND flash memory is optimized, and the problem of insufficient data retention capability in high and low temperature environments in NAND flash is solved, and the accuracy of data reading is improved.

CN119621418AActive Publication Date: 2025-03-14ARTMEM TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510162652.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-14
Publication Date
2025-03-14
Estimated Expiration
2045-02-14

AI Technical Summary

Technical Problem

The existing NAND flash has high and low temperature cross-temperature reading and writing environments, and the data retention ability of firmware is weak, especially when reading at low temperature after high temperature programming, it is easy to cause data reading failure.

Method used

Optimize the data retention capability of NAND flash memory by updating the firmware program by detecting time and temperature. The specific method includes determining the detection time when the embedded multimedia card switches from the working state to the sleep state, and detecting the error correction code of the firmware program when the detection time reaches the preset threshold; obtaining the detection temperature when the ECC reaches the preset threshold; controlling the firmware program to refresh or keep it unchanged according to the detection temperature and the preset temperature scene division information.

Benefits of technology

By updating the firmware program with detection time and temperature, the data retention capability of NAND flash memory is significantly improved, thereby improving the accuracy of data reading and reducing the risk of failure to read data in extreme temperature environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621418A_ABST
    Figure CN119621418A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method for optimizing NAND flash memory data retention capability, electronic equipment and a computer readable storage medium. The method comprises the following steps: determining detection time under the condition that the embedded multimedia card is switched from a working state to a dormant state; under the condition that the detection time reaches a preset time threshold value, detecting an error correction code (ECC) of the firmware program; under the condition that the ECC reaches a preset detection threshold value, the detection temperature is obtained; and according to the detection temperature and the preset temperature scene division information, controlling the firmware program to carry out refreshing processing or keep the firmware program unchanged. According to the scheme of the embodiment of the invention, the firmware program can be updated in combination with the detection time and the detection temperature, and the data retention capability of the NAND flash memory is improved, so that the accuracy of subsequent data reading can be well improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method for optimizing the data retention capability of a NAND flash memory, an electronic device, and a computer-readable storage medium. Background Art

[0002] As the capacity of NAND flash memory increases, the manufacturing process has been well optimized. Although the cost has been reduced, for some TLC (three-layer cell, each cell stores 3 bits of data) and QLC (four-layer cell, each cell stores 4 bits of data) NAND, its ability to retain firmware data in high and low temperature cross-temperature read and write environments has been weakened. Especially in the scenario of high-temperature programming and low-temperature reading, due to physical characteristics, the firmware has poor data retention in high-temperature scenarios, which easily leads to all backups being programmed in high-temperature scenarios, triggering data read failure when the temperature drops to low temperatures. Summary of the invention

[0003] The present invention aims to solve at least one of the technical problems existing in the prior art.

[0004] To this end, the present invention proposes a method for optimizing the data retention capability of NAND flash memory, which can update the firmware program in combination with the detection time and the detection temperature, thereby improving the data retention capability of the NAND flash memory, thereby greatly improving the accuracy of subsequent data reading.

[0005] The present invention also provides an electronic device using the method for optimizing the data retention capability of a NAND flash memory.

[0006] The present invention also provides a computer-readable storage medium using the above method for optimizing the data retention capability of a NAND flash memory.

[0007] According to a method for optimizing the data retention capability of a NAND flash memory according to an embodiment of a first aspect of the present invention, the method is applied to an embedded multimedia card, the embedded multimedia card includes a controller and a NAND flash memory, the controller is connected to the NAND flash memory, the NAND flash memory includes a plurality of data blocks, each of the data blocks stores at least one firmware program, the method includes: When the embedded multimedia card switches from a working state to a dormant state, determining a detection time; When the detection time reaches a preset time threshold, detecting an error correction code (ECC) of the firmware program; When the ECC reaches a preset detection threshold, obtaining a detection temperature; According to the detected temperature and the preset temperature scene division information, controlling the firmware program to be refreshed or remain unchanged; The detection time is obtained according to a preset ECC setting value, and the preset ECC setting value includes a plurality of ECC thresholds that decrease in sequence and the difference between two adjacent ones decreases in sequence.

[0008] According to some embodiments of the present invention, the detection time is obtained by: Obtaining a first ECC threshold, a second ECC threshold, a third ECC threshold, a fourth ECC threshold, and a fifth ECC threshold; wherein the ECC setting value includes the first ECC threshold, the second ECC threshold, the third ECC threshold, the fourth ECC threshold, and the fifth ECC threshold; A first firmware detection time is determined according to the first ECC threshold; and a second firmware detection time is determined according to the second ECC threshold and the first ECC threshold; and a third firmware detection time is determined according to the third ECC threshold and the second ECC threshold; and a fourth firmware detection time is determined according to the fourth ECC threshold and the third ECC threshold; and a fifth firmware detection time is determined according to the fifth ECC threshold and the fourth ECC threshold; wherein the fifth firmware detection time, the fourth firmware detection time, the third firmware detection time, the second firmware detection time and the first firmware detection time decrease in sequence, and the detection time includes the fifth firmware detection time, the fourth firmware detection time, the third firmware detection time, the second firmware detection time and the first firmware detection time.

[0009] According to some embodiments of the present invention, the temperature scene division information includes a first temperature threshold and a second temperature threshold, the first temperature threshold is smaller than the second temperature threshold, and the controlling the firmware program to perform a refresh process or remain unchanged according to the detected temperature and the preset temperature scene division information includes: When the detected temperature satisfies a first scenario and there is only one firmware program programmed in a normal temperature environment in the NAND flash memory, controlling the corresponding firmware program to remain unchanged; wherein the first scenario is that the detected temperature is continuously lower than the first temperature threshold; When the detected temperature satisfies the second scenario, the third scenario and the sixth scenario, the corresponding firmware program is refreshed; wherein the second scenario is that the detected temperature is continuously between the first temperature threshold and the second temperature threshold, the third scenario is that the detected temperature is continuously higher than the second temperature threshold, and the sixth scenario is that the detected temperature is continuously higher than the first temperature threshold.

[0010] According to some embodiments of the present invention, controlling the firmware program to be refreshed or remain unchanged according to the detected temperature and the preset temperature scene division information includes: When the detected temperature satisfies a fourth scenario and the detected temperature is lower than the first temperature threshold, and there is only one firmware program programmed in a normal temperature environment in the NAND flash memory, controlling the corresponding firmware program to remain unchanged; wherein the fourth scenario is that the detected temperature is continuously lower than the second temperature threshold; In the case that the detected temperature satisfies the fourth scenario and the detected temperature is higher than the first temperature threshold, and there is only one firmware program programmed in a low temperature environment in the NAND flash memory, the corresponding firmware program is controlled to remain unchanged.

[0011] According to some embodiments of the present invention, controlling the firmware program to be refreshed or remain unchanged according to the detected temperature and the preset temperature scene division information includes: When the detected temperature satisfies the fifth scenario and the detected temperature is lower than the first temperature threshold, and there are at least two firmware programs programmed in a low temperature environment in the NAND flash memory, the corresponding firmware program is refreshed; wherein the fifth scenario includes that the detected temperature is lower than the first temperature threshold, the detected temperature is between the first temperature threshold and the second temperature threshold, and the detected temperature is higher than the second temperature threshold; When the detected temperature satisfies the fifth scenario and the detected temperature is between the first temperature threshold and the second temperature threshold, and there are at least two firmware programs programmed in a normal temperature environment in the NAND flash memory, refreshing the corresponding firmware programs; In the case that the detected temperature satisfies the fifth scenario and the detected temperature is higher than the second temperature threshold, and there is only one firmware program programmed in a low temperature environment in the NAND flash memory, the corresponding firmware program is controlled to remain unchanged.

[0012] According to some embodiments of the present invention, controlling the firmware program to be refreshed or remain unchanged according to the detected temperature and the preset temperature scene division information includes: When the detected temperature satisfies the fourth scenario and the detected temperature is lower than the first temperature threshold, and when there is more than one firmware program programmed in a normal temperature environment in the NAND flash memory, refreshing the corresponding firmware program; When the detected temperature satisfies the fourth scenario and is higher than the first temperature threshold, and when there is more than one firmware program programmed in a low-temperature environment in the NAND flash memory, a refresh process is performed on the corresponding firmware program.

[0013] According to some embodiments of the present invention, controlling the firmware program to be refreshed or remain unchanged according to the detected temperature and the preset temperature scene division information includes: When the detected temperature satisfies the fifth scenario and the detected temperature is lower than the first temperature threshold, and there are not at least two firmware programs programmed in a low temperature environment in the NAND flash memory, controlling the corresponding firmware program to remain unchanged; When the detected temperature satisfies the fifth scenario and the detected temperature is between the first temperature threshold and the second temperature threshold, and there are not at least two firmware programs programmed in a normal temperature environment in the NAND flash memory, controlling the corresponding firmware program to remain unchanged; When the detected temperature satisfies the fifth scenario and is higher than the second temperature threshold, and when there is more than one firmware program programmed in a low-temperature environment in the NAND flash memory, the firmware program is refreshed.

[0014] According to some embodiments of the present invention, when the detection time reaches a preset time threshold, after detecting the error correction code ECC of the firmware program, the method further includes: In the case that the ECC does not reach a preset detection threshold, the corresponding firmware program is controlled to remain unchanged.

[0015] An electronic device according to an embodiment of the second aspect of the present invention includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for optimizing the data retention capability of NAND flash memory as described above when executing the computer program.

[0016] According to a third aspect of an embodiment of the present invention, a computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a control processor, the method for optimizing the data retention capability of a NAND flash memory as described above is implemented.

[0017] According to the method for optimizing the data retention capability of NAND flash memory according to the embodiment of the present invention, there are at least the following beneficial effects: in the process of optimizing the data retention capability of NAND flash memory, first, when the embedded multimedia card switches from the working state to the sleeping state, the detection time is determined; and when the detection time reaches the preset time threshold, the error correction code ECC of the firmware program is detected and processed; when the ECC reaches the preset detection threshold, the detection temperature is obtained; finally, the firmware program can be controlled to be refreshed or remain unchanged according to the detection temperature and the preset temperature scene division information. Through the above technical solution, the firmware program can be updated in combination with the detection time and the detection temperature, and the data retention capability of the NAND flash memory can be improved, thereby greatly improving the accuracy of subsequent data reading.

[0018] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings are used to provide further understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure.

[0020] Figure 1 is a flow chart of a method for optimizing NAND flash memory data retention capability provided by an embodiment of the present invention; Figure 2 It is a schematic diagram of a storage method of a firmware program in a NAND flash memory provided by an embodiment of the present invention; Figure 3 It is a schematic diagram of a firmware program booting process provided by an embodiment of the present invention; Figure 4 is a flow chart of determining detection time provided by an embodiment of the present invention; Figure 5 is a flowchart of determining a firmware program detection timing provided by a specific embodiment of the present invention; Figure 6 is a schematic diagram of ECC threshold division provided by a specific embodiment of the present invention; Figure 7 yes Figure 1 Sub-flow chart of step S400 in; Figure 8 is a sub-flow chart of step S400 in which the detection temperature satisfies the fourth scenario; Fig. 9is a sub-flow chart of step S400 in which the detection temperature satisfies the fifth scenario; Fig.10 is another sub-flow chart of step S400 in which the detected temperature satisfies the fourth scenario; Fig.11 is another sub-flow chart of step S400 in which the detection temperature satisfies the fifth scenario; Fig.12 is a flowchart of processing a firmware program according to ECC provided by an embodiment of the present invention; Fig.13 is a schematic diagram of scene division provided by a specific embodiment of the present invention; Fig.14 is a schematic diagram of firmware program processing according to temperature provided by a specific embodiment of the present invention; Fig.15 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0022] In the description of the present invention, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0023] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.

[0024] The present invention provides a method for optimizing the data retention capability of NAND flash memory, an electronic device and a computer-readable storage medium, the method comprising: in the process of optimizing the data retention capability of NAND flash memory, firstly, when the embedded multimedia card switches from the working state to the sleeping state, the detection time is determined; and when the detection time reaches the preset time threshold, the error correction code ECC of the firmware program is detected and processed; when the ECC reaches the preset detection threshold, the detection temperature is obtained; finally, the firmware program can be processed according to the detection temperature and the preset temperature scene division information. Through the above technical scheme, the firmware program can be updated in combination with the detection time and the detection temperature, and the data retention capability of the NAND flash memory can be improved, thereby greatly improving the accuracy of subsequent data reading.

[0025] The embodiments of the present invention are further described below in conjunction with the accompanying drawings.

[0026] like Figure 1 As shown, a flow chart of a method for optimizing the data retention capability of a NAND flash memory provided by an embodiment of the present invention. The method is applied to an embedded multimedia card, the embedded multimedia card includes a controller and a NAND flash memory, the controller is connected to the NAND flash memory, the NAND flash memory includes a plurality of data blocks, each data block stores at least one firmware program; the method includes but is not limited to steps S100, S200, S300 and S400: Step S100, when the embedded multimedia card switches from a working state to a sleeping state, determining a detection time; Step S200, when the detection time reaches a preset time threshold, detecting the error correction code ECC of the firmware program; Step S300, when the ECC reaches a preset detection threshold, obtaining a detection temperature; Step S400, controlling the firmware program to be refreshed or remain unchanged according to the detected temperature and the preset temperature scene division information.

[0027] It should be noted that in the process of optimizing the data retention capability of NAND flash memory, the detection time is first determined when the embedded multimedia card switches from the working state to the sleeping state; and when the detection time reaches the preset time threshold, the error correction code ECC of the firmware program is detected and processed; when the ECC reaches the preset detection threshold, the detection temperature is obtained; finally, the information can be divided according to the detection temperature and the preset temperature scene, and the firmware program can be controlled to be refreshed or remain unchanged. Through the above technical solution, the firmware program can be updated in combination with the detection time and the detection temperature, and the data retention capability of the NAND flash memory can be improved, thereby greatly improving the accuracy of subsequent data reading.

[0028] It is worth noting that the embedded MultiMedia Card (eMMC) is a storage solution that packages NAND flash memory chips and control chips together; eMMC is mainly used in mobile devices, embedded systems, consumer electronics and automotive electronics.

[0029] It is worth noting that the embedded multimedia card includes a controller and a NAND flash memory, the controller and the NAND flash memory are connected, the NAND flash memory includes multiple data blocks, and each data block stores at least one firmware program; illustratively, in the actual application of NAND flash memory, multiple backups are always used. In this solution, at least four backups are used, that is, 4 blks (data blocks) are used to store the firmware program (a single blk may store multiple backups). According to statistics from many NAND flash memory manuals, blk0 in the NAND flash memory provided by each manufacturer must always be ensured to be a good data block; based on this, the most critical boot information is placed in blk 0 in the form of multiple backups, and blk 0 and the other three blks each store at least one complete firmware program, such as Figure 2 The specific location is saved by the boot information, and the specific location of the boot information is screened out after analyzing the characteristics of NAND flash memories on the market during actual application.

[0030] It should be noted that, for eMMC, in order to save costs, one controller is often used to adapt to NAND flash memories from more manufacturers. Figure 3As shown, it is a common firmware program boot process. In the process of booting the firmware program, the eMMC is powered on and first reads the firmware program from the boot-rom, but different manufacturers require different adapter firmware programs, that is, for the controller, the boot-rom needs to boot the firmware programs of different manufacturers. Because the firmware program is saved in the NAND flash memory, the data retention capabilities of different NAND flash memories are inconsistent. In order to adapt more NAND flash memories in the boot-rom stage, it is often impossible to add a complex reread mechanism without increasing the hardware cost, and the eMMC has certain requirements for the boot-rom boot time, and it is even more impossible to use methods such as software decomposition to enhance the ability to boot the firmware program. Especially in the scenario of high-temperature programming and low-temperature reading, due to physical characteristics, the data retention of the firmware program in the high-temperature scenario is poor, and it is easy to have all backups programmed in the high-temperature scenario; when the temperature drops to a low temperature, it is very likely to trigger a data read failure. Therefore, in order to solve this problem, an embodiment of the present invention provides a method for optimizing the data retention capability of NAND flash memory, which aims to avoid refreshing data or refreshing all data only when serious errors occur in different extreme temperature environments, so as to enhance the data retention capability. The embodiment of the present invention can well enhance the possibility of the firmware program being successfully booted through multiple backups.

[0031] It is worth noting that after the eMMC switches from the working state to the sleeping state, the detection time will be determined; when it is determined that the detection time reaches the preset time threshold, the error correction code ECC of the firmware program will be detected and processed; among them, ECC is a technology used to detect and correct errors in data storage and transmission. In eMMC, ECC technology plays a vital role to ensure the integrity and reliability of data. When the ECC of the firmware program reaches the preset detection threshold, the temperature of the current environment will be detected and processed to obtain the detection temperature; finally, the information is divided according to the detection temperature and the preset temperature scene, and the firmware program is processed; in extreme temperature conditions, if a high ECC error occurs, the firmware program is selectively refreshed for different temperatures.

[0032] In addition, in one embodiment, if Figure 4 As shown, the detection time can be obtained by but not limited to the following steps: Step S110, obtaining a first ECC threshold, a second ECC threshold, a third ECC threshold, a fourth ECC threshold and a fifth ECC threshold; Step S120, determining a first firmware detection time according to a first ECC threshold; and determining a second firmware detection time according to a second ECC threshold and the first ECC threshold; and determining a third firmware detection time according to a third ECC threshold and the second ECC threshold; and determining a fourth firmware detection time according to a fourth ECC threshold and the third ECC threshold; and determining a fifth firmware detection time according to a fifth ECC threshold and the fourth ECC threshold.

[0033] It should be noted that, in the process of determining the detection time, the first ECC threshold, the second ECC threshold, the third ECC threshold, the fourth ECC threshold and the fifth ECC threshold are first obtained; then the first firmware detection time is determined according to the first ECC threshold, the second firmware detection time is determined according to the second ECC threshold and the first ECC threshold, the third firmware detection time is determined according to the third ECC threshold and the second ECC threshold, the fourth firmware detection time is determined according to the fourth ECC threshold and the third ECC threshold, and the fifth firmware detection time is determined according to the fifth ECC threshold and the fourth ECC threshold. Determining the detection time according to different ECC thresholds makes the detection timing of the firmware program more appropriate and reasonable.

[0034] It is worth noting that the detection time is obtained according to a preset ECC setting value, and the preset ECC setting value includes a plurality of ECC thresholds that decrease in sequence and the difference between two adjacent ones decreases in sequence. In an embodiment of the present invention, the ECC setting value includes a first ECC threshold, a second ECC threshold, a third ECC threshold, a fourth ECC threshold and a fifth ECC threshold, and the fifth ECC threshold, the fourth ECC threshold, the third ECC threshold, the second ECC threshold and the first ECC threshold decrease in sequence, and the difference between the fifth ECC threshold, the fourth ECC threshold, the third ECC threshold, the second ECC threshold and the first ECC threshold decreases in sequence; and the fifth firmware detection time, the fourth firmware detection time, the third firmware detection time, the second firmware detection time and the first firmware detection time decrease in sequence; the detection time includes the fifth firmware detection time, the fourth firmware detection time, the third firmware detection time, the second firmware detection time and the first firmware detection time.

[0035] For example, Figure 5As shown, the working state of eMMC can be generally divided into sleep state and working state. In the working state, a timer is used for timing. When the working state switches to the sleep state and the time reaches the set time, the firmware program will be detected. If it is found that the ECC exceeds a certain threshold, it will determine whether to refresh it based on the temperature conditions. The key point here is the time to detect the firmware program and the setting of the ECC threshold. If the detection is frequent, it will affect the operating efficiency of the firmware and increase power consumption; if the detection frequency is low, the opportunity to refresh the firmware program will be missed. In the MTBF (Mean Time between Failures) analysis during the data retention experiment, the time and Ecc thresholds are divided into five levels. Assuming that the complete error is 1, as Figure 6 As shown, A, B, C, D, E represent the thresholds of each stage of ECC, and satisfy (ED)> (DC)> (CB)> (BA). t1, t2, t3, t4, t5 are the detection time, which decreases accordingly. When the value of Ecc is in the ED segment, it is considered that the firmware needs to be refreshed at this time.

[0036] In addition, in one embodiment, if Figure 7 As shown, the temperature scene division information includes a first temperature threshold and a second temperature threshold, the first temperature threshold is smaller than the second temperature threshold, and the firmware program is processed according to the detected temperature and the preset temperature scene division information, which may include but is not limited to step S410 and step S420.

[0037] Step S410, when the detected temperature satisfies the first scenario and there is only one firmware program programmed in a normal temperature environment in the NAND flash memory, control the corresponding firmware program to remain unchanged; wherein the first scenario is that the detected temperature is continuously lower than the first temperature threshold; Step S420, when the detected temperature satisfies the second scenario, the third scenario and the sixth scenario, the corresponding firmware program is refreshed; wherein the second scenario is that the detected temperature is continuously between the first temperature threshold and the second temperature threshold, the third scenario is that the detected temperature is continuously higher than the second temperature threshold, and the sixth scenario is that the detected temperature is continuously higher than the first temperature threshold.

[0038] It is worth noting that, in the embodiment of the present invention, a temperature lower than the first temperature threshold is a low temperature, a temperature between the first temperature threshold and the second temperature threshold is a normal temperature, and a temperature higher than the second temperature threshold is a high temperature. That is, in the above embodiment, the first scene is a low temperature scene, the second scene is a normal temperature scene, the third scene is a high temperature scene, and the sixth scene is a normal temperature and high temperature switching scene.

[0039] It should be noted that, in the process of processing the firmware program according to the detected temperature and the preset temperature scene division information, when the detected temperature meets the first scene and there is only one firmware program programmed in the normal temperature environment in the NAND flash memory, the corresponding firmware program will be controlled to remain unchanged; wherein, the first scene is that the detected temperature is continuously lower than the first temperature threshold. When the detected temperature meets the second scene, the third scene and the sixth scene, the corresponding firmware program will be refreshed; wherein, the second scene is that the detected temperature is continuously between the first temperature threshold and the second temperature threshold, the third scene is that the detected temperature is continuously higher than the second temperature threshold, and the sixth scene is that the detected temperature is continuously higher than the first temperature threshold. Through the above technical solution, a more reasonable firmware program refresh process can be achieved in the scenarios of low temperature, normal temperature, high temperature or switching between normal temperature and high temperature, thereby improving the data retention capacity of the NAND flash memory.

[0040] In addition, in one embodiment, if Figure 8 As shown, the firmware program is processed according to the detected temperature and the preset temperature scene division information, which may include but is not limited to step S430 and step S440.

[0041] Step S430, when the detected temperature satisfies the fourth scenario and the detected temperature is lower than the first temperature threshold, and there is only one firmware program programmed in a normal temperature environment in the NAND flash memory, controlling the corresponding firmware program to remain unchanged; wherein the fourth scenario is that the detected temperature is continuously lower than the second temperature threshold; Step S440: When the detected temperature satisfies the fourth scenario and is higher than the first temperature threshold, and there is only one firmware program programmed in a low temperature environment in the NAND flash memory, control the corresponding firmware program to remain unchanged.

[0042] It should be noted that, in the process of processing the firmware program according to the detected temperature and the preset temperature scene division information, when the detected temperature meets the fourth scene and the detected temperature is lower than the first temperature threshold, and there is only one firmware program programmed in the normal temperature environment in the NAND flash memory, the corresponding firmware program is controlled to remain unchanged; wherein the fourth scene is that the detected temperature is continuously lower than the second temperature threshold; when the detected temperature meets the fourth scene and the detected temperature is higher than the first temperature threshold, and there is only one firmware program programmed in the low temperature environment in the NAND flash memory, the corresponding firmware program is controlled to remain unchanged. Through the above technical solution, a more reasonable firmware program refresh processing can be achieved in the scenario of switching between low temperature and normal temperature, thereby improving the data retention capability of the NAND flash memory.

[0043] In addition, in one embodiment, if Fig. 9As shown, the firmware program is processed according to the detected temperature and the preset temperature scene division information, which may include but is not limited to step S450, step S460 and step S470.

[0044] Step S450, when the detected temperature satisfies the fifth scenario and the detected temperature is lower than the first temperature threshold, and there are at least two firmware programs programmed in the low temperature environment in the NAND flash memory, the corresponding firmware program is refreshed; wherein the fifth scenario includes the detected temperature being lower than the first temperature threshold, the detected temperature being between the first temperature threshold and the second temperature threshold, and the detected temperature being higher than the second temperature threshold; Step S460, when the detected temperature satisfies the fifth scenario and the detected temperature is between the first temperature threshold and the second temperature threshold, and there are at least two firmware programs programmed in a normal temperature environment in the NAND flash memory, refreshing the corresponding firmware programs; Step S470: When the detected temperature satisfies the fifth scenario and is higher than the second temperature threshold, and there is only one firmware program programmed in a low temperature environment in the NAND flash memory, control the corresponding firmware program to remain unchanged.

[0045] It should be noted that, in the process of processing the firmware program according to the detection temperature and the preset temperature scene division information, when the detection temperature meets the fifth scene and the detection temperature is lower than the first temperature threshold, and there are at least two firmware programs programmed in the low temperature environment in the NAND flash memory, the corresponding firmware program is refreshed; wherein the fifth scene includes the detection temperature being lower than the first temperature threshold, the detection temperature being between the first temperature threshold and the second temperature threshold, and the detection temperature being greater than the second temperature threshold; when the detection temperature meets the fifth scene and the detection temperature is between the first temperature threshold and the second temperature threshold, and there are at least two firmware programs programmed in the normal temperature environment in the NAND flash memory, the corresponding firmware program is refreshed; when the detection temperature meets the fifth scene and the detection temperature is higher than the second temperature threshold, and there is only one firmware program programmed in the low temperature environment in the NAND flash memory, the corresponding firmware program is controlled to remain unchanged. Through the above technical solution, a more reasonable firmware program refresh process can be achieved in the scenario of switching between low temperature, normal temperature and high temperature, thereby improving the data retention capability of the NAND flash memory.

[0046] In addition, in one embodiment, if Fig.10 As shown, the firmware program is processed according to the detected temperature and the preset temperature scene division information, which may include but is not limited to step S480 and step S490.

[0047] Step S480, when the detected temperature satisfies the fourth scenario and is lower than the first temperature threshold, and when there is more than one firmware program programmed in the normal temperature environment in the NAND flash memory, refreshing the corresponding firmware program; Step S490: When the detected temperature satisfies the fourth scenario and is higher than the first temperature threshold, and there is more than one firmware program programmed in a low temperature environment in the NAND flash memory, a corresponding firmware program is refreshed.

[0048] It should be noted that, in the process of processing the firmware program according to the detected temperature and the preset temperature scene division information, when the detected temperature meets the fourth scenario and the detected temperature is lower than the first temperature threshold, and there is not only one firmware program programmed in the normal temperature environment in the NAND flash memory, the corresponding firmware program is refreshed; when the detected temperature meets the fourth scenario and the detected temperature is higher than the first temperature threshold, and there is not only one firmware program programmed in the low temperature environment in the NAND flash memory, the corresponding firmware program is refreshed; through the above technical solution, it is also possible to implement more reasonable firmware program refresh processing in the scenario of switching between low temperature and normal temperature, thereby improving the data retention capability of the NAND flash memory.

[0049] In addition, in one embodiment, if Fig.11 As shown, the firmware program is processed according to the detected temperature and the preset temperature scene division information, which may include but is not limited to step S500, step S510 and step S520.

[0050] Step S500, when the detected temperature satisfies the fifth scenario and is lower than the first temperature threshold, and there are not at least two firmware programs programmed in a low temperature environment in the NAND flash memory, controlling the corresponding firmware program to remain unchanged; Step S510, when the detected temperature satisfies the fifth scenario and the detected temperature is between the first temperature threshold and the second temperature threshold, and there are not at least two firmware programs programmed in the normal temperature environment in the NAND flash memory, controlling the corresponding firmware program to remain unchanged; Step S520: When the detected temperature satisfies the fifth scenario and is higher than the second temperature threshold, and there is more than one firmware program programmed in a low temperature environment in the NAND flash memory, the firmware program is refreshed.

[0051] It should be noted that, in the process of processing the firmware program according to the detected temperature and the preset temperature scene division information, when the detected temperature meets the fifth scene and the detected temperature is lower than the first temperature threshold, and there are not at least two firmware programs programmed for low temperature environments in the NAND flash memory, the corresponding firmware program is controlled to remain unchanged; when the detected temperature meets the fifth scene and the detected temperature is between the first temperature threshold and the second temperature threshold, and there are not at least two firmware programs programmed for normal temperature environments in the NAND flash memory, the corresponding firmware program is controlled to remain unchanged; when the detected temperature meets the fifth scene and the detected temperature is higher than the second temperature threshold, and there is not only one firmware program programmed for low temperature environments in the NAND flash memory, the firmware program is refreshed. Through the above technical solution, it is also possible to achieve a more reasonable firmware program refresh process in the scenario of switching between low temperature, normal temperature and high temperature, thereby improving the data retention capability of the NAND flash memory.

[0052] In addition, in one embodiment, if Fig.12 As shown, when the detection time reaches the preset time threshold, after the error correction code ECC of the firmware program is detected, it may also include but not be limited to step S210.

[0053] Step S210: When the ECC does not reach a preset detection threshold, the corresponding firmware program is controlled to remain unchanged.

[0054] It should be noted that, when the detection time reaches the preset time threshold, after the error correction code ECC of the firmware program is detected, if the ECC does not reach the preset detection threshold, the corresponding firmware program is controlled to remain unchanged. The ECC of the firmware program is detected and processed, and the firmware program is processed based on the ECC, so that the processing of the firmware program can be more reasonable.

[0055] For example, Fig.13 As shown, the temperature is classified into: low temperature, normal temperature, and high temperature, where the temperature range of normal temperature is defined as A℃-B℃. The basic principle of the embodiment scheme of the present application is that the active state of electrons is different at different temperatures, that is, when programming the NAND flash memory at different temperatures, the distribution voltage of the electrons is also different, and at different temperatures, the speed of change of the distribution voltage of the electrons in the same time is also different. The temperature is recorded by eMMC during working hours to determine the scene at this time: 1. Long-term low temperature; 2. Long-term normal temperature; 3. Long-term high temperature; 4. Switching between low temperature and normal temperature states; 5. Switching between low temperature, normal temperature, and high temperature states; 6. Switching between normal temperature and high temperature states.

[0056] like Fig.14As shown, for scenes 2, 3, and 6, when a backup is detected to have a problem, you can choose to refresh this backup without any restrictions. For scenes 1 and 4, and in a low temperature environment, when a backup is detected to have a problem, if this backup is currently the only backup programmed in a normal temperature environment, it will not be refreshed, otherwise it will be refreshed. For scene 4, in a normal temperature environment, when a backup is detected to have a problem, if this backup is currently the only backup programmed in a low temperature environment, it will not be refreshed, otherwise it will be refreshed. For scene 5, in a low temperature environment, when a backup is detected to have a problem, it should be ensured that after the refresh, the backup programmed at low temperature is less than or equal to 2. In a normal temperature environment, when a backup is detected to have a problem, it should be ensured that after the refresh, the backup programmed at normal temperature is less than or equal to 2. In a high temperature environment, when a backup is detected to have a problem, if this backup is currently the only backup programmed in a low temperature environment, it will not be refreshed, otherwise it will be refreshed. For scenarios 5 and 6, if the current trend is from high temperature to normal temperature, the backups that have been updated at high temperature should be updated again to ensure that most of the backups are programmed at normal temperature. In order to prevent the temperature from fluctuating around B℃, resulting in the state switching back and forth and increasing the number of erase / programming times of the NAND flash memory, the temperature is switched in the following way. When the temperature rises from a low temperature to B+5℃, it is considered to be a high temperature environment. When the temperature drops from a high temperature to B-5℃ and below, it is considered to have returned to normal temperature. Among them, ±5℃ is a variable offset. Targeted modifications are made according to the usage scenarios of different users. Similarly, the judgment of low temperature and normal temperature is also the same.

[0057] The embodiment of the present invention is aimed at the characteristics of NAND flash memory, and avoids the situation that the firmware program must go through a complex rereading process to read correctly. Through the embodiment of the present invention, the integrity of the firmware program can be effectively monitored. When a problem occurs in one of the backups, the software process can be optimized to avoid high-temperature programming or low-temperature programming in all firmware program backups. When it is programmed at high and low temperatures, if the temperature slowly changes to another extreme when the power is off, it is possible to read the firmware program error at this temperature, and it can be read normally when it returns to the programming temperature. Therefore, it is particularly important to reprogram the wrong firmware program at the right time. The embodiment of the present invention uses time and temperature as factors affecting data retention capacity, so that data refresh can be more reasonable. The embodiment of the present invention can also reduce the number of times NAND flash memory is erased / programmed, extend the service life of NAND, and be more suitable for switching back and forth between extreme conditions of low temperature and high temperature.

[0058] In some embodiments of the present invention, Fig.15As shown, an embodiment of the present invention further provides an electronic device 700, including: a memory 720, a processor 710, and a computer program stored in the memory 720 and executable on the processor 710. When the processor 710 executes the computer program, the method for optimizing the data retention capability of the NAND flash memory in the above embodiment is implemented, for example, the above described Figure 1 Steps S100 to S400 of the method, Figure 4 Steps S110 to S120 of the method, Figure 7 Steps S410 to S420 of the method, Figure 8 Steps S430 to S440 of the method, Fig. 9 Steps S450 to S470 of the method, Fig.10 Steps S480 to S490 of the method, Fig.11 Steps S500 to S520 of the method and Fig.12 Method step S210 in .

[0059] In some embodiments of the present invention, an embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. The computer-executable instructions are executed by a processor or a controller, for example, by a processor in the above-mentioned device embodiment, so that the above-mentioned processor can execute the method for optimizing the data retention capability of the NAND flash memory in the above-mentioned embodiment, for example, executing the above-mentioned Figure 1 Steps S100 to S400 of the method, Figure 4 Steps S110 to S120 of the method, Figure 7 Steps S410 to S420 of the method, Figure 8 Steps S430 to S440 of the method, Fig. 9 Steps S450 to S470 of the method, Fig.10 Steps S480 to S490 of the method, Fig.11 Steps S500 to S520 of the method and Fig.12 Method step S210 in .

[0060] It will be appreciated by those skilled in the art that all or some of the steps and systems in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0061] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions without violating the spirit of the present invention. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. A method for optimizing the data retention capability of NAND flash memory, characterized in that: Applied to an embedded multimedia card, the embedded multimedia card includes a controller and a NAND flash memory, the controller is connected to the NAND flash memory, the NAND flash memory includes a plurality of data blocks, each data block stores at least one firmware program, the method includes: When the embedded multimedia card switches from a working state to a dormant state, determining a detection time; When the detection time reaches a preset time threshold, detecting an error correction code (ECC) of the firmware program; When the ECC reaches a preset detection threshold, obtaining a detection temperature; According to the detected temperature and the preset temperature scene division information, controlling the firmware program to be refreshed or remain unchanged; The detection time is obtained according to a preset ECC setting value, and the preset ECC setting value includes a plurality of ECC thresholds that decrease in sequence and the difference between two adjacent ones decreases in sequence.

2. The method for optimizing the data retention capability of NAND flash memory according to claim 1, characterized in that: The detection time is obtained by: Obtaining a first ECC threshold, a second ECC threshold, a third ECC threshold, a fourth ECC threshold, and a fifth ECC threshold; wherein the ECC setting value includes the first ECC threshold, the second ECC threshold, the third ECC threshold, the fourth ECC threshold, and the fifth ECC threshold; A first firmware detection time is determined according to the first ECC threshold; and a second firmware detection time is determined according to the second ECC threshold and the first ECC threshold; and a third firmware detection time is determined according to the third ECC threshold and the second ECC threshold; and a fourth firmware detection time is determined according to the fourth ECC threshold and the third ECC threshold; and a fifth firmware detection time is determined according to the fifth ECC threshold and the fourth ECC threshold; wherein the fifth firmware detection time, the fourth firmware detection time, the third firmware detection time, the second firmware detection time and the first firmware detection time decrease in sequence, and the detection time includes the fifth firmware detection time, the fourth firmware detection time, the third firmware detection time, the second firmware detection time and the first firmware detection time.

3. The method for optimizing the data retention capability of NAND flash memory according to claim 1, characterized in that: The temperature scene division information includes a first temperature threshold and a second temperature threshold, the first temperature threshold is smaller than the second temperature threshold, and the controlling the firmware program to be refreshed or remain unchanged according to the detected temperature and the preset temperature scene division information includes: When the detected temperature satisfies a first scenario and there is only one firmware program programmed in a normal temperature environment in the NAND flash memory, controlling the corresponding firmware program to remain unchanged; wherein the first scenario is that the detected temperature is continuously lower than the first temperature threshold; When the detected temperature satisfies the second scenario, the third scenario and the sixth scenario, the corresponding firmware program is refreshed; wherein the second scenario is that the detected temperature is continuously between the first temperature threshold and the second temperature threshold, the third scenario is that the detected temperature is continuously higher than the second temperature threshold, and the sixth scenario is that the detected temperature is continuously higher than the first temperature threshold.

4. The method for optimizing the data retention capability of NAND flash memory according to claim 3, characterized in that: The controlling the firmware program to be refreshed or remain unchanged according to the detected temperature and the preset temperature scene division information comprises: When the detected temperature satisfies a fourth scenario and the detected temperature is lower than the first temperature threshold, and there is only one firmware program programmed in a normal temperature environment in the NAND flash memory, controlling the corresponding firmware program to remain unchanged; wherein the fourth scenario is that the detected temperature is continuously lower than the second temperature threshold; In the case that the detected temperature satisfies the fourth scenario and the detected temperature is higher than the first temperature threshold, and there is only one firmware program programmed in a low temperature environment in the NAND flash memory, the corresponding firmware program is controlled to remain unchanged.

5. The method for optimizing the data retention capability of NAND flash memory according to claim 3, characterized in that: The controlling the firmware program to be refreshed or remain unchanged according to the detected temperature and the preset temperature scene division information comprises: When the detected temperature satisfies the fifth scenario and the detected temperature is lower than the first temperature threshold, and there are at least two firmware programs programmed in a low temperature environment in the NAND flash memory, the corresponding firmware program is refreshed; wherein the fifth scenario includes that the detected temperature is lower than the first temperature threshold, the detected temperature is between the first temperature threshold and the second temperature threshold, and the detected temperature is higher than the second temperature threshold; When the detected temperature satisfies the fifth scenario and the detected temperature is between the first temperature threshold and the second temperature threshold, and there are at least two firmware programs programmed in a normal temperature environment in the NAND flash memory, refreshing the corresponding firmware programs; In the case that the detected temperature satisfies the fifth scenario and the detected temperature is higher than the second temperature threshold, and there is only one firmware program programmed in a low temperature environment in the NAND flash memory, the corresponding firmware program is controlled to remain unchanged.

6. The method for optimizing the data retention capability of NAND flash memory according to claim 4, characterized in that: The controlling the firmware program to be refreshed or remain unchanged according to the detected temperature and the preset temperature scene division information comprises: When the detected temperature satisfies the fourth scenario and the detected temperature is lower than the first temperature threshold, and when there is more than one firmware program programmed in a normal temperature environment in the NAND flash memory, refreshing the corresponding firmware program; When the detected temperature satisfies the fourth scenario and is higher than the first temperature threshold, and when there is more than one firmware program programmed in a low-temperature environment in the NAND flash memory, a refresh process is performed on the corresponding firmware program.

7. The method for optimizing the data retention capability of NAND flash memory according to claim 5, characterized in that: The controlling the firmware program to be refreshed or remain unchanged according to the detected temperature and the preset temperature scene division information comprises: When the detected temperature satisfies the fifth scenario and the detected temperature is lower than the first temperature threshold, and there are not at least two firmware programs programmed in a low temperature environment in the NAND flash memory, controlling the corresponding firmware program to remain unchanged; When the detected temperature satisfies the fifth scenario and the detected temperature is between the first temperature threshold and the second temperature threshold, and there are not at least two firmware programs programmed in a normal temperature environment in the NAND flash memory, controlling the corresponding firmware program to remain unchanged; When the detected temperature satisfies the fifth scenario and is higher than the second temperature threshold, and when there is more than one firmware program programmed in a low-temperature environment in the NAND flash memory, the firmware program is refreshed.

8. The method for optimizing the data retention capability of NAND flash memory according to claim 1, characterized in that: In the case where the detection time reaches a preset time threshold, after detecting the error correction code ECC of the firmware program, the method further includes: In the case that the ECC does not reach a preset detection threshold, the corresponding firmware program is controlled to remain unchanged.

9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for optimizing the data retention capability of a NAND flash memory as claimed in any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium storing computer-executable instructions, characterized in that: When the computer executable instructions are executed by the control processor, the method for optimizing the data retention capability of NAND flash memory as claimed in any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • A method and a device for improving the reliability of NAND flash memory data

    CN109542667A

  • Method for optimizing NAND Flash read reference voltage in SSD

    CN111192620A

  • ECC (Error Correction Code)-based flash memory particle repeated screening method, controller and medium

    CN116994631A

  • Dynamic adjustment of data protection schemes in flash storage systems based on temperature, power off duration and flash age

    US20150169398A1

Cited By

  • Method and system for prolonging retention time of stored data of embedded flash memory

    CN121260212A