WO2018041151A1 - 数据存储的方法、装置以及非易失性存储器 - Google Patents

数据存储的方法、装置以及非易失性存储器 Download PDF

Info

Publication number
WO2018041151A1
WO2018041151A1 PCT/CN2017/099722 CN2017099722W WO2018041151A1 WO 2018041151 A1 WO2018041151 A1 WO 2018041151A1 CN 2017099722 W CN2017099722 W CN 2017099722W WO 2018041151 A1 WO2018041151 A1 WO 2018041151A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
data block
overdue
block
page
Prior art date
Application number
PCT/CN2017/099722
Other languages
English (en)
French (fr)
Inventor
叶位彬
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2018041151A1 publication Critical patent/WO2018041151A1/zh

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/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0607Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device
    • 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
    • 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/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • 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]

Definitions

  • the storage time in the expired data block is determined by using a write time of the first page data in the expired data block as the storage time.
  • the storage time is stored in an out-of-band area OOB of the first page in the overdue data block.
  • an address specifying a data page in the free data block is marked as an address of the data page in the expired data block, and the expired data block is marked as an idle data block.
  • the expired data block is stored in an expired list.
  • an apparatus for data storage including: a verification module, configured to traverse an overdue data block in units of pages, and verify each page of data according to a preset rule.
  • the data in the expired data block stores the storage time reaching the preset time; the writing module is configured to write the data in the expired data block into the designated idle data block.
  • the device further includes: a pause module, configured to detect a data access request during the verification process, and then suspend the verification after the current expired data block is written to the specified idle data block; restarting the module For continuing verification of the overdue data block after the data access is completed.
  • a pause module configured to detect a data access request during the verification process, and then suspend the verification after the current expired data block is written to the specified idle data block; restarting the module For continuing verification of the overdue data block after the data access is completed.
  • the storage medium is further arranged to store program code for performing the following steps:
  • the storage medium is further arranged to store program code for performing the following steps:
  • the problem that the non-volatile memory data retention time becomes shorter and shorter can be solved, thereby increasing the data retention time.
  • FIG. 1 is a flow chart of a method of data storage in accordance with an embodiment of the present disclosure
  • FIG. 2 is a structural diagram of an apparatus for data storage according to an embodiment of the present disclosure
  • FIG. 1 is a flowchart of a method for data storage according to an embodiment of the present disclosure. As shown in FIG. 1, the process includes The following steps:
  • Step S102 traversing the data block in the unit of the data, and checking the data of each page according to a preset rule, wherein the data in the time-out data block stores the data stored in the preset time;
  • a write time of the first page data in the expired data block is used as the storage time.
  • the storage time is stored in the out-of-band area OOB of the first page in the overdue data block.
  • the foregoing verification process includes: performing verification on the data in the overdue data block according to a preset algorithm, and correcting data in the overdue data block when the verification is not passed. If the data in the overdue data block is successfully corrected, determining that the data in the overdue data block passes the check; if the data in the overdue data block is corrected If it is defeated, it is determined that the data in the overdue data block has not passed the verification.
  • the preset algorithm includes but is not limited to: Hamming coding and BCH coding.
  • the preset time refers to the maximum time that the non-volatile memory allows data storage.
  • Step S104 writing data in the expired data block into the designated idle data block.
  • the data that passes the check is written in the designated free data block, the data that does not pass the check but supports error correction, and the data that does not pass the check does not support error correction.
  • a real time clock is added to the controller in the non-volatile memory to obtain time information.
  • the CPU sends the current time information to the controller to correct the time of the real-time clock.
  • the maximum setting time for setting data is 2 years. Set the time interval for the controller to scan the data block for an expiration of 1 year.
  • the CPU sends the time information to the controller on January 1, 2010, and the controller corrects the real-time clock time to January 1, 2010. Then, the CPU sends a write data command to the controller, and sends the first page data to the buffer of the controller.
  • the controller selects a free data block without writing data, erases it, and writes the data of the buffer.
  • the first page of the data block is entered, and then the ECC code and the time information "January 1, 2010" are written to the OOB area of the first page.
  • the CPU sends a write data command to the controller, and sends the second page data to the buffer of the controller.
  • the controller writes the data of the buffer to the second page, and writes the ECC code to the OOB of the second page. region. This loops until the data is written.
  • the controller reads the write time of the first page of the non-free data block of the write data one by one, and compares with the current time "January 1, 2011", and finds that no data block is saved for more than 2 years, and the expired list is empty and ends. This scan.
  • the second scan time was reached.
  • the controller reads the first page of the non-idle data block one by one
  • the write time is compared with the current time "January 1, 2012". It is found that the data block has a storage time of 2 years, and these data block addresses are stored in the expired list. After all non-empty data blocks have been scanned, the first data block address of the expired list is read, assuming the address is 0x000a, and then an idle data block is selected, assuming the address is 0x020c.
  • the controller first erases the data block 0x020c, then reads the first page data of the data block 0x000a and the ECC code, checks the correctness of the data by using the ECC code, finds that the data is correct, and then writes the data to the first of the data block 0x020c.
  • the page, the ECC code, and the time information "January 1, 2012" are written to the OOB area of the page.
  • the second page data of the data block 0x000a and the ECC code are read, the correctness of the data is verified by the ECC code, the data is found to be incorrect, the data is corrected by the ECC code, and the corrected data is written into the data block 0x020c.
  • the ECC code is written to the OOB area of the page.
  • the remaining pages of the data block are moved, and then the data page logical address of data block 0x020c is changed to the data page logical address of data block 0x000a, and the data block 0x000a is marked with the free data block. At this point, the movement of the first data block is completed.
  • the CPU sends a read data command to the controller.
  • the controller responds to the CPU read command, sends the data to the CPU, and executes the overdue list. The movement of other data blocks.
  • the CPU externally stores a piece of NAND FLASH as a memory.
  • the data block address and the current time are simultaneously recorded in the second memory.
  • the data block address table in the order of the write time is recorded in the second memory. Assuming that the current time is January 1, 2014, and the maximum storage time of the set data is 2 years, then the CPU only needs to move the data blocks written before 2012, so that the data retention time can be extended.
  • a device for data storage is provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and has not been described again.
  • the term "module” may implement a combination of software and/or hardware of a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • the device for data storage in this embodiment may be applied to a non-volatile memory, such as a device including a NAND FLASH such as a CF card, an SD card, or a USB flash drive.
  • a non-volatile memory such as a device including a NAND FLASH such as a CF card, an SD card, or a USB flash drive.
  • the apparatus includes a verification module 22 and a write module 24.
  • the verification module 22 is configured to traverse the data of the expired data block in units of data pages, and verify each page of data according to a preset rule, where the data of the storage time reaches a preset time is stored in the overdue data block. ;
  • a write time of the first page data in the expired data block is used as the storage time.
  • the storage time is stored in the out-of-band area OOB of the first page in the overdue data block.
  • the foregoing verification process includes: performing verification on the data in the overdue data block according to a preset algorithm, and correcting data in the overdue data block when the verification is not passed. If the data in the overdue data block is successfully corrected, determining that the data in the overdue data block passes the check; if the data in the overdue data block is corrected, determining that the data in the overdue data block fails check.
  • the preset time refers to the maximum time that the non-volatile memory allows data storage.
  • the writing module 24 is configured to write data in the expired data block into the specified free data block.
  • the writing module 24 is further configured to write the data that passes the verification, the data that fails the verification but supports error correction, and the data that does not support the error correction by the verification.
  • the specified free data block is further configured to write the data that passes the verification, the data that fails the verification but supports error correction, and the data that does not support the error correction by the verification. The specified free data block.
  • FIG. 3 is a block diagram of another apparatus for data storage in accordance with an embodiment of the present disclosure. As shown in FIG. 3, the apparatus includes a marking module 32 in addition to all of the modules shown in FIG.
  • the marking module 32 is configured to mark an address of the designated free data block data page as an address of the data page in the expired data block, and mark the expired data block as an idle data block.
  • the suspending module 42 is configured to detect a data access request during the verification process, and then suspend the verification after the current expired data block is written to the designated idle data block;
  • the restarting module 44 is configured to continue to verify data of the expired data block after the data access is completed.
  • each of the above modules may be implemented by software or hardware.
  • the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the above modules are arbitrary.
  • the combined forms are located in different processors.
  • Embodiments of the present disclosure also provide a storage medium.
  • the foregoing storage medium may be configured to store program code for performing the following steps:
  • the storage medium is further arranged to store program code for performing the following steps:
  • the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • a mobile hard disk e.g., a hard disk
  • magnetic memory e.g., a hard disk
  • modules or steps of the present disclosure described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module. As such, the disclosure is not limited to any specific combination of hardware and software.
  • the data storage method and device and the non-volatile memory of the embodiment of the present disclosure traverse the overdue data block in units of pages, and check each page of data according to a preset rule, wherein the overdue data block is Data with a storage time reaching a preset time is stored; data in the overdue data block is written to the specified free data block. In this way, since the data block exceeding the storage time is verified and a new data block is written, the problem that the non-volatile memory data storage time becomes shorter and shorter can be solved, thereby increasing the data retention time.

