[go: up one dir, main page]

CN109582248B - Writing method and device of flash memory data and computer readable storage medium - Google Patents

Writing method and device of flash memory data and computer readable storage medium Download PDF

Info

Publication number
CN109582248B
CN109582248B CN201811539392.3A CN201811539392A CN109582248B CN 109582248 B CN109582248 B CN 109582248B CN 201811539392 A CN201811539392 A CN 201811539392A CN 109582248 B CN109582248 B CN 109582248B
Authority
CN
China
Prior art keywords
data
writing
storage area
storage
flash
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811539392.3A
Other languages
Chinese (zh)
Other versions
CN109582248A (en
Inventor
胡小均
吴大畏
李晓强
黄慧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SHENZHEN SILICONGO MICROELECTRONICS CO Ltd
Original Assignee
SHENZHEN SILICONGO MICROELECTRONICS CO Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHENZHEN SILICONGO MICROELECTRONICS CO Ltd filed Critical SHENZHEN SILICONGO MICROELECTRONICS CO Ltd
Priority to CN201811539392.3A priority Critical patent/CN109582248B/en
Publication of CN109582248A publication Critical patent/CN109582248A/en
Application granted granted Critical
Publication of CN109582248B publication Critical patent/CN109582248B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3058Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/062Securing storage systems
    • G06F3/0622Securing storage systems in relation to access

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Read Only Memory (AREA)

Abstract

The invention discloses a method and a device for writing flash memory data and a computer readable storage medium, comprising the following steps: after a data writing instruction is received, acquiring a temperature value of the current environment; when the temperature value is not in a preset range, writing the data into a first storage area, wherein the first storage area stores the data in an SLC programming mode, and 1Bit of data is written each time when the data are written; and when the temperature value is restored to be within a preset range, acquiring the data in the first storage area and writing the data into a second storage area, wherein the second storage area adopts other storage modes except an SLC programming mode. The invention can judge whether the working temperature is in the normal range before writing data, and writes the data into the single-stage storage unit when the temperature is not in the normal range, thereby solving the problem that the error rate of the data is increased when the flash memory writes the data outside the normal working temperature range.

Description

Writing method and device of flash memory data and computer readable storage medium
Technical Field
The present invention relates to the field of data storage, and in particular, to a method and an apparatus for writing data in a flash memory, and a computer-readable storage medium.
Background
In recent years, with the development of science and technology, various automatic instruments and equipment are continuously present in various industrial workshops and in some severe exploration environments, and in order to meet the requirement of high intelligence, the instruments and equipment generate a large amount of data in the working process and use a NAND flash memory for storage.
Many times, however, NAND flash memory is not as comfortable and the data stability of the device containing NAND flash memory loaded on it is a great challenge for devices operating in complex industrial and exploration environments. Especially when the external environment temperature is too high or too low, the error rate is greatly increased when data is written in the NAND flash memory.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a method and a device for writing data into a flash memory and a computer readable storage medium, and aims to solve the problem that the error rate of data is increased when the data is written into the flash memory outside a normal working temperature range.
In order to achieve the above object, the present invention provides a method for writing flash data, which comprises the following steps:
after a data writing instruction is received, acquiring a temperature value of the current environment;
when the temperature value is not in a preset range, writing the data into a first storage area, wherein a storage unit of the first storage area is a single-order storage unit, and the single-order storage unit writes one bit of data each time when the data is written;
and when the temperature value is restored to be within a preset range, acquiring the data in the first storage area and writing the data into a second storage area, wherein the storage unit of the second storage area is other storage units except the single-order storage unit, and the single-order storage unit is more stable than the other storage units when the temperature value is not within the preset range.
Preferably, the step of acquiring the data in the first storage area and writing the data in the second storage area when the temperature value is restored to the preset range includes:
acquiring a storage address of the data in the first storage area, generating and storing mark information containing the storage address;
when the temperature value is restored to be within a preset range, acquiring mark information in a memory;
when the mark information exists in the memory, acquiring a storage address in the mark information;
and acquiring the data in the storage address and writing the data into the second storage area.
Preferably, after the step of acquiring the data in the storage address and writing the data into the second storage area, the method further includes:
and deleting the mark information in the memory.
Preferably, the step of writing the data into the first storage area comprises:
acquiring the residual storage capacity of the first storage area;
and when the capacity corresponding to the data is smaller than the residual storage capacity, writing the data into a first storage area.
Preferably, after the step of acquiring the remaining storage capacity of the first storage area, the method further includes:
when the capacity corresponding to the data is larger than the residual storage capacity, acquiring invalid data in the first storage area;
and deleting the invalid data.
Preferably, after the step of acquiring the data in the first storage area and writing the data in the second storage area, the method further includes:
marking the data in the first storage area as invalid data.
In addition, in order to achieve the above object, the present invention further provides a flash data writing device, which includes a processor, a memory, and a flash data writing program stored in the memory and operable on the processor, wherein the flash data writing program implements the above steps of the flash data writing method when executed by the processor.
In addition, to achieve the above object, the present invention further provides a computer-readable storage medium having stored thereon a flash data writing program, which when executed by a processor implements the steps of the above-described flash data writing method.
The invention provides a writing method and device of flash memory data and a computer readable storage medium, which are characterized in that firstly, after a data writing instruction is received, a temperature value of the current environment is obtained, then, when the temperature value is not in a preset range, the data is written into a first storage area, wherein a storage unit of the first storage area is a single-order storage unit, one bit of data is written into the single-order storage unit each time when the data is written into the single-order storage unit, and finally, when the temperature value is restored to the preset range, the data in the first storage area is obtained and written into a second storage area, wherein the storage unit of the second storage area is other storage units except the single-order storage unit, and the single-order storage unit is more stable than the other storage units when the temperature value is not in the preset range. The invention can judge whether the working temperature is in the normal range before writing data, writes the data into the single-order storage unit when the temperature is not in the normal range, and writes the data stored in the single-order storage unit in the first storage area into the three-order storage unit in the second storage area when the temperature is recovered to the normal range, thereby solving the problem that the error rate of the data is increased when the flash memory writes the data outside the normal working temperature range.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
fig. 1 is a schematic hardware configuration diagram of a flash data writing device according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a method for writing data into a flash memory according to the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of a method for writing data into a flash memory according to the present invention;
FIG. 4 is a flow chart illustrating a third embodiment of a method for writing data into a flash memory according to the present invention;
FIG. 5 is a flowchart illustrating a method for writing data into a flash memory according to a fourth embodiment of the present invention;
FIG. 6 is a flow chart illustrating a fifth embodiment of a method for writing data into a flash memory according to the present invention;
fig. 7 is a flowchart illustrating a method for writing data into a flash memory according to a sixth embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows: after a data writing instruction is received, acquiring a temperature value of the current environment; when the temperature value is not in a preset range, writing the data into a first storage area, wherein a storage unit of the first storage area is a single-order storage unit, and the single-order storage unit writes one bit of data each time when the data is written; and when the temperature value is restored to be within a preset range, acquiring the data in the first storage area and writing the data into a second storage area, wherein the storage unit of the second storage area is other storage units except the single-order storage unit, and the single-order storage unit is more stable than the other storage units when the temperature value is not within the preset range.
Because the prior art uses the three-order memory cell to write data at all temperatures, the error rate of writing data is increased when the temperature value is not in the normal range.
The invention provides a solution, firstly, after receiving a data writing instruction, acquiring a temperature value of the current environment; then, when the temperature value is not in a preset range, writing the data into a first storage area, wherein a storage unit of the first storage area is a single-order storage unit, and the single-order storage unit writes one bit of data each time when the data is written; and finally, when the temperature value is restored to be within a preset range, acquiring the data in the first storage area and writing the data into a second storage area, wherein the storage unit of the second storage area is other storage units except the single-order storage unit, and the single-order storage unit is more stable than the other storage units when the temperature value is not within the preset range. The invention can judge whether the working temperature is in the normal range before writing data, writes the data into the single-order storage unit when the temperature is not in the normal range, and writes the data stored in the single-order storage unit in the first storage area into the three-order storage unit in the second storage area when the temperature is recovered to the normal range, thereby solving the problem that the error rate of the data is increased when the flash memory writes the data outside the normal working temperature range.
As shown in fig. 1, fig. 1 is a schematic diagram of a hardware structure of an apparatus according to an embodiment of the present invention.
Referring to fig. 1, the apparatus may include: a processor 1001, such as a CPU, a memory 1002, a communication bus 1003, and a network interface 1004. The communication bus 1003 is used for implementing connection communication between the components in the device. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1002 may be a high-speed RAM memory or a non-volatile memory (e.g., a disk memory). The memory 1002 may alternatively be a storage device separate from the processor 1001. As shown in fig. 1, the memory 1002, which is a kind of computer storage medium, may include therein an operating system, a network communication module, and a writing program of flash data.
Those skilled in the art will appreciate that the configuration of the device shown in fig. 1 is not intended to be limiting of the device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
Among the hardware involved in the apparatus shown in fig. 1, the network interface 1004 may be used to obtain data written to the flash memory; and the processor 1001 may be configured to call a write procedure of the flash data stored in the memory 1002, and perform the following operations:
after a data writing instruction is received, acquiring a temperature value of the current environment;
when the temperature value is not in a preset range, writing the data into a first storage area, wherein a storage unit of the first storage area is a single-order storage unit, and the single-order storage unit writes one bit of data each time when the data is written;
and when the temperature value is restored to be within a preset range, acquiring the data in the first storage area and writing the data into a second storage area, wherein the storage unit of the second storage area is other storage units except the single-order storage unit, and the single-order storage unit is more stable than the other storage units when the temperature value is not within the preset range.
Further, the processor 1001 may be configured to call a write program of the flash data stored in the memory 1002, and further perform the following operations:
acquiring a storage address of the data in the first storage area, generating and storing mark information containing the storage address;
when the temperature value is restored to be within a preset range, acquiring mark information in a memory;
when the mark information exists in the memory, acquiring a storage address in the mark information;
and acquiring the data in the storage address and writing the data into the second storage area.
Further, the processor 1001 may be configured to call a write program of the flash data stored in the memory 1002, and further perform the following operations:
and deleting the mark information in the memory.
Further, the processor 1001 may be configured to call a write program of the flash data stored in the memory 1002, and further perform the following operations:
acquiring the residual storage capacity of the first storage area;
and when the capacity corresponding to the data is smaller than the residual storage capacity, writing the data into a first storage area.
Further, the processor 1001 may be configured to call a write program of the flash data stored in the memory 1002, and further perform the following operations:
when the capacity corresponding to the data is larger than the residual storage capacity, acquiring invalid data in the first storage area;
and deleting the invalid data.
Further, the processor 1001 may be configured to call a write program of the flash data stored in the memory 1002, and further perform the following operations:
marking the data in the first storage area as invalid data.
According to the scheme, after a Host write data command is sent by a computer, a main control temperature sensor firstly acquires the current environment temperature, judges whether the current environment temperature is within a normal working temperature range, judges whether the residual storage capacity of an SLC storage area is larger than the storage capacity of data to be written if the residual storage capacity of the SLC storage area is not within a normal operating temperature range, recovers dirty blocks of the current device when the residual storage capacity of the SLC storage area is judged to be smaller than the storage capacity of the data to be written, erases data marked as invalid in the SLC storage area, and after the recovery of the dirty blocks is finished, FTL software uses an SLC programming mode to write the data into a first storage area, generates mark information containing a storage address of the data and stores the mark information into a queue of an internal memory. The storage unit of the first storage area is a single-order storage unit, and when the data is written in the single-order storage unit, one bit of data is written in each time; when the flash memory device is idle, an idle task is established in a background, the task is used for scanning whether mark information exists in a queue in the memory, if yes, an environment temperature waiting process is entered, when the environment temperature is recovered to be within a temperature range of normal operation, marked data in the first storage area are moved to the second storage area with larger capacity, and finally the mark information in the memory is cleared.
Referring to fig. 2, fig. 2 is a first embodiment of a method for writing flash data according to the present invention, the method for writing flash data includes:
step S10, after receiving the data writing instruction, acquiring the temperature value of the current environment;
the writing method of the flash memory data provided by the invention is mainly used for reducing the error rate of writing the flash memory data when the temperature is not in the normal working range. The terminal related to the writing method of the flash memory data provided by the invention comprises but is not limited to a mobile phone, a tablet personal computer, a computer and the like, and a related application system is pre-loaded on the terminal.
In the technical solution provided in this embodiment, there are various types of flash memories in the market at present, and the flash memories of different types have different sensitivity degrees to temperature, so before writing data into the first storage area, the normal operating temperature range of the currently used flash memory needs to be obtained first. Setting a stepping value, wherein the stepping value is set to be 5 ℃, then using a high-low temperature box to carry out jump temperature read-write operation on the flash memory to traverse all temperatures, then counting error bit numbers of 512-byte data under each temperature environment, and when the error bit numbers exceed the error correction capability of a main control error correction module or a soft decoding module when the critical temperature is reached, setting the temperature as a critical threshold temperature, and finally obtaining a temperature range of normal operation. Further, after the temperature range of the normal operation of the current flash memory is obtained and the Host data writing command is sent by the computer, the main control temperature sensor firstly collects the current ambient temperature and judges whether the current ambient temperature is within the temperature range of the normal operation.
Step S20, when the temperature value is not within the preset range, writing the data into a first storage area, where a storage unit of the first storage area is a single-level storage unit, and the single-level storage unit writes one bit of data each time when writing the data;
in the technical scheme provided by this embodiment, after the computer sends the Host write data command, the master control temperature sensor first collects the current ambient temperature, determines whether the current ambient temperature is within a normal working temperature range, and writes the data into the first storage area if the current ambient temperature is not within the normal operating temperature range, where the storage unit of the first storage area is a single-stage storage unit, and the single-stage storage unit writes one bit of data each time when writing the data. And then generating marking information, wherein the marking information comprises the storage position of the data in the first storage area, and finally adding the marking information into a queue in the memory.
The Nand flash memory has a Cell (Cell) unit, and stores bit information by storing electrons using a Floating Gate (Floating Gate). The flash memory is divided into a first storage area and a second storage area, wherein the first storage area is an SLC (Single-Level Cell) storage area, and the first storage area is composed of a plurality of Single-Level storage units; the second storage area, namely a TLC (third-order-Level Cell) storage area, is composed of a plurality of third-order storage units.
It should be noted that when the temperature is not within the normal operating range, the data error rate of writing data into the SLC storage area is lower than the data error rate of writing data into the TLC storage area. Since only two states are required in the SLC type, Cell charged to a certain potential represents 0 and vice versa represents 1, whereas in the TLC type, there are eight potential states, respectively (000,001,010,011,100,101,110,111), and when the temperature is not within the normal operating range, the SLC storage region storing data is more stable with only two states of charge.
It should be noted that, by applying high voltage to the gate of the floating gate field effect transistor to control the on/off between the source and the drain, the floating gate, which is a nitride layer sandwiched between silicon dioxide materials, of the floating gate field effect transistor is charged, so that electrons enter the floating gate (tunneling effect), and thus, data is stored in the floating gate in the form of electrons; in turn, a voltage is applied to the substrate of the floating gate fet to pull out electrons in the floating gate (tunneling release), and the data is erased and waits to be rewritten.
And step S30, when the temperature value is restored to the preset range, acquiring the data in the first storage area and writing the data into a second storage area, wherein the storage unit of the second storage area is other storage units except the single-order storage unit, and the single-order storage unit is more stable than the other storage units when the temperature value is not in the preset range.
In the technical solution provided in this embodiment, when the flash memory device is idle, an idle task is created in the background, where the idle task is used to scan whether there is any tag information in a queue in the memory, and when it is determined that there is any tag information in the queue in the memory, an ambient temperature waiting procedure is entered, and when the ambient temperature is restored to a temperature range of normal operation, data in the first storage area is obtained and written into a second storage area, where a storage unit of the second storage area is another storage unit except a single-order storage unit, such as a third-order storage unit, a fourth-order storage unit, a fifth-order storage unit, and the like.
According to the scheme, after a Host write data command is sent by a computer, a main control temperature sensor firstly acquires the current environment temperature, judges whether the current environment temperature is within a normal working temperature range, judges whether the residual storage capacity of an SLC storage area is larger than the storage capacity of data to be written if the residual storage capacity of the SLC storage area is not within a normal operating temperature range, recovers dirty blocks of the current device when the residual storage capacity of the SLC storage area is judged to be smaller than the storage capacity of the data to be written, erases data marked as invalid in the SLC storage area, and after the recovery of the dirty blocks is finished, FTL software uses an SLC programming mode to write the data into a first storage area, generates mark information containing a storage address of the data and stores the mark information into a queue of an internal memory. The storage unit of the first storage area is a single-order storage unit, and when the data is written in the single-order storage unit, one bit of data is written in each time; when the flash memory device is idle, an idle task is established in a background, the task is used for scanning whether mark information exists in a queue in the memory, if yes, an environment temperature waiting process is entered, when the environment temperature is recovered to be within a temperature range of normal operation, marked data in the first storage area are moved to the second storage area with larger capacity, and finally the mark information in the memory is cleared.
The invention can judge whether the working temperature is in the normal range before writing data, writes the data into the single-order storage unit when the temperature is not in the normal range, and writes the data stored in the single-order storage unit in the first storage area into the three-order storage unit in the second storage area when the temperature is recovered to the normal range, thereby solving the problem that the error rate of the data is increased when the flash memory writes the data outside the normal working temperature range.
Further, referring to fig. 3, fig. 3 is a second embodiment of the method for writing data into a flash memory according to the present invention, and based on the above embodiment, the step S30 includes:
step S31, acquiring a storage address of the data in the first storage area, generating and storing tag information including the storage address;
step S32, when the temperature value is restored to the preset range, obtaining the marking information in the memory;
step S33, when the mark information exists in the memory, the memory address in the mark information is obtained;
and step S34, acquiring the data in the storage address, and writing the data in the second storage area.
In the technical solution provided by this embodiment, the flag information is a variable, and is used to store the address of the data written in the first storage area, and is used by the apparatus to determine whether there is data in the first storage area when the temperature returns to the normal range. After a Host write data command is obtained and data are written into a first storage area, a storage address of the data in the first storage area is obtained, mark information containing the storage address is generated and stored in a queue. The mark information can be saved in a flash memory or a storage unit of a computer. And when the temperature value is restored to be within a preset range, creating an idle task in a background to scan whether the queue is marked, and when the queue is marked, acquiring the marking information in the memory, then acquiring the storage address in the marking information, finally acquiring the data in the storage address, and writing the data into the second storage area.
The terminal generates the mark information containing the address of the data written into the first storage area, then puts the mark information into the queue, and only needs to judge whether the mark information exists in the queue when the device is idle to know whether the data exists in the first storage area, so that the efficiency of writing the data from the first storage area into the second storage area is improved.
Further, referring to fig. 4, fig. 4 is a third embodiment of the method for writing data into a flash memory according to the present invention, and on the basis of the embodiment shown in fig. 3, after the step S34, the method further includes:
and step S40, deleting the mark information in the memory.
In the technical scheme provided by this embodiment, when the temperature value is restored to the preset range, an idle task is created in the background to scan whether the queue is marked, and when the queue is marked, the marking information in the memory is acquired, the storage address in the marking information is acquired, the data in the storage address is acquired finally, the data is written into the second storage area, and the marking information in the memory is deleted finally.
The terminal deletes the tag information in the queue after writing the data of the first storage area into the second storage area, preventing the device from recognizing the tag information again and writing the same data into the second storage area again.
Further, referring to fig. 5, fig. 5 is a fourth embodiment of the method for writing data into a flash memory according to the present invention, and on the basis of the embodiment shown in fig. 2, the step S10 includes:
step S11, acquiring the residual storage capacity of the first storage area;
and step S12, writing the data into the first storage area when the capacity corresponding to the data is smaller than the remaining storage capacity.
In the technical scheme provided by this embodiment, the master control temperature sensor first acquires the current ambient temperature, determines whether the current ambient temperature is within a normal working temperature range, determines whether the remaining storage capacity of the SLC storage area is greater than the storage capacity of the data to be written if the current ambient temperature is not within the normal operating temperature range, and writes the data into the first storage area by using the FTL software in the SLC programming mode when the remaining storage capacity of the SLC storage area is determined to be greater than the storage capacity of the data to be written.
When writing data, the terminal firstly judges whether the target storage area has enough storage capacity to store the data to be written, thereby preventing the written data from being mistaken due to overflow of the memory.
Further, referring to fig. 6, fig. 6 is a fifth embodiment of the method for writing data into a flash memory according to the present invention, and on the basis of the embodiment shown in fig. 5, after the step S12, the method further includes:
step S50, when the capacity corresponding to the data is greater than the remaining storage capacity, acquiring invalid data in the first storage area;
and step S60, deleting the invalid data.
In the technical scheme provided by this embodiment, the master control temperature sensor first acquires the current ambient temperature, determines whether the ambient temperature is within a normal operating temperature range, determines whether the remaining storage capacity of the SLC storage area is greater than the storage capacity of the data to be written if the ambient temperature is not within the normal operating temperature range, and recovers the dirty blocks of the current device when the remaining storage capacity of the SLC area is determined to be less than the storage capacity of the data to be written. It can be understood that invalid information is identified for data to be recovered in a dirty block, when memory recovery is performed, first, whether invalid tag information is contained in a queue is scanned, when invalid tag information is contained in the queue, the invalid tag information is acquired, then, a storage address of invalid data in the tag information is acquired, finally, the data marked as invalid in an SLC storage area is erased according to the storage, and after the dirty block recovery is completed, FTL software writes the data into a first storage area by using an SLC programming mode.
When writing data, the terminal firstly judges whether the target storage area has enough storage capacity to store the data to be written, thereby preventing the written data from being mistaken due to overflow of the memory.
Further, referring to fig. 7, fig. 7 is a sixth embodiment of the method for writing data into a flash memory according to the present invention, and on the basis of the embodiment shown in fig. 2, after the step S30, the method further includes:
step S70, mark the data in the first storage area as invalid data.
In the technical solution provided in this embodiment, after writing the data in the first storage area into the second storage area, for the performance of the flash memory, the data stored in the first storage area is not deleted immediately, but an invalid flag information is generated, an address of the data stored in the first storage area is acquired and then stored in the invalid flag information, and finally the invalid flag information is added to the queue. It will be appreciated that data marked as invalid is also stored in memory, and erased when the write-once data is written.
The terminal writes the data of the first storage area into the second storage area, generates invalid mark information containing the address information of the data, and adds the invalid mark information to the queue, so that the processing performance of the terminal is improved.
In order to achieve the above object, the present invention further provides a flash data writing device, which includes a processor, a memory, and a flash data writing program stored in the memory and operable on the processor, wherein the flash data writing program, when executed by the processor, implements the steps of the above flash data writing method.
In order to achieve the above object, the present invention further provides a computer-readable storage medium, on which a flash data writing program is stored, and the flash data writing program implements the steps of the flash data writing method as described above when executed by a processor.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a television, a mobile phone, a computer, an apparatus, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (7)

1. A method for writing flash memory data is characterized by comprising the following steps:
after a data writing instruction is received, acquiring a temperature value of the current environment;
when the temperature value is not within a preset range, writing the data into a first storage area, wherein the preset range is the temperature range in which the current flash memory normally works, a storage unit of the first storage area is a single-stage storage unit, the single-stage storage unit writes one bit of data each time when the data is written into the single-stage storage unit to generate mark information, and the mark information comprises the storage position of the data in the first storage area;
when the temperature value is restored to be within the preset range, obtaining mark information in a memory, obtaining data according to a storage address in the mark information, and writing the data into a second storage area, wherein a storage unit of the second storage area is other storage units except a single-order storage unit, and the single-order storage unit is more stable than the other storage units when the temperature value is not within the preset range.
2. The method for writing data into a flash memory according to claim 1, wherein after the step of obtaining data according to the storage address in the tag information and writing the data into the second storage area, the method further comprises:
and deleting the mark information in the memory.
3. The method of writing data of a flash memory according to claim 1, wherein the step of writing the data in the first storage area comprises:
acquiring the residual storage capacity of the first storage area;
and when the capacity corresponding to the data is smaller than the residual storage capacity, writing the data into a first storage area.
4. The method for writing data into a flash memory according to claim 3, wherein the step of obtaining the remaining storage capacity of the first storage area is followed by further comprising:
when the capacity corresponding to the data is larger than the residual storage capacity, acquiring invalid data in the first storage area;
and deleting the invalid data.
5. The method for writing data into a flash memory according to claim 1, wherein after the step of acquiring the data in the first storage area and writing the data into the second storage area, the method further comprises:
marking the data in the first storage area as invalid data.
6. A device for writing flash data, comprising a processor, a memory, and a flash data writer stored on the memory and operable on the processor, wherein the flash data writer implements the steps of the method for writing flash data according to any one of claims 1 to 5 when executed by the processor.
7. A computer-readable storage medium, on which a program for writing flash data is stored, the program for writing flash data implementing the steps of the method for writing flash data according to any one of claims 1 to 5 when executed by a processor.
CN201811539392.3A 2018-12-14 2018-12-14 Writing method and device of flash memory data and computer readable storage medium Active CN109582248B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811539392.3A CN109582248B (en) 2018-12-14 2018-12-14 Writing method and device of flash memory data and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811539392.3A CN109582248B (en) 2018-12-14 2018-12-14 Writing method and device of flash memory data and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109582248A CN109582248A (en) 2019-04-05
CN109582248B true CN109582248B (en) 2022-02-22

Family

ID=65930273

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811539392.3A Active CN109582248B (en) 2018-12-14 2018-12-14 Writing method and device of flash memory data and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109582248B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110531935B (en) * 2019-08-29 2023-02-03 北京计算机技术及应用研究所 SLC flash memory wear leveling method based on physical page relative temperature
CN110928488A (en) * 2019-10-28 2020-03-27 广州妙存科技有限公司 Method for optimizing high-low temperature read-write reliability of NAND flash memory
CN115145469A (en) * 2021-03-30 2022-10-04 深圳市江波龙电子股份有限公司 Data processing method of storage device and storage device
CN113448518A (en) * 2021-06-05 2021-09-28 山东英信计算机技术有限公司 Data processing method, system, device and medium
CN113643746B (en) * 2021-07-02 2023-09-26 深圳市宏旺微电子有限公司 Flash memory data analysis method and device, terminal equipment and storage medium
CN115826854A (en) * 2022-11-09 2023-03-21 深圳市广和通无线股份有限公司 Storage method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102682841A (en) * 2011-03-02 2012-09-19 苹果公司 Using temperature sensors with a memory device
CN103688246A (en) * 2011-05-17 2014-03-26 桑迪士克科技股份有限公司 Non-volatile memory and method with small logical groups distributed between active SLC and MLC memory partitions
CN103688247A (en) * 2011-06-15 2014-03-26 苹果公司 Block management schemes in hybrid slc/mlc memory
CN104571938A (en) * 2013-10-28 2015-04-29 擎泰科技股份有限公司 Method for accessing data in multi-level cell memory and multi-level cell memory device thereof
CN107845394A (en) * 2016-09-19 2018-03-27 三星电子株式会社 Storage device and its operating method
CN108804024A (en) * 2017-05-02 2018-11-13 慧荣科技股份有限公司 Data storage device and operation method thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9032269B2 (en) * 2011-07-22 2015-05-12 Sandisk Technologies Inc. Systems and methods of storing data
CN107506309B (en) * 2017-06-30 2020-05-19 深圳市硅格半导体有限公司 Terminal, flash memory data writing method and computer readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102682841A (en) * 2011-03-02 2012-09-19 苹果公司 Using temperature sensors with a memory device
CN103688246A (en) * 2011-05-17 2014-03-26 桑迪士克科技股份有限公司 Non-volatile memory and method with small logical groups distributed between active SLC and MLC memory partitions
CN103688247A (en) * 2011-06-15 2014-03-26 苹果公司 Block management schemes in hybrid slc/mlc memory
CN104571938A (en) * 2013-10-28 2015-04-29 擎泰科技股份有限公司 Method for accessing data in multi-level cell memory and multi-level cell memory device thereof
CN107845394A (en) * 2016-09-19 2018-03-27 三星电子株式会社 Storage device and its operating method
CN108804024A (en) * 2017-05-02 2018-11-13 慧荣科技股份有限公司 Data storage device and operation method thereof

Also Published As

Publication number Publication date
CN109582248A (en) 2019-04-05

Similar Documents

Publication Publication Date Title
CN109582248B (en) Writing method and device of flash memory data and computer readable storage medium
US6944060B2 (en) Non-volatile storage device and control method thereof
CN103425598B (en) Block management method of data storage device and flash memory
US7774390B2 (en) Apparatus for collecting garbage block of nonvolatile memory according to power state and method of collecting the same
US10168913B2 (en) Data storage device and data maintenance method thereof
JP4287222B2 (en) Nonvolatile semiconductor memory device
JP5142685B2 (en) Memory system
US20170285954A1 (en) Data storage device and data maintenance method thereof
US20080133824A1 (en) Memory card system including nand flash memory and sram/nor flash memory, and data storage method thereof
CN103854700A (en) Erasure method and device for nonvolatile memory
US20150161040A1 (en) Data-storage device and data erasing method
KR102743227B1 (en) Memory system and operating method thereof
US20170075811A1 (en) Memory system
US7487286B2 (en) Flash memory and method for controlling the memory
JPWO2006067923A1 (en) MEMORY CONTROLLER, NONVOLATILE MEMORY DEVICE, NONVOLATILE MEMORY SYSTEM, AND MEMORY CONTROL METHOD
CN113885808B (en) Mapping information recording method, memory control circuit unit and memory device
US9898211B2 (en) Nonvolatile memory control device, nonvolatile memory control method and computer readable storage medium
JP5183662B2 (en) Memory control device and memory control method
US20120151166A1 (en) Nonvolatile storage device and memory controller
KR20170001235A (en) Memory system and method of operating the same
CN107025063A (en) Memory management method, memory storage device and memory control circuit unit
CN112579004A (en) Method, system, computer equipment and storage medium for quickly deleting flash data
WO2024055832A1 (en) Non-volatile memory and erasing method therefor, and computer system
JP4177360B2 (en) Memory controller, flash memory system, and flash memory control method
US20130326123A1 (en) Memory management device and method, and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant