WO2019120133A1 - 一种基于固态硬盘的日志文件的读写方法及固态硬盘 - Google Patents

一种基于固态硬盘的日志文件的读写方法及固态硬盘 Download PDF

Info

Publication number
WO2019120133A1
WO2019120133A1 PCT/CN2018/121057 CN2018121057W WO2019120133A1 WO 2019120133 A1 WO2019120133 A1 WO 2019120133A1 CN 2018121057 W CN2018121057 W CN 2018121057W WO 2019120133 A1 WO2019120133 A1 WO 2019120133A1
Authority
WO
WIPO (PCT)
Prior art keywords
solid state
log file
space
hard disk
writing
Prior art date
Application number
PCT/CN2018/121057
Other languages
English (en)
French (fr)
Inventor
陈祥
李卫军
Original Assignee
深圳大普微电子科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳大普微电子科技有限公司 filed Critical 深圳大普微电子科技有限公司
Publication of WO2019120133A1 publication Critical patent/WO2019120133A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/16Protection against loss of memory contents
    • 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
    • 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/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/062Securing storage systems
    • G06F3/0622Securing storage systems in relation to access

Definitions

  • the present invention relates to the field of solid state hard disk technologies, and in particular, to a method for reading and writing log files based on a solid state hard disk and a solid state hard disk.
  • log file system In the prior art, almost all file systems provide a log function to protect the file system and the integrity of the file after a sudden shutdown due to a sudden power failure, and such a file system is called a log file system.
  • a log file system When the log file system is running in data mode, metadata and data are first written to the log and then to the file system. This mode maximizes the integrity of the file system, but this will write to the disk's data. Double the amount, which will seriously reduce the performance of the file system write operation.
  • the log file system prevents the metadata of the file system from being damaged. It caches all metadata as a cache block. If the disk data is abnormal, it will be from the cache block. restore.
  • the traditional method does not distinguish between the log file data and the actual data, the same data will be written to the SSD twice.
  • the prior art divides and manages the same data by deduplicating data and calculating the data block fingerprint.
  • Such a scheme often requires hardware and system software support, and the overhead is large, thereby improving system cost and power consumption.
  • the technical problem to be solved by the present invention is to provide a method for reading and writing a log file based on a solid state hard disk and a solid state hard disk, which have low overhead, a small amount of physical writing, and can extend the life of the solid state hard disk.
  • the present invention adopts the following technical solutions:
  • the present invention provides a method for reading and writing a log file based on a solid state hard disk, the method comprising: creating a DRAM storage space in a firmware system of a solid state hard disk to serve read and write of a log file, when writing When the log file is entered, the log file is written to the DRAM storage space; when the log file is read, the log file is read from the DRAM storage space.
  • the method further includes: when the solid state hard disk is powered off, writing the log file stored in the DRAM storage space to the flash memory of the solid state hard disk, and storing the storage device to the solid state hard disk when the power is restored. Log files in the flash memory are read into the DRAM memory space.
  • the step of creating a DRAM storage space for the firmware of the SSD to serve the reading and writing of the log file includes:
  • the firmware system creates the DRAM storage space according to the received information of the logical space
  • the information of the logical space includes a starting address and a space size of the logical space.
  • the size of the DRAM storage space is linear with the spatial size of the logical space.
  • the information of the logical space is sent to the firmware system by using a user-defined command.
  • the present invention provides a solid state hard disk, the firmware system of which creates a DRAM storage space for reading and writing log files, and writes log files to the DRAM storage when writing a log file. Space; when the log file is read, the log file is read from the DRAM storage space.
  • the solid state hard disk writes a log file stored in the DRAM storage space to the flash memory when the power is turned off, and reads the log file stored in the flash memory when the power is turned off, when the CPU is powered off. DRAM storage space.
  • the DRAM storage space is created according to the information of the logical space created by the log file system in the solid state hard disk; wherein the information of the logical space includes a starting address and a space size of the logical space.
  • the size of the DRAM storage space is linear with the spatial size of the logical space.
  • the information of the logical space is sent by a user-defined command.
  • the present invention has the beneficial effects that the present invention is responsible for reading and writing log files by creating a DRAM storage space, and the log file system writes the log files that need to be written into the DRAM storage space or from the DRAM storage.
  • the log file is read in the space.
  • the invention reduces the physical writing of the solid state hard disk, prolongs the life of the solid state hard disk, and does not need to occupy the file system resource due to the calculation of the unique fingerprint, and the overhead is small.
  • FIG. 1 is a flowchart of a method for a method for reading and writing a log file based on a solid state hard disk according to an embodiment of the present invention.
  • FIG. 2 is a schematic structural view of a solid state hard disk provided in an embodiment of the present invention.
  • a method for reading and writing a log file based on a solid state hard disk according to an embodiment of the present invention is further described in detail below with reference to FIG.
  • the method comprises:
  • Step S101 creating a DRAM storage space in the firmware system of the solid state hard disk to serve read and write of the log file, and writing the log file to the DRAM storage space when writing the log file; when reading the log file, from the The DRAM storage space reads the log file.
  • FIG. 2 is a schematic structural diagram of a solid state hard disk provided in an embodiment of the present invention.
  • a solid state disk 100 SSD is mainly stored by a solid state disk controller 101 and a FLASH (flash memory) 103.
  • the array, the on-board DRAM 102 (Dynamic Random Access Memory), and the HOST interface (such as SATA, SAS, PCIe, etc.) are composed.
  • the SSD controller consists of a hardware system and a firmware system.
  • the firmware system is configured and controlled based on the hardware system. The two are the two indispensable parts that make up the SSD controller.
  • the DRAM is a module inside the solid state hard disk controller.
  • the DRAM is generally used to store the address mapping table. In the embodiment provided by the embodiment, the DRAM is also used for reading and writing log files, and the log files are stored in the DRAM.
  • the step of the firmware system of the solid state hard disk creating a DRAM storage space to service the reading and writing of the log file includes step A1 and step A2, as follows:
  • Step A1 Acquire the information of the logical space created on the solid state hard disk and send it to the firmware system of the solid state hard disk.
  • the information of the logical space is sent to the firmware system by a user-defined command.
  • the log file system obtains the information of the logical space created on the solid state hard disk and sends it to the firmware system of the solid state hard disk.
  • the log file system sends the information of the logical space to the firmware system through a user-defined command.
  • Step A2 The firmware system creates the DRAM storage space according to the information of the received logical space; wherein the information of the logical space includes a starting address and a space size of the logical space.
  • the size of the DRAM storage space is linear with the spatial size of the logical space.
  • the SSD When the log file system creates a logical space, the SSD is formatted to create a logical space of size N.
  • the logical space is in LBA (Logical Block Address) and the size is 512 bytes or 4096 bytes.
  • the logical space provides the user with a range of file read and write, usually consisting of two parameters: the starting address of the logical space and the size of the space.
  • the log file system sends the information of the logical space to the firmware system through a user-defined command.
  • the user-defined command includes the command number, the starting address of the created logical space, and the size of the space, so that the firmware system starts according to the starting address of the logical space.
  • the size of the space is used to create DRAM storage space.
  • the log file system is a JBD (Journal Block Device)/JBD2 file system.
  • JBD Joint Block Device
  • JBD2 file system When the log file system creates a logical space, the starting address and space size of the logical space are customized by the user through the Linux driver. The command is sent to the firmware system.
  • the log file system sends information of the logical space to the firmware system via a user-defined command.
  • the firmware system creates a DRAM storage space to be responsible for reading and writing log files.
  • the log file When writing the log file, the log file is written into the DRAM storage space; when the log file is read, the log file is read from the DRAM storage space.
  • other operations such as deleting log files in the DRAM storage space can be performed.
  • the operations of reading, writing, and deleting log files are completed in the DRAM, thereby reducing the amount of writing in the disk, which is advantageous for extending the life of the solid state hard disk.
  • FIG. 1 is a flowchart of a method for reading and writing a log file based on a solid state hard disk according to an embodiment of the present invention. As shown in FIG. 1, in some embodiments, the method further includes after step S101:
  • Step S102 When the solid state hard disk is powered off, the log file stored in the DRAM storage space is written into the flash memory of the solid state hard disk.
  • the log file system writes the log file stored in the DRAM storage space into the flash memory of the solid state hard disk.
  • Step S103 When the SSD is restarted, the log file stored in the flash memory when the power is turned off is read into the DRAM storage space.
  • the log file system reads the log file stored in the flash memory during the power failure into the DRAM storage space.
  • the DRAM cannot save the log file data. Therefore, when the SSD is powered off, the log file system writes the log files stored in the DRAM storage space to the flash memory, thereby ensuring the integrity of the data, and the SSD.
  • the log files stored in the flash memory when the SSD is powered off are read into the DRAM storage space, and the DRAM storage space is reused to be responsible for reading and writing log files, thereby reducing the amount of disk writes and the occupancy of file system resources. To extend the life of the SSD and reduce overhead.
  • the method further includes: when the DRAM storage space is less than or equal to the preset space, the log file system presets according to the preset policy.
  • the number of log files is written to the flash, for example, by the time of writing, and the first number of log files written first is written to the flash.
  • the firmware system creates a DRAM storage space according to a user-defined command including logical space information, and utilizes a DRAM storage space to be responsible for reading and writing log files, and the log file system writes the log files to be written into the DRAM storage.
  • the method of the embodiment of the invention reduces the physical writing of the solid state hard disk, prolongs the life of the solid state hard disk, and does not need to occupy the file system resource due to the calculation of the unique fingerprint, and the overhead is small. .
  • the embodiment of the present invention further provides a solid state hard disk.
  • the embodiment of the solid state disk hard disk is implemented based on the embodiment of the foregoing method. For a detailed description of the solid state hard disk, refer to the foregoing method.
  • the firmware system of the solid state hard disk creates a DRAM storage space for reading and writing service log files.
  • the log file is written into the DRAM storage space; when the log file is read, The log file is read from the DRAM storage space.
  • the DRAM storage space is created according to information of a logical space created by the log file system on the solid state hard disk; wherein the information of the logical space includes a starting address and a spatial size of the logical space.
  • the information of the logical space is sent by a user-defined command.
  • the log file system obtains information about the logical space created on the solid state hard disk and sends it to the firmware system of the solid state hard disk, and the log file system sends the information to the firmware system through the information of the user-defined command piece logical space; the firmware system according to the The information of the received logical space creates the DRAM memory space.
  • the size of the DRAM storage space is linear with the spatial size of the logical space, that is, the larger the logical space, the larger the DRAM storage space is created.
  • the solid state hard disk writes a log file stored in the DRAM storage space to the flash memory when it is powered down, and stores the log file in the flash memory when the power is turned off when it is restarted.
  • the log file system writes log files stored in the DRAM storage space to the flash memory of the SSD when the SSD is powered off, and stores the log files in the flash memory when the SSD is restarted.
  • the log file system sends information of the logical space to the firmware system via a user-defined command.
  • the firmware system of the solid state hard disk creates a DRAM storage space according to a user-defined command including logical space information, and utilizes a DRAM storage space to be responsible for reading and writing log files, and the log file system writes the log file to be written.
  • the DRAM storage space is read or read from the DRAM storage space.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种基于固态硬盘的日志文件的读写方法及固态硬盘,所述方法包括:于固态硬盘的固件系统创建一DRAM存储空间以服务日志文件的读写,当写入日志文件时,将日志文件写入所述DRAM存储空间;当读取日志文件时,从所述DRAM存储空间读出日志文件(S101)。通过创建DRAM存储空间来负责日志文件的读写,减少了对固态硬盘的物理的写,提高了固态硬盘的寿命,也无需因计算唯一指纹而占用文件系统资源,开销小。