Landscapes

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

Abstract

一种数据存储的方法、装置以及非易失性存储器。其中,数据存储的方法包括:对超期数据块以数据页为单位进行遍历,并按照预设规则对每页数据进行校验,其中,所述超期数据块中存储有存储时间到达预设时间的数据(S102);将超期数据块中的数据写入到指定空闲数据块中(S104)。该方法解决了非易失性存储器数据保存时间越来越短的问题,从而增加了数据的保存时间。

Description

数据存储的方法、装置以及非易失性存储器 技术领域
本公开涉及数据存储领域,特别涉及一种数据存储的方法、装置以及非易失性存储器。
背景技术
在通讯设备领域,数据存储的解决方案主要有三种:磁盘、NOR FLASH、NAND FLASH。磁盘是传统的存储设备,优点是容量大,数据保存时间长,但体积大,不耐震,功耗高,而且价格也高,在通讯设备上已经较少使用。NOR FLASH优点是数据保存时间长,擦写次数多,可靠性高,功耗低,但是容量太小,而且价格高,已经不能满足通讯设备日益增长的数据存储需求。NAND FLASH是较理想的解决方案,具有大容量、高吞吐、低功耗、耐震、发热量小的优点。但是由于厂商的半导体工艺在不断升级,以及为了满足对日益增长的容量需求,NAND FLASH存储器的工艺尺寸不断缩小,使得NAND FLASH的数据保持能力严重下降。采用43nm工艺的SLC(Single Level Cell)NAND FLASH数据保存时间为10年以上,但采用24nm工艺之后数据保存时间仅为5年左右。这是由于NAND FLASH存储器是基于浮栅电荷存储实现数据的保存,在数据保存期间,浮栅电荷泄漏导致浮栅电荷数量减少,浮栅电荷的丢失将会导致数据错误产生。随着工艺尺寸不断缩小,NAND FLASH存储器的存储单元浮栅结构的几何尺寸不断缩小,导致绝缘层越来越薄,电荷泄漏越来越严重,所以数据保存时间越来越短。
相关技术中解决方案是增加纠错编码(Error Correction Code,简称ECC)纠错比特数来提升纠错能力,在一定程度上缓解了数据保持能力下降的问题。但这种方法效果有限,随着数据保存时间的增加,数据错误的产生会爆发式增长,很快就超出了可纠错范围,无法纠正。而且增加ECC纠错比特数,意味着纠错电路复杂度的提高,增加了成本。在当前24-32nm的工艺下,此方法能起到一定作用。但是对于将来16nm以及更小的尺寸,则不再适用。所以能否提高NAND FLASH的数据保持能力,将影响NAND FLASH能否作为未来工业级存储解决方案的关键。
因此,在相关技术中,还没有一种比较的好的方案解决非易失性存储器数据保存时间越来越短的问题。
发明内容
本公开实施例提供了一种数据存储的方法、装置以及非易失性存储器,以至少解决相关技术中非易失性存储器数据保存时间越来越短的问题。
根据本公开的一个实施例,提供了一种数据存储的方法,包括:对超期数据块以页为单位进行遍历,并按照预设规则对每页数据进行校验,其中,所述超期数据块中存储有存储时间到达预设时间的数据;将超期数据块中的数据写入到指定空闲数据块中。
可选地,所述超期数据块中的所述存储时间通过以下方式确定:将所述超期数据块中第一页数据的写入时间作为所述存储时间。
可选地,所述存储时间存储于所述超期数据块中第一页的带外区域OOB中。
可选地,按照预设规则对每页数据进行校验,包括以下之一:按照所述预设算法对所述超期数据块中的数据进行校验,并在未通过校验时,对所述超期数据块中的数据进行纠正,如果所述超期数据块中的数据纠正成功,则确定所述超期数据块中的数据通过校验;如果所述超期数据块中的数据纠正失败,则确定所述超期数据块中的数据未通过校验。可选地,将超期数据块中的数据写入到指定空闲数据块中,包括:将通过校验的所述数据、未通过校验但支持纠错的所述数据以及未通过校验不支持纠错的所述数据写入所述到所述指定空闲数据块中。
可选地,将指定空闲数据块中数据页的地址标记为所述超期数据块中数据页的地址,并且将所述超期数据块标记为空闲数据块。
可选地,所述超期数据块存储于超期列表当中。
可选地,对超期数据块以页为单位进行遍历,并按照预设规则对每页数据进行校验,还包括:在进行校验过程中检测到数据访问请求,则在当前的超期数据块写入到所述指定空闲数据块后暂停校验;在数据访问完成后,继续对所述超期数据块的校验。
根据本公开的另一个实施例,提供了一种数据存储的装置,包括:校验模块,用于对超期数据块以页为单位进行遍历,并按照预设规则对每页数据进行校验,其中,所述超期数据块中存储有存储时间到达预设时间的数据;写入模块,用于将超期数据块中的数据写入到指定空闲数据块中。
可选的,所述校验模块还用于:按照所述预设算法对所述超期数据块中的数据进行校验,并在未通过校验时,对所述超期数据块中的数据进行纠正,如果所述超期数据块中的数据纠正成功,则确定所述超期数据块中的数据通过校验;如果所述超期数据块中的数据纠正失败,则确定所述超期数据块中的数据未通过校验。
可选地,所述装置还包括:标记模块,用于将指定空闲数据块中数据页的地址标记为所述超期数据块中数据页的地址,并且将所述超期数据块标记为空闲数据块。
可选地,所述装置还包括:暂停模块,用于在进行校验过程中检测到数据访问请求,则在当前的超期数据块写入到所述指定空闲数据块后暂停校验;重启模块,用于在数据访问完成后,继续对所述超期数据块的校验。
根据本公开的又一个实施例,还提供了一种非易失性存储器,包括上述记载的数据存储的装置。
根据本公开的又一个实施例,还提供了一种存储介质。该存储介质设置为存储用于执行以下步骤的程序代码:
S11,对超期数据块以数据页为单位进行遍历,并按照预设规则对每页数据进行校验, 其中,所述超期数据块中存储有存储时间到达预设时间的数据;
S12,将超期数据块中的数据写入到指定空闲数据块中。
可选地,存储介质还设置为存储用于执行以下步骤的程序代码:
S21,将指定空闲数据块中数据页的地址标记为所述超期数据块中数据页的地址,并且将所述超期数据块标记为空闲数据块
可选地,存储介质还设置为存储用于执行以下步骤的程序代码:
S31,在进行校验过程中检测到数据访问请求,则在当前的超期数据块写入到所述指定空闲数据块后暂停校验;
S32,在数据访问完成后,继续对所述超期数据块的数据进行校验。
通过本公开,由于对超过存储时间的数据块进行校验并写入新的数据块,因此,可以解决非易失性存储器数据保存时间越来越短的问题,从而增加了数据的保存时间。
附图说明
此处所说明的附图用来提供对本公开的进一步理解,构成本申请的一部分,本公开的示意性实施例及其说明用于解释本公开,并不构成对本公开的不当限定。在附图中:
图1是根据本公开实施例的数据存储的方法的流程图;
图2是根据本公开实施例的一种数据存储的装置的结构图;
图3是根据本公开实施例的另一种数据存储的装置的结构图;
图4是根据本公开实施例的又一种数据存储的装置的结构图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本公开。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
实施例1
在本实施例中提供了一种运行于非易失性存储器的数据存储的方法,图1是根据本公开实施例的一种数据存储的方法的流程图,如图1所示,该流程包括如下步骤:
步骤S102,对超期数据块以数据页为单位进行遍历,并按照预设规则对每页数据进行校验,其中,所述超期数据块中存储有存储时间到达预设时间的数据;
可选地,将所述超期数据块中第一页数据的写入时间作为所述存储时间。
示例地,该存储时间存储于所述超期数据块中第一页的带外区域OOB中。
可选地,上述校验过程包括:按照预设算法对所述超期数据块中的数据进行校验,并在未通过校验时,对所述超期数据块中的数据进行纠正。如果所述超期数据块中的数据纠正成功,则确定所述超期数据块中的数据通过校验;如果所述超期数据块中的数据纠正失 败,则确定所述超期数据块中的数据未通过校验。
可选地,该预设算法包括但不限于:Hamming编码和BCH编码
可选地,预设时间是指非易失性存储器允许数据存储的最大时间。
可选地,当判断数据款中的数据存储时间大于预设时间时,则确定当前的数据块为超期数据块,并将该超期数据块存储在超期列表当中。
步骤S104,将超期数据块中的数据写入到指定空闲数据块中。
可选地,该指定空闲数据块中写入了通过校验的所述数据、未通过校验但支持纠错的所述数据以及未通过校验不支持纠错的所述数据
需要指出的是,校验的目的在于对错误的数据进行纠正。而对于不能够进行纠正的数据而言,虽然存在错误,但是仍然需要写入指定空闲数据块中。示例地,在本实施例中还提供了以下场景以便于理解本实施例。
可选地,在将超期数据块中的数据写入指定空闲数据块后,将指定空闲数据块中数据页的地址标记为所述超期数据块中数据页的地址,并且将所述超期数据块标记为空闲数据块。需要指出的是超期数据块的地址可以指超级数据块数据页的逻辑地址。通过上述方法,在后续需要读取数据时,可以根据更新后的地址正确地读取数据块。
可选地,当在将超期数据块中的数据写入指定空闲数据块时,用户通过该非易失性存储器进行数据访问时,那么在当前的超期数据块写入到指定空闲数据块后暂停校验。此时不会再去从超期列表当中读取新的超期数据块。直到用户完成对非易失性存储器进行数据访问后,继续对所述超期数据块的校验。通过上述方法,可以保证该非易失性存储器的正常使用,避免在使用非易失性存储器时,发生数据读取错误等问题,
场景1
在非易失性存储器中的控制器上增加一个实时时钟以获取时间信息。每次系统上电后,由CPU发送当前时间信息给控制器,以修正实时时钟的时间。设定数据最长保存时间为2年。设定控制器扫描数据块是否超期的时间间隔为1年。
假设当前时间是2010年1月1日,系统第一次上电,CPU将时间信息2010年1月1日发送给控制器,控制器修正实时时钟时间为2010年1月1日。接着,CPU给控制器发送写数据命令,并把第一页数据发送了控制器的缓冲区,控制器选择一个没有写入数据的空闲数据块,对其擦除,并把缓冲区的数据写入该数据块的第一页,接着将ECC码和时间信息“2010年1月1日”写入到第一页的OOB区域。然后,CPU再给控制器发送写数据命令,并把第二页数据发送了控制器的缓冲区,控制器将缓冲区的数据写入第二页,并将ECC码写入第二页的OOB区域。如此循环,直至数据写入完毕。
在2011年1月1日,到达第一扫描时间。控制器逐一读取写入数据的非空闲数据块第一页的写入时间,与当前时间“2011年1月1日”对比,发现没有数据块保存时间超过2年,超期列表为空,结束本次扫描。
在2012年1月1日,到达第二次扫描时间。控制器逐一读取非空闲数据块第一页的 写入时间,与当前时间“2012年1月1日”对比,发现存在数据块的保存时间达到2年,将这些数据块地址存放在超期列表中。待扫描完所有非空数据块后,读出超期列表第一个数据块地址,假设地址为0x000a,接着选择一个空闲的数据块,假设地址为0x020c。控制器先将数据块0x020c擦除,接着读出数据块0x000a的第一页数据以及ECC码,利用ECC码校验数据的正确性,发现数据无误,接着将数据写入数据块0x020c的第一页,ECC码和时间信息“2012年1月1日”写入该页的OOB区域。
接着,读出数据块0x000a的第二页数据以及ECC码,利用ECC码校验数据的正确性,发现数据有误,利用ECC码将数据纠正,再将纠正后的数据写入数据块0x020c的第二页,ECC码写入该页的OOB区域。如此类推,搬移完该数据块的剩余页,接着,将数据块0x020c的数据页逻辑地址改为数据块0x000a的数据页逻辑地址,将数据块0x000a标记空闲数据块。至此,完成了第一个数据块的搬移。
假设在搬移数据块0x000b时,CPU向控制器发送了一个读取数据命令,控制器在执行完数据块0x000b的搬移后,先响应CPU的读命令,将数据发送给CPU,再执行超期列表中其它数据块的搬移。
场景2
CPU外挂了一片NAND FLASH作为存储器,当向某一数据块的第一页写入数据时,同时在第二存储器记录下该数据块地址和当前时间。这样,便在第二存储器中记录了以写入时间为先后顺序的数据块地址表。假设当前时间为2014年1月1日,设定数据最长保存时间为2年,那么CPU只需要把2012年以前写入数据的数据块进行搬移,即可实现数据保存时间的延长。
通过上述步骤,解决了非易失性存储器数据保存时间越来越短的问题,从而增加了数据的保存时间。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个实施例所述的方法。
实施例2
在本实施例中还提供了一种数据存储的装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
需要指出的是,本实施例中的数据存储的装置可以应用于非易失性存储器当中,例如CF卡、SD卡、U盘等包含NAND FLASH的装置。
图2是根据本公开实施例的一种数据存储的装置的结构图,如图2所示,该装置包括:校验模块22以及写入模块24。
校验模块22,用于对超期数据块以数据页为单位进行遍历,并按照预设规则对每页数据进行校验,其中,所述超期数据块中存储有存储时间到达预设时间的数据;
可选地,将所述超期数据块中第一页数据的写入时间作为所述存储时间。
示例地,该存储时间存储于所述超期数据块中第一页的带外区域OOB中。
可选地,上述校验过程包括:按照预设算法对所述超期数据块中的数据进行校验,并在未通过校验时,对所述超期数据块中的数据进行纠正。如果所述超期数据块中的数据纠正成功,则确定所述超期数据块中的数据通过校验;如果所述超期数据块中的数据纠正失败,则确定所述超期数据块中的数据未通过校验。
可选地,预设时间是指非易失性存储器允许数据存储的最大时间。
可选地,当判断数据款中的数据存储时间大于预设时间时,则确定当前的数据块为超期数据块,并将该超期数据块存储在超期列表当中。
写入模块24,用于将超期数据块中的数据写入到指定空闲数据块中。
可选地,写入模块24还用于将通过校验的所述数据、未通过校验但支持纠错的所述数据以及未通过校验不支持纠错的所述数据写入所述到所述指定空闲数据块中。
需要指出的是,校验的目的在于对错误的数据进行纠正。而对于不能够进行纠正的数据而言,虽然存在错误,但是仍然需要写入指定空闲数据块中。。
图3是根据本公开实施例的另一种数据存储的装置的结构图,如图3所示,该装置除包括图2所示的所有模块外,还包括标记模块32。
标记模块32,用于将指定空闲数据块数据页的地址标记为所述超期数据块中数据页的地址,并且将所述超期数据块标记为空闲数据块。
需要指出的是超期数据块数据页的地址可以指超期数据块中数据页的逻辑地址。通过标记模块32,在后续需要读取数据时,可以根据更新后的地址正确地读取数据块。
图4是根据本公开实施例的又一种数据存储的装置的结构图,如图4所示,该装置除包括图2所示的所有模块外,还包括暂停模块42以及重启模块44。
暂停模块42,用于在进行校验过程中检测到数据访问请求,则在当前的超期数据块写入到指定空闲数据块后暂停校验;
重启模块44,用于在数据访问完成后,继续对所述超期数据块的数据进行校验。
通过暂停模块42以及重启模块44,可以保证该非易失性存储器的正常使用,避免在使用非易失性存储器时,发生数据读取错误等问题。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意 组合的形式分别位于不同的处理器中。
实施例3
本公开的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的程序代码:
S11,对超期数据块以页为单位进行遍历,并按照预设规则对每页数据进行校验,其中,所述超期数据块中存储有存储时间到达预设时间的数据;
S12,将超期数据块中的数据写入到指定空闲数据块中。
可选地,存储介质还设置为存储用于执行以下步骤的程序代码:
S21,将指定空闲数据块中数据页的地址标记为所述超期数据块中数据页的地址,并且将所述超期数据块标记为空闲数据块
可选地,存储介质还设置为存储用于执行以下步骤的程序代码:
S31,在进行校验过程中检测到数据访问请求,则在当前的超期数据块写入到指定空闲数据块后暂停校验;
S32,在数据访问完成后,继续对所述超期数据块的数据进行校验。
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
显然,本领域的技术人员应该明白,上述的本公开的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本公开不限制于任何特定的硬件和软件结合。
以上所述仅为本公开的优选实施例而已,并不用于限制本公开,对于本领域的技术人员来说,本公开可以有各种更改和变化。凡在本公开的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。
工业实用性
本公开实施例的数据存储的方法、装置以及非易失性存储器,对超期数据块以页为单位进行遍历,并按照预设规则对每页数据进行校验,其中,所述超期数据块中存储有存储时间到达预设时间的数据;将超期数据块中的数据写入到指定空闲数据块中。这样,由于对超过存储时间的数据块进行校验并写入新的数据块,因此,可以解决非易失性存储器数据保存时间越来越短的问题,从而增加了数据的保存时间。

