WO2013189277A1 - 一种固态硬盘及其数据管理方法、系统 - Google Patents

一种固态硬盘及其数据管理方法、系统 Download PDF

Info

Publication number
WO2013189277A1
WO2013189277A1 PCT/CN2013/077384 CN2013077384W WO2013189277A1 WO 2013189277 A1 WO2013189277 A1 WO 2013189277A1 CN 2013077384 W CN2013077384 W CN 2013077384W WO 2013189277 A1 WO2013189277 A1 WO 2013189277A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
solid state
timestamp
marked
information
Prior art date
Application number
PCT/CN2013/077384
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 记忆科技(深圳)有限公司
Priority to US14/409,987 priority Critical patent/US9875250B2/en
Publication of WO2013189277A1 publication Critical patent/WO2013189277A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1847File system types specifically adapted to static storage, e.g. adapted to flash memory or SSD
    • 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
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1016Performance improvement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7201Logical to physical mapping or translation of blocks or pages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7209Validity control, e.g. using flags, time stamps or sequence numbers

Definitions

  • the present invention relates to the field of solid state storage technologies, and in particular, to a solid state hard disk and a data management method and system thereof. Background technique
  • the "removal-erasing" garbage collection method continuously provides space for writing. If the file system does not inform the storage device of the address space corresponding to the invalid data, the data is also valid for the solid-state storage device. It will also be ineffectively moved during the garbage collection process, reducing the performance of solid-state storage devices.
  • the TRIM command is a command that the file system notifies the storage device of the address space corresponding to the invalid data. After receiving the command, the storage device marks the invalid data so that they do not participate in the garbage collection process to prevent the storage device from accessing the data. Unnecessary operations to improve the performance of solid state storage devices.
  • the existing TRIM implementation only stores TRIM information in bitmap mode.
  • the file system writes new data to the TRIM interval, it needs to update the TRIM information in time.
  • the cached part of the TRIM information is in the memory.
  • storing TRIM information only in bitmap mode will occupy more storage space.
  • the file system writes new data to the TRIM interval, it needs to update the TRIM information in time, which will make the TRIM and the normal data stream tightly coupled, which reduces the system's Efficiency, increased system complexity, and the cache of TRIM information increases the memory requirements of solid-state storage systems.
  • the object of the present invention is to provide a solid state hard disk and a data management method and system thereof, which can uncouple the tag information from the normal data stream, realize fast tagging of invalid data of the solid state hard disk, and improve system efficiency. , reducing the system's memory requirements and system implementation complexity.
  • the present invention provides a solid state hard disk data management method, including: adding a write data to a time stamp and then storing the data in a solid state hard disk;
  • the timestamp of the tag information is compared with the timestamp of the data in the tagged address range; if the timestamp of the data in the tagged address range is earlier than the tag The timestamp of the message, the address interval is marked as invalid, otherwise the address interval is not marked as invalid.
  • the step of "adding the write data to the time stamp and then storing it in the solid state hard disk” is specifically as follows: receiving a data write command; decomposing the write command into a data write unit; A time stamp is added to the data in each data writing unit; the data written in the data is stored in the flash memory of the solid state hard disk.
  • the step of "adding the tag information to the SSD and adding it to the SSD” is specifically: decomposing the tag information into a plurality of data writing units; writing the plurality of data
  • the input unit adds a time stamp; the data written in the unit is stored in the flash memory of the solid state hard disk.
  • the method before the step of "matching the timestamp of the tag information with the timestamp of the data in the tagged address range", the method further includes: scanning the solid state hard disk, and establishing a logical physical address mapping table; Reading the tag information from a flash memory of the solid state drive; scanning the marked address interval based on the tag information.
  • the tag information is stored in a bitmap manner.
  • the present invention provides a solid state hard disk data management system, which includes:
  • a data processing module configured to add the write data to the solid state hard disk after adding the time stamp
  • the marking module configured to receive the marking command that marks the data as invalid, mark the address interval corresponding to the invalid data, and mark the The information is added to the SSD and added to the SSD;
  • An initialization module configured to compare a timestamp of the tag information with a timestamp of data in the marked address range after the SSD is started; if the timestamp of the data in the tagged address range If the time stamp is earlier than the tag information, the address interval is marked as invalid, otherwise the address interval is not marked as invalid.
  • the write data processing module adds the write data to the time stamp And then stored in the solid state hard disk, specifically: receiving a data write command; decomposing the write command into a data write unit; adding a time stamp to the data in each of the data write units; writing the data
  • the data entered into the unit is stored in the flash memory of the solid state hard disk.
  • the tagging module adds a timestamp to the tag information and then stores the timestamp in the solid state hard disk, specifically: decomposing the tag information into a plurality of data writing units; The data writing unit adds a time stamp; stores the data written in the unit into the flash memory of the solid state hard disk.
  • the initialization unit is further configured to scan the solid state hard disk, establish a logical physical address mapping table, read the tag information from the flash memory of the solid state hard disk, and scan the marked information according to the tag information. Address range.
  • the invention also provides a solid state hard disk, comprising the above solid state hard disk data management system.
  • the invention records the timestamp of writing when the data or the invalid tag information is written into the solid state disk storage device, and determines whether to apply the invalid tag information by comparing the timestamp of the data with the timestamp of the invalid tag information when the solid state disk is started. , marked a specific address range as invalid.
  • the tag information is not applied when the SSD is started, that is, The address range will not be marked as invalid.
  • the mark information is not updated, and the application of the address interval invalid flag is implemented by adding a time stamp to the data and the mark information, and the mark information and the normal data are released.
  • the coupling of the stream realizes the fast marking of the invalid data of the solid state hard disk, which improves the efficiency of the system; at the same time, the marked information and the data are stored in the flash memory of the solid state hard disk, the storage manner is the same, and the system does not need to be cached in the memory, thereby reducing the system to the memory.
  • the requirements and the complexity of the system implementation whereby, the invention uncouples the marked information from the normal data stream, realizes fast marking of invalid data of the solid state hard disk, improves the efficiency of the system, reduces the system's requirement for memory and the complexity of the system implementation.
  • FIG. 1 is a schematic structural diagram of a solid state hard disk data management system according to the present invention.
  • FIG. 2 is a flow chart of a method for managing data of a solid state hard disk according to the present invention
  • 3 is a specific working flow chart of an embodiment of a write data processing module in the solid state hard disk data management system of the present invention
  • 4 is a specific working flow chart of an embodiment of a marking module in a solid state hard disk data management system according to the present invention
  • FIG. 5 is a flow chart showing the specific operation of an embodiment of the solid state hard disk initialization of the present invention. detailed description
  • a solid state hard disk data management system 100 for a solid state hard disk includes a write data processing module 10, a markup module 20, and an initialization module 30.
  • the write data processing module 10 is configured to add the write data to the solid state hard disk after adding the time stamp. Specifically, when the file system writes new data to the solid state hard disk, the solid state hard disk receives the data write command, and decomposes the data write command into a plurality of data write units (the data write unit may be one page or one Sectors, etc.), time stamps the data in each data write unit, and stores the data written in the unit into the flash memory of the SSD.
  • the marking module 20 is configured to receive a command to mark the data as invalid, mark the address range corresponding to the invalid data, and add a time stamp to the marked information, and then deposit the information into the solid state hard disk.
  • the SSD receives a command sent by the file system to mark the data as invalid (such as a TRIM command), writes a plurality of data in the logical unit, adds a time stamp to the plurality of data writing units, and stores the data in the SSD.
  • the tag information includes those address intervals that are invalid and which are valid.
  • the tag information can be saved in a bitmap manner by using different expressions (such as pixel color) and effective address intervals in the bitmap.
  • the address ranges are respectively corresponding.
  • commands that mark data as invalid are typically issued when the file system deletes data.
  • the logical physical address mapping table indicates the mapping relationship between logical addresses and physical addresses.
  • the initialization module 30 is configured to compare the timestamp of the tag information with the timestamp of the data in the tagged address range after the SSD is started, if the timestamp of the data in the tagged address range is earlier than the tag information. The timestamp is marked as invalid.
  • the solid state hard disk is scanned, and a logical physical address mapping table is established; the mark information is read from the flash memory of the solid state hard disk; the mark information is scanned for the marked address interval, and the time stamp of the mark information is marked with of The timestamps of the data in the address range are compared; if the timestamp of the data in the marked address range is earlier than the timestamp of the tag information, the address range is marked as invalid in the logical physical address mapping table.
  • the time stamp of the data in the address range must be earlier than the timestamp of the tag information. Then, in the next initialization, by comparing the time error of the data in the address interval with the time stamp of the tag information, it can be determined that the address interval is indeed invalid, and the tag information is applied in the logical physical address mapping table, and the address is used. The interval is re-marked as invalid.
  • the time stamp of the data in the address range will definitely be later than the timestamp of the tag information. Then, in the next initialization, the time interval of the data in the address interval and the time stamp of the tag information can be determined to be valid, so that the tag information is not applied in the logical physical address mapping table, and the tag information is not used.
  • the address range is re-marked as invalid. Therefore, when the file system writes new data to the address range that has been marked as invalid, the markup information is not updated, the coupling of the markup command and the normal data flow is released, the efficiency of the system is improved, and the system is used to reduce the memory. demand.
  • the invention records the timestamp of writing when the data or the invalid tag information is written into the solid state disk storage device, and determines whether to apply the invalid tag information by comparing the timestamp of the data with the timestamp of the invalid tag information when the solid state disk is started. , marked a specific address range as invalid.
  • the tag information is not applied when the SSD is started, that is, The address range will not be marked as invalid.
  • the mark information is not updated, and the application of the address interval invalid flag is implemented by adding a time stamp to the data and the mark information, and the mark information and the normal data are released.
  • the coupling of the stream realizes the fast marking of the invalid data of the solid state hard disk, which improves the efficiency of the system; at the same time, the marked information and the data are stored in the flash memory of the solid state hard disk, the storage manner is the same, and the system does not need to be cached in the memory, thereby reducing the system to the memory.
  • the requirements and the complexity of the system implementation whereby, the invention uncouples the marked information from the normal data stream, realizes fast marking of invalid data of the solid state hard disk, improves the efficiency of the system, reduces the system's requirement for memory and the complexity of the system implementation.
  • the present invention provides a solid state hard disk data management method, which is implemented by the management system shown in FIG. 1.
  • the method mainly includes the following processes:
  • step S201 the write data is added to the time stamp and then stored in the solid state drive. This step is implemented by writing to the data processing module 10.
  • Step S202 receiving a mark command that marks the data as invalid, marking the address area corresponding to the invalid data, and adding the mark information to the solid state hard disk after adding the time stamp. This step is implemented by the tag module 20.
  • Step S203 After the SSD is started, compare the timestamp of the tag information with the timestamp of the data in the tagged address range, if the timestamp of the data in the tagged address section is earlier than the timestamp of the tag information, The address interval is marked as invalid, otherwise the address interval is not marked as invalid. This step is implemented by the initialization module 30.
  • the above step S201 is specifically: receiving a data write command; decomposing the write command into a data write unit; adding a time stamp to the data in each data write unit; storing the data written in the unit to the data SSD in the flash memory.
  • adding the mark information to the solid state hard disk after adding the time stamp is specifically: decomposing the mark information into a plurality of data write units; adding a time stamp to the plurality of data write units; writing the data
  • the data in the unit is stored in the flash memory of the SSD.
  • the foregoing step S203 is specifically: scanning a solid state hard disk, establishing a logical physical address mapping table; reading tag information from a flash memory of the solid state hard disk; scanning the marked address interval by the tag information; and marking the time stamp of the tag information The time stamp of the data in the address range is compared; if the time stamp of the data in the marked address range is earlier than the time stamp of the tag information, the address range is marked as invalid in the logical physical address mapping table, otherwise Mark the address range as invalid.
  • FIG. 3 is a specific working flow chart of an embodiment of a write data processing module in the solid state hard disk data management system of the present invention. The process includes the following steps:
  • Step S301 Receive a data write command.
  • Step S302 the write command is decomposed into data writing units.
  • Step S303 adding a timestamp to the data in each data writing unit.
  • Step S304 the data written in the data is stored in the flash memory of the solid state hard disk.
  • Step S305 determining whether the write command is decomposed or not, if yes, proceeding to step S306, otherwise returning to step S302.
  • Step S306 the data writing is completed.
  • the write data processing module 10 decomposes a data write unit and immediately adds it
  • the step of adding the time stamp and simultaneously decomposing the next data write unit, the step of adding the time stamp is performed simultaneously with the step of decomposing the next data write unit.
  • FIG. 3 is a detailed workflow diagram of an embodiment of a tagging module in a solid state hard disk data management system of the present invention. The process includes the following steps:
  • Step S401 receiving a TRIM command.
  • the TRIM command is a command that the file system notifies the storage device of the address space corresponding to the invalid data.
  • Step S402 marking an address interval in the system according to the TRIM command.
  • the corresponding address space is invalidated according to the TRIM command.
  • Step S403 the TRIM information is decomposed into data writing units.
  • the TRIM information includes those address ranges that are invalid and which address ranges are valid.
  • the TRIM information can be saved in a bitmap format.
  • Step S404 adding a timestamp to the data in each data writing unit.
  • Step S405 the data written in the data is stored in the flash memory of the solid state hard disk.
  • Step S406 it is judged whether the TRIM information is decomposed or not, and if yes, the process proceeds to step S407, otherwise, the process returns to step S403.
  • Step S407 the TRIM command execution is completed.
  • FIG. 5 is a flowchart of an embodiment of the solid state hard disk initialization of the present invention, which includes the following steps: Step S501: Scan a solid state hard disk to establish a logical physical address mapping table.
  • Step S502 Read TRIM information from a flash memory of the solid state hard disk.
  • the TRIM information is saved in a bitmap mode, and is respectively associated with the effective address interval and the invalid address interval by using different expressions (such as pixel color) in the bitmap.
  • Step S503 scanning an address interval marked as invalid in the TRIM information.
  • Step S504 determining whether the timestamp of the TRIM information is later than the timestamp of the data in the marked address range. If yes, go to step S505, otherwise go to step S506.
  • Step S505 In the logical physical address mapping table, the address interval marked as invalid in the TRIM information is marked as invalid.
  • step S506 it is judged whether the scanning is completed, and if yes, the process goes to step S507, otherwise, the process returns to step S503.
  • step S507 the initialization is completed.
  • the TRIM information includes the address range marked as invalid, and after the SSD is started, there is no such tag information in the newly created logical physical address mapping table, so in the initialization process, it is necessary to judge according to TRIM.
  • the address range marked as invalid in the message is applied to the logical physics In the address mapping table.
  • the TRIM information is stored in a mixed mode of interval and bitmap, which reduces the amount of TRIM information to be stored, accelerates the execution of TRIM commands, and applies TRIM information to reduce system startup time.
  • the present invention records the timestamp of writing when writing data or invalid tag information to the SSD storage device.
  • the SSD When the SSD is started, it is determined by comparing the timestamp of the data with the timestamp of the invalid tag information. Apply the invalid tag information to mark a specific address range as invalid.
  • the tag information When writing new data to an address range marked as invalid, since the timestamp of the newly written data is later than the timestamp of the tag information of the address range, the tag information is not applied when the SSD is started, that is, The address range will not be marked as invalid.
  • the mark information is not updated, and the application of the address interval invalid flag is implemented by adding a time stamp to the data and the mark information, and the mark information and the normal data are released.
  • the coupling of the stream realizes the fast marking of the invalid data of the solid state hard disk, which improves the efficiency of the system; at the same time, the marked information and the data are stored in the flash memory of the solid state hard disk, the storage manner is the same, and the system does not need to be cached in the memory, thereby reducing the system to the memory.
  • the requirements and the complexity of the system implementation whereby, the invention uncouples the marked information from the normal data stream, realizes fast marking of invalid data of the solid state hard disk, improves the efficiency of the system, reduces the memory requirement of the system and the complexity of the system implementation.

