[go: up one dir, main page]

CN112433959B - Method, device, computer storage medium and terminal for realizing data storage processing - Google Patents

Method, device, computer storage medium and terminal for realizing data storage processing Download PDF

Info

Publication number
CN112433959B
CN112433959B CN202011328864.8A CN202011328864A CN112433959B CN 112433959 B CN112433959 B CN 112433959B CN 202011328864 A CN202011328864 A CN 202011328864A CN 112433959 B CN112433959 B CN 112433959B
Authority
CN
China
Prior art keywords
page
data
storage
power failure
memory
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
CN202011328864.8A
Other languages
Chinese (zh)
Other versions
CN112433959A (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.)
Hefei Datang Storage Technology Co ltd
Original Assignee
Hefei Datang Storage Technology 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 Hefei Datang Storage Technology Co ltd filed Critical Hefei Datang Storage Technology Co ltd
Priority to CN202011328864.8A priority Critical patent/CN112433959B/en
Publication of CN112433959A publication Critical patent/CN112433959A/en
Application granted granted Critical
Publication of CN112433959B publication Critical patent/CN112433959B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0877Cache access modes
    • G06F12/0882Page mode
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0891Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches using clearing, invalidating or resetting means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0893Caches characterised by their organisation or structure
    • G06F12/0895Caches characterised by their organisation or structure of parts of caches, e.g. directory or tag array
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/16Protection against loss of memory contents

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The embodiment of the invention takes a storage page which is finally written into a block in which data is written when a NAND flash memory is abnormally powered down as a reference page, and after the storage page influenced by the abnormal power down is determined, the data storage processing is carried out on the storage page influenced by the abnormal power down, so that the influence of the abnormal power down on data storage is reduced.

Description

实现数据存储处理的方法、装置、计算机存储介质及终端Method, device, computer storage medium and terminal for realizing data storage processing

技术领域Technical Field

本文涉及但不限于数据存储技术,尤指一种实现数据存储处理的方法、装置、计算机存储介质及终端。This article relates to but is not limited to data storage technology, and in particular to a method, device, computer storage medium and terminal for implementing data storage processing.

背景技术Background Art

与非门(Nand)闪存(Flash)存储是基于浮栅(Floating Gate)的存储技术,在栅极(控制栅)与漏极之间存在浮置栅,Nand Flash可以进行擦除(erase) 放电和编译(program)充电动作;数据在Nand Flash中以电荷形式存储,栅极及主板利用氧化膜进行绝缘处理,因此电荷可以保持很长时间,在无电源时仍然可以进行数据存储。NAND flash memory is based on floating gate storage technology. There is a floating gate between the gate (control gate) and the drain. Nand Flash can perform erase discharge and program charge operations. Data is stored in Nand Flash in the form of charge. The gate and the motherboard are insulated with an oxide film, so the charge can be maintained for a long time and data can still be stored when there is no power.

Nand Flash中的块(block)在执行写入操作时如果发生异常掉电,则这个块就会变得极其不稳定,在异常掉电前写入的存储页(page)和在后续存储页编译写入的数据,在读取时都容易发生错误检查和纠正(ECC)失败(Fail) 的问题,造成数据丢失;相关技术在发生ECC Fail时会进行重新读取(Retry Read)操作,但仍会发生ECC Fail,影响用户使用Nand Flash进行数据存储。为避免异常掉电对数据存储造成影响,一些技术人员对异常掉电时的块进行停止写入的操作,虽然可以避免在后续存储页中写入数据造成的数据丢失,但影响了存储资源的应用。If a block in Nand Flash loses power when performing a write operation, the block will become extremely unstable. The storage page written before the abnormal power failure and the data written in the subsequent storage page compilation are prone to error checking and correction (ECC) failure when reading, resulting in data loss. The related technology will perform a retry read operation when ECC Fail occurs, but ECC Fail will still occur, affecting users' use of Nand Flash for data storage. In order to avoid the impact of abnormal power failure on data storage, some technicians stop writing to the block when the abnormal power failure occurs. Although this can avoid data loss caused by writing data in subsequent storage pages, it affects the application of storage resources.

如何减少异常掉电对数据存储的影响,成为一个有待解决的问题。How to reduce the impact of abnormal power failure on data storage has become a problem to be solved.

发明内容Summary of the invention

以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.