Description

一种基于固态硬盘的日志文件的读写方法及固态硬盘 技术领域
本发明涉及固态硬盘技术领域,尤其涉及一种基于固态硬盘的日志文件的读写方法及固态硬盘。
背景技术
现有技术中,几乎所有的文件系统都提供日志功能,以保护文件系统以及文件在遇到突然断电等原因导致系统非正常停机后的完整性,而这样的文件系统称为日志文件系统,当日志文件系统运行在数据模式时,元数据和数据都先写入日志中,再写入文件系统中,这种模式可以最大程度地保护文件系统的完整性,但是这将写入磁盘的数据量加倍了,会严重降低文件系统写操作的性能,日志文件系统就是防止文件系统的元数据被损坏,它作为一个缓存块先缓存所有的元数据,如果磁盘数据异常,就会从缓存块中恢复。
传统的方法并未区分日志文件数据和实际数据之间的关系,相同的数据会被写入固态硬盘两次。现有技术通过重复数据删除,计算数据块指纹来区分管理相同的数据,但这种方案往往需要硬件和系统软件的支持,开销较大,提高了系统成本和功耗。
发明内容
本发明所要解决的技术问题在于提供了一种开销小、物理写入量少、能延长固态硬盘寿命的基于固态硬盘的日志文件的读写方法及固态硬盘。
为解决上述技术问题,本发明采用以下技术方案:
一方面,本发明提供了一种基于固态硬盘的日志文件的读写方法,其特征在于,所述方法包括:于固态硬盘的固件系统创建一DRAM存储空间以服务日 志文件的读写,当写入日志文件时,将日志文件写入所述DRAM存储空间;当读取日志文件时,从所述DRAM存储空间读出日志文件。
其中,所述方法还包括:当固态硬盘掉电时,将存储于所述DRAM存储空间中的日志文件写入所述固态硬盘的闪存中,而在固态硬盘重启时,将掉电时存储至闪存中的日志文件读入所述DRAM存储空间中。
其中,所述于固态硬盘的固件系统创建一DRAM存储空间以服务日志文件的读写的步骤包括:
获取于固态硬盘上创建的逻辑空间的信息并将其发送给固态硬盘的固件系统;
固件系统根据所述接收的逻辑空间的信息创建所述DRAM存储空间;
其中,所述逻辑空间的信息包括逻辑空间的起始地址及空间大小。
其中,所述DRAM存储空间的大小与逻辑空间的空间大小为线性关系。
其中,所述逻辑空间的信息通过用户自定义命令发送给所述固件系统。
另一方面,本发明提供了一种固态硬盘,该固态硬盘的固件系统创建有一用于服务日志文件的读写的DRAM存储空间,当写入日志文件时,将日志文件写入所述DRAM存储空间;当读取日志文件时,从所述DRAM存储空间读出日志文件。
其中,所述固态硬盘在其掉电时,将存储于所述DRAM存储空间中的日志文件写入闪存中,而在其重启时,将掉电时存储至闪存中的日志文件读入所述DRAM存储空间中。
其中,所述DRAM存储空间根据日志文件系统在固态硬盘所创建的逻辑空间的信息创建;其中,所述逻辑空间的信息包括逻辑空间的起始地址及空间大小。
其中,所述DRAM存储空间的大小与逻辑空间的空间大小为线性关系。
其中,所述逻辑空间的信息通过用户自定义命令发送。
与现有技术相比,本发明的有益效果为:本发明通过创建DRAM存储空间来负责日志文件的读写,日志文件系统将需要写入的日志文件写入所述DRAM存储空间或从DRAM存储空间中读取日志文件,本发明减少了对固态硬盘的物理的写,延长了固态硬盘的寿命,也无需因计算唯一指纹而占用文件系统资源,开销小。
附图说明
图1是本发明具体实施方式中提供的一种基于固态硬盘的日志文件的读写方法的实施例的方法流程图。
图2是本发明具体实施方式中提供的一种固态硬盘的结构示意图。
具体实施方式
为使本发明解决的技术问题、采用的技术方案和达到的技术效果更加清楚,下面将结合附图对本发明实施例的技术方案作进一步的详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
下面结合附图1对本发明实施例提供的一种基于固态硬盘的日志文件的读写方法作进一步的详细描述。在一些实施例中,该方法包括:
步骤S101:于固态硬盘的固件系统创建一DRAM存储空间以服务日志文件的读写,当写入日志文件时,将日志文件写入所述DRAM存储空间;当读取日志文件时,从所述DRAM存储空间读出日志文件。
图2是本发明具体实施方式中提供的一种固态硬盘的结构示意图,如图2 所示,固态硬盘100(Solid State Disk,简称SSD)主要由固态硬盘控制器101、FLASH(闪存)103存储阵列、板上DRAM 102(Dynamic Random Access Memory、动态随机存取存储器)、以及HOST接口(诸如SATA、SAS、PCIe等)组成。固态硬盘控制器包含硬件系统和固件系统,固件系统基于硬件系统进行配置、控制,两者是组成固态硬盘控制器的两个不可缺少的部分。DRAM是固体硬盘控制器内部的一个模块,DRAM一般用于存储地址映射表,而本实施例提供的实施例,DRAM还用于负责日志文件的读写,日志文件存储在DRAM中。
在一些实施例中,所述于固态硬盘的固件系统创建一DRAM存储空间以服务日志文件的读写的步骤包括步骤A1和步骤A2,具体如下:
步骤A1:获取于固态硬盘上创建的逻辑空间的信息并将其发送给固态硬盘的固件系统。其中,逻辑空间的信息通过用户自定义命令发送给所述固件系统。在本实施例中,日志文件系统获取于固态硬盘上创建的逻辑空间的信息并将其发送给固态硬盘的固件系统,日志文件系统通过用户自定义命令将逻辑空间的信息发送给固件系统。
步骤A2:固件系统根据所述接收的逻辑空间的信息创建所述DRAM存储空间;其中,所述逻辑空间的信息包括逻辑空间的起始地址及空间大小。其中,所述DRAM存储空间的大小与逻辑空间的空间大小为线性关系。
日志文件系统在创建逻辑空间时,对固态硬盘进行格式化操作,以创建大小为N的逻辑空间,逻辑空间的单位为LBA(Logical Block Address,逻辑区块地址),大小为512byte或4096byte,该逻辑空间为用户提供文件读写的范围,通常包括有两个参数:逻辑空间的起始地址和空间大小。日志文件系统将逻辑空间的信息通过用户自定义命令发送给固件系统,用户自定义命令包括命令号、创建的逻辑空间的起始地址及空间大小,以使固件系统根据逻辑空间的 起始地址及空间大小来创建DRAM存储空间。本实施例中,日志文件系统为JBD(Journal Block Device,日志文件设备)/JBD2文件系统,日志文件系统创建逻辑空间时,通过Linux驱动,将逻辑空间的起始地址及空间大小通过用户自定义命令发送给固件系统。
在一些实施例中,日志文件系统通过用户自定义命令将所述逻辑空间的信息发送给所述固件系统。
固件系统创建一DRAM存储空间以负责日志文件的读写,当写入日志文件时,将日志文件写入所述DRAM存储空间;读取日志文件是,从所述DRAM存储空间读出日志文件,当然也可以对DRAM存储空间中的日志文件进行删除等其他操作。本实施例在DRAM中完成日志文件的读写及删除等操作,减少了磁盘中的写入量,有利于延长固态硬盘的寿命。
图1其是本发明具体实施方式中提供的一种基于固态硬盘的日志文件的读写方法的实施例的方法流程图。如图1所示,在一些实施例中,该方法在步骤S101之后还包括:
步骤S102:当固态硬盘掉电时,将存储于所述DRAM存储空间中的日志文件写入所述固态硬盘的闪存中。本实施例中,日志文件系统将存储于所述DRAM存储空间中的日志文件写入所述固态硬盘的闪存中。
步骤S103:在固态硬盘重启时,将掉电时存储至闪存中的日志文件读入所述DRAM存储空间中。本实施例中,日志文件系统在固态硬盘重启时,将掉电时存储至闪存中的日志文件读入所述DRAM存储空间中。
在固态硬盘掉电时,DRAM不能保存日志文件数据,因此当固态硬盘掉电时,日志文件系统将存储于DRAM存储空间的日志文件写入闪存中,从而保证了数据的完整性,而固态硬盘重启时,将固态硬盘掉电时存储至闪存中的日志 文件读入DRAM存储空间中,重新利用DRAM存储空间负责日志文件的读写,减少磁盘的写入量和对文件系统资源的占用量,以延长固态硬盘的寿命和减少开销。
在一些实施例中,在当写入日志文件时,将日志文件写入所述DRAM存储空间步骤之后还包括:当DRAM存储空间小于等于预置空间时,日志文件系统根据预置策略将预置数量的日志文件写入闪存中,例如可以按写入的时间进行排序,将最先写入的预置数量的日志文件写入闪存中。
本实施例中,固件系统根据包括逻辑空间信息的用户自定义命令创建DRAM存储空间,利用DRAM存储空间来负责日志文件的读写,日志文件系统将需要写入的日志文件写入所述DRAM存储空间或从DRAM存储空间中读取日志文件,本发明实施例提供的方法减少了对固态硬盘的物理的写,延长了固态硬盘的寿命,也无需因计算唯一指纹而占用文件系统资源,开销小。
本发明具体实施例方式中还提供了一种固态硬盘,该固态盘硬盘的实施例时基于上述的方法的实施例实现,在固态硬盘中未详尽的描述,请参考前述方法的实施例。
本实施例提供的固态硬盘的固件系统创建有一用于服务日志文件的读写的DRAM存储空间,当写入日志文件时,将日志文件写入所述DRAM存储空间;当读取日志文件时,从所述DRAM存储空间读出日志文件。
在一些实施例中,所述DRAM存储空间根据日志文件系统在固态硬盘所创建的逻辑空间的信息创建;其中,所述逻辑空间的信息包括逻辑空间的起始地址及空间大小。所述逻辑空间的信息通过用户自定义命令发送。日志文件系统获取于固态硬盘上创建的逻辑空间的信息并将其发送给固态硬盘的固件系统,日志文件系统通过用户自定义命令件逻辑空间的信息发送给所述固件系统;固 件系统根据所述接收的逻辑空间的信息创建所述DRAM存储空间。其中,所述DRAM存储空间的大小与逻辑空间的空间大小为线性关系,即逻辑空间越大,创建的DRAM存储空间也越大。
在一些实施例中,所述固态硬盘在其掉电时,将存储于所述DRAM存储空间中的日志文件写入闪存中,而在其重启时,将掉电时存储至闪存中的日志文件读入所述DRAM存储空间中。日志文件系统在固态硬盘掉电时,将存储于所述DRAM存储空间中的日志文件写入所述固态硬盘的闪存中,而在固态硬盘重启时,将掉电时存储至闪存中的日志文件读入所述DRAM存储空间中。在一些实施例中,日志文件系统通过用户自定义命令将所述逻辑空间的信息发送给所述固件系统。
本实施例中,固态硬盘的固件系统根据包括逻辑空间信息的用户自定义命令创建DRAM存储空间,利用DRAM存储空间来负责日志文件的读写,日志文件系统将需要写入的日志文件写入所述DRAM存储空间或从DRAM存储空间中读取日志文件,本发明实施例提供的方法减少了对固态硬盘的物理的写,延长了固态硬盘的寿命,也无需因计算唯一指纹而占用文件系统资源,开销小。
以上结合具体实施例描述了本发明的技术原理。这些描述只是为了解释本发明的原理,而不能以任何方式解释为对本发明保护范围的限制。基于此处的解释,本领域的技术人员不需要付出创造性的劳动即可联想到本发明的其它具体实施方式,这些方式都将落入本发明的保护范围之内。