Claims (12)

  1. 一种数据存储的方法,包括:
    对超期数据块以数据页为单位进行遍历,并按照预设规则对每页数据进行校验,其中,所述超期数据块中存储有存储时间到达预设时间的数据;
    将所述超期数据块中的数据写入到指定空闲数据块中。
  2. 根据权利要求1所述的方法,其中,所述超期数据块中的所述存储时间通过以下方式确定:
    将所述超期数据块中第一页数据的写入时间作为所述存储时间。
  3. 根据权利要求2所述的方法,所述存储时间存储于所述超期数据块中第一页的带外区域OOB中。
  4. 根据权利要求1所述的方法,其中,按照所述预设规则对每页数据进行校验,包括以下之一:
    按照预设算法对所述超期数据块中的数据进行校验,并在未通过校验时,对所述超期数据块中的数据进行纠正,如果所述超期数据块中的数据纠正成功,则确定所述超期数据块中的数据通过校验;如果所述超期数据块中的数据纠正失败,则确定所述超期数据块中的数据未通过校验。
  5. 根据权利要求1所述的方法,其中,将所述超期数据块中的数据写入到所述指定空闲数据块中,包括:
    将通过校验的所述数据、未通过校验但支持纠错的所述数据以及未通过校验不支持纠错的所述数据写入所述到所述指定空闲数据块中。
  6. 根据权利要求1所述的方法,其中,所述方法还包括:将所述指定空闲数据块中数据页的地址标记为所述超期数据块中数据页的地址,并且将所述超期数据块标记为空闲数据块。
  7. 根据权利要求1所述的方法,其中,对所述超期数据块以页为单位进行遍历,并按照预设规则对每页数据进行校验,还包括:
    在进行校验过程中检测到数据访问请求,则在将所述超期数据块的当前数据写入到所述指定空闲数据块后暂停校验;
    在数据访问完成后,继续对所述超期数据块的数据进行校验。
  8. 一种数据存储的装置,包括:
    校验模块,设置为对超期数据块以数据页为单位进行遍历,并按照预设规则对每页数据进行校验,其中,所述超期数据块中存储有存储时间到达预设时间的数据;
    写入模块,设置为将所述超期数据块中的数据写入到指定空闲数据块中。
  9. 根据权利要求8所述的装置,其中,所述校验模块还设置为:
    按照预设算法对所述超期数据块中的数据进行校验,并在未通过校验时,对所述超期 数据块中的数据进行纠正,如果所述超期数据块中的数据纠正成功,则确定所述超期数据块中的数据通过校验;如果所述超期数据块中的数据纠正失败,则确定所述超期数据块中的数据未通过校验。
  10. 根据权利要求8所述的装置,其中,所述装置还包括:
    标记模块,设置为将所述指定空闲数据块中数据页的地址标记为所述超期数据块中数据页的地址,并且将所述超期数据块标记为空闲数据块。
  11. 根据权利要求8所述的装置,其中,所述装置还包括:
    暂停模块,设置为在进行校验过程中检测到数据访问请求,则在将所述超期数据块的当前数据写入到所述指定空闲数据块后暂停校验;
    重启模块,设置为在数据访问完成后,继续对所述超期数据块的数据进行校验。
  12. 一种存储介质,用于存储程序代码,所述程序代码用于执行权利要求1至7任一项所述的数据存储的方法。