本发明实施例提供一种实现数据存储处理的方法、装置、计算机存储介质及终端,能够减少异常掉电对数据存储的影响。The embodiments of the present invention provide a method, an apparatus, a computer storage medium and a terminal for implementing data storage processing, which can reduce the impact of abnormal power failure on data storage.

本发明实施例提供了一种实现数据存储处理的方法,包括:An embodiment of the present invention provides a method for implementing data storage processing, including:

Nand闪存异常掉电后重新上电时,确定异常掉电时刻数据写入的块中最后写入数据的储存页;When the Nand flash memory is powered on again after an abnormal power failure, determine the storage page where the last data was written in the block where the data was written at the time of the abnormal power failure;

以确定的最后写入数据的储存页作为基准页,确定受异常掉电影响的存储页;Using the storage page to which data was last written as a reference page, determining the storage page affected by the abnormal power failure;

对确定的受异常掉电影响的存储页进行数据存储处理。Data storage processing is performed on the determined storage pages affected by the abnormal power failure.

在一种示例性实例中,所述确定掉电时刻数据写入的块中最后写入数据的储存页之前,所述方法还包括:In an exemplary embodiment, before determining the storage page of the block to which data is last written at the time of power failure, the method further includes:

根据加载所述Nand闪存的应用的运行日志信息,确定所述异常掉电时刻数据写入的块。The block to which the data is written at the time of the abnormal power failure is determined according to the operation log information of the application loaded with the Nand flash memory.

在一种示例性实例中,所述确定受异常掉电影响的存储页,包括:In an exemplary embodiment, determining the storage page affected by the abnormal power failure includes:

将所述基准页及所述基准页之前的第一预设数值页存储页,确定为已写入数据的受异常掉电影响的第一存储页;和/或,Determine the reference page and the first preset value page storage page before the reference page as the first storage page affected by abnormal power failure and having written data; and/or,

将所述基准页之后的第二预设数值页存储页,确定为未写入数据的受异常掉电影响的第二存储页。A second preset value page storage page after the reference page is determined as a second storage page affected by abnormal power failure and to which no data is written.

在一种示例性实例中,所述第一存储页包括:In an exemplary embodiment, the first storage page includes:

所述基准页所在的位线中的所有存储页。All memory pages in the bit line where the reference page is located.

在一种示例性实例中,所述对确定的受掉电影响的存储页进行数据存储处理,包括:In an exemplary embodiment, performing data storage processing on the determined storage page affected by the power failure includes:

所述受异常掉电影响的存储页包括所述第一存储页时,将所述第一存储页中的数据,迁移至不受掉电影响的存储页中;When the storage page affected by the abnormal power failure includes the first storage page, migrating the data in the first storage page to a storage page not affected by the power failure;

所述受异常掉电影响的存储页包括所述第二存储页时,在所述第二存储页中写入预先设定的无效数据。When the storage pages affected by the abnormal power failure include the second storage page, preset invalid data is written into the second storage page.

在一种示例性实例中,所述受异常掉电影响的存储页包括所述第一存储页和所述第二存储页时,所述对确定的受掉电影响的存储页进行数据存储处理,包括:In an exemplary embodiment, when the storage page affected by the abnormal power failure includes the first storage page and the second storage page, the performing data storage processing on the determined storage page affected by the power failure includes:

在预先设定的缓存区域,缓存所述第一存储页中的数据;caching the data in the first storage page in a preset cache area;

在所述第二存储页中写入预先设定的无效数据;Writing preset invalid data into the second storage page;

在写入所述无效数据的所述第二存储页之后,写入缓存的所述第一存储页中的数据。After writing the invalid data to the second storage page, the data in the cached first storage page is written.

另一方面,本发明实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机程序,所述计算机程序被处理器执行时实现上述实现数据存储处理的方法。On the other hand, an embodiment of the present invention further provides a computer storage medium, wherein a computer program is stored in the computer storage medium, and when the computer program is executed by a processor, the above-mentioned method for implementing data storage processing is implemented.

再一方面,本发明实施例还提供一种终端,包括:存储器和处理器,所述存储器中保存有计算机程序;其中,In another aspect, an embodiment of the present invention further provides a terminal, comprising: a memory and a processor, wherein the memory stores a computer program; wherein:

处理器被配置为执行存储器中的计算机程序;The processor is configured to execute the computer program in the memory;

所述计算机程序被所述处理器执行时实现如上述实现数据存储处理的方法。When the computer program is executed by the processor, the method for implementing data storage processing as described above is implemented.

