US9875250B2 - Solid state disk, data management method and system therefor - Google Patents

Solid state disk, data management method and system therefor Download PDF

Info

Publication number
US9875250B2
US9875250B2 US14/409,987 US201314409987A US9875250B2 US 9875250 B2 US9875250 B2 US 9875250B2 US 201314409987 A US201314409987 A US 201314409987A US 9875250 B2 US9875250 B2 US 9875250B2
Authority
US
United States
Prior art keywords
data
solid state
timestamp
state disk
invalid
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, expires
Application number
US14/409,987
Other versions
US20150363425A1 (en
Inventor
Jian Li
Zhiqing Zhang
Meng Wang
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.)
Ramaxel Technology Shenzhen Co Ltd
Original Assignee
Ramaxel Technology Shenzhen 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 Ramaxel Technology Shenzhen Co Ltd filed Critical Ramaxel Technology Shenzhen Co Ltd
Assigned to RAMAXEL TECHNOLOGY (SHENZHEN) LIMITED reassignment RAMAXEL TECHNOLOGY (SHENZHEN) LIMITED ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: LI, JIAN, WANG, MENG, ZHANG, ZHIQING
Publication of US20150363425A1 publication Critical patent/US20150363425A1/en
Application granted granted Critical
Publication of US9875250B2 publication Critical patent/US9875250B2/en
Active legal-status Critical Current
Adjusted expiration legal-status Critical

Links