Claims (10)

  1. 一种基于固态硬盘的日志文件的读写方法,其特征在于,所述方法包括:于固态硬盘的固件系统创建一DRAM存储空间以服务日志文件的读写,当写入日志文件时,将日志文件写入所述DRAM存储空间;当读取日志文件时,从所述DRAM存储空间读出日志文件。
  2. 根据权利要求1所述的基于固态硬盘的日志文件的读写方法,其特征在于,所述方法还包括:当固态硬盘掉电时,将存储于所述DRAM存储空间中的日志文件写入所述固态硬盘的闪存中,而在固态硬盘重启时,将掉电时存储至闪存中的日志文件读入所述DRAM存储空间中。
  3. 根据权利要求1或2所述的基于固态硬盘的日志文件的读写方法,其特征在于,所述于固态硬盘的固件系统创建一DRAM存储空间以服务日志文件的读写的步骤包括:
    获取于固态硬盘上创建的逻辑空间的信息并将其发送给固态硬盘的固件系统;
    固件系统根据所述接收的逻辑空间的信息创建所述DRAM存储空间;
    其中,所述逻辑空间的信息包括逻辑空间的起始地址及空间大小。
  4. 根据权利要求3所述的基于固态硬盘的日志文件的读写方法,其特征在于,所述DRAM存储空间的大小与逻辑空间的空间大小为线性关系。
  5. 根据权利要求3所述的基于固态硬盘的日志文件的读写方法,其特征在于,所述逻辑空间的信息通过用户自定义命令发送给所述固件系统。
  6. 一种固态硬盘,其特征在于,所述固态硬盘的固件系统创建有一用于服务日志文件的读写的DRAM存储空间,当写入日志文件时,将日志文件写入所述DRAM存储空间;当读取日志文件时,从所述DRAM存储空间读出日志文件。
  7. 根据权利要求6所述的固态硬盘,其特征在于,所述固态硬盘在其掉电时,将存储于所述DRAM存储空间中的日志文件写入闪存中,而在其重启时,将掉电时存储至闪存中的日志文件读入所述DRAM存储空间中。
  8. 根据权利要求6或7所述的固态硬盘,其特征在于,所述DRAM存储空间根据日志文件系统在固态硬盘所创建的逻辑空间的信息创建;其中,所述逻辑空间的信息包括逻辑空间的起始地址及空间大小。
  9. 根据权利要求8所述的固态硬盘,其特征在于,所述DRAM存储空间的大小与逻辑空间的空间大小为线性关系。
  10. 根据权利要求8所述的固态硬盘,其特征在于,所述逻辑空间的信息通过用户自定义命令发送。