还一方面,本发明实施例还提供一种实现数据存储处理的装置,包括:第一确定单元、第二确定单元和处理单元;其中,In another aspect, an embodiment of the present invention further provides a device for implementing data storage processing, comprising: a first determining unit, a second determining unit and a processing unit; wherein,

第一确定单元设置为:Nand闪存异常掉电后重新上电时,确定异常掉电时刻数据写入的块中最后写入数据的储存页;The first determining unit is configured to: when the Nand flash memory is powered on again after abnormal power failure, determine the storage page where the data is last written in the block where the data is written at the time of abnormal power failure;

第二确定单元设置为:以确定的最后写入数据的储存页作为基准页,确定受异常掉电影响的存储页;The second determining unit is configured to: determine the storage page affected by the abnormal power failure by taking the storage page determined to have last written data as the reference page;

处理单元设置为:对确定的受异常掉电影响的存储页进行数据存储处理。The processing unit is configured to perform data storage processing on the determined storage pages affected by the abnormal power failure.

在一种示例性实例中,所述第二确定单元是设置为:In an exemplary embodiment, the second determining unit is configured to:

将所述基准页及所述基准页之前的第一预设数值页存储页,确定为已写入数据的受异常掉电影响的第一存储页;和/或,Determine the reference page and the first preset value page storage page before the reference page as the first storage page affected by abnormal power failure and having written data; and/or,

将所述基准页之后的第二预设数值页存储页,确定为未写入数据的受异常掉电影响的第二存储页。A second preset value page storage page after the reference page is determined as a second storage page affected by abnormal power failure and to which no data is written.

本发明实施例以Nand闪存异常掉电时刻数据写入的块中最后写入数据的储存页作为基准页,确定受异常掉电影响的存储页后,对受异常掉电影响的存储页进行数据存储处理,减少了异常掉电对数据存储的影响。The embodiment of the present invention uses the storage page where data is written last in the block where data is written at the time of abnormal power failure of the Nand flash memory as the reference page, determines the storage page affected by the abnormal power failure, and then performs data storage processing on the storage page affected by the abnormal power failure, thereby reducing the impact of the abnormal power failure on data storage.

本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

附图用来提供对本发明技术方案的进一步理解,并且构成说明书的一部分,与本申请的实施例一起用于解释本发明的技术方案,并不构成对本发明技术方案的限制。The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present invention and do not constitute a limitation on the technical solution of the present invention.

图1为本发明实施例实现数据存储处理的方法的流程图;FIG1 is a flow chart of a method for implementing data storage processing according to an embodiment of the present invention;

图2为本发明实施例实现数据存储处理的装置的结构框图。FIG. 2 is a structural block diagram of a device for implementing data storage processing according to an embodiment of the present invention.

具体实施方式DETAILED DESCRIPTION

为使本发明的目的、技术方案和优点更加清楚明白,下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。In order to make the purpose, technical solution and advantages of the present invention more clear, the embodiments of the present invention will be described in detail with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other arbitrarily without conflict.

在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。The steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. Also, although a logical sequence is shown in the flowchart, in some cases, the steps shown or described can be performed in a sequence different from that shown here.

图1为本发明实施例实现数据存储处理的方法的流程图,如图1所示,包括:FIG. 1 is a flow chart of a method for implementing data storage processing according to an embodiment of the present invention, as shown in FIG. 1 , including:

步骤101、与非门(Nand)闪存(Flash)异常掉电后重新上电时,确定异常掉电时刻数据写入的块中最后写入数据的储存页;Step 101, when a NAND flash memory is powered on again after abnormal power failure, determining a storage page where data is last written in a block where data is written at the time of abnormal power failure;

在一种示例性实例中,本发明实施例步骤101之前还包括:根据加载Nand 闪存的应用的运行日志信息,确定异常掉电时刻数据写入的块。In an exemplary embodiment, the embodiment of the present invention further includes, before step 101: determining a block to which data is written at the time of abnormal power failure according to the operation log information of the application loaded into the Nand flash memory.

在一种示例性实例中,本发明实施例Nand闪存是否是异常掉电,可以加载Nand闪存的应用的运行日志信息确定;In an exemplary embodiment, whether the Nand flash memory of the embodiment of the present invention is abnormally powered off can be determined by loading the running log information of the application of the Nand flash memory;