Images

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
    • G06F17/30218
    • 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
    • G06F17/30371
    • 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 technical field of solid-state storage, and particularly to a solid state disk and a data management method and system therefor.
  • TRIM command commands a file system to inform a storage device of the address space corresponding to the invalid data. After receipt of such a command, the storage device will mark the invalid data to disenable the data to participate in the process of garbage collection so as to prevent the storage device from unnecessarily operating over the data, thereby improving the performance of the solid state storage device.
  • TRIM information is only saved in a way of a bitmap, and when a file system writes new data into a range indicated by TRIM, the TRIM information needs to be updated in time and, in the meanwhile, part of the TRIM information is cached in the memory in order to accelerate the updating of the TRIM information. But, more storage space will be taken up if the TRIM information is only saved in a way of a bitmap. Accordingly, when a file system writes new data into a TRIM range, the TRIM information needs to be updated in time. As a result, TRIM will be tightly coupled with a normal data stream, the efficiency of the system will be reduced, the complexity of the system will be increased, and the caching of TRIM information increases the demand of the solid state storage system for memory.
  • the present invention provides a data management method for a solid state disk, characterized by comprising:
  • the step of “saving the written data in a solid state disk after adding a timestamp to written data” specifically comprises: receiving a data write command; resolve the write command into data write units; adding a timestamp to the data in each said data write unit; and saving the data in the data write units into the flash memory of the solid state disk.
  • the step of “saving the marked information in the solid state disk after adding a timestamp to the marked information” specifically comprises: resolve the marked information into a plurality of data write units; adding timestamps to the plurality of data write units; and saving the data in the data write units into the flash memory of the solid state disk.
  • the data management method characterized by further comprising the following steps before the step of “comparing the timestamp of the marked information with the timestamp of the data in the marked address range”: scanning the solid state disk to create a logical physical address mapping table; reading the marked information from the flash memory of the solid state disk; and scanning the marked address range according to the marked information.
  • the marked information is saved in a way of a bitmap.
  • the present invention provides a data management system for a solid state disk, characterized by comprising:
  • a write data processing module adapted for saving the written data in a solid state disk after adding a timestamp to written data
  • a marking module adapted for receiving a mark command for marking the data to be invalid, marking an address range corresponding to the invalid data, and saving the marked information in the solid state disk after adding a timestamp to the marked information
  • an initialization module adapted for comparing the timestamp of the marked information with the timestamp of the data in the marked address range after starting the solid state disk, marking the address range as invalid if the timestamp of the data in the marked address range is earlier than the timestamp of the marked information, otherwise not marking the address range as invalid.
  • the write data processing module adapted for saving the written data in a solid state disk after adding a timestamp to written data specifically comprises: receiving a data write command; resolve the write command into data write units; adding a timestamp to the data in each said data write unit; and saving the data in the data write units into the flash memory of the solid state disk.
  • the marking module adapted for saving the marked information in the solid state disk after adding a timestamp to the marked information specifically comprises: resolve the marked information into a plurality of data write units; adding timestamps to the plurality of data write units; and saving the data in the data write units into the flash memory of the solid state disk.
  • the initialization module is further adapted for scanning the solid state disk to create a logical physical address mapping table; reading the marked information from the flash memory of the solid state disk; and scanning the marked address range according to the marked information.
  • the present invention further provides a solid state disk comprising said data management system for a solid state disk.
  • the written timestamp is recorded, and when the solid state disk is started, the timestamp of the data is compared with the timestamp of the invalid marked information to determine whether to apply the invalid marked information, and the specific address range is marked as invalid.
  • the marked information will not be applied, i.e. the address range will not be marked as invalid, when the solid state disk is started.
  • the file system when a file system writes new data into the address range marked as invalid, the file system does not need to update the marked information, but adds timestamps to the data and the marked information to apply the invalid marks in the address range, relieve the coupling of marked information with a normal data stream, achieve the quick marking of the invalid data in a solid state disk, and improve the efficiency of the system; meanwhile, both the marked information and the data are saved in the same way in the flash memory of the solid state disk, and they need not be saved in the memory, thereby reducing the demand of the system for memory and the complexity for system realization.
  • FIG. 1 is a principle diagram of the data management system for a solid state disk according to the present invention
  • FIG. 2 is a flow chart of data management method for a solid state disk according to the present invention.
  • FIG. 3 is a work flow chart of an embodiment of a write data processing module of the data management system for a solid state disk according to the present invention
  • FIG. 4 is a work flow chart of an embodiment of a marking module of the data management system for a solid state disk according to the present invention.
  • FIG. 5 is a work flow chart of an embodiment of the initialization of the solid state disk according to the present invention.
  • a data management system 100 for a solid state disk according to the present invention for use in a solid state disk mainly comprises a write data processing module 10 , a marking module 20 , and an initialization module 30 .
  • the write data processing module 10 is adapted for saving the written data in a solid state disk after adding a timestamp to written data. Specifically, when a file system writes new data into the solid state disk, the solid state disk receives a data write command, divides the data write command into a plurality of data write units (the data write unit may be a page or a sector, etc.), adds a timestamp to the data in each said data write unit, and saves the data in the data write units into the flash memory of the solid state disk.
  • the marking module 20 is adapted for receiving a mark command for marking the data to be invalid, marking an address range corresponding to the invalid data, and saving the marked information in the solid state disk after adding a timestamp to the marked information.
  • the solid state disk receives from the file system a command (e.g. TRIM command) for marking the data to be invalid, marks an address range corresponding to the invalid data in a logical physical address mapping table, divides the marked information into a plurality of data write units, adds timestamps to the plurality of data write units and then saves the plurality of data write units in the flash memory of the solid state disk.
  • a command e.g. TRIM command
  • the marked information includes which address ranges are invalid and which address ranges are valid; the marked information can be saved in a way of a bitmap, and corresponds to the valid address ranges and the invalid address ranges, respectively, using different expressions (e.g., the colors of pixels) in the bitmap.
  • the command for marking the data to be invalid is generally sent when the file system deletes data.
  • the logical physical address mapping table shows the mapping relation between logical addresses and physical addresses.
  • the initialization module 30 is adapted for comparing the timestamp of the marked information with the timestamp of the data in the marked address range after starting the solid state disk, marking the address range as invalid if the timestamp of the data in the marked address range is earlier than the timestamp of the marked information, otherwise not marking the address range as invalid.
  • the solid state disk is scanned to create a logical physical address mapping table; the marked information is read from the flash memory of the solid state disk; the marked address range is scanned according to the marked information, and the timestamp of the marked information is compared with the timestamp of the data in the marked address range; if the timestamp of the data in the marked address range is earlier than the timestamp of the marked information, the address range is marked as invalid in the logical physical address mapping table.
  • the timestamp of the data in the address range definitely will be earlier than the timestamp of the marked information. Then, during the next initialization, the timestamp of the data in the address range may be compared with the timestamp of the marked information to determine that the address range is indeed invalid, thereby applying the marked information in the logical physical address mapping table and marking the address range as invalid once again.
  • the timestamp of the data in the address range definitely will be later than the timestamp of the marked information. Then, during the next initialization, the timestamp of the data in the address range may be compared with the timestamp of the marked information to determine that the address range is valid, thereby not applying the marked information in the logical physical address mapping table and not marking the address range as invalid once again.
  • a file system writes new data into the address range which has been marked as invalid, it does not need to update the marked information, relieves the coupling of marked information with a normal data stream, achieves the quick marking of the invalid data of a solid state disk, improves the efficiency of the system, and reduces the demand of the system for memory.
  • the written timestamp is recorded, and when the solid state disk is started, the timestamp of the data is compared with the timestamp of the invalid marked information to determine whether to apply the invalid marked information, and the specific address range is marked as invalid.
  • the marked information will not be applied, i.e. the address range will not be marked as invalid, when the solid state disk is started.
  • the file system when a file system writes new data into the address range marked as invalid, the file system does not need to update the marked information, but adds timestamps to the data and the marked information to apply the invalid marks in the address range, relieves the coupling of marked information with a normal data stream, achieves the quick marking of the invalid data of a solid state disk, and improves the efficiency of the system; meanwhile, both the marked information and the data are saved in the same way in the flash memory of the solid state disk, and they need not be saved in the memory, thereby reducing the demand of the system for memory and the complexity for system realization.
  • the present invention provides a data management method for a solid state disk, which is carried out by means of the management system as shown in FIG. 1 , the method mainly comprises the following work flow:
  • Step S 201 saving the written data in a solid state disk after adding a timestamp to written data. This step is performed by the write data processing module 10 .
  • Step S 202 receiving a mark command for marking the data to be invalid, marking an address range corresponding to the invalid data, and saving the marked information in the solid state disk after adding a timestamp to the marked information. This step is performed by the marking module 20 .
  • Step S 203 comparing the timestamp of the marked information with the timestamp of the data in the marked address range after starting the solid state disk; if the timestamp of the data in the marked address range is earlier than the timestamp of the marked information, marking the address range as invalid, otherwise not marking the address range as invalid. This step is performed by the initialization module 30 .
  • the above step S 201 specifically comprises: receiving a data write command; resolve the write command into data write units; adding a timestamp to the data in each said data write unit; and saving the data in the data write units into the flash memory of the solid state disk.
  • saving the marked information in the solid state disk after adding a timestamp to the marked information specifically comprises: resolve the marked information into a plurality of data write units; adding timestamps to the plurality of data write units; and saving the data in the data write units into the flash memory of the solid state disk.
  • the above step S 203 specifically comprises: scanning the solid state disk to create a logical physical address mapping table; reading the marked information from the flash memory of the solid state disk; scanning the marked address range according to the marked information; comparing the timestamp of the marked information with the timestamp of the data in the marked address range; if the timestamp of the data in the marked address range is earlier than the timestamp of the marked information, marking the address range as invalid in the logical physical address mapping table, otherwise not marking the address range as invalid.
  • FIG. 3 is a work flow chart of an embodiment of a write data processing module of the data management system for a solid state disk according to the present invention.
  • the work flow comprises the steps of:
  • Step S 301 receiving a data write command.
  • Step S 302 resolve the write command into data write units.
  • Step S 303 adding a timestamp to the data in each said data write unit.
  • Step S 304 saving the data in the data write units into the flash memory of the solid state disk.
  • Step S 305 determining whether the write command is completed divided, and performing step S 306 if YES, otherwise returning to step S 302 .
  • Step S 306 completing data write.
  • the write data processing module 10 adds a timestamp to the data write unit immediately and at the same time divides the next data write unit, i.e. the step of adding a timestamp and the step of resolve the next data write unit are performed concurrently.
  • FIG. 4 is a work flow chart of an embodiment of a marking module of the data management system for a solid state disk according to the present invention.
  • the work flow comprises the steps of:
  • Step S 401 receiving TRIM command.
  • TRIM command commands a file system to inform a storage device of the address space corresponding to the invalid data.
  • Step S 402 marking the address range in the system according to the TRIM command.
  • the corresponding address space is marked as invalid according to the TRIM command.
  • Step S 403 resolve the TRIM information into data write units.
  • the TRIM information includes which address ranges are invalid and which address ranges are valid, and the TRIM information can be saved in a way of a bitmap.
  • Step S 404 adding a timestamp to the data in each said data write unit.
  • Step S 405 saving the data in the data write units into the flash memory of the solid state disk.
  • Step S 406 determining whether the TRIM information is completed divided, and performing step S 407 if YES, otherwise returning to step S 403 .
  • Step S 407 completing the execution of TRIM command.
  • FIG. 5 is a work flow chart of an embodiment of the initialization of the solid state disk according to the present invention, comprising the steps of:
  • Step S 501 scanning the solid state disk to create a logical physical address mapping table.
  • Step S 502 reading the TRIM information from the flash memory of the solid state disk.
  • the TRIM information is saved in a way of a bitmap, and corresponds to the valid address ranges and the invalid address ranges, respectively, using different expressions (e.g., the colors of pixels) in the bitmap.
  • Step S 503 scanning the address ranges which have been marked as invalid in the TRIM information.
  • Step S 504 determining if the timestamp of the TRIM information is later than the timestamp of the data in the marked address range. If YES, the step S 505 will be performed, otherwise the step S 506 will be performed.
  • Step S 505 marking the address ranges, which have been marked as invalid in the TRIM information, as invalid in the logical physical address mapping table.
  • Step S 506 determining if the scanning is completed, and performing step S 507 if YES, otherwise returning to step S 503 .
  • Step S 507 completing initialization.
  • the TRIM information includes the address ranges which are marked as invalid, but after the solid state disk is started, such marked information cannot be found in the newly created logical physical address mapping table, so during initialization, it is necessary to apply the address ranges, which have been marked as invalid in the TRIM information, to the logical physical address mapping table. Furthermore, when the TRIM information is saved by a mixed method involving ranges and bitmaps, the amount of TRIM information needed to be saved is reduced, the execution of TRIM command and the application of TRIM information are accelerated, and the system boot time is reduced.
  • the written timestamp is recorded, and when the solid state disk is started, the timestamp of the data is compared with the timestamp of the invalid marked information to determine whether to apply the invalid marked information, and the specific address range is marked as invalid.
  • the marked information will not be applied, i.e. the address range will not be marked as invalid, when the solid state disk is started.
  • the file system when a file system writes new data into the address range which is marked as invalid, the file system does not need to update the marked information, but adds timestamps to the data and the marked information to apply the invalid marks in the address range, relieve the coupling of marked information with a normal data stream, achieve the quick marking of the invalid data in a solid state disk, and improve the efficiency of the system; meanwhile, both the marked information and the data are saved in the same way in the flash memory of the solid state disk, and they need not be saved in the memory, thereby reducing the demand of the system for memory and the complexity for system realization.