PCT/CN2018/121057 2017-12-22 2018-12-14 一种基于固态硬盘的日志文件的读写方法及固态硬盘 WO2019120133A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711408978.1 2017-12-22
CN201711408978.1A CN108182154A (zh) 2017-12-22 2017-12-22 一种基于固态硬盘的日志文件的读写方法及固态硬盘

Publications (1)

Publication Number Publication Date
WO2019120133A1 true WO2019120133A1 (zh) 2019-06-27

Family

ID=62546747

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/121057 WO2019120133A1 (zh) 2017-12-22 2018-12-14 一种基于固态硬盘的日志文件的读写方法及固态硬盘

Country Status (2)

Country Link
CN (1) CN108182154A (zh)
WO (1) WO2019120133A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11947839B2 (en) 2021-05-10 2024-04-02 Samsung Electronics Co., Ltd. Storage device, system, and method for customizable metadata

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108182154A (zh) * 2017-12-22 2018-06-19 深圳大普微电子科技有限公司 一种基于固态硬盘的日志文件的读写方法及固态硬盘
CN108959589B (zh) * 2018-07-11 2021-08-10 中电海康集团有限公司 基于stt-mram加速固态存储器件日志文件保存恢复的方法
CN109614042B (zh) * 2018-11-30 2022-09-02 维沃移动通信有限公司 一种存储日志信息的方法及终端设备
CN109901799B (zh) * 2019-02-28 2022-08-19 新华三信息安全技术有限公司 一种日志读写方法及装置
CN110007860A (zh) * 2019-03-28 2019-07-12 深圳大普微电子科技有限公司 基于lsm数据库的垃圾处理的方法、固态硬盘以及存储装置
CN110286850B (zh) * 2019-05-15 2023-05-09 镕铭微电子(济南)有限公司 固态硬盘元数据的写入方法、恢复方法及固态硬盘
CN110456898A (zh) * 2019-08-19 2019-11-15 菏泽学院 一种计算机断电保护系统及方法
CN115686372B (zh) * 2022-11-07 2023-07-25 武汉麓谷科技有限公司 一种基于zns固态硬盘zrwa功能的数据管理的方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120063255A1 (en) * 2010-09-14 2012-03-15 Kabushiki Kaisha Toshiba Storage device, electronic device, and storage device control method
CN103488578A (zh) * 2012-12-28 2014-01-01 晶天电子(深圳)有限公司 虚拟存储设备(vmd)应用/驱动器
US20160054942A1 (en) * 2013-03-15 2016-02-25 Super Talent Technology, Corp. Green NAND Device (GND) Driver with DRAM Data Persistence For Enhanced Flash Endurance and Performance
CN106354615A (zh) * 2015-07-21 2017-01-25 北京忆恒创源科技有限公司 固态硬盘日志生成方法及其装置
CN108182154A (zh) * 2017-12-22 2018-06-19 深圳大普微电子科技有限公司 一种基于固态硬盘的日志文件的读写方法及固态硬盘

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8775717B2 (en) * 2007-12-27 2014-07-08 Sandisk Enterprise Ip Llc Storage controller for flash memory including a crossbar switch connecting a plurality of processors with a plurality of internal memories
US8886870B2 (en) * 2010-05-25 2014-11-11 Marvell World Trade Ltd. Memory access table saving and restoring system and methods
WO2014081719A1 (en) * 2012-11-20 2014-05-30 Peddle Charles I Solid state drive architectures
JP6276296B2 (ja) * 2013-03-14 2018-02-07 マイクロン テクノロジー, インク. トレーニング、データ再構築および/またはシャドウィングを含むメモリシステムおよび方法
US20150331624A1 (en) * 2014-05-19 2015-11-19 Kabushiki Kaisha Toshiba Host-controlled flash translation layer snapshot

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120063255A1 (en) * 2010-09-14 2012-03-15 Kabushiki Kaisha Toshiba Storage device, electronic device, and storage device control method
CN103488578A (zh) * 2012-12-28 2014-01-01 晶天电子(深圳)有限公司 虚拟存储设备(vmd)应用/驱动器
US20160054942A1 (en) * 2013-03-15 2016-02-25 Super Talent Technology, Corp. Green NAND Device (GND) Driver with DRAM Data Persistence For Enhanced Flash Endurance and Performance
CN106354615A (zh) * 2015-07-21 2017-01-25 北京忆恒创源科技有限公司 固态硬盘日志生成方法及其装置
CN108182154A (zh) * 2017-12-22 2018-06-19 深圳大普微电子科技有限公司 一种基于固态硬盘的日志文件的读写方法及固态硬盘

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11947839B2 (en) 2021-05-10 2024-04-02 Samsung Electronics Co., Ltd. Storage device, system, and method for customizable metadata