需要说明的是,获取运行日志信息、根据运行日志信息确定异常掉电及从运行日志信息确定异常掉电时刻数据写入的块,可以参照相关技术中实现,在此不做赘述。确定异常掉电时刻数据写入的块之后,可以重新上电时,对块中数据进行恢复的参数确定最后写入数据的储存页。It should be noted that obtaining the operation log information, determining the abnormal power failure according to the operation log information, and determining the block to which the data is written at the time of the abnormal power failure from the operation log information can be implemented with reference to the relevant technology, and will not be described in detail here. After determining the block to which the data is written at the time of the abnormal power failure, the parameters for restoring the data in the block can be used to determine the storage page of the last written data when the power is turned on again.

步骤102、以确定的最后写入数据的储存页作为基准页,确定受异常掉电影响的存储页;Step 102, using the storage page to which data is last written as a reference page, and determining the storage page affected by the abnormal power failure;

在一种示例性实例中,本发明实施例确定受异常掉电影响的存储页,包括:In an exemplary embodiment, an embodiment of the present invention determines a storage page affected by an abnormal power failure, including:

将基准页及基准页之前的第一预设数值页存储页,确定为已写入数据的受异常掉电影响的第一存储页;和/或,Determine the reference page and the first preset value page storage page before the reference page as the first storage page affected by abnormal power failure and having written data; and/or,

将基准页之后的第二预设数值页存储页,确定为未写入数据的受异常掉电影响的第二存储页。A second preset value page storage page after the reference page is determined as a second storage page affected by abnormal power failure and to which no data is written.

本发明实施例受异常掉电影响的存储页可以包括上述第一存储页,也可以包括上述第二存储页,还可以同时包括第一存储页和第二存储页。The storage page affected by abnormal power failure in the embodiment of the present invention may include the first storage page, may include the second storage page, or may include the first storage page and the second storage page at the same time.

在一种示例性实例中,本发明实施例中的第一存储页包括:In an exemplary embodiment, the first storage page in the embodiment of the present invention includes:

基准页所在的位线中的所有存储页。All memory pages in the bit line where the reference page is located.

在一种示例性实例中,本发明实施例第二预设数值根据实验确定的数值,可以为大于36、但小于208的数;例如,100左右。In an exemplary embodiment, the second preset value of the embodiment of the present invention is a value determined based on experiments, and can be a number greater than 36 but less than 208; for example, about 100.

步骤103、对确定的受异常掉电影响的存储页进行数据存储处理。Step 103: Perform data storage processing on the determined storage pages affected by the abnormal power failure.

在一种示例性实例中,对确定的受掉电影响的存储页进行数据存储处理,包括:In an exemplary embodiment, performing data storage processing on a determined storage page affected by power failure includes:

受异常掉电影响的存储页包括第一存储页时,将第一存储页中的数据,迁移至不受掉电影响的存储页中;When the storage pages affected by the abnormal power failure include the first storage page, data in the first storage page is migrated to a storage page not affected by the power failure;

受异常掉电影响的存储页包括第二存储页时,在第二存储页中写入预先设定的无效数据。When the memory pages affected by the abnormal power failure include the second memory page, preset invalid data is written into the second memory page.

在一种示例性实例中,无效数据可以包括:通过预设标识标定的无效的数据,例如、通过元数据(meta-data)标识为无效的数据。In an exemplary embodiment, the invalid data may include: invalid data marked by a preset identifier, for example, data marked as invalid by metadata (meta-data).

在一种示例性实例中,本发明实施例受异常掉电影响的存储页包括第一存储页和第二存储页时,对确定的受掉电影响的存储页进行数据存储处理,包括:In an exemplary embodiment, when the storage page affected by abnormal power failure in the embodiment of the present invention includes a first storage page and a second storage page, data storage processing is performed on the determined storage page affected by the power failure, including:

在预先设定的缓存区域,缓存第一存储页中的数据;caching the data in the first storage page in a preset cache area;

在第二存储页中写入预先设定的无效数据;Writing preset invalid data into the second storage page;

在写入无效数据的第二存储页之后,写入缓存的第一存储页中的数据。After writing the second memory page of invalid data, the data in the first memory page of the cache is written.

在一种示例性实例中,本发明实施例缓存区域可以包括:预先设定的位于静态随机存取存储器(SRAM)或动态随机存取存储器(DRAM)中的存储区域。In an exemplary embodiment, the cache area of the embodiment of the present invention may include: a pre-set storage area located in a static random access memory (SRAM) or a dynamic random access memory (DRAM).