PCT/CN2017/099722 2016-08-30 2017-08-30 数据存储的方法、装置以及非易失性存储器 WO2018041151A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610779065.XA CN107783725A (zh) 2016-08-30 2016-08-30 数据存储的方法、装置以及非易失性存储器
CN201610779065.X 2016-08-30

Publications (1)

Publication Number Publication Date
WO2018041151A1 true WO2018041151A1 (zh) 2018-03-08

Family

ID=61300079

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/099722 WO2018041151A1 (zh) 2016-08-30 2017-08-30 数据存储的方法、装置以及非易失性存储器

Country Status (2)

Country Link
CN (1) CN107783725A (zh)
WO (1) WO2018041151A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113820649A (zh) * 2021-08-31 2021-12-21 中国电力科学研究院有限公司 一种电能表固件的寿命可靠性测试方法和装置

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI722938B (zh) * 2020-07-06 2021-03-21 慧榮科技股份有限公司 記憶裝置、快閃記憶體控制器及其存取方法
CN116521092B (zh) * 2023-06-30 2023-09-05 昆山工业大数据创新中心有限公司 一种工业设备数据的存储方法和装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060291304A1 (en) * 2005-06-23 2006-12-28 Rothman Michael A Method for enhanced block management
CN101226504A (zh) * 2008-01-25 2008-07-23 炬力集成电路设计有限公司 一种防止存储器读损的方法及装置
CN103455386A (zh) * 2013-08-28 2013-12-18 华为技术有限公司 一种修复出错数据的方法和设备
CN103745753A (zh) * 2013-12-17 2014-04-23 记忆科技(深圳)有限公司 基于闪存的纠错方法与系统
CN105788647A (zh) * 2014-12-26 2016-07-20 北京兆易创新科技股份有限公司 一种非易失存储器的纠错方法和装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101377749B (zh) * 2007-08-31 2010-06-02 华为技术有限公司 存储器数据校验方法、装置、可编程逻辑器件及系统
CN101794622B (zh) * 2010-02-10 2012-12-12 华为数字技术(成都)有限公司 存储设备的数据扫描方法和装置
CN105242871B (zh) * 2014-06-06 2018-06-05 华为技术有限公司 一种数据写入方法及装置
CN105867833B (zh) * 2015-01-21 2019-05-28 深圳市硅格半导体有限公司 数据存储装置及数据存储方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060291304A1 (en) * 2005-06-23 2006-12-28 Rothman Michael A Method for enhanced block management
CN101226504A (zh) * 2008-01-25 2008-07-23 炬力集成电路设计有限公司 一种防止存储器读损的方法及装置
CN103455386A (zh) * 2013-08-28 2013-12-18 华为技术有限公司 一种修复出错数据的方法和设备
CN103745753A (zh) * 2013-12-17 2014-04-23 记忆科技(深圳)有限公司 基于闪存的纠错方法与系统
CN105788647A (zh) * 2014-12-26 2016-07-20 北京兆易创新科技股份有限公司 一种非易失存储器的纠错方法和装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113820649A (zh) * 2021-08-31 2021-12-21 中国电力科学研究院有限公司 一种电能表固件的寿命可靠性测试方法和装置
CN113820649B (zh) * 2021-08-31 2024-05-17 中国电力科学研究院有限公司 一种电能表固件的寿命可靠性测试方法和装置