Abstract

本发明适用于固态存储技术领域,提供了一种固态硬盘及其数据管理方法、系统。固态硬盘数据管理方法包括:将写入数据加入时间戳后再存入固态硬盘中;接收将数据标记为无效的标记命令,将无效数据对应的地址区间进行标记,并将标记信息加入时间戳后存入固态硬盘中;固态硬盘启动后,将标记信息的时间戳与被标记的地址区间内的数据的时间戳进行比对;若被标记的地址区间内的数据的时间戳早于标记信息的时间戳,则将该地址区间标记为无效,否则不将该地址区间标记为无效。借此,本发明解除了标记信息与正常数据流的耦合,实现了对固态硬盘无效数据的快速标记,提高了系统的效率,降低了系统对内存的需求以及系统实现的复杂度。

Description

一种固态硬盘及其数据管理方法、 系统 技术领域
本发明涉及固态存储技术领域, 尤其涉及一种固态硬盘及其数据管理方法、 系统。 背景技术
对于传统的支持原地更新的存储系统, 文件系统写入新数据时, 会将同一 地址上的旧数据覆盖, 不会影响存储系统的性能; 但对于不能支持原地更新的 固态存储设备, 需要通过 "搬移-擦除" 垃圾回收方式来不断提供可供写入的空 间, 若文件系统不将无效数据对应的地址空间告知存储设备, 则对于固态存储 设备而言, 这些数据也是有效的, 因此也会在垃圾回收过程中被不断无效的搬 移, 降低固态存储设备性能。 TRIM命令是一个文件系统将无效数据对应的地址 空间告知存储设备的命令, 存储设备收到这样的命令后, 会标记这些无效数据, 使它们不参与到垃圾回收过程, 以避免存储设备对这些数据的不必要的操作, 从而提高固态存储设备性能。
现有的 TRIM实现方式仅按位图方式存储 TRIM信息,文件系统向被 TRIM 的区间写入新数据时, 需要及时更新 TRIM信息, 同时为了加速 TRIM信息的 更新, 緩存部分 TRIM信息在内存中。 而仅按位图方式存储 TRIM信息会占用 较多存储空间, 文件系统向被 TRIM的区间写入新数据时, 需要及时更新 TRIM 信息, 会使得 TRIM与正常数据流的紧耦合, 降低了系统的效率, 提高了系统 复杂度, 对 TRIM信息的緩存使得固态存储系统对内存的需求增加。
综上可知, 现有的固态硬盘在实际使用上显然存在不便与缺陷, 所以有必 要加以改进。 发明内容
针对上述的缺陷, 本发明的目的在于提供一种固态硬盘及其数据管理方法、 系统, 解除了标记信息与正常数据流的耦合, 实现了对固态硬盘无效数据的快 速标记, 提高了系统的效率, 降低了系统对内存的需求以及系统实现的复杂度。 为了实现上述目的, 本发明提供一种固态硬盘数据管理方法, 包括: 将写入数据加入时间戳后再存入固态硬盘中;
接收将数据标记为无效的标记命令, 将无效数据对应的地址区间进行标记, 并将标记信息加入时间戳后存入所述固态硬盘中;
所述固态硬盘启动后, 将所述标记信息的时间戳与被标记的地址区间内的 数据的时间戳进行比对; 若所述被标记的地址区间内的数据的时间戳早于所述 标记信息的时间戳, 则将该地址区间标记为无效, 否则不将该地址区间标记为 无效。
根据本发明的数据管理方法, "将写入数据加入时间戳后再存入固态硬盘 中" 的步骤具体为: 接收数据写入命令; 将所述写入命令分解为数据写入单元; 为所述每个数据写入单元内的数据添加时间戳; 将所述数据写入单元内的数据 存储到所述固态硬盘的闪存中。
根据本发明的数据管理方法, "将标记信息加入时间戳后存入所述固态硬 盘中" 的步骤具体为: 将所述标记信息分解为多个数据写入单元; 为所述多个 数据写入单元添加时间戳; 将所述数据写入单元内的数据存储到所述固态硬盘 的闪存中。
根据本发明的数据管理方法, "将所述标记信息的时间戳与被标记的地址 区间内的数据的时间戳进行比对" 的步骤之前还包括: 扫描固态硬盘, 建立逻 辑物理地址映射表; 从所述固态硬盘的闪存中读取所述标记信息; 根据所述标 记信息扫描被标记的地址区间。
根据本发明的数据管理方法, 所述标记信息按照位图方式保存。
本发明相应提供一种固态硬盘数据管理系统, 包括:
写数据处理模块, 用于将写入数据加入时间戳后再存入固态硬盘中; 标记模块, 用于接收将数据标记为无效的标记命令, 将无效数据对应的地 址区间进行标记, 并将标记信息加入时间戳后存入所述固态硬盘中;
初始化模块, 用于所述固态硬盘启动后, 将所述标记信息的时间戳与被标 记的地址区间内的数据的时间戳进行比对; 若所述被标记的地址区间内的数据 的时间戳早于所述标记信息的时间戳, 则将该地址区间标记为无效, 否则不将 该地址区间标己为无效。
根据本发明的数据管理系统, 所述写数据处理模块将写入数据加入时间戳 后再存入固态硬盘中具体为: 接收数据写入命令; 将所述写入命令分解为数据 写入单元; 为所述每个数据写入单元内的数据添加时间戳; 将所述数据写入单 元内的数据存储到所述固态硬盘的闪存中。
根据本发明的数据管理系统, 所述标记模块在标记信息上加入时间戳后再 存入所述固态硬盘中具体为: 将所述标记信息分解为多个数据写入单元; 为所 述多个数据写入单元添加时间戳; 将所述数据写入单元内的数据存储到所述固 态硬盘的闪存中。
根据本发明的数据管理系统, 所述初始化单元还用于扫描固态硬盘, 建立 逻辑物理地址映射表; 从所述固态硬盘的闪存中读取所述标记信息; 根据所述 标记信息扫描被标记的地址区间。
本发明还提供一种固态硬盘, 包括上述固态硬盘数据管理系统。
本发明通过在数据或者无效标记信息写入固态硬盘存储设备时, 记录写入 的时间戳, 固态硬盘启动时, 通过比较数据的时间戳与无效标记信息的时间戳 来确定是否应用该无效标记信息, 将特定的地址区间标记为无效。 在向被标记 为无效的地址区间写入新数据时, 由于新写入数据的时间戳晚于该地址区间的 标记信息的时间戳, 则当固态硬盘启动时, 不会应用该标记信息, 即不会将该 地址区间标记为无效。 从而文件系统向被标记为无效的地址区间写入新数据时, 不用更新标记信息, 而通过对数据和标记信息添加时间戳的方式实现对地址区 间无效标记的应用, 解除了标记信息与正常数据流的耦合, 实现了对固态硬盘 无效数据的快速标记, 提高了系统的效率; 同时标记信息与数据均存储在固态 硬盘的闪存中, 存储方式一致, 不用緩存到内存中, 降低了系统对内存的需求 以及系统实现的复杂度。 借此, 本发明解除了标记信息与正常数据流的耦合, 实现了对固态硬盘无效数据的快速标记, 提高了系统的效率, 降低了系统对内 存的需求以及系统实现的复杂度。 附图说明
图 1是本发明固态硬盘数据管理系统的原理结构图;
图 2是本发明固态硬盘数据管理方法的流程图;
图 3是本发明固态硬盘数据管理系统中写数据处理模块一种实施例的具体 工作流程图; 图 4是本发明固态硬盘数据管理系统中标记模块一种实施例的具体工作流 程图;
图 5是本发明固态硬盘初始化一种实施例的具体工作流程图。 具体实施方式
为了使本发明的目的、 技术方案及优点更加清楚明白, 以下结合附图及实 施例, 对本发明进行进一步详细说明。 应当理解, 此处所描述的具体实施例仅 仅用以解释本发明, 并不用于限定本发明。
如图 1所示, 本发明一种固态硬盘数据管理系统 100, 用于固态硬盘, 其主 要包括写数据处理模块 10、 标记模块 20以及初始化模块 30。
写数据处理模块 10, 用于将写入数据加入时间戳后再存入固态硬盘中。 具 体的, 当文件系统向固态硬盘中写入新数据时, 固态硬盘接收数据写入命令, 并将该数据写入命令分解为多个数据写入单元(数据写入单元可以为一个页或 一个扇区等等) , 为每个数据写入单元内的数据添加时间戳, 并将数据写入单 元内的数据存储到固态硬盘的闪存中。
标记模块 20, 用于接收将数据标记为无效的命令, 将无效数据对应的地址 区间进行标记, 并在标记信息上加入时间戳后再存入固态硬盘中。 具体的, 固 态硬盘接收文件系统发来的将数据标记为无效的命令(如 TRIM命令) , 在逻 为多个数据写入单元, 为多个数据写入单元添加时间戳后存入固态硬盘的闪存 中。 该标记信息包括那些地址区间是无效的, 哪些地址区间是有效的; 该标记 信息可按照位图方式保存, 通过在位图中采用不同的表达方式(如象素颜色) 与有效地址区间和无效地址区间进行分别对应。 优选地, 将数据标记为无效的 命令通常在文件系统删除数据的时候发出。 其中, 逻辑物理地址映射表表示了 逻辑地址到物理地址之间的映射关系。
初始化模块 30, 用于固态硬盘启动后, 将标记信息的时间戳与被标记的地 址区间内的数据的时间戳进行比对, 若被标记的地址区间内的数据的时间戳早 于标记信息的时间戳, 则将该地址区间标记为无效。 具体的, 当固态硬盘启动 后, 扫描固态硬盘, 建立逻辑物理地址映射表; 从固态硬盘的闪存中读取标记 信息; 居标记信息扫描被标记的地址区间, 将标记信息的时间戳与被标记的 地址区间内的数据的时间戳进行比对; 若被标记的地址区间内的数据的时间戳 早于标记信息的时间戳, 则在逻辑物理地址映射表将该地址区间标记为无效。
根据本发明的实施例, 在固态硬盘初始化时, 一般会包括以下两种情况:
1、 如果某个地址区间写入数据后, 又被标记为无效, 则该地址区间内的数 据的时间戳肯定会早于标记信息的时间戳。 那么下次初始化时, 通过比对该地 址区间内数据的时间错和标记信息的时间戳, 可以判断该地址区间确实是无效 的, 从而在逻辑物理地址映射表中应用该标记信息, 将该地址区间重新标记为 无效。
2、 如果某个地址区间被标记为无效后, 又写入了新的数据, 则该地址区间 内的数据的时间戳肯定会晚于标记信息的时间戳。 那么下次初始化时, 通过比 对该地址区间内数据的时间错和标记信息的时间戳, 可以判断该地址区间是有 效的, 从而在逻辑物理地址映射表中不应用该标记信息, 不将该地址区间重新 标记为无效。 从而在文件系统向已被标记为无效的地址区间写入新的数据时, 不用更新标记信息, 解除了标记命令与正常数据流的耦合, 提高了系统的效率, 降^^了系统对内存的需求。
本发明通过在数据或者无效标记信息写入固态硬盘存储设备时, 记录写入 的时间戳, 固态硬盘启动时, 通过比较数据的时间戳与无效标记信息的时间戳 来确定是否应用该无效标记信息, 将特定的地址区间标记为无效。 在向被标记 为无效的地址区间写入新数据时, 由于新写入数据的时间戳晚于该地址区间的 标记信息的时间戳, 则当固态硬盘启动时, 不会应用该标记信息, 即不会将该 地址区间标记为无效。 从而文件系统向被标记为无效的地址区间写入新数据时, 不用更新标记信息, 而通过对数据和标记信息添加时间戳的方式实现对地址区 间无效标记的应用, 解除了标记信息与正常数据流的耦合, 实现了对固态硬盘 无效数据的快速标记, 提高了系统的效率; 同时标记信息与数据均存储在固态 硬盘的闪存中, 存储方式一致, 不用緩存到内存中, 降低了系统对内存的需求 以及系统实现的复杂度。 借此, 本发明解除了标记信息与正常数据流的耦合, 实现了对固态硬盘无效数据的快速标记, 提高了系统的效率, 降低了系统对内 存的需求以及系统实现的复杂度。
本发明相应提供一种固态硬盘数据管理方法, 其通过如图 1 所示的管理系 统实现, 该方法主要包括如下流程: 步骤 S201 , 将写入数据加入时间戳后再存入固态硬盘中。 本步骤通过写数 据处理模块 10实现。
步骤 S202, 接收将数据标记为无效的标记命令, 将无效数据对应的地址区 间进行标记, 并将标记信息加入时间戳后存入固态硬盘中。 本步骤通过标记模 块 20实现。
步骤 S203 , 固态硬盘启动后, 将标记信息的时间戳与被标记的地址区间内 的数据的时间戳进行比对, 若被标记的地址区间内的数据的时间戳早于标记信 息的时间戳, 则将该地址区间标记为无效, 否则不将该地址区间标记为无效。 本步骤通过初始化模块 30实现。
优选地, 上述步骤 S201具体为: 接收数据写入命令; 将写入命令分解为数 据写入单元; 为每个数据写入单元内的数据添加时间戳; 将数据写入单元内的 数据存储到固态硬盘的闪存中。
优选地, 上述步骤 S202中, 将标记信息加入时间戳后存入固态硬盘中具体 为: 将标记信息分解为多个数据写入单元; 为多个数据写入单元添加时间戳; 将数据写入单元内的数据存储到固态硬盘的闪存中。
优选地,上述步骤 S203具体为: 扫描固态硬盘,建立逻辑物理地址映射表; 从固态硬盘的闪存中读取标记信息; 居标记信息扫描被标记的地址区间; 将 标记信息的时间戳与被标记的地址区间内的数据的时间戳进行比对; 若被标记 的地址区间内的数据的时间戳早于标记信息的时间戳, 则在逻辑物理地址映射 表将该地址区间标记为无效, 否则不将该地址区间标记为无效。
图 3是本发明固态硬盘数据管理系统中写数据处理模块一种实施例的具体 工作流程图。 该流程包括如下步骤:
步骤 S301 , 接收数据写入命令。
步骤 S302, 将写入命令分解为数据写入单元。
步骤 S303 , 为每个数据写入单元内的数据添加时间戳。
步骤 S304, 将数据写入单元内的数据存储到固态硬盘的闪存中。
步骤 S305 , 判断写入命令是否分解完成, 若是则进入步骤 S306, 否则回到 步骤 S302。
步骤 S306, 数据写入完成。
在上述流程中, 写数据处理模块 10分解出一个数据写入单元, 立即对其添 加时间戳并同时分解下一个数据写入单元, 添加时间戳的步骤与分解下一个数 据写入单元的步骤同时进行。
图 3是本发明固态硬盘数据管理系统中标记模块一种实施例的具体工作流 程图。 该流程包括如下步骤:
步骤 S401 , 接收 TRIM命令。 TRIM命令是一个文件系统将无效数据对应 的地址空间告知存储设备的命令。
步骤 S402 , 根据 TRIM命令标记系统中的地址区间。 根据 TRIM命令将相 应的地址空间标¾为无效。
步骤 S403, 将 TRIM信息分解为数据写入单元。 该 TRIM信息包括那些地 址区间是无效的, 哪些地址区间是有效的, 该 TRIM信息可按照位图方式保存。
步骤 S404, 为每个数据写入单元内的数据添加时间戳。
步骤 S405, 将数据写入单元内的数据存储到固态硬盘的闪存中。
步骤 S406, 判断 TRIM信息是否分解完成, 若是则进入步骤 S407, 否则回 到步骤 S403。
步骤 S407, TRIM命令执行完成。
图 5是本发明固态硬盘初始化一种实施例的工作流程图, 其包括如下步骤: 步骤 S501 , 扫描固态硬盘, 建立逻辑物理地址映射表。
步骤 S502 , 从固态硬盘的闪存中读取 TRIM信息。 TRIM信息通过位图方 式保存, 通过在位图中采用不同的表达方式(如象素颜色) 与有效地址区间和 无效地址区间进行分别对应。
步骤 S503 , 扫描在 TRIM信息中被标记为无效的地址区间。
步骤 S504, 判断 TRIM信息的时间戳是否晚于被标记的地址区间内数据的 时间戳。 若是, 则进入步骤 S505, 否则进入步骤 S506。
步骤 S505, 在逻辑物理地址映射表中将被 TRIM信息中被标记为无效的地 址区间标" ^己为无效。
步骤 S506,判断是否完成扫描,若是则进入步骤 S507,否则回到步骤 S503。 步骤 S507, 初始化完成。
在上述流程中, TRIM信息中包括了被标记为无效的地址区间, 而在固态硬 盘启动后, 在新建的逻辑物理地址映射表中并无这些标记信息, 因此在初始化 过程中, 需要判断根据 TRIM信息中被标记为无效的地址区间应用到逻辑物理 地址映射表中。 同时, 采用区间与位图混合方式存储 TRIM信息, 减少需要存 储的 TRIM信息量, 加速了 TRIM命令的执行, 以及 TRIM信息的应用, 减少 系统启动时间。
综上所述, 本发明通过在数据或者无效标记信息写入固态硬盘存储设备时, 记录写入的时间戳, 固态硬盘启动时, 通过比较数据的时间戳与无效标记信息 的时间戳来确定是否应用该无效标记信息, 将特定的地址区间标记为无效。 在 向被标记为无效的地址区间写入新数据时, 由于新写入数据的时间戳晚于该地 址区间的标记信息的时间戳, 则当固态硬盘启动时, 不会应用该标记信息, 即 不会将该地址区间标记为无效。 从而文件系统向被标记为无效的地址区间写入 新数据时, 不用更新标记信息, 而通过对数据和标记信息添加时间戳的方式实 现对地址区间无效标记的应用, 解除了标记信息与正常数据流的耦合, 实现了 对固态硬盘无效数据的快速标记, 提高了系统的效率; 同时标记信息与数据均 存储在固态硬盘的闪存中, 存储方式一致, 不用緩存到内存中, 降低了系统对 内存的需求以及系统实现的复杂度。 借此, 本发明解除了标记信息与正常数据 流的耦合, 实现了对固态硬盘无效数据的快速标记, 提高了系统的效率, 降低 了系统对内存的需求以及系统实现的复杂度。
当然, 本发明还可有其它多种实施例, 在不背离本发明精神及其实质的情况 些相应的改变和变形都应属于本发明所附的权利要求的保护范围。