由于Nand闪存中的块中,如果第一存储页中已经进行过数据写入,因此,不允许再次进行数据写入,而要使用第二存储页之后的存储页进行数据写入,则第二存储页不允许空闲。为避免写入数据受异常掉电影响,同时最大程度的利用Nand闪存中的存储资源,本发明实施例在第二存储页中写入无效数据,将第一存储页中的数据嵌入第二存储页之后,以此,减少了异常掉电对数据存储的影响。Since in a block in a Nand flash memory, if data has been written in the first storage page, data writing is not allowed again, and data must be written using the storage page after the second storage page, so the second storage page is not allowed to be idle. In order to avoid the influence of abnormal power failure on the written data and to maximize the use of the storage resources in the Nand flash memory, the embodiment of the present invention writes invalid data in the second storage page and embeds the data in the first storage page after the second storage page, thereby reducing the influence of abnormal power failure on data storage.

本发明实施例以Nand闪存异常掉电时刻数据写入的块中最后写入数据的储存页作为基准页,确定受异常掉电影响的存储页后,对受异常掉电影响的存储页进行数据存储处理,减少了异常掉电对数据存储的影响。The embodiment of the present invention uses the storage page where data is written last in the block where data is written at the time of abnormal power failure of the Nand flash memory as the reference page, determines the storage page affected by the abnormal power failure, and then performs data storage processing on the storage page affected by the abnormal power failure, thereby reducing the impact of the abnormal power failure on data storage.

本发明实施例还提供一种计算机存储介质,计算机存储介质中存储有计算机程序,计算机程序被处理器执行时实现上述实现数据存储处理的方法。An embodiment of the present invention further provides a computer storage medium, in which a computer program is stored. When the computer program is executed by a processor, the above-mentioned method for realizing data storage processing is implemented.

本发明实施例还提供一种终端,包括:存储器和处理器,存储器中保存有计算机程序;其中,The embodiment of the present invention further provides a terminal, comprising: a memory and a processor, wherein a computer program is stored in the memory; wherein:

处理器被配置为执行存储器中的计算机程序;The processor is configured to execute the computer program in the memory;

计算机程序被处理器执行时实现如上述实现数据存储处理的方法。When the computer program is executed by the processor, the method for implementing data storage processing as described above is implemented.

图2为本发明实施例一种实现数据存储处理的装置的结构框图,如图2 所示,包括:第一确定单元、第二确定单元和处理单元;其中,FIG2 is a structural block diagram of a device for implementing data storage processing according to an embodiment of the present invention. As shown in FIG2 , the device comprises: a first determining unit, a second determining unit and a processing unit; wherein,

第一确定单元设置为:Nand Flash异常掉电后重新上电时,确定异常掉电时刻数据写入的块中最后写入数据的储存页;The first determining unit is configured to: when the Nand Flash is powered on again after abnormal power failure, determine the storage page where the data is last written in the block where the data is written at the time of abnormal power failure;

第二确定单元设置为:以确定的最后写入数据的储存页作为基准页,确定受异常掉电影响的存储页;The second determining unit is configured to: determine the storage page affected by the abnormal power failure by taking the storage page determined to have last written data as the reference page;

处理单元设置为:对确定的受异常掉电影响的存储页进行数据存储处理。The processing unit is configured to perform data storage processing on the determined storage pages affected by the abnormal power failure.

本发明实施例以Nand闪存异常掉电时刻数据写入的块中最后写入数据的储存页作为基准页,确定受异常掉电影响的存储页后,对受异常掉电影响的存储页进行数据存储处理,减少了异常掉电对数据存储的影响。The embodiment of the present invention uses the storage page where data is written last in the block where data is written at the time of abnormal power failure of the Nand flash memory as the reference page, determines the storage page affected by the abnormal power failure, and then performs data storage processing on the storage page affected by the abnormal power failure, thereby reducing the impact of the abnormal power failure on data storage.

在一种示例性实例中,本发明实施例第一确定单元还设置为:In an exemplary embodiment, the first determining unit in the embodiment of the present invention is further configured to:

根据加载Nand Flash的应用的运行日志信息,确定异常掉电时刻数据写入的块。Determine the block to which data is written at the time of abnormal power failure based on the running log information of the application loaded into Nand Flash.

在一种示例性实例中,本发明实施例第二确定单元是设置为:In an exemplary embodiment, the second determining unit of the embodiment of the present invention is configured as follows:

将基准页及基准页之前的第一预设数值页存储页,确定为已写入数据的受异常掉电影响的第一存储页;和/或,Determine the reference page and the first preset value page storage page before the reference page as the first storage page affected by abnormal power failure and having written data; and/or,