Abstract

The present invention is applied to the technical field of solid-state storage, and provided are a solid state disk and a data management method and system. The data management method for a solid state disk comprises: saving the written data in a solid state disk after adding a timestamp to written data; receiving a mark command for marking the data to be invalid, marking an address range corresponding to the invalid data, and saving the marked information in the solid state disk after adding a timestamp to the marked information; comparing the timestamp of the marked information with the timestamp of the data in the marked address range after starting the solid state disk; if the timestamp of the data in the marked address range is earlier than the timestamp of the marked information, marking the address range as invalid, otherwise not marking the address range as invalid.

Description

TECHNICAL FIELD
The present invention relates to the technical field of solid-state storage, and particularly to a solid state disk and a data management method and system therefor.
BACKGROUND ART
For a traditional storage system that supports in-place updating, when a file system writes new data, the old data at the same address will be covered, so that the performance of the storage system will not be affected; however, for a solid state storage device that cannot support in-place updating, there is a need for “move-erase” garbage collection to continuously provide space which is available for writing, if the file system does not inform the storage device of the address space corresponding to the invalid data, such data is also valid for the solid state storage device and accordingly will be continuously moved ineffectively during garbage collection, thereby degrading the performance of the solid state storage device. TRIM command commands a file system to inform a storage device of the address space corresponding to the invalid data. After receipt of such a command, the storage device will mark the invalid data to disenable the data to participate in the process of garbage collection so as to prevent the storage device from unnecessarily operating over the data, thereby improving the performance of the solid state storage device.
In the existing methods for implementing TRIM, TRIM information is only saved in a way of a bitmap, and when a file system writes new data into a range indicated by TRIM, the TRIM information needs to be updated in time and, in the meanwhile, part of the TRIM information is cached in the memory in order to accelerate the updating of the TRIM information. But, more storage space will be taken up if the TRIM information is only saved in a way of a bitmap. Accordingly, when a file system writes new data into a TRIM range, the TRIM information needs to be updated in time. As a result, TRIM will be tightly coupled with a normal data stream, the efficiency of the system will be reduced, the complexity of the system will be increased, and the caching of TRIM information increases the demand of the solid state storage system for memory.
DISCLOSURE OF THE INVENTION
To overcome the above-mentioned defects, it is an object of the present invention to provide a solid state disk and a data management method and system therefor, which relieve the coupling of marked information with a normal data stream, achieve the quick marking of the invalid data in a solid state disk, improve the efficiency of the system, and reduce the demand of the system for memory and the complexity for system realization.
To this end, the present invention provides a data management method for a solid state disk, characterized by comprising:
saving the written data in a solid state disk after adding a timestamp to written data;
receiving a mark command for marking the data to be invalid, marking an address range corresponding to the invalid data, and saving the marked information in the solid state disk after adding a timestamp to the marked information; and
comparing the timestamp of the marked information with the timestamp of the data in the marked address range after starting the solid state disk; if the timestamp of the data in the marked address range is earlier than the timestamp of the marked information, marking the address range as invalid, otherwise not marking the address range as invalid.
In accordance with the data management method according to the present invention, the step of “saving the written data in a solid state disk after adding a timestamp to written data” specifically comprises: receiving a data write command; resolve the write command into data write units; adding a timestamp to the data in each said data write unit; and saving the data in the data write units into the flash memory of the solid state disk.
In accordance with the data management method according to the present invention, the step of “saving the marked information in the solid state disk after adding a timestamp to the marked information” specifically comprises: resolve the marked information into a plurality of data write units; adding timestamps to the plurality of data write units; and saving the data in the data write units into the flash memory of the solid state disk.
In accordance with the data management method according to the present invention, characterized by further comprising the following steps before the step of “comparing the timestamp of the marked information with the timestamp of the data in the marked address range”: scanning the solid state disk to create a logical physical address mapping table; reading the marked information from the flash memory of the solid state disk; and scanning the marked address range according to the marked information.
In accordance with the data management method according to the present invention, the marked information is saved in a way of a bitmap.
Accordingly, the present invention provides a data management system for a solid state disk, characterized by comprising:
a write data processing module adapted for saving the written data in a solid state disk after adding a timestamp to written data;
a marking module adapted for receiving a mark command for marking the data to be invalid, marking an address range corresponding to the invalid data, and saving the marked information in the solid state disk after adding a timestamp to the marked information; and
an initialization module adapted for comparing the timestamp of the marked information with the timestamp of the data in the marked address range after starting the solid state disk, marking the address range as invalid if the timestamp of the data in the marked address range is earlier than the timestamp of the marked information, otherwise not marking the address range as invalid.
In accordance with the data management system according to the present invention, the write data processing module adapted for saving the written data in a solid state disk after adding a timestamp to written data specifically comprises: receiving a data write command; resolve the write command into data write units; adding a timestamp to the data in each said data write unit; and saving the data in the data write units into the flash memory of the solid state disk.
In accordance with the data management system according to the present invention, the marking module adapted for saving the marked information in the solid state disk after adding a timestamp to the marked information specifically comprises: resolve the marked information into a plurality of data write units; adding timestamps to the plurality of data write units; and saving the data in the data write units into the flash memory of the solid state disk.
In accordance with the data management system according to the present invention, the initialization module is further adapted for scanning the solid state disk to create a logical physical address mapping table; reading the marked information from the flash memory of the solid state disk; and scanning the marked address range according to the marked information.
The present invention further provides a solid state disk comprising said data management system for a solid state disk.
According to the present invention, when data or invalid marked information is written into the storage device of a solid state disk, the written timestamp is recorded, and when the solid state disk is started, the timestamp of the data is compared with the timestamp of the invalid marked information to determine whether to apply the invalid marked information, and the specific address range is marked as invalid. When new data is written into the address range marked as invalid, since the timestamp of the newly written data is later than the timestamp of the marked information in the address range, the marked information will not be applied, i.e. the address range will not be marked as invalid, when the solid state disk is started. Thus, when a file system writes new data into the address range marked as invalid, the file system does not need to update the marked information, but adds timestamps to the data and the marked information to apply the invalid marks in the address range, relieve the coupling of marked information with a normal data stream, achieve the quick marking of the invalid data in a solid state disk, and improve the efficiency of the system; meanwhile, both the marked information and the data are saved in the same way in the flash memory of the solid state disk, and they need not be saved in the memory, thereby reducing the demand of the system for memory and the complexity for system realization.
BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a principle diagram of the data management system for a solid state disk according to the present invention;
FIG. 2 is a flow chart of data management method for a solid state disk according to the present invention;
FIG. 3 is a work flow chart of an embodiment of a write data processing module of the data management system for a solid state disk according to the present invention;
FIG. 4 is a work flow chart of an embodiment of a marking module of the data management system for a solid state disk according to the present invention; and
FIG. 5 is a work flow chart of an embodiment of the initialization of the solid state disk according to the present invention.
EMBODIMENTS
To make the object, technical solutions and advantages of the present invention more clear, the present invention is further described in detail hereinafter with reference to the accompanying drawings and embodiments. It should be appreciated that the specific embodiments described herein are only intended to illustrate the present invention but not to limit it.
As shown in FIG. 1, a data management system 100 for a solid state disk according to the present invention for use in a solid state disk mainly comprises a write data processing module 10, a marking module 20, and an initialization module 30.
The write data processing module 10 is adapted for saving the written data in a solid state disk after adding a timestamp to written data. Specifically, when a file system writes new data into the solid state disk, the solid state disk receives a data write command, divides the data write command into a plurality of data write units (the data write unit may be a page or a sector, etc.), adds a timestamp to the data in each said data write unit, and saves the data in the data write units into the flash memory of the solid state disk.
The marking module 20 is adapted for receiving a mark command for marking the data to be invalid, marking an address range corresponding to the invalid data, and saving the marked information in the solid state disk after adding a timestamp to the marked information. Specifically, the solid state disk receives from the file system a command (e.g. TRIM command) for marking the data to be invalid, marks an address range corresponding to the invalid data in a logical physical address mapping table, divides the marked information into a plurality of data write units, adds timestamps to the plurality of data write units and then saves the plurality of data write units in the flash memory of the solid state disk. The marked information includes which address ranges are invalid and which address ranges are valid; the marked information can be saved in a way of a bitmap, and corresponds to the valid address ranges and the invalid address ranges, respectively, using different expressions (e.g., the colors of pixels) in the bitmap. Preferably, the command for marking the data to be invalid is generally sent when the file system deletes data. The logical physical address mapping table shows the mapping relation between logical addresses and physical addresses.
The initialization module 30 is adapted for comparing the timestamp of the marked information with the timestamp of the data in the marked address range after starting the solid state disk, marking the address range as invalid if the timestamp of the data in the marked address range is earlier than the timestamp of the marked information, otherwise not marking the address range as invalid. Specifically, after the solid state disk is started, the solid state disk is scanned to create a logical physical address mapping table; the marked information is read from the flash memory of the solid state disk; the marked address range is scanned according to the marked information, and the timestamp of the marked information is compared with the timestamp of the data in the marked address range; if the timestamp of the data in the marked address range is earlier than the timestamp of the marked information, the address range is marked as invalid in the logical physical address mapping table.
According to an embodiment of the present invention, the following two circumstances generally exist during the initialization of the solid state disk:
1. If data is written into a certain address range and then the address range is marked as invalid, then the timestamp of the data in the address range definitely will be earlier than the timestamp of the marked information. Then, during the next initialization, the timestamp of the data in the address range may be compared with the timestamp of the marked information to determine that the address range is indeed invalid, thereby applying the marked information in the logical physical address mapping table and marking the address range as invalid once again.
2. If new data is written after a certain address range is marked as invalid, then the timestamp of the data in the address range definitely will be later than the timestamp of the marked information. Then, during the next initialization, the timestamp of the data in the address range may be compared with the timestamp of the marked information to determine that the address range is valid, thereby not applying the marked information in the logical physical address mapping table and not marking the address range as invalid once again. Thus, when a file system writes new data into the address range which has been marked as invalid, it does not need to update the marked information, relieves the coupling of marked information with a normal data stream, achieves the quick marking of the invalid data of a solid state disk, improves the efficiency of the system, and reduces the demand of the system for memory.
According to the present invention, when data or invalid marked information is written into the storage device of a solid state disk, the written timestamp is recorded, and when the solid state disk is started, the timestamp of the data is compared with the timestamp of the invalid marked information to determine whether to apply the invalid marked information, and the specific address range is marked as invalid. When new data is written into the address range which is marked as invalid, since the timestamp of the newly written data is later than the timestamp of the marked information in the address range, the marked information will not be applied, i.e. the address range will not be marked as invalid, when the solid state disk is started. Thus, when a file system writes new data into the address range marked as invalid, the file system does not need to update the marked information, but adds timestamps to the data and the marked information to apply the invalid marks in the address range, relieves the coupling of marked information with a normal data stream, achieves the quick marking of the invalid data of a solid state disk, and improves the efficiency of the system; meanwhile, both the marked information and the data are saved in the same way in the flash memory of the solid state disk, and they need not be saved in the memory, thereby reducing the demand of the system for memory and the complexity for system realization.
Accordingly, the present invention provides a data management method for a solid state disk, which is carried out by means of the management system as shown in FIG. 1, the method mainly comprises the following work flow:
Step S201: saving the written data in a solid state disk after adding a timestamp to written data. This step is performed by the write data processing module 10.
Step S202: receiving a mark command for marking the data to be invalid, marking an address range corresponding to the invalid data, and saving the marked information in the solid state disk after adding a timestamp to the marked information. This step is performed by the marking module 20.
Step S203: comparing the timestamp of the marked information with the timestamp of the data in the marked address range after starting the solid state disk; if the timestamp of the data in the marked address range is earlier than the timestamp of the marked information, marking the address range as invalid, otherwise not marking the address range as invalid. This step is performed by the initialization module 30.
Preferably, the above step S201 specifically comprises: receiving a data write command; resolve the write command into data write units; adding a timestamp to the data in each said data write unit; and saving the data in the data write units into the flash memory of the solid state disk.
Preferably, in the above step S202, saving the marked information in the solid state disk after adding a timestamp to the marked information specifically comprises: resolve the marked information into a plurality of data write units; adding timestamps to the plurality of data write units; and saving the data in the data write units into the flash memory of the solid state disk.
Preferably, the above step S203 specifically comprises: scanning the solid state disk to create a logical physical address mapping table; reading the marked information from the flash memory of the solid state disk; scanning the marked address range according to the marked information; comparing the timestamp of the marked information with the timestamp of the data in the marked address range; if the timestamp of the data in the marked address range is earlier than the timestamp of the marked information, marking the address range as invalid in the logical physical address mapping table, otherwise not marking the address range as invalid.
FIG. 3 is a work flow chart of an embodiment of a write data processing module of the data management system for a solid state disk according to the present invention. The work flow comprises the steps of:
Step S301: receiving a data write command.
Step S302: resolve the write command into data write units.
Step S303: adding a timestamp to the data in each said data write unit.
Step S304: saving the data in the data write units into the flash memory of the solid state disk.
Step S305: determining whether the write command is completed divided, and performing step S306 if YES, otherwise returning to step S302.
Step S306: completing data write.
In the above work flow, once the write data processing module 10 divides a data write unit, the write data processing module 10 adds a timestamp to the data write unit immediately and at the same time divides the next data write unit, i.e. the step of adding a timestamp and the step of resolve the next data write unit are performed concurrently.
FIG. 4 is a work flow chart of an embodiment of a marking module of the data management system for a solid state disk according to the present invention. The work flow comprises the steps of:
Step S401: receiving TRIM command. TRIM command commands a file system to inform a storage device of the address space corresponding to the invalid data.
Step S402: marking the address range in the system according to the TRIM command. The corresponding address space is marked as invalid according to the TRIM command.
Step S403: resolve the TRIM information into data write units. The TRIM information includes which address ranges are invalid and which address ranges are valid, and the TRIM information can be saved in a way of a bitmap.
Step S404: adding a timestamp to the data in each said data write unit.
Step S405: saving the data in the data write units into the flash memory of the solid state disk.
Step S406: determining whether the TRIM information is completed divided, and performing step S407 if YES, otherwise returning to step S403.
Step S407: completing the execution of TRIM command.
FIG. 5 is a work flow chart of an embodiment of the initialization of the solid state disk according to the present invention, comprising the steps of:
Step S501: scanning the solid state disk to create a logical physical address mapping table.
Step S502: reading the TRIM information from the flash memory of the solid state disk. The TRIM information is saved in a way of a bitmap, and corresponds to the valid address ranges and the invalid address ranges, respectively, using different expressions (e.g., the colors of pixels) in the bitmap.
Step S503: scanning the address ranges which have been marked as invalid in the TRIM information.
Step S504: determining if the timestamp of the TRIM information is later than the timestamp of the data in the marked address range. If YES, the step S505 will be performed, otherwise the step S506 will be performed.
Step S505: marking the address ranges, which have been marked as invalid in the TRIM information, as invalid in the logical physical address mapping table.
Step S506: determining if the scanning is completed, and performing step S507 if YES, otherwise returning to step S503.
Step S507: completing initialization.
In the above work flow, the TRIM information includes the address ranges which are marked as invalid, but after the solid state disk is started, such marked information cannot be found in the newly created logical physical address mapping table, so during initialization, it is necessary to apply the address ranges, which have been marked as invalid in the TRIM information, to the logical physical address mapping table. Furthermore, when the TRIM information is saved by a mixed method involving ranges and bitmaps, the amount of TRIM information needed to be saved is reduced, the execution of TRIM command and the application of TRIM information are accelerated, and the system boot time is reduced.
To sum up, according to the present invention, when data or invalid marked information is written into the storage device of a solid state disk, the written timestamp is recorded, and when the solid state disk is started, the timestamp of the data is compared with the timestamp of the invalid marked information to determine whether to apply the invalid marked information, and the specific address range is marked as invalid. When new data is written into the address range marked as invalid, since the timestamp of the newly written data is later than the timestamp of the marked information in the address range, the marked information will not be applied, i.e. the address range will not be marked as invalid, when the solid state disk is started. Thus, when a file system writes new data into the address range which is marked as invalid, the file system does not need to update the marked information, but adds timestamps to the data and the marked information to apply the invalid marks in the address range, relieve the coupling of marked information with a normal data stream, achieve the quick marking of the invalid data in a solid state disk, and improve the efficiency of the system; meanwhile, both the marked information and the data are saved in the same way in the flash memory of the solid state disk, and they need not be saved in the memory, thereby reducing the demand of the system for memory and the complexity for system realization.
Of course, the present invention may have a variety of other embodiments. Those skilled in the art can make all kinds of corresponding changes and modifications according to the present invention without departing from the spirit and essence of the present invention. It is intended that all these changes and modifications be covered by the appended claims of the present invention.