Claims

权利要求书
1、 一种固态硬盘数据管理方法, 其特在于, 包括:
将写入数据加入时间戳后再存入固态硬盘中;
接收将数据标记为无效的标记命令, 将无效数据对应的地址区间进行标记, 并将标记信息加入时间戳后存入所述固态硬盘中;
所述固态硬盘启动后, 将所述标记信息的时间戳与被标记的地址区间内的 数据的时间戳进行比对, 若所述被标记的地址区间内的数据的时间戳早于所述 标记信息的时间戳, 则将该地址区间标记为无效, 否则不将该地址区间标记为 无效。
2、 根据权利要求 1所述的数据管理方法, 其特征在于, "将写入数据加入 时间戳后再存入固态硬盘中" 的步骤具体为:
接收数据写入命令;
将所述写入命令分解为数据写入单元;
为所述每个数据写入单元内的数据添加时间戳;
将所述数据写入单元内的数据存储到所述固态硬盘的闪存中。
3、 根据权利要求 1所述的数据管理方法, 其特征在于, "将标记信息加入 时间戳后存入所述固态硬盘中" 的步骤具体为:
将所述标记信息分解为多个数据写入单元;
为所述多个数据写入单元添加时间戳;
将所述数据写入单元内的数据存储到所述固态硬盘的闪存中。
4、 根据权利要求 1所述的数据管理方法, 其特征在于, "将所述标记信息 的时间戳与被标记的地址区间内的数据的时间戳进行比对" 的步骤之前还包括: 扫描固态硬盘, 建立逻辑物理地址映射表;
从所述固态硬盘的闪存中读取所述标记信息;
居所述标记信息扫描被标记的地址区间。
5、 根据权利要求 1所述的数据管理方法, 其特征在于, 所述标记信息按照 位图方式保存。
6、 一种固态硬盘数据管理系统, 其特在于, 包括:
写数据处理模块, 用于将写入数据加入时间戳后再存入固态硬盘中; 标记模块, 用于接收将数据标记为无效的标记命令, 将无效数据对应的地 址区间进行标记, 并将标记信息加入时间戳后存入所述固态硬盘中; 初始化模块, 用于所述固态硬盘启动后, 将所述标记信息的时间戳与被标 记的地址区间内的数据的时间戳进行比对, 若所述被标记的地址区间内的数据 的时间戳早于所述标记信息的时间戳, 则将该地址区间标记为无效, 否则不将 该地址区间标己为无效。
7、 根据权利要求 6所述的数据管理系统, 其特征在于, 所述写数据处理模 块将写入数据加入时间戳后再存入固态硬盘中具体为: 接收数据写入命令; 将 所述写入命令分解为数据写入单元; 为所述每个数据写入单元内的数据添加时 间戳; 将所述数据写入单元内的数据存储到所述固态硬盘的闪存中。
8、 根据权利要求 6所述的数据管理系统, 其特征在于, 所述标记模块在标 记信息上加入时间戳后再存入所述固态硬盘中具体为: 将所述标记信息分解为 多个数据写入单元; 为所述多个数据写入单元添加时间戳; 将所述数据写入单 元内的数据存储到所述固态硬盘的闪存中。
9、 根据权利要求 6所述的数据管理系统, 其特征在于, 所述初始化单元还 用于扫描固态硬盘, 建立逻辑物理地址映射表; 从所述固态硬盘的闪存中读取 所述标记信息; ^据所述标记信息扫描被标记的地址区间。
10、 一种固态硬盘, 包括如权利要求 6 ~ 9任一项所述的固态硬盘数据管理 系统。
PCT/CN2013/077384 2012-06-21 2013-06-18 一种固态硬盘及其数据管理方法、系统 WO2013189277A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/409,987 US9875250B2 (en) 2012-06-21 2013-06-18 Solid state disk, data management method and system therefor

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210206930.3A CN102789368B (zh) 2012-06-21 2012-06-21 一种固态硬盘及其数据管理方法、系统
CN201210206930.3 2012-06-21

Publications (1)

Publication Number Publication Date
WO2013189277A1 true WO2013189277A1 (zh) 2013-12-27

Family

ID=47154776

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/077384 WO2013189277A1 (zh) 2012-06-21 2013-06-18 一种固态硬盘及其数据管理方法、系统

Country Status (3)

Country Link
US (1) US9875250B2 (zh)
CN (1) CN102789368B (zh)
WO (1) WO2013189277A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105260328A (zh) * 2015-10-26 2016-01-20 成都华为技术有限公司 一种设备掉电时的数据保存方法及装置
KR20170092536A (ko) * 2014-12-09 2017-08-11 인텔 코포레이션 다수의 순차적 기입 스트림을 관리하는 기술

Families Citing this family (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102789368B (zh) * 2012-06-21 2015-10-21 记忆科技(深圳)有限公司 一种固态硬盘及其数据管理方法、系统
CN103279402B (zh) * 2013-05-13 2016-08-10 记忆科技(深圳)有限公司 基于多层单元固态硬盘的数据恢复方法及固态硬盘
CN103559054B (zh) * 2013-10-30 2017-10-10 华为终端有限公司 智能终端多操作系统的实现、删除方法和装置
US10061377B2 (en) * 2015-02-06 2018-08-28 Toshiba Memory Corporation Memory device and information processing device
WO2016162981A1 (ja) * 2015-04-08 2016-10-13 株式会社日立製作所 計算機システム、及び、データベース管理方法
CN106406769A (zh) * 2016-09-28 2017-02-15 郑州云海信息技术有限公司 一种提升固态硬盘在linux系统下IO性能的方法
TWI634424B (zh) * 2017-05-08 2018-09-01 慧榮科技股份有限公司 資料儲存裝置以及其操作方法
WO2020010604A1 (zh) * 2018-07-13 2020-01-16 华为技术有限公司 一种ssd数据读取方法和装置
CN109254953A (zh) * 2018-08-24 2019-01-22 深圳市德名利电子有限公司 一种基于fat文件的数据删除方法、数据存储设备及系统
US20200104384A1 (en) * 2018-10-02 2020-04-02 Nutanix, Inc. Systems and methods for continuous trim commands for memory systems
CN110780812B (zh) * 2019-09-27 2021-08-24 苏州浪潮智能科技有限公司 一种硬盘数据置无效方法与装置
CN112988040B (zh) * 2019-12-18 2023-02-24 深圳大普微电子科技有限公司 一种数据存储方法、装置、设备及可读存储介质
EP3964940A4 (en) 2020-04-01 2022-08-17 Changxin Memory Technologies, Inc. READ/WRITE METHOD AND STORAGE DEVICE
CN113495670B (zh) * 2020-04-01 2024-03-26 长鑫存储技术有限公司 读写方法及存储器装置
CN113495675B (zh) 2020-04-01 2023-08-11 长鑫存储技术有限公司 读写方法及存储器装置
EP3964941B1 (en) 2020-04-01 2024-02-28 Changxin Memory Technologies, Inc. Read-write method and memory device
EP3985494B1 (en) 2020-04-01 2024-01-17 Changxin Memory Technologies, Inc. Read-write method and memory device
CN113495674B (zh) 2020-04-01 2023-10-10 长鑫存储技术有限公司 读写方法及存储器装置
EP3936996A4 (en) 2020-04-01 2022-07-06 Changxin Memory Technologies, Inc. READ-WRITE METHOD AND STORAGE DEVICE
CN113495671B (zh) 2020-04-01 2023-10-17 长鑫存储技术有限公司 读写方法及存储器装置
CN113495672B (zh) 2020-04-01 2023-08-11 长鑫存储技术有限公司 读写方法及存储器装置
CN113254265B (zh) * 2021-05-10 2023-03-14 苏州库瀚信息科技有限公司 基于固态硬盘的快照实现方法、存储系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102165406A (zh) * 2008-09-30 2011-08-24 英特尔公司 用于将时间戳传输到存储系统的方法
CN102239480A (zh) * 2008-12-17 2011-11-09 Lsi公司 Ssd技术协助的存储系统快照
US20120110376A1 (en) * 2009-05-28 2012-05-03 Lsi Corporation Systems and Methods for Managing End of Life in a Solid State Drive
CN102789368A (zh) * 2012-06-21 2012-11-21 记忆科技(深圳)有限公司 一种固态硬盘及其数据管理方法、系统

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8719501B2 (en) * 2009-09-08 2014-05-06 Fusion-Io Apparatus, system, and method for caching data on a solid-state storage device
CN102073560A (zh) * 2011-01-17 2011-05-25 北京深思洛克软件技术股份有限公司 一种数据备份方法和装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102165406A (zh) * 2008-09-30 2011-08-24 英特尔公司 用于将时间戳传输到存储系统的方法
CN102239480A (zh) * 2008-12-17 2011-11-09 Lsi公司 Ssd技术协助的存储系统快照
US20120110376A1 (en) * 2009-05-28 2012-05-03 Lsi Corporation Systems and Methods for Managing End of Life in a Solid State Drive
CN102789368A (zh) * 2012-06-21 2012-11-21 记忆科技(深圳)有限公司 一种固态硬盘及其数据管理方法、系统

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170092536A (ko) * 2014-12-09 2017-08-11 인텔 코포레이션 다수의 순차적 기입 스트림을 관리하는 기술
CN105260328A (zh) * 2015-10-26 2016-01-20 成都华为技术有限公司 一种设备掉电时的数据保存方法及装置

Also Published As

Publication number Publication date
CN102789368A (zh) 2012-11-21
US20150363425A1 (en) 2015-12-17
CN102789368B (zh) 2015-10-21
US9875250B2 (en) 2018-01-23

Similar Documents

Publication Publication Date Title
WO2013189277A1 (zh) 一种固态硬盘及其数据管理方法、系统
US8001315B2 (en) Memory device and control method thereof
US7861028B2 (en) System and method for configuration and management of flash memory
CN102741843B (zh) 从数据库中读取数据的方法及装置
CA2673434C (en) Memory device performance enhancement through pre-erase mechanism
WO2016127658A1 (zh) 一种快照处理方法及装置
US9195578B2 (en) Systems, methods and computer program products memory space management for storage class memory
CN103678145B (zh) 数据储存装置与快闪存储器控制方法
WO2017041570A1 (zh) 向缓存写入数据的方法及装置
CN103577121A (zh) 一种基于nand flash的高可靠线性文件存取方法
US10049024B2 (en) Data processing method, device, and system for storage unit
TW201135738A (en) Erase command caching to improve erase performance on flash memory
KR101779174B1 (ko) 저널링 파일시스템의 데이터 폐기 방법 및 이를 구현하기 위한 메모리 관리 장치
TW201120904A (en) Power interrupt management
JP2010218290A (ja) コントローラ、及びメモリシステム
US9959046B2 (en) Multi-streaming mechanism to optimize journal based data storage systems on SSD
JPWO2009133605A1 (ja) 仮想テープ装置、制御方法、制御部
JP2005316635A (ja) データ処理システムおよび方法並びにその処理プログラム
JP2013235531A (ja) 制御装置、記憶装置、記憶制御方法
WO2020057479A1 (zh) 地址映射表项页管理
WO2017000821A1 (zh) 存储系统、存储管理装置、存储器、混合存储装置及存储管理方法
JP2012181611A (ja) メモリシステム
JP2005316632A (ja) キャッシュ制御およびデータ処理システム並びにその処理プログラム
US9535796B2 (en) Method, apparatus and computer for data operation
CN115705153A (zh) 有条件更新和延迟的查找

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: 13806412

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14409987

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13806412

Country of ref document: EP

Kind code of ref document: A1