将基准页之后的第二预设数值页存储页,确定为未写入数据的受异常掉电影响的第二存储页。A second preset value page storage page after the reference page is determined as a second storage page affected by abnormal power failure and to which no data is written.

在一种示例性实例中,本发明实施例第一存储页包括:In an exemplary embodiment, the first storage page of the embodiment of the present invention includes:

基准页所在的位线中的所有存储页。All memory pages in the bit line where the reference page is located.

在一种示例性实例中,本发明实施例处理单元是设置为:In an exemplary embodiment, the processing unit of the embodiment of the present invention is configured as follows:

受异常掉电影响的存储页包括第一存储页时,将第一存储页中的数据,迁移至不受掉电影响的存储页中;When the storage pages affected by the abnormal power failure include the first storage page, data in the first storage page is migrated to a storage page not affected by the power failure;

受异常掉电影响的存储页包括第二存储页时,在第二存储页中写入预先设定的无效数据。When the memory pages affected by the abnormal power failure include the second memory page, preset invalid data is written into the second memory page.

在一种示例性实例中,本发明实施例处理单元是设置为:In an exemplary embodiment, the processing unit of the embodiment of the present invention is configured as follows:

在预先设定的缓存区域,缓存第一存储页中的数据;caching the data in the first storage page in a preset cache area;

在第二存储页中写入预先设定的无效数据;Writing preset invalid data into the second storage page;

在写入无效数据的第二存储页之后,写入缓存的第一存储页中的数据。After writing the second memory page of invalid data, the data in the first memory page of the cache is written.

以下通过应用示例对本发明实施例进行简要说明,应用示例仅用于陈述本发明,并不用于限定本发明的保护范围。The following briefly describes the embodiments of the present invention through application examples. The application examples are only used to illustrate the present invention and are not used to limit the protection scope of the present invention.

应用示例Application Examples

本应用示例将本发明实施例的数据存储处理加入到异常掉电过程中,异常掉电后进行的处理包括:This application example adds the data storage processing of the embodiment of the present invention to the abnormal power failure process. The processing after the abnormal power failure includes:

步骤一:在Nand Flash写入数据过程中出现异常掉电时,通过加载Nand Flash的应用的运行日志信息,将正在写入数据的块(Block)定义为Block N;Step 1: When an abnormal power failure occurs during the data writing process of the Nand Flash, the block (Block) where data is being written is defined as Block N by loading the running log information of the Nand Flash application;

参照相关技术在Nand Flash异常掉电后,会根据Nand Flash的特性,在异常掉电后继续进行数据写入处理;According to the related technology, after the Nand Flash loses power abnormally, the data writing process will continue after the Nand Flash loses power abnormally according to the characteristics of the Nand Flash.

步骤二:重新上电时恢复数据时,确定Block N中写入数据的最大存储页,即最后写入数据的储存页(page);Step 2: When restoring data after power-on, determine the largest storage page for writing data in Block N, that is, the storage page for writing data last;

步骤三:将确定的最后写入数据的储存页作为基准页,将基准页所在的位线(wordline)中所有存储页的数据读出,写入到预先设定的缓存区域;Step 3: The storage page to which the data is last written is used as the reference page, and the data of all the storage pages in the wordline where the reference page is located are read out and written into a preset cache area;

在一种示例性实例中,本发明实施例预先设定的缓存区域可以包括:预先设定的静态随机存取存储器(SRAM)和动态随机存取存储器(DRAM)中的存储区域;In an exemplary embodiment, the cache area preset in the embodiment of the present invention may include: a storage area in a preset static random access memory (SRAM) and a dynamic random access memory (DRAM);

步骤四:在基准页之后的第二预设数值页存储页中写入无效数据。Step 4: writing invalid data into a second preset value page storage page after the reference page.

步骤五:将缓存在缓存区域中的数据,写入到写入无效数据的存储页之后的存储页中。Step 5: Write the data cached in the cache area to the storage page following the storage page where the invalid data is written.