Also Published As

Publication number Publication date
CN107783725A (zh) 2018-03-09

Similar Documents

Publication Publication Date Title
CN108269604B (zh) 用于读取干扰检测以及处理的方法和装置
CN111752487B (zh) 一种数据恢复方法、装置及固态硬盘
JP5675954B2 (ja) メタデータタグを介した不規則なパリティ分布の検出
TWI387023B (zh) 防止迴焊過程中資料遺失之方法及使用該方法之記憶體裝置
US20170139839A1 (en) Data storage device and data maintenance method thereof
KR101969008B1 (ko) 영구 메모리에서의 에러 처리 기술
TWI490876B (zh) 系統啟動引導處理方法及裝置
TWI512742B (zh) 非揮發性快閃記憶體擦除異常存儲塊修復方法和裝置
US9305663B2 (en) Techniques for assessing pass/fail status of non-volatile memory
JP2010529557A (ja) 新たな不良ブロック検出
WO2018041151A1 (zh) 数据存储的方法、装置以及非易失性存储器
TWI659304B (zh) 存取快閃記憶體模組的方法及相關的快閃記憶體控制器與電子裝置
TWI486957B (zh) Nand快閃記憶體燒錄資料的處理、使用方法及裝置、運行系統
US9754682B2 (en) Implementing enhanced performance with read before write to phase change memory
CN106469119B (zh) 一种基于nvdimm的数据写缓存方法及其装置
TW201732533A (zh) 資料儲存裝置及其操作方法
US10942678B2 (en) Method of accessing data in storage device, method of managing data in storage device and storage device performing the same
WO2019062147A1 (zh) 一种计数器的读写方法及装置、设备、存储介质
US9443604B2 (en) Electronic device and data-management method thereof
CN107168650B (zh) 一种对bios的存储器中的数据的处理方法及装置
CN113918485B (zh) 一种闪存资料防丢失方法、装置、设备及存储介质
US9880926B1 (en) Log structured reserved zone for a data storage device
TWI670598B (zh) 管理快閃記憶體模組的方法及相關的快閃記憶體控制器及電子裝置
CN112433959A (zh) 实现数据存储处理的方法、装置、计算机存储介质及终端
US20170235635A1 (en) Solid state storage device and data processing method thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17845453

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17845453

Country of ref document: EP

Kind code of ref document: A1