Data reading and writing method, electronic device, storage medium and chip
By writing data in different temperature zones in the Flash memory and reading and rewriting data in the normal temperature zone, using temperature marks to distinguish data written in different temperature zones, the problem of poor reliability of Flash memory under cross-temperature conditions is solved, and data reading with high reliability at different temperatures is realized.
Patent Information
- Application Number
- CN202311607978.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-28
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2043-11-28
AI Technical Summary
As more bit data is stored in Flash memory, especially when four-layer unit storage technology is used, the worse the cross-temperature reliability of the memory is, resulting in a serious deviation of the on-voltage probability density, affecting the data readout reliability.
By writing data in different temperature zones and reading and rewriting data in normal temperature zones, the data written in different temperature zones are distinguished by temperature marks, thereby reducing the on-voltage offset caused by temperature changes and improving data read reliability.
Improve data read reliability at different temperatures, ensure the reliability of data read at ultra-low temperature, normal temperature or ultra-high temperature, and reduce the probability of read errors.
Smart Images

Figure CN118445216B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of memory technology, and in particular to a data reading and writing method, an electronic device, a storage medium and a chip. Background Art
[0002] Flash memory can store programs and data. Cell is the basic storage unit of flash memory, which is a semiconductor storage unit composed of floating gate transistors. Data can be programmed and written into the cell, and data can also be read from the cell.
[0003] As more bits of data are stored in a cell, the reliability of the flash memory becomes worse, especially when quadruple level cell (QLC) or even more-layer storage technology is used, the cross-temperature reliability of the flash memory becomes worse. Summary of the invention
[0004] The present application provides a data reading and writing method, an electronic device, a storage medium and a chip, which can improve the cross-temperature reading and writing reliability of a memory.
[0005] In order to achieve the above-mentioned purpose, the first aspect of the present application adopts the following technical solutions:
[0006] The first aspect of the present application provides a data reading and writing method, comprising:
[0007] When writing first data into a first physical page, if the ambient temperature is less than or equal to a first value, writing a first mark into the first physical page;
[0008] When the ambient temperature is greater than the first value and less than a second value, the first data is read from the first physical page of the first mark, and the first data is written into the second physical page.
[0009] As more bits of data are stored in the cell, the normal distribution of the on-state voltage of the cell in different states becomes denser, and the reliability of the cell becomes worse; especially when the temperature difference is large, the VT (on-state voltage probability density) offset is serious, causing the reference voltage to offset, and the reliability is even worse.
[0010] For example, when data written at a temperature less than or equal to a first value (which can be recorded as ultra-low temperature) is read at a temperature greater than or equal to a second value (which can be recorded as ultra-high temperature), the read reliability is poor due to severe VT offset.
[0011] In order to solve this problem, the data written at the ultra-low temperature are read out at a normal temperature (a temperature between the ultra-low temperature and the ultra-high temperature), and then rewritten in other physical pages at the normal temperature.
[0012] Since the temperature difference between ultra-low temperature and normal temperature is not too large, the VT offset is not serious, so the reliability of reading data written at ultra-low temperature at normal temperature is higher; similarly, for data rewritten at normal temperature, no matter when it is read at ultra-low temperature, ultra-high temperature or normal temperature, the temperature difference between the reading temperature and the writing temperature is not too large, and the VT offset is not serious, so the reliability of data written at normal temperature when read out at ultra-low temperature, normal temperature or ultra-high temperature is relatively high.
[0013] As another implementation of the first aspect of the present application, after writing the first data into the second physical page, the method further includes:
[0014] A second mark is written in the second physical page.
[0015] In the present application, not only a temperature mark is required for writing data at ultra-low temperature, but also a temperature mark is required for writing data at normal temperature, so as to distinguish data written at ultra-low temperature from data written at normal temperature.
[0016] As another implementation of the first aspect of the present application, after writing the first data into the second physical page, the method further includes:
[0017] The first physical page is marked as a physical page to be erased.
[0018] In the present application, after the data written at ultra-low temperature is read from the first physical page and written into other physical pages, the data in the original physical page can be erased, so the first physical page is marked as a physical page to be erased, and data can continue to be stored after being erased.
[0019] As another implementation manner of the first aspect of the present application, the first data is in a main storage area of the first physical page, and the first mark is in a spare storage area of the first physical page.
[0020] In the present application, the main storage area in the physical page is usually used to store data, and the security of the backup storage area is relatively higher than that of the main storage area, so the backup storage area can be used to store the temperature mark.
[0021] As another implementation of the first aspect of the present application, after writing the first data into the second physical page, the method further includes:
[0022] When an instruction to read the first data is received, the first data is read from the second physical page.
[0023] In the present application, the temperature when the first data is written to the second physical page is in the normal temperature zone, so after receiving the instruction to read the first data, the probability of correctly reading the first data is very high regardless of whether it is currently in the ultra-low temperature zone, the normal temperature zone or the ultra-high temperature zone.
[0024] As another implementation of the first aspect of the present application, the method further includes:
[0025] When writing the second data into the third physical page, if the ambient temperature is greater than or equal to the second value, writing a third mark into the third physical page;
[0026] When the ambient temperature is greater than the first value and less than the second value, the second data is read from the third physical page of the third mark, and the second data is written in the fourth physical page.
[0027] In the present application, data written at an ultra-high temperature are read out at a normal temperature (a temperature between the ultra-low temperature and the ultra-high temperature), and are rewritten in other physical pages at the normal temperature.
[0028] Since the temperature difference between ultra-high temperature and normal temperature is not too large, the VT offset is not serious, so the reliability of reading data written at ultra-high temperature at normal temperature is higher; similarly, for data rewritten at normal temperature, no matter when it is read at ultra-low temperature, ultra-high temperature or normal temperature, the temperature difference between the reading temperature and the writing temperature is not too large, and the VT offset is not serious, so the reliability of data written at normal temperature when read out at ultra-low temperature, normal temperature or ultra-high temperature is relatively high.
[0029] As another implementation of the first aspect of the present application, after writing the second data into the fourth physical page, the method further includes:
[0030] Writing a third mark in the spare storage area of the fourth physical page;
[0031] Marking the third physical page as a physical page to be erased;
[0032] When an instruction to read the second data is received, the second data is read from the main storage area of the fourth physical page.
[0033] As another implementation of the first aspect of the present application, the method further includes:
[0034] When writing the third data in the main storage area of the fifth physical page, if the ambient temperature is greater than the first value and less than the second value, writing a second mark in the spare storage area of the fifth physical page;
[0035] When an instruction to read the third data is received, the third data is read from the main storage area of the fifth physical page.
[0036] In the present application, the data written in the normal temperature zone can no longer perform the process of reading and rewriting. This is because the temperature difference between the normal temperature zone and the ultra-low temperature zone is not too large, and the temperature difference with the ultra-high temperature zone is not too large. Therefore, the VT curve offset is not obvious. Therefore, the data written in the normal temperature zone has a high reliability when read at any temperature.
[0037] In a second aspect, an electronic device is provided, comprising a processor, wherein the processor is used to call a computer program stored in a memory to implement any method of the first aspect of the present application.
[0038] In a third aspect, a chip is provided, including a processor, wherein the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement any method of the first aspect of the present application.
[0039] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer instructions are executed on an electronic device, the electronic device implements any one of the methods of the first aspect of the present application.
[0040] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a device, enables the device to execute any one of the methods in the first aspect of the present application.
[0041] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A schematic diagram of the hardware structure of an electronic device in which a memory used in the data reading and writing method provided in an embodiment of the present application is located;
[0043] Figure 2 A schematic diagram comparing the on-voltage probability density curves of various storage technologies provided in the embodiments of the present application;
[0044] Figure 3 A schematic diagram showing a comparison of VT curves in ultra-low temperature and ultra-high temperature environments of an SLC storage technology provided in an embodiment of the present application;
[0045] Figure 4 A schematic diagram showing a comparison of VT curves in ultra-low temperature and ultra-high temperature environments of a QLC storage technology provided in an embodiment of the present application;
[0046] Figure 5 A schematic diagram of a temperature zoning method provided in an embodiment of the present application;
[0047] Figure 6 A schematic diagram of another temperature zoning method provided in an embodiment of the present application;
[0048] Figure 7 A schematic diagram of a storage structure of a memory provided in an embodiment of the present application;
[0049] Figure 8 A schematic diagram of changes in cells in a physical page during reading and rewriting provided in an embodiment of the present application;
[0050] Fig. 9 A schematic diagram of a process for writing data at ultra-low or ultra-high temperatures and reading data and re-writing it in a normal temperature range provided by an embodiment of the present application;
[0051] Fig.10 A schematic diagram of a process of writing data at a normal temperature and reading data at a normal temperature provided by an embodiment of the present application;
[0052] Fig.11 A schematic diagram of a VT curve change in ultra-low temperature writing and ultra-high temperature reading provided in an embodiment of the present application;
[0053] Fig.12 A schematic diagram of a VT curve change provided in an embodiment of the present application, which is written at ultra-low temperature and read out and re-written in a normal temperature range;
[0054] Fig.13 A schematic diagram of the change of a VT curve after being written in a normal temperature zone and read at an ultra-high temperature provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In the following description, specific details such as specific system structures and technologies are provided for illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details.
[0056] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0057] It should also be understood that in the embodiments of the present application, "one or more" refers to one, two or more than two; "and / or" describes the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B may be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0058] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", "fourth", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0059] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0060] The embodiment of the present application provides a data reading and writing method, which can be applied to a memory, and the memory can be applied to an electronic device, and the electronic device can be a tablet computer, a mobile phone, a wearable device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The embodiment of the present application does not limit the specific type of the electronic device.
[0061] Figure 1The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0062] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0063] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural network processor (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. For example, the processor 110 is used to execute the data reading and writing method in the embodiment of the present application.
[0064] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0065] The internal memory 121 may be used to store computer executable program codes, which may include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area.
[0066] In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The data in the embodiments of the present application may be stored in the physical pages of the internal memory.
[0067] The audio module 170 is used to convert digital audio signals into analog audio signals for output, and is also used to convert analog audio inputs into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0068] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0069] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0070] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0071] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0072] The camera 193 is used to capture still images or videos. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0073] The video codec is used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record videos in multiple coding formats.
[0074] NPU is a neural network (NN) computing processor, which can quickly process input information and continuously self-learn by drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain. NPU can realize applications such as intelligent cognition of electronic device 100.
[0075] The embodiment of the present application does not particularly limit the specific structure of the execution subject of a data reading and writing method, as long as the code of a data reading and writing method of the embodiment of the present application can be run to communicate according to a data reading and writing method provided by the embodiment of the present application. For example, the execution subject of a data reading and writing method provided by the embodiment of the present application can be a functional module in an electronic device that can call and execute a program, or a communication device applied to an electronic device, such as a chip.
[0076] Flash memory can store programs and data. Cell is the basic storage unit of flash memory, which is a semiconductor storage unit composed of floating gate transistors. Data can be programmed and written into the cell, and data can also be read from the cell.
[0077] Cell can be regarded as a common Metal-Oxide-Semiconductor Field-Effect Transistor (MOSFET), which can be referred to as MOS tube. Only a small voltage is applied to the gate to turn on the MOS tube. If a certain number of electrons are injected into the floating gate of the MOS tube, an electric field is formed between the substrate and the floating gate; in order to turn on the MOS tube, a larger voltage needs to be applied to the gate to overcome the electric field between the substrate and the floating gate.
[0078] Based on the above principle, as an example of programming and writing data in a cell, applying a programming voltage (e.g., 10V) to the floating gate of a cell is equivalent to injecting a certain number of electrons into the floating gate of the cell, and the data "0" is written into the cell. Correspondingly, if no programming voltage is applied to the floating gate of the cell (e.g., maintaining the original 1V), it is equivalent to not injecting electrons into the floating gate of the cell, and the data in the cell is "1".
[0079] Based on the above principle, as an example of reading data from the cell, a voltage of 5V is applied to the gate, and the cell that has not been programmed is turned on and current flows through; the cell that has been programmed is still in the cut-off state and no current flows through. Therefore, it is possible to determine whether the data in the cell is "1" or "0" by whether there is current flowing through. Of course, the data in the cell can also be determined by the threshold voltage when the cell is turned on. Since a certain number of electrons are injected into the floating gate of the cell by applying the programming voltage, the reference voltage is determined to be 8V according to the programming voltage. When reading the data stored in the cell, if the threshold voltage for turning on the cell is 10.5V, which is greater than the reference voltage of 8V, the data in the cell is determined to be 0. Therefore, it is possible to determine whether the data in the cell is "1" or "0" by comparing the threshold voltage for turning on the cell with the reference voltage.
[0080] In this way, 1 bit of data can be written in one cell. This storage technology is called single level cell (SLC).
[0081] In order to store more bits of data in one cell, multi-level cell storage technology (MLC) emerged, that is, each cell can store 2 bits of data; it developed into triple level cell storage technology (TLC), that is, each cell can store 3 bits of data; it developed into quadruple level cell storage technology (QLC), that is, each cell can store 4 bits of data; it even developed into penta level cell storage technology (PLC), that is, each cell can store 5 bits of data.
[0082] When more bits of data need to be stored in a cell, the cell may include more states than just two states "1" and "0", for example, "11", "01", "00" and "10". Of course, more states may appear depending on the amount of bits of data stored.
[0083] In order to distinguish different states of the cell, different programming voltages are applied to the floating gate of the cell, which is equivalent to injecting different numbers of electrons into the floating gate of the cell. Different programming voltages correspond to different states. For example, 3V corresponds to a state "11", 6V corresponds to a state "01", 9V corresponds to a state "00", and 12V corresponds to a state "10". According to multiple states, the reference voltages used to distinguish different states can be set as: 4.5V, 7.5V and 10.5V.
[0084] If when reading data, the threshold voltage of the cell is 2.9V, and 2.9V is less than 4.5V, then it can be determined that the read data is 11; similarly, if when reading data, the threshold voltage of the cell is 6.2V, and 6.2V is between 4.5V and 7.5V, then it can be determined that the read data is 01; similarly, if when reading data, the threshold voltage of the cell is 8.9V, and 8.9V is between 7.5V and 10.5V, then it can be determined that the read data is 00; similarly, if when reading data, the threshold voltage of the cell is 12.3V, and 12.3V is greater than 10.5V, then it can be determined that the read data is 10.
[0085] In practical applications, for multiple cells in the same state, the threshold voltages for turning on these cells are normally distributed, that is, the threshold voltages are most concentrated at the center of the normal distribution, such as 3V, 6V, 9V and 12V in the above example.
[0086] If the reference voltage is set to the voltage corresponding to the center position of the normal distribution, then the data of the cells whose threshold voltage is on the left side of the center position of the normal distribution can be read normally; the data of the cells whose threshold voltage is on the right side of the center position of the normal distribution may be read incorrectly; therefore, the reference voltage can be set to a value greater than the threshold voltage of most cells, so that the data of most cells can be read normally.
[0087] In order to have a clearer understanding of the above description, you can refer to Figure 2 Schematic diagram of the threshold voltage probability density curve shown.
[0088] Reference Figure 2 , which is a schematic diagram comparing threshold voltage probability density (VT) curves of multiple storage technologies provided in an embodiment of the present application.
[0089] Among them, in the single-layer unit storage technology, a cell stores 1 bit of data, and the cell includes two states, and the threshold voltage distribution interval between the states is relatively wide; as more bits of data are stored in a cell, the cell includes more states, and the threshold voltage distribution interval between the states becomes narrower.
[0090] In order to make the reference voltage cover the threshold voltages of most cells in this state, the reference voltage is usually set to the voltage corresponding to the valley position between the normal distribution of the current state and the normal distribution of the next state.
[0091] It can be understood that the fewer bits of data a cell stores, the wider the threshold voltage distributions of different states will be, the farther the distance between adjacent states will be, and the less likely it is to make mistakes when determining the read data by reading the voltage; similarly, the more bits of data a cell stores, the narrower the threshold voltage distributions of different states will be, the closer the distance between adjacent states will be, and there may even be intersections, making it more likely to make mistakes when determining the read data by using the reference voltage; this results in lower reliability as the number of bits stored in each cell increases.
[0092] In addition, at low temperatures, the electron energy is lower and the probability of quantum tunneling is lower. Therefore, fewer electrons are captured in the floating gate, and the electric field from the substrate to the floating gate is smaller. When data needs to be read, the forward threshold voltage that needs to be applied to the gate becomes smaller, which is manifested as a left shift of the VT curve at low temperatures.
[0093] Similarly, at high temperatures, the electron energy is higher, the probability of quantum tunneling is higher, more electrons are captured in the floating gate, and the electric field from the substrate to the floating gate is stronger; when data needs to be read, the forward threshold voltage that needs to be applied to the gate becomes larger, which is manifested as a rightward shift of the VT curve at high temperatures.
[0094] Reference Figure 3 and Figure 4 , which is a comparison diagram of VT curves in an ultra-low temperature environment and an ultra-high temperature environment provided in an embodiment of the present application.
[0095] Reference Figure 3 , which are the VT curves of the SLC storage technology when writing data at ultra-low temperature and ultra-high temperature. It can be understood that when the memory enters an ultra-high temperature environment from an ultra-low temperature environment, the VT curve shifts to the right. Due to the normal distribution distance of the threshold voltages in different states under the SLC technology, even if the VT curve shifts, the data can still be read correctly through the reference voltage.
[0096] Reference Figure 4 , which are the VT curves of the QLC storage technology when writing data at ultra-low temperature and at high temperature. It can be understood that when the memory enters an ultra-high temperature environment from an ultra-low temperature environment, the VT curve shifts to the right. Due to the close normal distribution distance of the threshold voltages in different states under QLC technology, after the VT curve shifts, some cells may read out errors when using the reference voltage to determine the read data.
[0097] Through experiments, it is found that the temperature tolerance of QLC is about 40°C lower than that of TLC. The temperature tolerance will directly affect data security. For example, if data is written to a cell at low temperature but read at a higher temperature, the reference voltage will be offset, which will cause some cells to read data incorrectly or even permanently lose the data.
[0098] To solve this problem, refer to Figure 5 , the temperature can be divided into three zones: ultra-low temperature zone (≤-20℃), normal temperature zone (>-20℃ and <50℃), ultra-high temperature zone (≥50℃). Among them, the characteristics of the normal temperature zone are: the temperature difference between the ultra-low temperature zone and the normal temperature zone is not too large, the VT curve offset is not too serious, and the reliability of writing and reading data between them is still high. At the same time, the temperature difference between the normal temperature zone and the ultra-high temperature zone is not too large, the VT curve offset is not serious, and the reliability of reading and writing data between them is still high.
[0099] Based on the above principle, the normal temperature zone can be determined first according to the working environment of the memory; the temperature range lower than the normal temperature zone is the ultra-low temperature zone, and the temperature range higher than the normal temperature zone is the ultra-high temperature zone. Therefore, -20℃ and 50℃ in the above example are only used as examples. In actual applications, the three zones can also be divided by other values.
[0100] Currently, many flash memories are built with temperature sensors, which can monitor the ambient temperature around the memory at a certain sampling frequency.
[0101] The embodiment of the present application can write data into a cell in an ultra-low temperature zone (or an ultra-high temperature zone) and read the data through a reference voltage in a normal temperature zone; since the temperature span between the ultra-low temperature zone and the normal temperature zone (or the temperature span between the ultra-high temperature zone and the normal temperature zone) is not particularly large, and the VT curve offset is not particularly large, the data can still be correctly read through the reference voltage.
[0102] Of course, after the data is correctly read out in the normal temperature zone, the data is immediately rewritten in the current normal temperature zone, which is equivalent to writing the data in the normal temperature zone.
[0103] Since the temperature span between the normal temperature zone and the ultra-high temperature zone is not particularly large, and the VT curve offset is not particularly large, the data rewritten in the normal temperature zone can be correctly read in the ultra-high temperature zone, but the data written in the ultra-low temperature zone may be read abnormally in the ultra-high temperature zone.
[0104] Similarly, since the temperature span between the normal temperature zone and the ultra-low temperature zone is not particularly large, the VT curve offset is not particularly large, so the data rewritten in the normal temperature zone can also be correctly read in the ultra-low temperature zone.
[0105] Naturally, the data rewritten in the normal temperature zone can also be correctly read in the normal temperature zone.
[0106] Of course, in the above example, "correct reading" does not mean that the data is definitely read correctly, but it means that the probability of reading the data correctly is high; "abnormal reading" does not mean that the data is definitely read abnormally, but it means that the probability of reading abnormally is high. This expression method will also be used in the following.
[0107] In practical applications, if the VT curve offset between the high temperature segment (e.g., 45°C) and the ultra-low temperature segment (e.g., -40°C) in normal temperature is relatively large; the VT curve offset between the low temperature segment (e.g., -15°C) and the ultra-high temperature segment (e.g., 70°C) in normal temperature is also relatively large, the temperature can also be divided into four zones: ultra-low temperature zone (≤-20°C), low temperature zone (>-20°C and <15°C), high temperature zone (≥15°C and <50°C) and ultra-high temperature zone (≥50°C). The VT curve offset between each temperature zone and the two adjacent temperature zones on the left and right is not large, and the reliability is still high when writing and reading data between the current temperature zone and the adjacent temperature zone.
[0108] Reference Figure 6 , which is another temperature zoning method provided in the embodiment of the present application. Similarly, -20 degrees Celsius, 15 degrees Celsius, and 50 degrees Celsius are only examples.
[0109] The data A written into the cell in the ultra-low temperature zone can be read out by the read voltage in the low temperature zone; the data A can be rewritten in the current low temperature zone. Subsequently, the data A can be correctly read in the ultra-low temperature zone, the low temperature zone, and the high temperature zone. When the ambient temperature enters the high temperature zone from the low temperature zone, the data B written in the low temperature zone and the data A rewritten in the low temperature zone can also be read out, and the data A and data B can be rewritten in the high temperature zone. Subsequently, the data A and data B can be correctly read in the low temperature zone, the high temperature zone, and the ultra-high temperature zone. Of course, when the ambient temperature enters the ultra-high temperature zone from the high temperature zone, there is no need to repeat the above steps.
[0110] Similarly, the data C written into the cell in the ultra-high temperature zone can be read out by the read voltage in the high temperature zone; and the data C can be rewritten in the current high temperature zone. Subsequently, the data C can be correctly read in the ultra-high temperature zone, the high temperature zone, and the low temperature zone. When the ambient temperature enters the low temperature zone from the high temperature zone, the data D written in the high temperature zone and the data C rewritten in the low temperature zone can also be read out, and the data C and data D can be rewritten in the low temperature zone. Subsequently, the data C and data D can be correctly read in the high temperature zone, the low temperature zone, and the ultra-low temperature zone. Of course, when the ambient temperature enters the ultra-low temperature zone from the low temperature zone, there is no need to repeat the above steps.
[0111] In this way, it is equivalent to that all the data is written in the low temperature zone and the high temperature zone, and the above-mentioned reading and rewriting process can be continued as the ambient temperature changes. Of course, in practical applications, the main temperature zone of the memory can also be determined according to the ambient temperature monitored by the temperature sensor, so that the data can be rewritten in the middle range of the main temperature zone by reading and rewriting. For example, when the main temperature zones are concentrated in the ultra-low temperature, low temperature and high temperature zones, the data can be rewritten in the low temperature zone by reading and rewriting once or multiple times. When the main temperature zones are concentrated in the ultra-high temperature, high temperature and low temperature zones, the data can be rewritten in the high temperature zone by reading and rewriting once or multiple times.
[0112] Of course, in practical applications, more temperature zones may be set according to actual conditions, and the embodiment of the present application will not exemplify the method of reading and rewriting more temperature zones.
[0113] The following takes dividing the temperature into three zones as an example to describe the specific implementation process of the data reading and writing method.
[0114] Reference Figure 7 As shown in FIG. 1 , when writing data in the flash memory, it is not in a single cell unit, but in a physical page unit, and a physical page includes multiple cells. Each physical page includes a main storage area and a spare storage area.
[0115] In the embodiment of the present application, data can be written in the main storage area of each physical page, and 2 bits of data can be taken out of the spare storage area to record the temperature mark when the data is written to the physical page. As an example, ultra-low temperature can be recorded as 00; normal temperature can be recorded as 01; and ultra-high temperature can be recorded as 11. Of course, the temperature marks recorded above are only for examples. In actual applications, different temperature marks can be used for recording according to the situation.
[0116] Reference Figure 8 As shown, when entering the normal temperature from the ultra-low temperature area (or ultra-high temperature area), the data in the physical page with the temperature mark "00" (or "11") in the spare storage area is read out, rewritten into the new physical page in the new block, and the spare storage area of the new physical page is written into the temperature mark "01" of the normal temperature. The old physical page from which the data has been read is marked as the physical page that needs to be erased, waiting for subsequent erasure.
[0117] Reference Fig. 9 As shown, it is a schematic diagram of the process of writing data in an ultra-low temperature zone (or ultra-high temperature zone) and reading and re-writing in a normal temperature zone provided by an embodiment of the present application.
[0118] S101, monitoring the ambient temperature of the flash memory by a temperature sensor at a preset time period (or sampling rate).
[0119] In the embodiment of the present application, the ambient temperature is not the ambient temperature of the electronic device where the memory is located; due to frequent read and write operations on the memory, the temperature of the memory may rise, and the temperature of the memory is higher than the temperature of the environment where the electronic device where the memory is located. In the embodiment of the present application, the temperature offset of the VT curve is related to the temperature of the memory itself; therefore, the temperature sensor should theoretically monitor the temperature of the memory itself, but due to technical limitations, the temperature sensor actually monitors the ambient temperature around the memory. Of course, the ambient temperature around the memory is closer to the temperature of the memory itself than the ambient temperature around the electronic device. With the development of technology, the temperature sensor may be a sensor set on the memory itself, which may be able to more realistically measure the temperature of the memory itself. Similar improvements made on the principle of the present application all belong to the scope of protection of the present application.
[0120] S102, writing first data into a main storage area of a first physical page of a flash memory.
[0121] S103, after writing the first data, determining whether the ambient temperature monitored in real time by the temperature sensor is in an ultra-low temperature zone or an ultra-high temperature zone.
[0122] S1041: If the ambient temperature monitored by the temperature sensor is in an ultra-low temperature region, a first mark is written into a spare storage area of a first physical page.
[0123] The first mark is used to mark the writing of the ultra-low temperature area, for example, "00". The spare storage area and the main storage area adopt the same storage technology, for example, both are MLC storage technology, or both are TLC storage technology.
[0124] S1051, after writing the first mark, determine whether the temperature monitored by the temperature sensor enters the normal temperature zone from the ultra-low temperature zone.
[0125] If the ambient temperature monitored by the temperature sensor does not enter the normal temperature zone from the ultra-low temperature zone, the ambient temperature monitored by the temperature sensor continues to be obtained to continue to determine whether the temperature monitored by the temperature sensor enters the normal temperature zone from the ultra-low temperature zone.
[0126] S1061, if the ambient temperature monitored by the temperature sensor enters the normal range from the ultra-low temperature range, the first data in the first physical page with the first mark is read out; the first data is written in the main storage area of the second physical page, and the second mark is written in the spare storage area of the second physical page; the first physical page is marked as a physical page of data to be erased.
[0127] In the embodiment of the present application, other data may also be written in other physical pages in the ultra-low temperature zone. This step is to read out and rewrite the data in all physical pages with the first mark. The embodiment of the present application only takes the reading and rewriting of the first data in the first physical page as an example.
[0128] The second mark indicates normal temperature zone writing, for example, "01".
[0129] After S1061, no matter the ambient temperature of the memory remains in the normal temperature zone, returns to the ultra-low temperature zone, or enters the ultra-high temperature zone, when reading the first data, the first data is read from the second physical page; because the second physical page is written in the normal temperature zone when the first data is written, the probability of correctly reading the data is very high whether reading in the normal temperature zone (the span between the reading temperature and the writing temperature is small), reading back to the ultra-low temperature zone (the span between the reading temperature and the writing temperature is not large), or reading in the ultra-high temperature zone (the span between the reading temperature and the writing temperature is not large).
[0130] As an example, the first data in the second physical page is read out at any temperature.
[0131] S1071 , when receiving a read instruction of the first data, reading data from the second physical page.
[0132] S1081: If the data in the second physical page is read abnormally, error correction is performed on the abnormally read data to obtain the first data.
[0133] In a specific implementation, the method of performing error correction processing on abnormally read data may be any error correction method such as ECC error correction.
[0134] S1091: If the data in the second physical page is read normally, the read first data is returned to the sender of the read instruction.
[0135] Of course, after S103, there may be another situation:
[0136] S1042: If the ambient temperature monitored by the temperature sensor is in an ultra-high temperature zone, a third mark is written into the spare storage area of the first physical page.
[0137] The third mark is used to mark the writing of the ultra-high temperature area, for example, "11".
[0138] S1052, after writing the third mark, determine whether the temperature monitored by the temperature sensor enters the normal temperature zone from the ultra-high temperature zone.
[0139] If the ambient temperature monitored by the temperature sensor does not enter the normal temperature zone from the ultra-high temperature zone, the ambient temperature monitored by the temperature sensor continues to be obtained to continue to determine whether the temperature monitored by the temperature sensor enters the normal temperature zone from the ultra-high temperature zone.
[0140] S1062, if the ambient temperature monitored by the temperature sensor enters the normal range from the ultra-high temperature range, the first data in the first physical page with the third mark is read out; the first data is written in the main storage area of the fourth physical page, and the second mark is written in the spare storage area of the fourth physical page; the first physical page is marked as a physical page of data to be erased.
[0141] In the embodiment of the present application, other data may also be written in other physical pages in the ultra-high temperature zone. This step is to read out and rewrite the data in all physical pages with the third mark. The embodiment of the present application only takes the reading and rewriting of the first data in the first physical page as an example.
[0142] After S1062, no matter the ambient temperature of the memory remains in the normal temperature zone, returns to the ultra-high temperature zone, or enters the ultra-low temperature zone, when the first data is read, the first data is read from the fourth physical page; because the first data is written to the fourth physical page in the normal temperature zone, the probability of correctly reading the data is very high whether reading in the normal temperature zone (the span between the reading temperature and the writing temperature is small), reading back to the ultra-high temperature zone (the span between the reading temperature and the writing temperature is not large), or reading in the ultra-low temperature zone (the span between the reading temperature and the writing temperature is not large).
[0143] As an example, the first data in the fourth physical page is read out at any temperature.
[0144] S1072, when receiving a read instruction of the first data, read data from the fourth physical page.
[0145] S1082: If the data in the fourth physical page is read abnormally, error correction is performed on the abnormally read data to obtain the first data.
[0146] S1092: If the data in the fourth physical page is read normally, the read first data is returned to the sender of the read instruction.
[0147] Of course, in actual applications, data may also be written in the normal temperature range. In this case, there is no need to read and write repeatedly. For details, please refer to Fig.10 After S103, it also includes:
[0148] S1043: If the ambient temperature monitored by the temperature sensor is within the normal temperature range, a second mark is written into the spare storage area of the first physical page.
[0149] After S1043, no matter the ambient temperature of the memory remains in the normal temperature zone, enters the ultra-high temperature zone, or enters the ultra-low temperature zone, when reading the first data, the first data is read from the first physical page; because the first physical page is written in the normal temperature zone when the first data is written, the probability of correctly reading the data is very high whether reading in the normal temperature zone (the span between the reading temperature and the writing temperature is small), reading in the ultra-high temperature zone (the span between the reading temperature and the writing temperature is not large), or reading in the ultra-low temperature zone (the span between the reading temperature and the writing temperature is not large).
[0150] As an example, the first data in the first physical page is read out at any temperature.
[0151] S1053 , when receiving a read instruction of the first data, reading data from the first physical page.
[0152] S1063: If the data in the first physical page is read abnormally, error correction is performed on the abnormally read data to obtain the first data.
[0153] S1073: If the data in the first physical page is read normally, the read first data is returned to the sender of the read instruction.
[0154] The above embodiment only takes the first data as an example to describe the process of writing, reading, and rewriting. In actual applications, there may also be second data, third data, fourth data, etc.; the process of writing, reading, and rewriting these data is similar. The embodiment of the present application does not limit the implementation method based on the above core invention point. Of course, the first physical page, the second physical page, and the fourth physical page in the above example are also examples. In actual applications, there may also be a third physical page, a fifth physical page, etc. that participate in the above writing, reading, and rewriting process.
[0155] Reference Fig.11 As shown in FIG. 1 , it is a schematic diagram of the VT curve change when writing data at ultra-low temperature and reading data at ultra-high temperature. It can be understood that since the VT curve when reading data at ultra-high temperature is greatly offset relative to the VT curve when writing data at ultra-low temperature, the reference voltage when reading data at ultra-high temperature is also greatly offset relative to the reference voltage when writing data at ultra-low temperature. Then, when comparing the threshold voltage read at ultra-high temperature with the reference voltage to determine the state of the cell, it is easier to read an abnormality.
[0156] Below through Fig.12 and Fig.13 The data reading and writing method provided in the embodiment of the present application is described, and the reason why it is not easy to read abnormalities when reading data at ultra-high temperature after writing data at ultra-low temperature and then reading data in a normal temperature zone and writing data again is described.
[0157] Reference Fig.12 As shown in FIG. 1 , it is a VT curve variation diagram when writing data at ultra-low temperature, reading data at normal temperature zone and rewriting data. It can be understood that since the offset between the VT curve when reading data at normal temperature zone and the VT curve when writing data at ultra-low temperature is smaller, the offset between the reference voltage when reading data at normal temperature and the reference voltage when writing data at ultra-low temperature is also smaller. Therefore, when comparing the threshold voltage read when reading data at normal temperature with the reference voltage to determine the state of the cell, it is less likely to read an abnormality.
[0158] Reference Fig.13 As shown in FIG. 1 , it is a schematic diagram of the change of the VT curve of the data read out at the ultra-high temperature after the data is rewritten in the normal temperature zone. It can be understood that since the offset between the VT curve when reading data in the ultra-high temperature zone and the VT curve when writing data in the normal temperature zone is smaller, the offset between the reference voltage when reading data at the ultra-high temperature and the reference voltage when writing data at the normal temperature is also smaller. Therefore, when comparing the threshold voltage read out at the ultra-high temperature with the reference voltage to determine the state of the cell, it is less likely to read an abnormality.
[0159] pass Fig.11 and Fig.13 By comparison, it can be understood that by reading the data written at ultra-low temperature and writing it again at normal temperature, and then entering the ultra-high temperature area to read the data, the VT curve changes are small, and the probability of abnormal reading will be greatly reduced.
[0160] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0161] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed on an electronic device, the steps in the above-mentioned method embodiments can be implemented.
[0162] The embodiment of the present application also provides a computer program product. When the computer program product is run on an electronic device or a wireless router, the electronic device can implement the steps in the above-mentioned various method embodiments.
[0163] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the first device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0164] The embodiment of the present application further provides a chip, the chip includes a processor, the processor is coupled to a memory, and the processor calls a computer program stored in the memory to implement the steps of any method embodiment of the present application. The chip can be a single chip or a chip module composed of multiple chips.
[0165] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0166] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. 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 can 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.
[0167] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A data reading and writing method, characterized in that: include: When writing first data into a first physical page, if the ambient temperature is less than or equal to a first value, writing a first mark into the first physical page; When the ambient temperature changes to a value greater than the first value and less than a second value, reading the first data from the first physical page of the first mark, and writing the first data and the second mark into the second physical page; When the ambient temperature changes to a value greater than or equal to the second value and less than a third value, reading the first data from the second physical page of the second mark, and writing the first data and the third mark in the third physical page; When the ambient temperature changes to be greater than or equal to a third value, the read and rewrite operation of the first data is no longer performed; When writing the second data into the fourth physical page, if the ambient temperature is greater than or equal to the third value, writing a fourth mark into the fourth physical page; When the ambient temperature changes to be greater than or equal to the second value and less than a third value, reading the second data from the fourth physical page of the fourth mark, and writing the second data and the third mark in the fifth physical page; When the ambient temperature changes to be greater than the first value and less than the second value, the second data is read from the fifth physical page of the third mark, the second data and the second mark are written to the sixth physical page, the first data is read from the third physical page of the third mark, and the first data and the second mark are written to the seventh physical page; When the ambient temperature changes to be less than or equal to the first value, the read and re-write operations of the first data and the second data are no longer performed.
2. The method according to claim 1, characterized in that After writing the first data into the second physical page, the method further includes: Marking the first physical page as a physical page to be erased; After writing the first data into the third physical page, the method further includes: The second physical page is marked as a physical page to be erased.
3. The method according to claim 1 or 2, characterized in that The first data is in a main storage area of the first physical page, and the first mark is in a spare storage area of the first physical page.
4. The method according to claim 2, characterized in that After writing the first data into the second physical page and before erasing the first data written into the second physical page, the method further includes: When an instruction to read the first data is received, the first data is read from the second physical page.
5. An electronic device, characterized in that: The electronic device comprises a processor, and the processor is used to call a computer program in a memory to execute the method according to any one of claims 1 to 4.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 4.
7. A chip, characterized in that: The chip comprises a processor, and the processor is used to call a computer program in a memory to execute the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Temperature variation compensation of memory
CN109074831A
Method for optimizing high-temperature and low-temperature read-write reliability of NAND flash memory
CN110928488A