本应用示例通过将受异常掉电影响的已写入数据存储到不受异常掉电影响的区域;在未写入数据的受异常掉电影响的区域写入无效数据,避免了在受异常掉电影响的存储页中进行有效数据的存储,减少了异常掉电对数据存储的影响。将缓存区域中数据,写入到写入无效数据的存储页之后的存储页中之后,后续的存储页也是不受异常掉电影响的存储页,可以继续进行数据写入。本发明实施例可以适用由环境温度、磨损次数和耐久力(Endurance) 等因素造成的异常断电,不会因为异常掉电造成block不稳定而造成的数据丢失,提升了Nand闪存工作的稳定性。提升了用户使用Nand闪存进行数据存储的体验。This application example avoids storing valid data in the storage page affected by the abnormal power outage by storing the written data affected by the abnormal power outage in the area not affected by the abnormal power outage; and writes invalid data in the area affected by the abnormal power outage where no data is written, thereby reducing the impact of the abnormal power outage on data storage. After writing the data in the cache area to the storage page after the storage page where the invalid data is written, the subsequent storage pages are also storage pages not affected by the abnormal power outage, and data writing can continue. The embodiment of the present invention can be applied to abnormal power outages caused by factors such as ambient temperature, number of wear and endurance, and will not cause data loss due to block instability caused by abnormal power outages, thereby improving the stability of Nand flash memory. It improves the user experience of using Nand flash memory for data storage.

“本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质”。“A person skilled in the art will appreciate that all or some of the steps, systems, and functional modules/units in the above disclosed methods may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a transient medium). As is known in the art, As is well known to those skilled in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, as is well known to those skilled in the art, communication media typically contains computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media".

Claims (5)

1.A method of implementing a data storage process, comprising:
When the NAND flash memory is powered up again after abnormal power failure, determining a storage page of data written in a block written in by data at the moment of abnormal power failure;
The storage page which is finally written with the data is used as a reference page, and the storage page which is affected by abnormal power failure is determined;
Carrying out data storage processing on the determined storage pages affected by abnormal power failure;
Wherein the determining the memory pages affected by the abnormal power down includes: the reference page and a first preset value page storage page in front of the reference page are determined to be a first storage page of written data, which is affected by abnormal power failure; determining a second preset value page storage page behind the reference page as a second storage page which is not written with data and is affected by abnormal power failure; the first memory page includes: all memory pages in the bit line where the reference page is located; the data storage processing is carried out on the determined storage pages affected by power failure, and the method comprises the following steps: when the memory page affected by abnormal power failure comprises the first memory page, migrating data in the first memory page to the memory page not affected by power failure; when the memory page affected by abnormal power failure comprises the second memory page, writing preset invalid data into the second memory page; when the memory pages affected by abnormal power failure include the first memory page and the second memory page, the data storage processing is performed on the determined memory pages affected by power failure, including: caching data in the first storage page in a preset cache area; writing preset invalid data in the second storage page; after writing the second memory page of the invalid data, writing data in the first memory page of the cache.
2. The method of claim 1, wherein the determining the power down time is prior to the last page of data written in the block of data writes, the method further comprising:
and determining the block in which the data is written at the abnormal power-down moment according to the operation log information of the application loading the Nand flash memory.
3. A computer storage medium having a computer program stored therein, which when executed by a processor, implements the method of implementing a data storage process according to any one of claims 1 to 2.
4. A terminal, comprising: a memory and a processor, the memory storing a computer program; wherein,
The processor is configured to execute the computer program in the memory;
The computer program, when executed by the processor, implements a method of implementing a data storage process according to any one of claims 1 to 2.
5. An apparatus for implementing a data storage process, comprising: the device comprises a first determining unit, a second determining unit and a processing unit; wherein,
The first determination unit is configured to: when the Nand flash memory is powered up again after abnormal power failure, determining a storage page of data written in a block written in by data at the moment of abnormal power failure;
The second determination unit is configured to: determining a storage page affected by abnormal power failure by taking the determined storage page of the last written data as a reference page, wherein the determining the storage page affected by abnormal power failure comprises the following steps: the reference page and a first preset value page storage page in front of the reference page are determined to be a first storage page of written data, which is affected by abnormal power failure; determining a second preset value page storage page behind the reference page as a second storage page which is not written with data and is affected by abnormal power failure; the first memory page includes: all memory pages in the bit line where the reference page is located;
the processing unit is configured to: carrying out data storage processing on the determined storage pages affected by abnormal power failure;
wherein; the data storage processing is carried out on the determined storage pages affected by power failure, and the method comprises the following steps: when the memory page affected by abnormal power failure comprises the first memory page, migrating data in the first memory page to the memory page not affected by power failure; when the memory page affected by abnormal power failure comprises the second memory page, writing preset invalid data into the second memory page; when the memory pages affected by abnormal power failure include the first memory page and the second memory page, the data storage processing is performed on the determined memory pages affected by power failure, including: caching data in the first storage page in a preset cache area; writing preset invalid data in the second storage page; after writing the second memory page of the invalid data, writing data in the first memory page of the cache.
CN202011328864.8A 2020-11-24 2020-11-24 Method, device, computer storage medium and terminal for realizing data storage processing Active CN112433959B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011328864.8A CN112433959B (en) 2020-11-24 2020-11-24 Method, device, computer storage medium and terminal for realizing data storage processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011328864.8A CN112433959B (en) 2020-11-24 2020-11-24 Method, device, computer storage medium and terminal for realizing data storage processing