Also Published As

Publication number Publication date
CN108182154A (zh) 2018-06-19

Similar Documents

Publication Publication Date Title
WO2019120133A1 (zh) 一种基于固态硬盘的日志文件的读写方法及固态硬盘
US11797191B2 (en) Systems and methods for storing data in SSD
US8862808B2 (en) Control apparatus and control method
US10776153B2 (en) Information processing device and system capable of preventing loss of user data
TWI385516B (zh) 快閃記憶體儲存系統及其資料寫入方法
US7930499B2 (en) Method to accelerate block level snapshots in archiving storage systems
US20150331624A1 (en) Host-controlled flash translation layer snapshot
US10127166B2 (en) Data storage controller with multiple pipelines
US20190324859A1 (en) Method and Apparatus for Restoring Data after Power Failure for An Open-Channel Solid State Drive
TW201619971A (zh) 耦合至主機dram之綠能與非固態硬碟(nand ssd)驅動器、gnsd應用程式及其操作方法和電腦系統主機、增加非揮發快閃記憶儲存器耐久性之方法
US20110010499A1 (en) Storage system, method of controlling storage system, and method of controlling control apparatus
US20100235568A1 (en) Storage device using non-volatile memory
US20140143476A1 (en) Usage of cache and write transaction information in a storage device
JP2011253251A (ja) データ記憶装置及びデータ書き込み方法
US12019544B2 (en) Memory mapping for hibernation
CN111124258B (zh) 全闪存阵列的数据存储方法、装置、设备及可读存储介质
JP2017033500A (ja) 記憶装置およびデータ退避方法
US9921913B2 (en) Flushing host cache data before rebuilding degraded redundant virtual disk
CN106469119B (zh) 一种基于nvdimm的数据写缓存方法及其装置
US10031689B2 (en) Stream management for storage devices
US20130179634A1 (en) Systems and methods for idle time backup of storage system volumes
CN117149062A (zh) 一种磁带损坏数据的处理方法以及计算装置
US20170357545A1 (en) Information processing apparatus and information processing method
US9836359B2 (en) Storage and control method of the same
CN109491593B (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: 18893132

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18893132

Country of ref document: EP

Kind code of ref document: A1