Claims (9)

The invention claimed is:
1. A data management method for a solid state disk, comprising:
saving new written data in a solid state disk along with a first timestamp corresponding to the new written data;
receiving a mark command including marked information having an invalid address range corresponding to invalid data and a valid address range corresponding to valid data;
marking the invalid address range corresponding to the invalid data; and
saving the marked information in the solid state disk along with a second timestamp corresponding to the marked information; and
determining whether to apply the marked information having the invalid address range by comparing the second timestamp of the marked information with the first timestamp of the new written data, wherein the new written data is in the address range corresponding to the invalid data, and if the first timestamp of the new written data is earlier than the second timestamp of the marked information, marking an address range of the new written data as invalid, otherwise not marking the address range of the new written data as invalid such that the marked information is not applied for the address range of the new written data.
2. The data management method according to claim 1, the step of saving the new written data in the solid state disk after adding the first timestamp to the new written data comprising:
receiving a data write command;
resolving the data write command into data write units;
adding a timestamp to the data in each said of the data write units; and
saving the data in the data write units into a flash memory of the solid state disk.
3. The data management method according to claim 1, the step of saving the marked information in the solid state disk after adding the second timestamp to the marked information comprising:
resolving the marked information into a plurality of data write units;
adding timestamps to the plurality of data write units; and
saving the data in the data write units into a flash memory of the solid state disk.
4. The data management method according to claim 1, wherein before the step of comparing the second timestamp of the marked information with the first timestamp of the new written data, the method comprises:
scanning the solid state disk to create a logical physical address mapping table;
reading the marked information from a flash memory of the solid state disk; and
scanning the marked address range according to the marked information.
5. The data management method according to claim 1, wherein the marked information is saved as a bitmap.
6. A solid state disk comprising a data management system for the solid state disk, the data management system comprising:
a write data processing module adapted for saving new written data in the solid state disk along with a first timestamp corresponding to the new written data;
a marking module adapted for:
receiving a mark command including marked information having an invalid address range corresponding to invalid data and a valid address range corresponding to valid data;
marking the invalid address range corresponding to the invalid data; and
saving the marked information in the solid state disk along with a second timestamp corresponding to the marked information; and
an initialization module adapted for:
determining whether to apply the marked information having the invalid address range by comparing the second timestamp of the marked information with the first timestamp of the new written data, wherein the new written data is in the address range corresponding to the invalid data, and marking an address range of the new written data as invalid if the first timestamp of the new written data is earlier than the second timestamp of the marked information, and otherwise not marking the address range of the new written data as invalid such that the marked information is not applied for the address range of the new written data.
7. The data management system according to claim 6, the write data processing module is further adapted for:
receiving a data write command;
resolving the data write command into data write units;
adding a timestamp to the data in each of the data write units; and
saving the data in the data write units into a flash memory of the solid state disk.
8. The data management system according to claim 6, the marking module is further adapted for:
resolving the marked information into a plurality of data write units;
adding timestamps to the plurality of data write units; and
saving the data in the data write units into a flash memory of the solid state disk.
9. The data management system according to claim 6, the initialization module further adapted for:
scanning the solid state disk to create a logical physical address mapping table;
reading the marked information from a flash memory of the solid state disk; and
scanning the marked address range according to the marked information.
US14/409,987 2012-06-21 2013-06-18 Solid state disk, data management method and system therefor Active 2034-09-17 US9875250B2 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201210206930.3 2012-06-21
CN201210206930 2012-06-21
CN201210206930.3A CN102789368B (en) 2012-06-21 2012-06-21 A kind of solid state hard disc and data managing method, system
PCT/CN2013/077384 WO2013189277A1 (en) 2012-06-21 2013-06-18 Solid state disk, and data management method and system therefor

Publications (2)

Publication Number Publication Date
US20150363425A1 US20150363425A1 (en) 2015-12-17
US9875250B2 true US9875250B2 (en) 2018-01-23

Family

ID=47154776

Family Applications (1)

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

Country Status (3)

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

Families Citing this family (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102789368B (en) 2012-06-21 2015-10-21 记忆科技(深圳)有限公司 A kind of solid state hard disc and data managing method, system
CN103279402B (en) * 2013-05-13 2016-08-10 记忆科技(深圳)有限公司 Data reconstruction method based on multilevel-cell solid state hard disc and solid state hard disc
CN103559054B (en) * 2013-10-30 2017-10-10 华为终端有限公司 Realization, delet method and the device of intelligent terminal multi-operation system
US9519429B2 (en) * 2014-12-09 2016-12-13 Intel Corporation Techniques to manage multiple sequential write streams to a solid state drive
US10061377B2 (en) * 2015-02-06 2018-08-28 Toshiba Memory Corporation Memory device and information processing device
WO2016162981A1 (en) * 2015-04-08 2016-10-13 株式会社日立製作所 Computer system and database management method
CN105260328B (en) * 2015-10-26 2019-02-12 成都华为技术有限公司 Data save method and device when a kind of device looses power
CN106406769A (en) * 2016-09-28 2017-02-15 郑州云海信息技术有限公司 Method for improving IO performance of solid state disk in linux system
TWI634424B (en) * 2017-05-08 2018-09-01 慧榮科技股份有限公司 Data storage device and operating method therefor
CN112424742B (en) * 2018-07-13 2022-06-14 华为技术有限公司 SSD data reading method and device
CN109254953A (en) * 2018-08-24 2019-01-22 深圳市德名利电子有限公司 A kind of data-erasure method based on FAT file, data storage device and system
US20200104384A1 (en) * 2018-10-02 2020-04-02 Nutanix, Inc. Systems and methods for continuous trim commands for memory systems
CN110780812B (en) * 2019-09-27 2021-08-24 苏州浪潮智能科技有限公司 Method and device for invalidating hard disk data
CN112988040B (en) * 2019-12-18 2023-02-24 深圳大普微电子科技有限公司 Data storage method, device and equipment and readable storage medium
CN113495674B (en) 2020-04-01 2023-10-10 长鑫存储技术有限公司 Read-write method and memory device
CN113495675B (en) 2020-04-01 2023-08-11 长鑫存储技术有限公司 Read-write method and memory device
EP3936996A4 (en) 2020-04-01 2022-07-06 Changxin Memory Technologies, Inc. Read-write method and memory device
EP3964941B1 (en) 2020-04-01 2024-02-28 Changxin Memory Technologies, Inc. Read-write method and memory device
CN113495672B (en) 2020-04-01 2023-08-11 长鑫存储技术有限公司 Read-write method and memory device
CN113495670B (en) * 2020-04-01 2024-03-26 长鑫存储技术有限公司 Read-write method and memory device
EP3985494B1 (en) 2020-04-01 2024-01-17 Changxin Memory Technologies, Inc. Read-write method and memory device
CN113495671B (en) 2020-04-01 2023-10-17 长鑫存储技术有限公司 Read-write method and memory device
EP3964940A4 (en) 2020-04-01 2022-08-17 Changxin Memory Technologies, Inc. Read/write method and memory apparatus
CN113254265B (en) * 2021-05-10 2023-03-14 苏州库瀚信息科技有限公司 Snapshot implementation method and storage system based on solid state disk

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110066808A1 (en) * 2009-09-08 2011-03-17 Fusion-Io, Inc. Apparatus, System, and Method for Caching Data on a Solid-State Storage Device
CN102165406A (en) 2008-09-30 2011-08-24 英特尔公司 Methods to communicate a timestamp to a storage system
CN102239480A (en) 2008-12-17 2011-11-09 Lsi公司 Storage system snapshot assisted by ssd technology
US20120110376A1 (en) * 2009-05-28 2012-05-03 Lsi Corporation Systems and Methods for Managing End of Life in a Solid State Drive
CN102789368A (en) 2012-06-21 2012-11-21 记忆科技(深圳)有限公司 Solid-state hard disk, and data management method and system thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102073560A (en) * 2011-01-17 2011-05-25 北京深思洛克软件技术股份有限公司 Data backup method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102165406A (en) 2008-09-30 2011-08-24 英特尔公司 Methods to communicate a timestamp to a storage system
CN102239480A (en) 2008-12-17 2011-11-09 Lsi公司 Storage system snapshot assisted by ssd technology
US20120110376A1 (en) * 2009-05-28 2012-05-03 Lsi Corporation Systems and Methods for Managing End of Life in a Solid State Drive
US20110066808A1 (en) * 2009-09-08 2011-03-17 Fusion-Io, Inc. Apparatus, System, and Method for Caching Data on a Solid-State Storage Device
CN102789368A (en) 2012-06-21 2012-11-21 记忆科技(深圳)有限公司 Solid-state hard disk, and data management method and system thereof

Also Published As

Publication number Publication date
WO2013189277A1 (en) 2013-12-27
US20150363425A1 (en) 2015-12-17
CN102789368A (en) 2012-11-21
CN102789368B (en) 2015-10-21

Similar Documents

Publication Publication Date Title
US9875250B2 (en) Solid state disk, data management method and system therefor
CN103440206B (en) A kind of solid state hard disc and mixed-use developments method thereof
US7861028B2 (en) System and method for configuration and management of flash memory
US9323659B2 (en) Cache management including solid state device virtualization
US20170160989A1 (en) Solid state disk and method for implementing trim command of the same
CN103514212B (en) Method for writing data and system
JP2010218290A (en) Controller, and memory system
DE102019116546A1 (en) METHOD FOR FAST BOAT READING
CN110568998A (en) trim command implementation method and device based on solid state disk and computer equipment
US11132145B2 (en) Techniques for reducing write amplification on solid state storage devices (SSDs)
CN110910921A (en) Command read-write method and device and computer storage medium
US20170160940A1 (en) Data processing method and apparatus of solid state disk
CN105677511A (en) Data writing method and apparatus for reducing synchronization overheads
WO2017157158A1 (en) Data writing method and apparatus, and computer storage medium
CN103425438A (en) Solid state disk and method for optimizing write request of solid state disk
KR100995546B1 (en) Database system based on hybrid storage device nand flash memory and non-volatile ram, and method of updating data in the database system
US9535796B2 (en) Method, apparatus and computer for data operation
CN109324929B (en) Snapshot creating method, device and equipment and readable storage medium
US8856468B2 (en) Memory device capable of improving write processing speed and memory control method
CN103744796A (en) Caching method and system by means of uSSD
CN111338562A (en) Data storage device and data processing method
CN101807212A (en) Caching method for embedded file system and embedded file system
CN103729209A (en) Difference upgrading method used for firmware device
CN102622307A (en) Operating method for hard disk data and hard disk controller
CN111506458A (en) Method and module for improving transaction performance of F2FS file system and storage system

Legal Events

Date Code Title Description
AS Assignment

Owner name: RAMAXEL TECHNOLOGY (SHENZHEN) LIMITED, CHINA

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:LI, JIAN;ZHANG, ZHIQING;WANG, MENG;REEL/FRAME:034989/0172

Effective date: 20141008

STCF Information on status: patent grant

Free format text: PATENTED CASE

MAFP Maintenance fee payment

Free format text: PAYMENT OF MAINTENANCE FEE, 4TH YR, SMALL ENTITY (ORIGINAL EVENT CODE: M2551); ENTITY STATUS OF PATENT OWNER: SMALL ENTITY

Year of fee payment: 4