Publications (2)

Publication Number Publication Date
CN112433959A CN112433959A (en) 2021-03-02
CN112433959B true CN112433959B (en) 2024-11-08

Family

ID=74693947

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011328864.8A Active CN112433959B (en) 2020-11-24 2020-11-24 Method, device, computer storage medium and terminal for realizing data storage processing

Country Status (1)

Country Link
CN (1) CN112433959B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114328281B (en) * 2021-11-30 2023-11-14 苏州浪潮智能科技有限公司 Methods, devices, electronic equipment and media for handling abnormal power outage of solid state drives

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110580130A (en) * 2019-08-21 2019-12-17 天津大学 A method of writing data to a flash memory module that is protected from power interruptions
CN111324549A (en) * 2018-12-14 2020-06-23 北京兆易创新科技股份有限公司 Memory and control method and device thereof

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7752381B2 (en) * 2005-05-24 2010-07-06 Micron Technology, Inc. Version based non-volatile memory translation layer
CN103914397B (en) * 2013-01-09 2018-01-30 深圳市江波龙电子有限公司 Flash memory device and its management method
CN107992431A (en) * 2017-12-21 2018-05-04 珠海亿智电子科技有限公司 A kind of power-off protection method of nand flash memory invalid data recycling

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111324549A (en) * 2018-12-14 2020-06-23 北京兆易创新科技股份有限公司 Memory and control method and device thereof
CN110580130A (en) * 2019-08-21 2019-12-17 天津大学 A method of writing data to a flash memory module that is protected from power interruptions

Also Published As

Publication number Publication date
CN112433959A (en) 2021-03-02

Similar Documents

Publication Publication Date Title
CN111752487B (en) Data recovery method and device and solid state disk
US8271515B2 (en) System and method for providing copyback data integrity in a non-volatile memory system
US12056391B2 (en) SSD-based log data storage method and apparatus, device and medium
CN104750571A (en) Method for error correction, memory device and controller of memory device
CN109902034B (en) Snapshot creating method and device, electronic equipment and machine-readable storage medium
WO2023116346A1 (en) Method and system for recovering trim data under abnormal power failure, and solid-state drive
CN111722800A (en) A ROW snapshot implementation method and related components of a distributed storage system
CN109710286A (en) System upgrade method, apparatus, device and storage medium
CN116134519A (en) Balanced three-level read disturb management in memory devices
TWI490869B (en) Method and associated controller for flash memory
CN111758086B (en) Method for refreshing mapping table of SSD
CN112433959B (en) Method, device, computer storage medium and terminal for realizing data storage processing
CN108777156A (en) A kind of flash memory data processing method and device
WO2018041151A1 (en) Data storage method and apparatus, and nonvolatile memory
CN112115515A (en) Data protection method and device, electronic equipment and storage medium
US12079485B2 (en) Method and apparatus for closing open block in SSD
US20220214817A1 (en) Memory system and operating method thereof
WO2019001296A1 (en) Method and apparatus for storing record
CN105260264A (en) Snapshot implementation method and snapshot system
KR102760286B1 (en) Digital device performing booting process and method for controlling same
KR20230037255A (en) Method for managing event log, controller and storage device
CN108984117B (en) Data reading and writing method, medium and equipment
CN113760195B (en) FATFS file system based on embedded type
JP2013174976A (en) Memory system and update method for control program
US20100037004A1 (en) Storage system for backup data of flash memory and method for the same

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
CB02 Change of applicant information

Address after: 230088 floor 7, block C, building J2, phase II, innovation industrial park, high tech Zone, Hefei, Anhui Province

Applicant after: HEFEI DATANG STORAGE TECHNOLOGY Co.,Ltd.

Address before: 100094 No. 6 Yongjia North Road, Beijing, Haidian District

Applicant before: HEFEI DATANG STORAGE TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant