WO2021035555A1 - Data storage method and apparatus for solid state disk and solid state disk (ssd) - Google Patents

Data storage method and apparatus for solid state disk and solid state disk (ssd) Download PDF

Info

Publication number
WO2021035555A1
WO2021035555A1 PCT/CN2019/102909 CN2019102909W WO2021035555A1 WO 2021035555 A1 WO2021035555 A1 WO 2021035555A1 CN 2019102909 W CN2019102909 W CN 2019102909W WO 2021035555 A1 WO2021035555 A1 WO 2021035555A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
ssd
storage area
read
stored
Prior art date
Application number
PCT/CN2019/102909
Other languages
French (fr)
Chinese (zh)
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 CN201980099647.5A priority Critical patent/CN114303123A/en
Priority to PCT/CN2019/102909 priority patent/WO2021035555A1/en
Publication of WO2021035555A1 publication Critical patent/WO2021035555A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers

Definitions

  • This application relates to the storage field, and in particular to a data storage method and device of a solid-state hard disk, and a solid-state hard disk SSD.
  • SSD Solid State Disk
  • the storage unit generally includes multiple flash memory particles such as NAND Flash.
  • Each flash memory particle includes one or more dies, and each die includes multiple physical blocks.
  • the capacity of the block is generally in the hundreds. Between KB and several MB, each block includes multiple pages (pages), and the size of the page is generally a multiple of 4KB (such as 4KB or 16KB).
  • SSD uses Flash Translation Layer (FTL) to evenly distribute data and store data on each NAND Flash. Since the SSD has no mechanical structure and no seek process, the read and write latency of the SSD is as low as microseconds, and the read and write bandwidth is as high as GB/s (Gigabyte/Second).
  • FTL Flash Translation Layer
  • the read and write delay of the storage device has a greater impact on the business performance of a specific application (Application, APP), such as query operations in a relational database management system.
  • Application, APP Application, such as query operations in a relational database management system.
  • Reducing the average read latency of storage devices can greatly improve the business performance of this type of application.
  • the average read latency of SSD is mainly affected by the access latency of the NANDFlash medium itself.
  • a cache module is generally designed inside the SSD to speed up the processing of read commands, thereby reducing the average read latency of the SSD.
  • the SSD device not only includes a control unit and a storage unit, but also includes a cache buffer storage area module.
  • the buffer storage module utilizes the lower latency characteristics of storage media such as Storage Class Memory (SCM) or Dynamic Random Access Memory (DRAM) to reduce the average read latency of the SSD.
  • SCM Storage Class Memory
  • DRAM Dynamic Random Access Memory
  • the SSD using this solution has a high overall cost and high implementation complexity.
  • the effect of the solution in reducing the average read delay is strongly related to the probability of directly obtaining the target data from the buffer memory module.
  • the embodiments of the present application provide a solid-state hard disk storage method and device, and a solid-state hard disk SSD, which can effectively reduce the average read delay of the SSD and improve the service performance of the SSD in delay-sensitive scenarios.
  • an embodiment of the present application provides a data storage method of a solid state drive (SSD).
  • the method may include: receiving data to be stored, and identifying first data in the data to be stored, wherein the aforementioned first data is the same as the target Data matching data, the target data is the data that is read from the SSD with a frequency higher than the preset frequency threshold; from the multiple storage areas of the SSD (this application takes the page unit as an example of the storage area for explanation), select the data with the aforementioned A first storage area matching the read delay of the first data; storing the first data in the aforementioned first storage area.
  • the first data is identified from the received data to be stored (the aforementioned first data may be data that needs to be quickly read from the aforementioned SSD, for example, the frequency of reading from the aforementioned SSD is higher than the preset frequency threshold.
  • the data, the data containing the designated identifier, and the data with higher read frequency in the data set, where the foregoing data set may include data received by the SSD from the Host one or more times) and the foregoing first data is stored To the first storage area matching the read delay, thereby reducing the average read delay in the process of reading the first data, and improving the service processing performance of the device equipped with the SSD.
  • the built-in SSD cache module causes the SSD controller to determine whether the read/write command hits the cache, and requires multiple addressing processes; through the implementation of the embodiments of this application, the production is reduced while meeting certain business requirements.
  • the cost of materials (such as the cost of the SSD cache module), while avoiding secondary addressing and increasing the processing load of the SSD controller; more importantly, based on the characteristics of the SSD storage medium, the data is matched and stored purposefully.
  • the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period; the aforementioned identification of the first data in the aforementioned data to be stored includes: Identify part or all of the data that has the same content as the target data in the aforementioned data to be stored as the aforementioned first data.
  • the data to be stored with the same content as the target data in the preset historical time period is filtered (for example, it is judged that the two are the same according to conditions such as consistent reading frequency and consistent data valid bits), so that the first The data is stored in a storage area that matches the expected read delay.
  • the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period; the aforementioned identification of the first data in the aforementioned data to be stored includes: Part or all of the data to be stored that is of the same type as the target data is identified as the first data.
  • the data to be stored is screened for data of the same type as the target data in the preset historical time period (for example, the same type may include: some or all of the data in the data to be stored has the same data source as the target data Or similar; or, part or all of the data to be stored and the target data belong to the same link of business processing; or users (including developers) to read some or all of the data in the stored data and the target data Same requirements, etc.), to facilitate subsequent storage of the first data in a storage area matching the expected read delay.
  • the same type may include: some or all of the data in the data to be stored has the same data source as the target data Or similar; or, part or all of the data to be stored and the target data belong to the same link of business processing; or users (including developers) to read some or all of the data in the stored data and the target data Same requirements, etc.
  • the foregoing method further includes: identifying second data in the foregoing data to be stored, where the foregoing second data is data whose frequency of reading from the foregoing SSD is lower than that of the foregoing first data; Among the multiple storage areas, select a second storage area that matches the read delay of the second data, and the read delay of the second storage area is higher than that of the first storage area; store the second data in the second storage area.
  • the second data that meets the characteristics of the specific data and is different from the first data is identified (for example, the reading frequency is lower than the first data), and the foregoing second data is stored in the second data that matches the read delay.
  • the storage area, the classified storage of data effectively stores data based on the characteristics of the storage area, and improves the efficiency of reading the required data.
  • the embodiment of the present application does not specifically limit the second data that meets the specific data characteristics and the aforementioned specific data characteristics.
  • the foregoing method further includes: counting the read frequency of reading data from the foregoing SSD within a preset historical time period; and determining the read frequency of the foregoing SSD that is higher than the foregoing preset frequency threshold.
  • the data is determined as the aforementioned target data.
  • the reading frequency of data in the SSD is counted regularly or irregularly, and the data in the SSD is determined as the target data according to a preset reading frequency threshold.
  • the determined target data is used as one of the identification criteria of the first data in the subsequent data to be stored, wherein the target data and the preset frequency threshold can be adjusted and updated according to actual needs and actual usage.
  • counting the frequency of reading data from the aforementioned SSD within a preset historical time period includes: counting the data stored in each of the multiple storage areas of the aforementioned SSD in the pre-determined period. Set the number of historical readings in the historical time period; according to the number of historical readings, determine the aforementioned reading frequency of the data stored in each of the aforementioned storage areas.
  • by calculating the reading frequency of the data that has been stored in the solid-state hard disk it is beneficial to optimize the storage area configuration of the stored data, and facilitate subsequent adjustments of the data storage area according to the actual data reading situation, and improve the overall performance. The efficiency of data reading is required, thereby improving the business processing performance of the main control device.
  • the aforementioned SSD further includes a buffer storage area; the aforementioned method further includes: buffering the aforementioned first data in the aforementioned buffer storage area.
  • a buffer storage area can be added to store part of the data through the buffer storage area; when the SSD is normally powered on, it is convenient for the main control (such as a processor or Server) can obtain the required data directly from the buffer storage area with probability, and further reduce the average read delay of SSD on the basis of the embodiment of the present application, and is suitable for low cost requirements but high data read efficiency requirements Application scenarios.
  • the aforementioned buffering of the first data in the aforementioned buffer storage area includes: after receiving a write command of the aforementioned first data, storing the aforementioned first data in the aforementioned buffer storage area according to the aforementioned write command.
  • the first data is stored in the buffer storage area according to the received write command, and the data can be accurately stored.
  • the foregoing method further includes: when receiving the read command of the foregoing first data, preferentially reading the foregoing first data from the foregoing buffer storage area.
  • the first data is read from the buffer storage area according to the read command, and the read delay of the first data is further reduced and the processing speed of the device is increased in the case of specific requirements.
  • the aforementioned method further includes: when the data amount of the aforementioned first data is greater than the storage capacity of the aforementioned first storage area, storing part of the aforementioned first data in the aforementioned second storage area; or, When the data amount of the aforementioned second data is greater than the storage capacity of the aforementioned second storage area, storing part of the aforementioned second data in the aforementioned first storage area.
  • data is stored according to the relationship between the amount of data and the storage capacity of the storage area. For example, when the amount of second data is large, part of the data is stored in the first storage area; the data is stored flexibly according to the actual amount of data, and the storage is effectively utilized. The area helps to reduce the average read delay as a whole.
  • an embodiment of the present application provides a data storage method of a solid state hard drive (SSD), and the method may include:
  • the data to be stored is received, and the first data in the data to be stored is identified, where the first data is data containing a designated identifier, and the designated identifier is used to indicate the read delay requirement of the first data; Among the plurality of storage areas, a first storage area matching the read delay of the first data is selected according to the aforementioned designated identifier; the aforementioned first data is stored in the aforementioned first storage area.
  • the first data is identified by a designated identifier (such as a data number, command or field, etc.) from the received data to be stored, and the aforementioned first data is stored in the first storage area matching its read delay, thereby The average read delay generated in the process of reading the foregoing first data is reduced, and the service processing performance of the device equipped with the foregoing SSD is improved.
  • the built-in SSD cache module causes the SSD controller to determine whether the read/write command hits the cache, and requires multiple addressing processes; through the implementation of the embodiments of this application, the production is reduced while meeting certain business requirements.
  • the foregoing method further includes: identifying second data in the foregoing data to be stored, where the foregoing second data is data whose frequency of reading from the foregoing SSD is lower than that of the foregoing first data; Among the multiple storage areas, select a second storage area that matches the read delay of the second data, and the read delay of the second storage area is higher than that of the first storage area; store the second data in the second storage area.
  • the second data that meets the characteristics of the specific data and is different from the first data is identified (for example, the reading frequency is lower than the first data), and the foregoing second data is stored in the second data that matches the read delay.
  • the storage area, the classified storage of data effectively stores data based on the characteristics of the storage area, and improves the efficiency of reading the required data.
  • the aforementioned SSD further includes a buffer storage area; the aforementioned method further includes: buffering the aforementioned first data in the aforementioned buffer storage area.
  • a buffer storage area can be added to store part of the data through the buffer storage area; when the SSD is normally powered on, it is convenient for the main control to be able to probabilistically Obtaining the required data directly from the buffer storage area further reduces the average read delay of the SSD on the basis of the embodiments of the present application, and is suitable for application scenarios that require low cost but high data read efficiency.
  • the aforementioned buffering of the aforementioned first data in the aforementioned buffer storage area includes: after receiving a write command of the aforementioned first data, storing the aforementioned first data in the aforementioned buffer storage area according to the aforementioned write command .
  • the first data is stored in the buffer storage area according to the received write command, and the data can be accurately stored.
  • the foregoing method further includes: when receiving the read command of the foregoing first data, preferentially reading the foregoing first data from the foregoing buffer storage area.
  • the first data is read from the buffer storage area according to the read command, and the average read delay of the first data is further reduced and the processing speed of the device is increased in the case of a specific demand.
  • the aforementioned method further includes: when the data amount of the aforementioned first data is greater than the storage capacity of the aforementioned first storage area, storing part of the aforementioned first data in the aforementioned second storage area; or, When the data amount of the aforementioned second data is greater than the storage capacity of the aforementioned second storage area, storing part of the aforementioned second data in the aforementioned first storage area.
  • data is stored according to the relationship between the amount of data and the storage capacity of the storage area. For example, when the amount of second data is large, part of the data is stored in the first storage area; data is stored flexibly according to the actual amount of data, and the storage is effectively utilized. The area helps to reduce the average read latency of the SSD as a whole.
  • the embodiments of the present application provide a solid state drive SSD.
  • the aforementioned SSD may include a controller and a memory connected to the aforementioned controller; wherein, the aforementioned memory may include a plurality of different types of storage areas, and each type of storage area has The read delay is different; the aforementioned controller is used to: receive the data to be stored, and identify the first data in the aforementioned data to be stored, wherein the aforementioned first data is data that matches the target data, and the aforementioned target data is from the aforementioned SSD Reading data with a frequency higher than a preset frequency threshold; selecting a first storage area matching the read delay of the first data from the plurality of storage areas; storing the first data in the first storage area; The first storage area is used to store the aforementioned first data.
  • the aforementioned controller is specifically configured to: identify part or all of the aforementioned data to be stored that has the same content as the aforementioned target data as the aforementioned first data.
  • the aforementioned controller is specifically configured to: identify part or all of the aforementioned data to be stored that is of the same type as the aforementioned target data as the aforementioned first data.
  • the aforementioned controller is further configured to: identify second data in the aforementioned data to be stored, and the aforementioned second data is data whose frequency of reading from the aforementioned SSD is lower than that of the aforementioned first data; Among the foregoing multiple storage areas, select a second storage area that matches the read delay of the second data, and the read delay of the second storage area is higher than that of the first storage area; store the second data to the second Storage area; the aforementioned second storage area is used to store the aforementioned second data.
  • the aforementioned controller is also used to: count the read frequency of reading data from the aforementioned SSD within a preset historical time period; and set the aforementioned read frequency from the SSD to be higher than the aforementioned preset
  • the frequency threshold data is determined as the aforementioned target data.
  • the aforementioned controller is specifically configured to: count the historical reading times of data stored in each of the aforementioned multiple storage areas within a preset historical time period; according to the aforementioned historical reading times , Determine the aforementioned read frequency of the data stored in each of the aforementioned storage areas.
  • the aforementioned SSD further includes a buffer storage area; the aforementioned buffer storage area is connected to the aforementioned controller; the aforementioned controller is further used for: buffering the aforementioned first data to the aforementioned buffer storage area; the aforementioned buffer storage Area, used to store the aforementioned first data.
  • the aforementioned controller is specifically configured to: after receiving a write command of the aforementioned first data, store the aforementioned first data in the aforementioned buffer storage area according to the aforementioned write command.
  • the aforementioned controller is further configured to: when receiving the aforementioned first data read command, preferentially read the aforementioned first data from the aforementioned buffer storage area.
  • the aforementioned controller is further configured to: when the data amount of the aforementioned first data is greater than the storage capacity of the aforementioned first storage area, store part of the aforementioned first data in the aforementioned second storage area Or, when the data amount of the aforementioned second data is greater than the storage capacity of the aforementioned second storage area, store part of the aforementioned second data in the aforementioned first storage area.
  • an embodiment of the present application provides a solid state drive SSD, which may include a controller and a memory connected to the aforementioned controller; wherein, the aforementioned memory includes a plurality of different types of storage areas, and the read delay of each type of storage area Different; the aforementioned controller is used to: receive the data to be stored, and identify the first data in the aforementioned data to be stored, wherein the aforementioned first data is data containing a designated identifier, and the aforementioned designated identifier is used to indicate the reading of the aforementioned first data Obtain the latency requirement; from the foregoing multiple storage areas, select the first storage area matching the foregoing first data read latency according to the foregoing designated identifier; store the foregoing first data in the foregoing first storage area; the foregoing first storage The area is used to store the aforementioned first data.
  • the aforementioned controller is further configured to: identify second data in the aforementioned data to be stored, and the aforementioned second data is data whose frequency of reading from the aforementioned SSD is lower than that of the aforementioned first data; Among the foregoing multiple storage areas, select a second storage area that matches the read delay of the second data, and the read delay of the second storage area is higher than that of the first storage area; store the second data to the second Storage area; the aforementioned second storage area is used to store the aforementioned second data.
  • the aforementioned SSD further includes a buffer storage area; the aforementioned buffer storage area is connected to the aforementioned controller; the aforementioned controller is further used for: buffering the aforementioned first data to the aforementioned buffer storage area; the aforementioned buffer storage Area, used to store the aforementioned first data.
  • the aforementioned controller is further configured to: when receiving the aforementioned first data read command, preferentially read the aforementioned first data from the aforementioned buffer storage area.
  • an embodiment of the present application provides a data storage device for a solid state drive (SSD).
  • the device may include: a first receiving unit for receiving data to be stored; and a first identifying unit for identifying the aforementioned data to be stored The first data, wherein, the first data is data that matches the target data, and the target data is data that is read from the SSD with a frequency higher than a preset frequency threshold; the first selection unit is used to obtain data from the SSD Among the multiple storage areas, the first storage area matching the read delay of the first data is selected; the first storage unit is used to store the first data in the first storage area.
  • the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period; the aforementioned first identification unit is specifically used to: Part or all of the data that has the same content as the aforementioned target data is identified as the aforementioned first data.
  • the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period; the aforementioned first identification unit is specifically used to: Part or all of the data with the same type as the aforementioned target data is identified as the aforementioned first data.
  • the aforementioned device further includes a first storage area classification unit for identifying the second data in the aforementioned data to be stored, and the aforementioned second data is read from the aforementioned SSD with a lower frequency than the aforementioned first data.
  • the second data is stored in the aforementioned second storage area.
  • the foregoing device further includes a target data determining unit, configured to: count the read frequency of reading data from the foregoing SSD within a preset historical time period; and set the read frequency of the foregoing SSD to be high
  • the data at the aforementioned preset frequency threshold is determined as the aforementioned target data.
  • the aforementioned target data determining unit is specifically configured to: count the historical reading times of data stored in each of the multiple storage areas of the SSD; and determine the aforementioned historical reading times according to the aforementioned historical reading times. The aforementioned reading frequency of the data stored in each storage area.
  • the aforementioned SSD further includes a buffer storage area; the aforementioned device further includes a first cache unit for: buffering the aforementioned first data in the aforementioned buffer storage area.
  • the foregoing first buffer unit is specifically configured to store the foregoing first data in the foregoing buffer storage area according to the foregoing write command after receiving a write command of the foregoing first data.
  • the aforementioned device further includes a first reading unit, configured to: when receiving the aforementioned first data read command, preferentially read the aforementioned first data from the aforementioned buffer storage area.
  • the aforementioned device further includes a first decision-making unit, configured to store part of the aforementioned first data in the aforementioned first data when the data amount of the aforementioned first data is greater than the storage capacity of the aforementioned first storage area.
  • an embodiment of the present application provides a data storage device for a solid-state hard drive (SSD).
  • the device may include: a second receiving unit for receiving data to be stored; and a second identifying unit for identifying the aforementioned data to be stored
  • the aforementioned first data is data containing a designated identifier, and the aforementioned designated identifier is used to indicate the read delay requirement of the aforementioned first data;
  • the second selection unit is used to obtain data from multiple storage areas of the aforementioned SSD
  • the first storage area that matches the read delay of the first data is selected according to the aforementioned designated identifier; the second storage unit is used to store the aforementioned first data in the aforementioned first storage area.
  • the aforementioned device further includes a second storage area classification unit for identifying the second data in the aforementioned data to be stored, and the aforementioned second data is read from the aforementioned SSD with a lower frequency than the aforementioned first data.
  • the second data is stored in the aforementioned second storage area.
  • the aforementioned SSD further includes a buffer storage area; the aforementioned device further includes a second cache unit for: buffering the aforementioned first data in the aforementioned buffer storage area.
  • the foregoing second buffer unit is specifically configured to store the foregoing first data in the foregoing buffer storage area according to the foregoing write command after receiving the foregoing write command of the first data.
  • the aforementioned device further includes a second reading unit, configured to: when receiving the aforementioned first data read command, preferentially read the aforementioned first data from the aforementioned buffer storage area.
  • the aforementioned device further includes a second decision-making unit, configured to store part of the aforementioned first data in the aforementioned first storage area when the amount of the aforementioned first data is greater than the storage capacity of the aforementioned first storage area.
  • an embodiment of the present application provides a chipset that includes at least one processor for supporting the realization of the functions involved in the first or second aspect, for example, receiving data to be stored and identifying the aforementioned The first data in the data to be stored.
  • the aforementioned chipset further includes at least one first memory and at least one second memory; wherein, the aforementioned at least one first memory and the aforementioned at least one processor are interconnected by wires, and the aforementioned first memory stores Instruction; when the foregoing instruction is executed by the foregoing processor, the foregoing method of any one of the foregoing first aspect or the foregoing second aspect is implemented; the foregoing at least one second memory and the foregoing at least one processor are interconnected by wires, and the foregoing second memory is Store the data to be stored in any one of the foregoing methods in the first aspect or the second aspect.
  • the chipset can be composed of chips, or it can include chips and other discrete devices.
  • an embodiment of the present application provides a computer-readable storage medium in which a computer program is stored.
  • the computer program is executed by a processor, any one of the first aspect or the second aspect is implemented. Possible implementations are described in the method.
  • an embodiment of the present application provides a computer program, the computer program includes instructions, when the computer program is executed by a computer, the computer can execute the data storage of the SSD of any one of the first aspect or the second aspect. The flow of the method.
  • FIG. 1 is a schematic diagram of a data storage architecture of a solid-state hard drive (SSD) provided by an embodiment of the present application;
  • SSD solid-state hard drive
  • FIG. 2 is a schematic diagram of a logical module of an SSD provided by an embodiment of the present application
  • FIG. 3 is a schematic diagram of an SSD data exchange channel provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a connection between SSD and Flash Die according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a data storage process of an SSD provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of an SSD data storage method provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of another SSD data storage process provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of another SSD data storage process provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of an SSD average read delay analysis provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of another SSD data storage method provided by an embodiment of the present application.
  • FIG. 11 is a schematic diagram of yet another SSD data storage method provided by an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of an SSD data storage device provided by an embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of another SSD data storage device provided by an embodiment of the present application.
  • component may be, but is not limited to, a process, an object, an executable file, an execution thread, a program, etc. running on the processor.
  • application running on the computing device and the computing device can be components.
  • One or more components may reside in a process or thread of execution, and the components may be located on one computing device or distributed among two or more computing devices.
  • these components can be executed from various computer readable media having various data structures stored thereon.
  • Solid State Drive is a hard drive made of an array of solid-state electronic storage chips.
  • the SSD is composed of a control unit and a storage unit (Flash chip, DRAM chip). Its chip has a wide operating temperature range and has a wide range of applications.
  • flash memory Flash chip
  • DRAM dynamic random access memory
  • the solid-state drive involved in this application is a flash-based solid-state drive, that is, an SSD that uses a Flash chip as a storage medium. Its appearance can be made into a variety of shapes, such as: notebook hard drives, micro hard drives, memory cards, U disks and other styles.
  • NAND Flash is a non-destructive storage technology. NAND Flash memory cells are divided into cell, die, block, page, cell, etc. A cell is the smallest memory unit. Multiple cells form a page (page); multiple pages form a block (block); multiple blocks form a die.
  • NAND Flash can save data after power off, it also has the following hardware features: After a memory cell is programmed, the data represented can be changed from logic 1 to logic 0, but this unit cannot be written to. Reverting to logic 1 requires erasing (erase) before reverting to logic 1. Generally, the smallest unit of erase in a flash memory is called a block. The operation time of erasing is generally longer than the operation time of reading and writing.
  • SSD flash memory particles are mainly divided into single-level storage cells (Single-Level Cell, SLC), dual-level storage cells (Multi-Level Cell, MLC), three-level storage cells (Trinary-Level Cell, TLC) and Quadruple-Level Cells (Quadruple-Level Cell, QLC), and even multi-layer storage cells may appear; among them, TLC includes 3D-TLC and 2D-TLC; 3D-TLC can be subdivided into 32-layer 3D-TLC, 64-layer 3D-TLC and 96-layer 3D-TLC.
  • the solutions of the various embodiments of the present application are not only applicable to TLC of 2D structure, but also applicable to TLC of 3D structure; the scope of application of the solutions of the present application is not limited.
  • Logical block address (Logical Block Address, LBA) is a general mechanism for describing the location of data on a storage device, and is generally used in auxiliary memory devices such as hard disks.
  • LBA can refer to the address of a certain data block or the data block pointed to by a certain address.
  • LBA is equal to the house address we usually use (for example: No. 26, Zhongshan 4th Road, Guangzhou City, Guangdong province, People's Republic of China).
  • the so-called logical block on a computer is usually 512 or 1024 bits.
  • the standard CD in ISO-9660 format uses 2048 bits as a logical block size.
  • PBA Physical Block Address
  • LBA the latitude and longitude used for GPS positioning.
  • LBA the latitude and longitude used for GPS positioning.
  • LBA the latitude and longitude used for GPS positioning.
  • LBA the latitude and longitude used for GPS positioning.
  • the latitude and longitude of the aforementioned house address are: east longitude: 113°16′40.0621′′, north latitude: 23°07′37.6129′′.
  • LBA Physical Block Address
  • SSD due to the characteristics of NAND flash memory, the relationship between LBA and PBA is no longer fixed. Therefore, SSD needs FTL for address conversion to match the existing file system.
  • the SSD controller uses the mapping table of LBA and PBA to manage the flash memory.
  • the controller When there is data that needs to be updated to be written, the controller will write the new data into the blank flash memory space (in the erased state), and then update the mapping table data to point the LBA to the new PBA.
  • the original PBA becomes invalid data. If the PBA wants to write data again, it needs to be erased first.
  • Flash Translation Layer is a mapping algorithm from LBA to PBA.
  • the unit of reading and writing of flash memory is a page (the size of a page is generally a multiple of 4KB), but the operating system reads and writes data according to the sector size of the HDD (512 bytes (Byte)); in addition, flash erasing is done by block Units and blocks cannot store data correctly without being erased, causing the common file system of the operating system to be unable to manage SSDs.
  • SSD uses software to virtualize the operation of flash memory into independent sector operations of the disk, then FTL must be used.
  • FTL exists between the file system and the physical medium (flash memory).
  • the operating system only needs to operate the LBA, and FTL is responsible for all the conversion from LBA to PBA. Specifically, when the file system sends an instruction to write or update a specific logical page, FTL actually writes the data to a different free physical page and updates the mapping table (the associated data of LBA and PBA), and The "old data" contained on this page is marked as "invalid” (that is, the updated data has been written into the new PBA, and the data at the old address is naturally invalid).
  • Map Table used when reading a user page (Host Page), SSD first finds the physical page (Physical Page) corresponding to the Host Page, and then accesses Flash to read the corresponding Host data .
  • Host Page is the basic unit for Host to access SSD; Host accesses SSD through LBA, and each LBA represents a Sector (usually 512B in size), and the operating system generally accesses SSD in 4K units.
  • Flash Page is the basic unit to access Flash, among which Flash Page is called Physical Page.
  • the SSD master Each time the Host writes a Host Page, the SSD master will find a Physical Page to write the Host data, and such a map is also recorded inside the SSD. With this mapping relationship, the next time the Host needs to read a Host Page, the SSD knows where to read the data from the Flash.
  • the buffer or buffer storage area, is a part of the memory space, that is, a certain storage space is reserved in the memory space for buffering input or output data.
  • the buffer is divided into input buffer and output buffer according to whether it corresponds to an input device or an output device.
  • the function of the buffer zone can include the following 2 points: 1. Data can be directly sent to the buffer zone, and high-speed devices no longer need to wait for low-speed devices, which improves the efficiency of the device. For example: using SSD to store data, part of the data can be directly sent to the buffer of the SSD according to the write command. 2. The number of reads and writes of storage media can be reduced. Frequent small block write operations will greatly aggravate the life loss of the SSD.
  • the buffer or data buffer mentioned in the various embodiments of the present application refers to a buffer storage area.
  • Host interface, or data bus can include SATA, SAS, PCIe, etc.
  • Serial ATA Serial Advanced Technology Attachment, Serial ATA
  • Serial ATA is a computer bus that is responsible for data transmission between the motherboard and mass storage devices (such as hard disks and optical drives), and is mainly used in personal computers;
  • the two cables of serial SCSI Serial Attached SCSI, SAS
  • SAS Serial Attached SCSI
  • SAS Serial Attached SCSI
  • SAS Serial Attached SCSI
  • Serial Attached SCSI is a serial-attached SCSI interface, that is, a serial-attached small computer system interface; the same as SATA hard disks, serial technology is used to obtain higher transmission speeds, and the internal space is improved by shortening the connection line Wait.
  • PCI Express bus (ie PCIe) is a high-speed serial replacement of the older PCI/PCI-X bus; PCI Express is based on a point-to-point topology, with a separate serial link connecting each device to the root system (host). Due to its shared bus topology, the PCI bus in a single direction can be arbitrated (in the case of multiple hosts), and limited to one host at a time; in addition, the PCI Express bus link supports full duplex between any two endpoints There are no inherent restrictions on industrial communications, and concurrent access across multiple endpoints at the same time.
  • Garbage collection mechanism The basic principle of this mechanism is to centrally move the valid data (non-garbage data) in several blocks in the SSD to a new block, and then erase these blocks to make them usable block. Therefore, a new SSD that has just been bought has a very fast writing speed, because it can always find a usable block for writing at the beginning. However, as the use time or number of uses of the SSD increases, its writing speed will slow down. The reason is that after the SSD is full, when new data needs to be written, it is often necessary to do the above-mentioned garbage collection: move the valid data on several blocks to a block, then erase the original block, and then put the Host data Writing, resulting in more time-consuming than the initial search for available blocks to write.
  • WL Wear Leveling
  • WL includes two algorithms: dynamic WL algorithm and static WL algorithm. Whether WL is used or not, and which WL algorithm is used, has a great impact on the lifespan of the SSD. Flash has a certain life span, which is measured by the P/E number (Program/Erase Count). If the SSD concentrates on erasing and writing certain blocks, these blocks will soon run out of life. For example, if some data needs to be updated frequently, then the block where the data is located needs to be frequently erased and written, and the life of these blocks may be exhausted quickly.
  • P/E number Program/Erase Count
  • I/O interface can be the link between the controlled object and the controlled object for information exchange.
  • the host computer exchanges data with external devices through the I/O interface.
  • most of the specific programs involved in the I/O interface are programmable, that is, their working mode can be controlled by the program.
  • FIG. 1 is a schematic diagram of a data storage architecture of a solid state drive SSD provided by an embodiment of the present application.
  • the architecture shown in FIG. 1 mainly takes the solid state drive SSD as the main body and is described from the perspective of data writing.
  • the data storage method of the solid-state hard disk proposed in this application can be applied to the system architecture.
  • the system architecture includes a main control 10 (Host, the figure includes a processor 101 as an example for illustration) and a solid state drive (SSD) 20; among them, Figure 1 takes the controller 201 and the memory 202 integrated inside the solid state drive 20 as
  • the solid-state hard disk 20 may include a controller 201 and a memory 202; optionally, the controller 201 may be a processing device independent of the solid-state hard disk 20, and is connected to the memory 202 in the solid-state hard disk 20 to perform data storage and data storage. Operations such as reading and data modification; and the memory 202 may also be an independent storage device, which will not be repeated here. As shown in FIG.
  • the memory 202 may include multiple Flash storage areas, such as Flash0, Flash1,..., FlashN, etc., where N is an integer greater than zero.
  • the multiple Flash storage areas may include multiple storage areas with different read delays, and the specific read delays of the storage areas are not limited here.
  • the processor 101 when it processes a service, it sends a write command of the target data to the SSD 20, and the write command instructs the SSD 20 to select a target storage area suitable for storing the target data according to preset rules, and store the data to be stored in the target storage area .
  • the operation of matching and storing the target data in the target storage area and storing the target data may be performed simultaneously or in a reasonable order.
  • the write command may include instructing the SSD 20 to store data of a certain length or amount of data in a specific storage area (that is, a target storage area).
  • the processor 101 sends the write command a of the data A to the SSD 20, and the SSD 20 receives the write command a and the data A through the data bus.
  • the controller 201 of the SSD 20 analyzes the write command a, and identifies whether the data A belongs to the type of the first data (that is, it conforms to the characteristic that is frequently read or is identified as the frequently read data). After confirming that the data A is the first data, a storage area with a low read latency is selected from a plurality of storage areas in the memory 202 to store the data A.
  • the controller 201 of the SSD 20 can automatically re-categorize and identify the data according to the reading frequency of the data to be stored during the storage area change process, and store the data of different reading frequency categories to the data reading delay.
  • the matching storage area for example, the higher the historical reading frequency of the data to be stored is, the data to be stored is stored in the storage area with the lower the reading delay.
  • the solid state drive can be configured in different devices and correspond to different main control forms in different devices.
  • the embodiment of the present application does not limit the main control form, such as a server or a personal computer.
  • the solid state drive 20 interacts with the central processing unit CPU of the computer through a data bus.
  • the computer sends writes to the solid state drive (SSD) 20 through the data bus.
  • SSD solid state drive
  • the server When the aforementioned solid state drive is configured in a server (that is, the main controller 10 is a server, the server is the main server of the entire server network, which handles all transactions in the server network), the server is performed through Wi-Fi, mobile network, or wired connection Communicate and process data. For example, the server sends a write command to the solid state drive (SSD) 20 through the data bus to write specific data to the SSD 20.
  • SSD solid state drive
  • Other structures and functions are similar to the aforementioned electronic devices, and the specific data storage scenario after the SSD is configured also applies to the application scenario illustrated in the embodiment of the present application, which will not be repeated here.
  • an embodiment of the present application also provides a diagram of an SSD data storage device involving the interaction between a Host and an SSD, which can be applied to the system architecture shown in FIG.
  • a schematic diagram of the logic module of the SSD provided by the application embodiment; as shown in FIG. 2, the built-in logic module of the SSD in the embodiment of the application may include: Interface module (that is, interface 203, which also includes the aforementioned data bus), controller The module (that is, the SSD controller 201, which is also the aforementioned controller 201) and the NAND Flash Array module (that is, the flash memory array 205, which is also the aforementioned memory 202). among them,
  • the Interface module 203 is used to connect to Host 10 and undertake the functions of reading and writing command reception and data transmission; this embodiment of the application does not limit the Host, the processor contained in the Host, and other content in the Host, so it is not described in detail in Figure 2 Logo.
  • the controller module 201 is the control unit (ie controller) of the SSD; it can be understood that the controller (or controller unit) is the brain of the SSD device, responsible for the processing of SSD read and write commands, data distribution management, and NAND Flash management And so on.
  • a read attribute identification function module 2011 is designed in the controller module, and the function module is used to identify the attributes of the data to be stored (which can be used to determine and identify the first data); for example, It can be judged whether the data is read attribute data rd_attr_data (that is, the first data is identified from the data to be stored), and it can be judged whether the data is common data comm_data (that is, the second data is identified from the data to be stored).
  • LP and UP (the read latency of LP and UP in the embodiment of this application is lower than the read latency of MP) store read attribute data, and MP stores ordinary data; it is understandable that as shown in Figure 2
  • the shown read attribute data and common data are exemplary descriptions.
  • the NAND Flash Array module 202 may include the NAND Flash media particle group of the SSD, which is a physical carrier for the final storage of data.
  • the module may include the illustrated lower memory page (LP) 2021, middle page (MP) 2022, and upper memory page (UP) 2023.
  • the aforementioned page unit may correspond to FIG. 1
  • the specific correspondence between Flash0-FlashN shown in combination with actual considerations is not limited here; the embodiment of the present application does not limit the number of LP2021, MP2022, and UP2023. It is understandable that a typical SSD device may include multiple NAND Flash particles; the FTL and other related modules or units related to the SSD, please refer to the specific description of the related embodiments below.
  • the embodiment of the present application does not limit the connection relationship between the interface, the controller, and the flash memory array shown in the figure. It is understandable that the embodiments of the present application do not limit the Chinese translation names corresponding to LP, MP, and UP respectively, and the things referred to by the English names shall prevail.
  • SSD20 can include SSD controller 201, memory (or Flash storage array) 202, and Host interface (such as SATA interface).
  • SATA interface is not described in detail in Figure 3, please refer to the subsequent implementation.
  • the SSD controller 201 operates multiple Flash particles in parallel through a number of channels.
  • Figure 3 is a schematic diagram of an SSD data exchange channel provided by an embodiment of the present application. The two-way transmission of data or information shown in Figure 3 is described with SSD as the main body. Related illustrations and descriptions will not be introduced in detail; as shown in Figure 3, the SATA interface is connected to the SSD and the Host, and the Flash channel is connected to the SSD controller 201 and the memory 202 (including Flash Die) as an example.
  • the SSD controller 201 and multiple Flash particles There are several channels between each channel, and a flash memory particle is mounted on each channel. Taking 8 channels as an example, the controller connects 8 FlashDie through 8 channels; the Flash channel (including Flash channel 1, Flash channel 2 and Flash channel M) and FlashDie (including FlashDie1, FlashDie2 and FlashDieM) in Figure 3 are examples sexual description.
  • the SSD may also include on-board DRAM, and the on-board DRAM may be connected to the controller 201 for storing a mapping table, so as to save the space of the SSD for storing data.
  • the on-board DRAM may be connected to the controller 201 for storing a mapping table, so as to save the space of the SSD for storing data.
  • the Host writes a Host Page
  • a new mapping relationship is generated, and the new mapping relationship is added (written for the first time) or changed (written over) Map Table.
  • Map Table Map Table
  • the SSD based on Sandforce's main control does not support onboard DRAM. When it works, most of the mapping is stored in Flash, and some of it is stored in on-chip RAM.
  • the Host When the Host needs to read a piece of data, for the SSD with onboard DRAM, it only needs to look up the mapping table in the DRAM, obtain the physical address and then access the Flash to obtain the Host data. During this period, you only need to access Flash once; for Sandforce SSD, it first checks whether the mapping relationship corresponding to the Host Page is in RAM, if the mapping relationship exists in RAM, it reads Flash directly according to the mapping relationship; if the mapping relationship is If it is not in RAM, then it first needs to read the mapping relationship from Flash, and then read the Host data according to this mapping relationship; this means that compared to SSD with DRAM, it needs to read the Flash twice to get the Host The data is read out.
  • mapping relationship Cache hit the mapping relationship is on the on-chip RAM
  • the probability of the mapping relationship Cache hit is very small, so for it, basically every read needs to access the Flash twice, so it is based on the Sandforce master control
  • the SSD random read performance is not ideal.
  • FIG. 4 is a schematic diagram of the connection between an SSD and Flash Die provided by an embodiment of the present application; for the convenience of explanation, FIG. 4 only exemplarily shows a block in each Die, and each small block Represents a page (assuming the size is 4KB).
  • each of the four blocks corresponding to Channel 0-3 has 4KB of data written, and a total of 16KB of data has been written.
  • the blank area means that no data is written.
  • the SSD controller 201 will select other blocks to continue writing in the same way .
  • SSDs generally generate new available blocks through the garbage collection mechanism.
  • the SSD also uses a wear balance mechanism to ensure that the blocks in the SSD memory are used in a balanced manner, extending the service life of the SSD. It is understandable that there will still be reserved space in the SSD, which is not used to store data written to the user (such as the first data, the second data, etc.). This part of the space can not only be used for garbage collection, but also some system data inside the SSD needs to reserve space for storage, such as the aforementioned Map Table, such as SSD firmware, and other SSD system management data.
  • FIG. 5 is a schematic diagram of a data storage process of an SSD provided by an embodiment of the present application; as shown in FIG. 5,
  • the working steps of SSD can include the description of the following steps:
  • the SSD receives the write command issued by the Host.
  • the SSD ready may include powering on the SSD, initializing the SSD, and so on.
  • the SSD receives the write command, analyzes the write command through the controller, and recognizes the attribute of the data to be stored carried (or instructed) by the write command (the write command is generally used to store target data).
  • the predictable data attributes may include: read, frequent update, and rarely update, etc.
  • the embodiment of the present application refers to the aforementioned method The detailed description has already been made in the embodiment part, and will not be repeated here.
  • the SSD stores the data in a matching storage area according to the attributes of the data to be stored obtained by the judgment. Specifically, if it is the data of the read attribute (that is, Y as shown in the figure), try to store the data in the page unit with low read latency; if it is not the data of the read attribute (that is, the N in the figure), try to store the data as much as possible Stored in the page unit with high read latency.
  • the process can be ended or the storage result can be fed back to the SSD control, and further, the storage result can also be fed back to the Host.
  • the read attribute data (that is, the first data) can also be stored in the page unit with a high read delay, and ordinary data other than the first data or Data with low read delay requirements can also be selectively stored in page units with low read delay according to actual conditions.
  • the host subsequently reads the read attribute data from the SSD, the completion time of the read command will be very low.
  • adopting the solutions of the embodiments of this application can effectively reduce the time for APP to query data.
  • FIG. 6 is a schematic diagram of an SSD data storage method provided by an embodiment of the present application.
  • the data storage method of the solid state hard disk is applied to the data storage system of the solid state hard disk (including the above system architecture).
  • the data storage system of the solid-state hard disk may include a main controller (such as a processor of a server or a computer) and a solid-state hard disk SSD, where the SSD may include a controller and a memory.
  • the following will describe from a single side of the controller in the solid state hard disk with reference to FIG. 6.
  • the method may include the following steps S601 to S603.
  • Step S601 Receive data to be stored, and identify the first data in the data to be stored.
  • the controller (or SSD controller) 201 receives the data to be stored from a device (such as a processor) connected to the solid state hard disk 20 through the data bus of the solid state hard disk. Then, according to the data characteristics of the first data, the first data is identified from the data to be stored. Among them, the data characteristics may include a reading frequency higher than a preset frequency threshold, including a designated identifier and a reading frequency ranking higher in the data set, etc. The embodiment of the present application does not limit the specific data characteristics.
  • the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period;
  • the aforementioned identification of the first data in the aforementioned data to be stored includes: Identify part or all of the data that has the same content as the target data in the aforementioned data to be stored as the aforementioned first data. For example, the two are judged to be the same based on unique characteristics such as the same reading frequency and the same valid data bits.
  • the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period;
  • the aforementioned identification of the first data in the aforementioned data to be stored includes: Part or all of the data to be stored that is of the same type as the target data is identified as the first data.
  • the case of the same type may include: some or all of the data to be stored and the target data have the same or similar data source; or, some or all of the data to be stored and the target data belong to the same link of business processing needs Data; or users (including developers) have the same read requirements for some or all of the data to be stored and the target data, etc.
  • part of the data in the file (such as several GB of file data) can be stored in the SSD first.
  • the SSD controller judges the part of the data (such as hundreds of megabytes) according to certain identification rules (such as comparing the reading frequency of the data with a preset frequency threshold).
  • the data is the first data (that is, the high-frequency read data).
  • the SSD controller not only recognizes the part as the first data, but also predicts that all the data of the file to which the part of the data belongs is likely to be the first data; when the SSD receives a write command for other data in the file According to the aforementioned result of the pre-judgment, the SSD first recognizes the data belonging to the file as the first data, and stores it in the first storage area (that is, the storage area with low read latency).
  • the SSD controller determines the data to be stored
  • the indicated storage area of is consistent with the aforementioned certain storage area, and some or all of the aforementioned data to be stored is identified as the first data.
  • the historical frequency of the target data type For example, data a belongs to type A data, and type A data has historical frequency in the SSD. How to store data a can refer to the frequency of type A data.
  • the data type of data a (which can be understood as data belonging to type A) is often read by the master (in this case, you can analyze the reading situation of data a through the stored history reading records to determine whether data A is often read Take), then the controller will judge the data a as the first data.
  • the matching with the target data fails, resulting in no historical frequency to refer to and subsequent storage operations, then you can store it first and then subsequently change its storage area according to the data frequency. For example, store some or all of the data to be stored that cannot be immediately identified (maybe because it does not match the target data or cannot be identified based on the judgment conditions pre-stored in SSD, etc.) in a non-first storage area; calculate some or all of the data The frequency read from the SSD in the preset historical time period; when the read frequency is higher than the preset frequency threshold, the part or all of the data is identified as the first data. After the first data is identified, it is stored in the first storage area, the data in the original storage area is erased, and the data mapping relationship is re-established in the mapping table.
  • data B can be stored randomly, and then according to the following period of time (this time period can be autonomous Select or automatically select according to certain rules) to calculate the reading frequency of data B; then match the appropriate storage area (such as page unit or page) according to the reading frequency of data B; page or page in the embodiment of this application
  • the unit refers to the same), which reduces the average read delay for subsequent reading of data B in the SSD.
  • the data containing the first data feature can be read attribute data.
  • the so-called read attribute data can refer to data that has a greater impact on business performance by the average delay of reading the data when the processor is running (such as when running an APP).
  • the characteristics of the class data are that it is frequently read, multiple read requests form a business transaction (specifically, the SSD memory needs to be read multiple times to process a business transaction) and so on.
  • the predictable attributes can include: read, frequently updated, rarely updated, and so on. Reading is the operation of reading data from SSD. Reading can include reading of key data and reading of frequent data.
  • the reading of key data generally requires high read latency; for example, in business processing In the process, for the key data involved, it is necessary to quickly obtain these key data, and it is expected that the lower the read delay, the better.
  • Frequent data reading generally refers to frequently reading the required data, and the reading frequency is high, but it may not require a low read delay for a single reading.
  • the update is an operation to write (or store data) to the SSD, and the update can only be written but not read or the number of reads is too small. Frequent updates correspond to infrequent updates, which are distinguished based on the frequency of writing data.
  • the SSD controller 201 receives the data to be stored from the device (such as the processor 101) connected to the solid state hard disk through the interface 203 of the solid state hard disk. Then, through the read attribute recognition function module 2011, the first data is recognized from the data to be stored.
  • the first data may be data whose reading frequency is higher than a preset frequency threshold from the SSD, or the first data may be data including a designated identifier.
  • the first data may specifically be data with a frequency higher than a preset frequency threshold that is read from the SSD within a preset historical time period, where the preset historical time period may include the time period before the data to be stored is received.
  • a fixed frequency threshold is preset according to the actual application scenario; then, in the process of storing data, the preset frequency threshold is used as a standard, and data greater than the preset frequency threshold is identified as the first data.
  • the first data may be data with a higher reading frequency in the received data set (the data set may include data received by the SSD from the Host one or more times) from the SSD (such as the data set in the data set).
  • the data is sorted according to the reading frequency of the data, and the data of the first three types of reading frequency can be selected as the first data).
  • the SSD 20 may include a controller 201 and a memory (that is, a flash memory array 202);
  • the SSD 20 in the example can also include an interface (Interface, the aforementioned data bus, or Interface module) 203, a controller 201 (i.e. SSD controller, or controller module), and a flash memory array 202 (i.e., the aforementioned memory, or NAND Flash).
  • Array module The controller 201 may include a flash memory conversion layer (FTL) 2012 and a read attribute recognition function module 2011.
  • FTL flash memory conversion layer
  • the interface module 203 of the SSD20 can provide an I/O interface (ie interface 203) for receiving data; this module can be independent of the controller and the memory, or can be integrated with either or both of the controller and the memory.
  • the processor 101 of the Host sends a write command to the controller 201 of the SSD 20, which can not only include or indicate the storage location and data volume of the data to be stored, but also mark the data attributes of the data to be stored, such as a mark Part of the data to be stored is the first data (the data to be stored W1 and the data to be stored W2 as shown in FIG. 7).
  • the running APP application software
  • the SSD controller 203 can not only identify the length of the data and determine the area to be stored through the interface, but also identify the read attribute of the data (the data has been marked as read attribute data), and continue the operation of storing the data.
  • the role of each module in the embodiment of this application will not be repeated, please refer to the related description of the aforementioned device embodiment or method embodiment; the embodiment of this application does not limit the function and specific structure of each module.
  • the interface 203 of the SSD provides an I/O interface (ie interface 203) capable of receiving data to the processor 101 of the Host for receiving the data W to be stored, wherein the data W to be stored may be stored in the processor or There is no untagged data sent to the SSD.
  • I/O interface ie interface 203
  • the read attribute identification function module 2011 in the SSD controller 201 identifies the data attribute of the command, such as identifying and distinguishing W1 and W2, identifying W1 as the first data, and identifying W2 as the second data.
  • W1 in FIG. 7 may refer to the read attribute data in FIG. 2
  • W2 may refer to the ordinary data in FIG. 2.
  • the lower page (corresponding to the storage area with low read latency) preferentially stores W1 (the read attribute data to be stored, that is, the first data) as an example for illustration, and part of W1 can also be stored in UP according to the actual situation; If it is not the data of the read attribute, try to store the data in the page unit with high read delay.
  • W1 the read attribute data to be stored, that is, the first data
  • the embodiment of the present application does not limit the matching relationship between the specific data and the read delay of the specific storage area.
  • writing the tag data into the SSD by the APP is an exemplary scenario description.
  • the first data may be data containing a designated identifier, and the designated identifier is used to mark the first data; the designated identifier may be manually set, or smart marking may be performed according to a certain marking rule.
  • the content of the designated identifier may also include the preset reading frequency or read priority of the identified data, and the specific content of the designated identifier is not limited in the embodiment of the present application. For example, if the read priority of the data corresponding to the designated identification mark is high priority, then when the storage area corresponding to the data is selected, the storage area with low read latency is selected to store the data. For another example, if the preset reading frequency of the data corresponding to the designated identification mark is high-frequency reading, when the storage area corresponding to the data is selected, a storage area with a low read delay is selected to store the data.
  • the above application embodiment provides an SSD device that needs to cooperate with the Host to complete data identification and storage; in order to intuitively illustrate the aforementioned first data containing the identifier, this application embodiment provides another different SSD device and implementation solution.
  • the difference from the foregoing application embodiment is that the embodiment of the application involves the addition of a read and write frequency statistics module to the SSD without the need to cooperate with the Host, and can independently complete operations such as data identification and storage.
  • FIG. 8 is a schematic diagram of another SSD data storage process provided by an embodiment of the present application.
  • the SSD 20 in the embodiment of the present application may include a controller 201 and a memory (that is, a flash memory array 202), specifically, it may also include an interface 203 (that is, the aforementioned data bus, or interface module), a controller (controller) 201, and a flash memory array.
  • 202 that is, the aforementioned memory, or NAND Flash Array module
  • the SSD in the embodiment of the present application may also include a read attribute recognition function module 2011 and a read/write frequency statistics (Read/Write frequency statistics) module 2013.
  • the controller 201 may also include a memory translation layer (FTL) 2012.
  • FTL memory translation layer
  • the SSD 20 intelligently recognizes the attributes of the data to be persistently stored (data W as shown in FIG. 8) through the controller 201, and then combines the identified different data (data W1 and data as shown in FIG. 8). W2, the data to be stored after being distinguished by the controller in the data W) is stored in different page units.
  • the read and write frequency statistics module 2013 designed inside the SSD will count the historical read and write times of each storage area and calculate the read and write frequency of each area.
  • the granularity of the storage area can be various, for example, divided by LBA.
  • the reading attribute recognition function module 2011 judges the attribute of the data according to the information of the reading and writing frequency statistics module.
  • the interface module 203 may be independent of the controller and the memory, or may be integrated with either or both of the controller and the memory, which is not limited in the embodiment of the present application.
  • the working steps of the SSD in the embodiment of the present application are described as follows:
  • the processor issues a write command to the SSD 20 through the I/O interface, where the write command is used to instruct the SSD to receive and store part or all of the data to be stored W, where the data to be stored W It can be data that is not marked in the processor.
  • the read attribute recognition function module 2011 in the SSD controller 201 determines the attribute of the data W to be stored according to the read and write frequency statistics module 2013. As shown in FIG. 8, in the controller, part of the data in the data W may be identified as the first data (for example, the data to be stored W1) or part of the data may be identified as the second data (for example, the data to be stored W2); However, the judgment of the first data and the second data can be re-judgmented and identified according to specific rules and the reading and writing of the data. For example, the data whose reading frequency is higher than the preset reading frequency threshold is identified as the first data. A piece of data, or one or more pieces of data with a higher reading frequency in a data set are identified as the first data; this embodiment of the present application does not limit this.
  • the data to be written (including the data to be stored W1 and the data to be stored W2) are distributed and stored on the NAND Flash medium through the FTL module 2012; among them, if it is the data of the read attribute, Try to store this data in the page unit with low read latency.
  • Lower Page (corresponding to the storage area with low read latency) is used to store W1 (the read attribute data to be stored, that is, the first data), and MP is stored to be stored.
  • the data W2 is taken as an example for description; if it is not the data of the read attribute, try to store the data in the page unit with high read delay.
  • the data issued by the Host is generally evenly stored in the three page units of NAND Flash; the average read delay of the SSD is the average delay of the three pages and the controller itself The sum of data transmission delays.
  • the read attribute data frequently read by APP is stored in LP and UP.
  • APP When reading data, it is obtained from LP and UP.
  • the average read delay is 59us (indicated by avg3 in Figure 9), and the average delay of SSD controller data transmission is also 20us (indicated by avg4 in the figure)
  • the embodiment of the present application does not limit the amount of data to be stored, and does not limit the application scenario.
  • the APP writing unmarked data to the SSD is an exemplary scenario description. It should be noted that, for the functions of the SSD described in the embodiments of the present application, reference may be made to related descriptions in the method embodiments described in FIG. 6, FIG. 10, and FIG. 11, which will not be repeated here.
  • the aforementioned first data classification may have a situation where the classification overlaps, for example, the initial identifier for data A is the first data (that is, the designated identifier is included), but In the actual writing, updating, and reading process, the calculation found that the read frequency of data A is low, or the priority is lower than other types of data, or low read latency is not required, etc.; then data A can be returned
  • the class is non-first data.
  • data B has a low read frequency in a certain business processing stage, but data B needs to be read at a high frequency in another business processing stage.
  • the attributes of data B can be re-judged, or data B can be added with timeliness The designated logo, etc.
  • the embodiment of the present application does not specifically limit the classification and recognition mode of the first data.
  • the controller recognizes the first data in the data to be stored while receiving the data to be stored.
  • the data volume of the data to be stored received by the controller at one time is determined by the size of the built-in storage module of the controller.
  • the controller receives a write command, where the write command is used to instruct the control
  • the device stores a certain length or amount of data to be stored in a designated area.
  • Step S602 From the multiple storage areas of the SSD, select a first storage area that matches the first data read delay.
  • the controller selects the first storage area in the memory that matches the expected read delay of the first data according to the first data, for example, according to the data characteristics of the first data (for example, the read delay is required due to frequent reading). Lower), the read delay of the matched first storage area is relatively low or the lowest among the read delays of the multiple storage areas of the SSD.
  • the embodiment of the present application does not limit the specific content involved in the expected read delay of the data.
  • the first storage area may be one or several storage areas among Flash0-FlashN in FIG. 1.
  • the SSD controller 203 selects the storage area 2021 (LP) and the storage area 2023 (UP) in the flash memory array 205 that match the read delay expected by the read attribute data according to the read attribute data.
  • the first data can also be classified into first data with different priorities according to the importance and reading frequency of the specific data.
  • the first data with the highest priority should generally be stored in the first storage area first.
  • the storage area with the lowest read delay, and the first data with a slightly lower priority can wait for the first data with the highest priority to be stored, and then store it to the storage with the same or slightly higher read delay than the lowest read delay.
  • the embodiment of the application does not specifically limit the specific storage method that does not affect the core of the application.
  • the multiple storage areas of the SSD may be classified into a storage area with low read latency, a storage area with medium read latency, and a storage area with high read latency.
  • TLC-type media For example, most SSD products in the industry currently use TLC-type media.
  • One cell of TLC NAND Flash can store 3 bits of information. In terms of logical division, each bit in a cell belongs to a different page, so TLC NAND Flash can include three types of page units, specifically Lower Page, Middle Page, and Upper Page; the names of these three page (page) units and their There is no inevitable connection to the lengthening of the reading time.
  • the storage characteristics of each page unit are different, especially the delay of the read operation (or read command), which is not specifically limited in the embodiment of the present application.
  • the read latency of the Lower Page of Toshiba BiCS4TLC is about 60us, while that of the Middle Page is about 80us, and that of the Upper Page is about 58us. It is understandable that the read latency of Middle Page is nearly 20% higher than that of the other two pages.
  • This difference in read latency also exists on QLC NAND Flash media; it is understandable that, as far as the current prior art is concerned, the embodiments of this application are more suitable for TLC and QLC, but the embodiments of this application are more effective in this application.
  • the media applied in the various embodiments involved are not limited.
  • different types of storage media generally include pages of different categories.
  • Each bit in the cell belongs to a different page; a cell of MLC stores 2 bits of information, so the cell has 4 states (11, 10, 01, 00), and Flash uses 4 kinds of charge to represent the aforementioned 4 kinds of cells status. Flash uses different read voltages to determine the data stored in the current cell. For example, for Lower Page, only one read voltage can be used to determine whether the data of the page is 0 or 1, but for Upper Page, it may be necessary to read the cell multiple times with three read voltages to determine whether the page is 0 or 1.
  • NAND Flash media can be classified into four types: SLC, MLC, TLC, and QLC according to the amount of data stored in the cell. The embodiment of the present application is more suitable for both TLC and QLC NAND Flash media.
  • Step S603 Store the first data in the first storage area.
  • the controller may directly store the first data in the first storage area in the memory through the received write command.
  • the controller receives the write command and analyzes the write command to obtain the tasks that the controller should perform.
  • the controller directly stores the data obtained by the SSD through the data bus from the data bus to the corresponding storage area according to the write command without passing through the controller.
  • the SSD controller 203 stores the read attribute data in the storage area 2021 (LP) and the storage area 2023 (UP) according to the write command.
  • the first data is identified from the received data to be stored (the first data may be data that needs to be read quickly from the SSD, for example, the reading frequency from the SSD is higher than a preset One or more of frequency threshold data, data containing a designated identifier, and data with a higher read frequency in the data set, where the data set may include data received by the SSD from the Host one or more times), and
  • the first data is stored in the first storage area matching the read delay, thereby reducing the average read delay generated in the process of reading the first data, and improving the service processing performance of the device equipped with the SSD.
  • the built-in cache module of the SSD causes the SSD controller to determine whether the read/write command hits the cache, and multiple addressing processes are required; in the embodiment of the present application, the internal cache module (or called Data caching module) to reduce the cost of production materials while meeting certain business requirements, and at the same time avoid the data caching module’s secondary addressing and increase the processing load of the SSD controller; more importantly, the SSD storage medium-based The feature stores data in a purposeful and reasonable manner, reduces the complexity of the solution implementation, and reduces the average read delay of the SSD. The effect is obvious.
  • FIG. 10 is a schematic diagram of another SSD data storage method provided by an embodiment of the present application.
  • the data storage method of the solid state disk is applied to the data storage system of the solid state disk (including the above system architecture).
  • the data storage system of the solid-state hard disk may include a main controller (such as a processor of a server or a computer) and a solid-state hard disk SSD, where the SSD may include a controller and a memory.
  • the following will describe from a single side of the controller in the solid state hard disk with reference to the accompanying drawings.
  • the method may include the following steps S1001-step S1010, and optional steps may also include step S1004-step S1010.
  • Step S1001 Receive data to be stored, and identify the first data in the data to be stored.
  • step S601 Please refer to the specific description of the foregoing step S601, which will not be repeated here.
  • the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period;
  • the aforementioned identification of the first data in the aforementioned data to be stored includes: Identify part or all of the data that has the same content as the target data in the aforementioned data to be stored as the aforementioned first data. For example, it can be judged whether the two are the same according to conditions such as whether the reading frequency is consistent and whether the data valid bit is consistent.
  • the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period;
  • the aforementioned identification of the first data in the aforementioned data to be stored includes: Identify part or all of the data to be stored that has the same type as the target data as the first data. For example, judging whether some or all of the data in the data to be stored is the same or similar to the data source of the target data; or whether they belong to the data required by the same link of business processing; or users (including developers) treat part of the stored data Or whether the reading requirements of all data and target data are the same, and so on.
  • the embodiments of the present application do not limit specific identification conditions.
  • the foregoing method further includes: counting the read frequency of reading data from the foregoing SSD within a preset historical time period; and determining the read frequency of the foregoing SSD that is higher than the foregoing preset frequency threshold.
  • the data is determined as the aforementioned target data.
  • the controller 201 determines the frequency at which data is read from the SSD within a preset historical time period, and identifies data with a frequency higher than a preset frequency threshold as the target data.
  • the target data may be data whose read frequency is higher than a preset frequency threshold from the SSD.
  • the user information is data to be stored, and content such as chat history and name is each data in the data to be stored.
  • the controller can calculate the historical reading frequency of these data according to the data types and data objects frequently called by the processor during the running of the APP. For example, if the reading frequency corresponding to the chat history and the transaction history is higher than the preset frequency threshold, then these two types of data are data that are frequently read from the SSD, and can be identified (or judged) as the first data.
  • the controller may perform a reading frequency calculation for each data in the received and stored data.
  • the reading frequency of the historical calculation can be retained, and then the reading frequency of the historical calculation can be used for the data belonging to the chat history.
  • the data is identified, and it is judged whether it is the first data.
  • the reading frequency of each type or category of data may be updated in combination with the reading frequency calculated subsequently.
  • Step S1002 From the multiple storage areas of the SSD, select a first storage area matching the first data read delay.
  • step S602 please refer to the specific description of the foregoing step S602, which will not be repeated here.
  • Step S1003 Store the first data in the first storage area.
  • step S603 please refer to the specific description of the foregoing step S603, which will not be repeated here.
  • Step S1004 Identify the second data in the data to be stored.
  • the second data may include data whose frequency of reading from the SSD is lower than that of the first data.
  • the second data may include data whose frequency of reading from the SSD is lower than that of the first data.
  • Step S1005 Select a second storage area matching the second data read delay from the multiple storage areas of the SSD.
  • the read delay of the second storage area is higher than that of the first storage area.
  • the specific process of selecting the second storage area reference may be made to the specific description of the foregoing step S602, which will not be repeated here.
  • Step S1006 Store the second data in the second storage area.
  • Step S1007 When the data amount of the first data is greater than the storage capacity of the first storage area, store part of the first data in the second storage area.
  • the controller 201 Part of the first data (for example, the first data that is read less frequently among the first data) is stored in the second storage area, so as to achieve flexible storage of the data.
  • the partial data may include a part of the first data that exceeds the storage capacity of the first storage area. For example, the part of the first data that has already filled the first storage area, and the part of the first data that exceeds the storage capacity of the first storage area.
  • a data is stored in the second storage area.
  • the data in the first storage area can be filtered and sorted according to the read frequency, and the read frequency is sorted.
  • the top ones are stored in the first storage area, and the remaining data can be optionally stored in the second storage area.
  • the part of the data may also include first data in other storage conditions.
  • first data in other storage conditions.
  • the data in it can be sorted and sorted according to the read frequency first, the read frequency sorted first is stored in the first storage area, and the remaining data can be optionally stored in the second storage area.
  • the solution provided in the embodiments of this application is a solution to reduce the average read latency of SSDs, but when it comes to actual specific data storage, it will be based on data conditions (such as data type, data volume, and data length, etc.) It is flexible to match the storage area for the data to be stored, which not only realizes the storage of all data to prevent loss, but also reduces the read delay to a certain extent. Therefore, the embodiments of the present application are not contradictory to the various embodiments of the present application. There is no limitation on the flexible storage method of actual specific data.
  • Step S1008 When the data amount of the second data is greater than the storage capacity of the second storage area, store part of the second data in the first storage area.
  • the controller 201 Part of the second data is stored in the first storage area to achieve flexible storage of the data; further, it can be used when the proportion of the second data is high and the first storage area satisfies the first data storage Using the first storage area to store the second data can not only satisfy the fast reading of the first data, but also improve the reading efficiency of the second data, and effectively reduce the read delay of the SSD.
  • the solution provided by the embodiments of this application is a solution to reduce the average read latency of SSD, but when it comes to actual specific data storage, it should be understood that it will be based on the data situation (such as data type, data volume, and data length, etc.) It is flexible to match the storage area for the data to be stored, which not only realizes the storage of all data to prevent loss, but also reduces the read delay to a certain extent. Therefore, the embodiments of the present application are not contradictory to the various embodiments of the present application. There is no limitation on the flexible storage method of actual specific data.
  • Step S1009 Buffer the first data in the buffer storage area.
  • the subsequent controller 201 generally has the following two processing results for the received read command: (1) Obtain data directly from the buffer memory module, and read under this operation The delay is relatively low; (2) The data is obtained from the NAND Flash chip and stored in the buffer memory module synchronously. In this way, the delay of the read command (that is, the read delay) may be higher than the aforementioned result (1); therefore, the The effect of the acceleration scheme in reducing the read delay is strongly related to the probability of obtaining data directly from the buffer memory module.
  • the embodiments of the present application are described on the premise of the second situation.
  • the controller 201 of the SSD stores part of the first data in the buffer storage area according to the write command; when the controller 201 receives the read command, it can query and read the first data from the buffer storage area and the memory 202 at the same time, or The first data is queried and read from the buffer storage area first, and when the target first data fails to be searched in the buffer storage area, the memory 202 of the SSD is queried and read the target first data immediately.
  • the SSD may also include a buffer storage area; wherein the buffer storage area is used to store the first data; a data cache (buffer storage area) module may only be used to cache commands sent by the Host (which may include The data involved in the read command and write command can also be cached in the metadata of the SSD.
  • the controller 201 stores the first data in the buffer storage area according to the identification carried in the first data.
  • the embodiment of the application can not only use the reading frequency of the internal statistics data of the SSD to identify the first data (or other reasonable ways to identify the first data, which will not be repeated here), but also identify the first data and match the corresponding storage area.
  • the first data in the buffer storage area of the SSD is combined to cache part.
  • the identified first data part is stored in the buffer storage area, and at the same time, the same complete data is backed up and stored in the storage area matched by the memory 202 (that is, the NAND Flash medium).
  • the data can be read from the buffer storage area first.
  • the probability hits the required data, then there is no need for secondary addressing.
  • the data can be read directly from the buffer storage area; even in the case of sudden power failure, the backup data can be obtained from the memory when it is powered on the next time. It not only reduces the average read delay but also guarantees the normal storage of data.
  • Step S1010 When receiving the read command of the first data, preferentially read the first data from the buffer storage area.
  • the SSD controller 201 preferentially reads part or all of the storage from the buffer storage area according to the command of the first data (which may include the specific identification of the first data or the storage area of the first data or the data amount of the first data).
  • the first data in the buffer storage area it can be understood that the priority of reading from the buffer storage area does not necessarily mean that the required data can be obtained from the buffer storage area in the first time, because the required data may be due to storage capacity, etc.
  • the problem is not stored in the buffer storage area.
  • the SSD controller 201 recognizes the read command from the received command, processes the recognized read command preferentially, and reads the data matching the read command; further, it can be implemented in conjunction with this application For example, thereby effectively reducing the average read latency of SSD. Specifically, the SSD controller judges whether the command received or generated by the SSD controller is a read command; if it is a read command, the SSD preferentially processes the aforementioned read command and related operations.
  • the embodiment of the present application does not specifically describe and limit the processing method of the read command (including the processing method of the optimized read command).
  • the first data is identified from the received data to be stored (the first data may be data that needs to be read quickly from the SSD, for example, the reading frequency from the SSD is higher than a preset One or more of frequency threshold data, data containing a designated identifier, and data with a higher read frequency in the data set, where the data set may include data received by the SSD from the Host one or more times), and
  • the first data is stored in the first storage area matching the read delay, thereby reducing the average read delay generated in the process of reading the first data, and improving the service processing performance of the device equipped with the SSD.
  • the built-in cache module of the SSD causes the SSD controller to determine whether the read/write command hits the cache, and multiple addressing processes are required; in the embodiment of the present application, the internal cache module (or called Data caching module) to reduce the cost of production materials while meeting certain business requirements, and at the same time avoid the data caching module’s secondary addressing and increase the processing load of the SSD controller; more importantly, the SSD storage medium-based The feature stores data in a purposeful and reasonable manner, reduces the complexity of the solution implementation, and reduces the average read delay of the SSD. The effect is obvious.
  • the data characteristics may include reading frequency higher than a preset frequency threshold, including a designated identifier, and reading frequency higher in the data set, etc.
  • the specific data characteristics are not limited in the embodiment of the present application.
  • by calculating the reading frequency of the data that has been stored in the solid state drive it is helpful to optimize the storage area of the stored data, and the data storage location can be adjusted according to the actual data reading situation, and the data reading efficiency can be improved. In turn, the service processing performance of the main control device is improved.
  • the data is classified and stored , Effectively store data based on the characteristics of the storage area, and improve the efficiency of data reading.
  • the embodiment of the present application does not limit the second data that meets the specific data feature and the specific data feature.
  • store data according to the relationship between the amount of data and the storage capacity of the storage area, such as storing part of the data in the first storage area when the amount of second data is large; store data flexibly according to the actual amount of data, and effectively use the storage area, It helps to reduce the read delay as a whole.
  • the buffer storage area module can be added again; part of the data is stored through the buffer storage area; when the SSD is normally powered on, it is convenient for the main control (such as a processor or server) to be directly from the buffer storage area with probability Obtaining the required data further reduces the average read delay of the SSD on the basis of the embodiments of the present application, and is suitable for application scenarios that require low cost but high data read efficiency. Compared with the SSD built-in buffer storage area in the prior art, the average read latency of the SSD can be reduced when the first addressing fails and the second addressing is required.
  • FIG. 11 is a schematic diagram of another SSD data storage method provided by an embodiment of the present application.
  • the data storage method of the solid state hard disk is applied to the data storage system of the solid state hard disk (including the above-mentioned system architecture).
  • the data storage system of the solid-state hard disk may include a main controller (such as a processor of a server or a computer) and a solid-state hard disk SSD, where the SSD may include a controller and a memory.
  • the following will describe from a single side of the controller in the solid state hard disk with reference to FIG. 11.
  • the method may include the following steps S1101-step S1106, and optional steps may also include step S1104-step S1106.
  • Step S1101 Receive the data to be stored, and identify the first data in the data to be stored.
  • the first data is data including a designated identifier, and the designated identifier is used to indicate the reading of the first data.
  • the delay requirement For example, after the master has identified the data, the data has the identification of the first data.
  • the data A itself carries an identifier specifying the first data; the controller directly recognizes the data as the first data from the received data according to the write command through the identifier of the first data.
  • Step S1102 From the multiple storage areas of the SSD, select a first storage area matching the first data read delay according to the designated identifier.
  • the designated identifier is used to indicate the read delay requirement of the first data; according to the content of the designated identifier (for example, the designated identifier marks the specific read frequency or read priority of the first data, the foregoing content It can be considered that it reflects the demand of read delay), and the first data is stored in the first storage area that matches the expected read delay. For example, if it is determined from the identifier that the reading frequency of the first data is the highest, then the first data can be stored in the storage area of the SSD with the smallest reading delay.
  • the data including the designated identifier in the to-be-stored data is identified as the first data.
  • the controller 201 recognizes the data carrying the designated identifier as the first data, where the data may include a fixed character in a certain position in the data field, or the data and the identifier are bound together, but the identifier does not occupy Data fields.
  • the designated identifier may be the ID or number corresponding to the data. Taking the number 1 as the first data as an example, when it is recognized that the data number in the received command is 1, then the corresponding data is stored in the first storage area.
  • the embodiments of this application do not limit the specific form of the designated identifier and how the data contains the designated identifier.
  • Step S1103 Store the first data in the first storage area.
  • step S603 corresponding to FIG. 6, which will not be repeated here.
  • the method further includes: when the data amount of the first data is greater than the storage capacity of the first storage area, storing part of the data in the first data in the second Storage area; or, when the data amount of the second data is greater than the storage capacity of the second storage area, store part of the second data in the first storage area.
  • the SSD further includes a buffer storage area; the method further includes: buffering the first data in the buffer storage area.
  • the buffering the first data in the buffer storage area includes: after receiving a write command of the first data, storing the first data in the buffer according to the write command Storage area.
  • the method further includes: when receiving a read command of the first data, preferentially reading the first data from the buffer storage area.
  • Step S1104 Identify the second data in the data to be stored.
  • the second data is data whose frequency of reading from the SSD is lower than that of the first data.
  • the designated identification of the first data marks that the first data is high-frequency read data, and the reading frequency of the second data should be lower than the reading frequency of the first data within a certain range, which is not the same as other data in this application.
  • the designated identification of the first data marks that the first data is low-frequency read data, and the reading frequency of the second data should also be lower than that of the first data within a certain range. The frequency can even be similar to the reading frequency of the first data.
  • the data that does not contain an identifier in the data to be stored is identified as the second data, and the second data is stored in a storage area with a high read delay such as a non-first storage area (such as the first storage area). Two storage area).
  • the data identifier received by the SSD may also be used to mark the data as the first data or to mark the data as the second data.
  • the main controller marks data C as high-frequency read data, and adds field c when issuing a write command; when the SSD controller receives commands and data through the interface, it directly determines that the data is the first data according to field c ( That is, high-frequency read data), and then store it in the first storage area with low read latency.
  • the main controller marks data C as low-frequency read data, and adds field d when issuing a write command; when the SSD controller receives commands and data through the interface, it directly determines that the data is the second data according to field d (ie Low-frequency read data), and then store it in the second storage area with high read latency.
  • the storage area can be changed according to the subsequent changes in the reading frequency of the data; for example, the data originally marked as high-frequency reading will have a low reading frequency in the subsequent period of time, and the data can be changed according to certain rules.
  • the data originally marked as low-frequency read will have a high read frequency in the subsequent period of time, and it can be changed according to certain rules. It is stored in the first storage area, which is beneficial to improve the data processing efficiency of the SSD and reduce the average read delay of the SSD.
  • Step S1105 Select a second storage area matching the second data read delay from the multiple storage areas of the SSD.
  • step S1005 corresponding to FIG. 10, which will not be repeated here; wherein, the read delay of the second storage area is higher than that of the first storage area.
  • Step S1106 Store the second data in the second storage area.
  • step S1006 corresponding to FIG. 10, which will not be repeated here.
  • FIG. 12 is a schematic structural diagram of an SSD data storage device provided by an embodiment of the present application.
  • the data storage device 12 of the solid state hard disk SSD includes a first receiving unit 1201, a first identifying unit 1202, and a first The selection unit 1203, the first storage unit 1204, the first storage area classification unit 1205, the first decision unit 1206, the first cache unit 1207, the first reading unit 1208, and the target data determination unit 1209.
  • the optional units may include the first A storage area classification unit 1205, a first decision-making unit 1206, a first caching unit 1207, a first reading unit 1208, and a target data determining unit 1209. among them,
  • the first receiving unit 1201 is configured to receive data to be stored
  • the first identification unit 1202 is configured to identify the first data in the aforementioned data to be stored, wherein the aforementioned first data is data that matches the target data, and the aforementioned target data is that the reading frequency from the aforementioned SSD is higher than a preset frequency threshold The data;
  • the first selection unit 1203 is configured to select a first storage area matching the first data read delay from a plurality of storage areas of the SSD;
  • the first storage unit 1204 is configured to store the first data in the first storage area.
  • the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period; the aforementioned first identification unit 1202 is specifically configured to: Part or all of the data in the stored data that has the same content as the aforementioned target data is identified as the aforementioned first data.
  • the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period; the aforementioned first identification unit 1202 is specifically configured to: Some or all data of the same type as the aforementioned target data in the stored data is identified as the aforementioned first data.
  • the device 12 further includes a first storage area classification unit 1205, configured to:
  • the second data in the data to be stored where the second data is data that is read from the SSD with a lower frequency than the first data; it is understandable that the identification of the second data is also It can be processed by the aforementioned first identification unit 1202.
  • the main function of the first storage area classification unit 1205 is to select a suitable storage area according to the stored data; for example, the storage unit corresponding to the NAND Flash medium in the memory is classified and managed according to characteristics such as read delay, for example, all Lower Pages with low read latency in Flash particles are classified as a type of storage area.
  • the first storage area classification unit 1205 can accept the call of the first storage unit 1204, that is, after the storage area selection is completed, the first storage unit 1204 can be used for storage.
  • the identification, selection (or matching) and storage functions of the first storage area classification unit 1205 mentioned in the embodiments of this application are all exemplary descriptions; the storage classification unit may be combined with some other units, or not Relying on other units to achieve corresponding functions, therefore, the embodiment of the present application does not limit the specific functions of the storage area classification unit.
  • the foregoing device further includes a target data determining unit 1209, configured to: count the read frequency of reading data from the foregoing SSD within a preset historical time period; and compare the read frequency from the foregoing SSD Data higher than the aforementioned preset frequency threshold is determined as the aforementioned target data.
  • a target data determining unit 1209 configured to: count the read frequency of reading data from the foregoing SSD within a preset historical time period; and compare the read frequency from the foregoing SSD Data higher than the aforementioned preset frequency threshold is determined as the aforementioned target data.
  • the target data determining unit 1209 is specifically configured to:
  • the SSD further includes a buffer storage area; the device 12 further includes a first caching unit 1207 configured to cache the first data in the buffer storage area.
  • the first caching unit 1207 is specifically configured to:
  • the first data After receiving the write command of the first data, the first data is stored in the buffer storage area according to the write command.
  • the device 12 further includes a first reading unit 1208, configured to: when receiving a read command of the first data, preferentially read the first data from the buffer storage area. data.
  • a first reading unit 1208 configured to: when receiving a read command of the first data, preferentially read the first data from the buffer storage area. data.
  • the required data can also be read from the NANDFlash.
  • the device 12 further includes a first decision-making unit 1206, configured to:
  • the data to be stored is received through the receiving unit, and the first data is identified therefrom, and then a suitable first storage area is selected according to the selection unit, and the first data is stored to the first data matching its read delay based on the storage unit.
  • a storage area thereby reducing the average read delay generated in the process of reading the first data, and improving the service processing performance of the device equipped with the SSD.
  • the first data may be data that needs to be read quickly from the SSD, such as data whose reading frequency is higher than a preset frequency threshold from the SSD, data containing a designated identifier, and a data set with a relatively high reading frequency.
  • the data set may include data received by the SSD from the Host one or more times.
  • the built-in cache module of the SSD causes the SSD controller to determine whether the read/write command hits the cache, and multiple addressing processes are required; in the embodiment of the present application, the internal cache module (or called Data caching module) to reduce the cost of production materials while meeting certain business requirements, and at the same time avoid the data caching module’s secondary addressing and increase the processing load of the SSD controller; more importantly, the SSD storage medium-based The feature stores data in a purposeful and reasonable manner, reduces the complexity of the solution implementation, and reduces the average read delay of the SSD. The effect is obvious.
  • the identification unit in the receiving unit According to the data characteristics of the first data, the first data is identified from the data to be stored, which facilitates subsequent data classification and storage, and efficiently stores the first data to be read. Storage area for delay matching.
  • the data characteristics may include reading frequency higher than a preset frequency threshold, including a designated identifier, and reading frequency higher in the data set, etc.
  • the specific data characteristics are not limited in the embodiment of the present application.
  • the reading frequency of the data already stored in the solid state drive is calculated by the identification unit, which is beneficial to optimize the storage area of the stored data, and can adjust the data storage location according to the actual data reading situation, and improve the data reading Efficiency, thereby improving the business processing performance of the main control device.
  • the storage area classification unit identifies the second data that meets the specific data characteristics (data characteristics that are different from the first data), and stores the second data in a second storage area that matches the read delay.
  • the classified storage of data effectively stores data based on the characteristics of the storage area and improves the efficiency of data reading.
  • the embodiment of the present application does not limit the second data that meets the specific data feature and the specific data feature.
  • the decision unit stores data according to the relationship between the amount of data and the storage capacity of the storage area, such as storing part of the data in the first storage area when the amount of the second data is large; stores the data flexibly according to the actual amount of data, and makes effective use of The storage area helps to reduce the overall read delay.
  • part of the data can be stored through the increased buffer storage area; when the SSD is normally powered on, it is convenient for the main control (such as a processor or server) to obtain the required data directly from the buffer storage area with probability ,
  • the average read delay of the SSD is further reduced, and it is suitable for application scenarios that require low cost but high data read efficiency.
  • the first addressing fails and the second addressing is required the average read delay of the SSD can be reduced.
  • the data storage device of the solid state drive SSD described in the embodiment of the present application refer to the related description of the data storage method of the solid state drive SSD in the method embodiments described in FIG. 6, FIG. 10, and FIG. 11. , I won’t repeat it here.
  • the functions of the various units involved in the data storage device of the solid state drive SSD described in the embodiments of the present application are part of the functions of the SSD controller, but do not include all the functions of the SSD controller; for example, the implementation of this application
  • the data storage device mentioned in the example does not include the process of reading data and the description of related functions in general; however, in actual application scenarios, the device generally reads or writes data and performs related operations, which are only implemented in this application. Do not give too much description in the example.
  • FIG. 13 is a schematic structural diagram of another SSD data storage device provided by an embodiment of the present application.
  • the data storage device 13 of the solid state hard disk SSD may include a second receiving unit 1301 and a second identifying unit 1302. , The second selection unit 1303, the second storage unit 1304, the second storage area classification unit 1305, the second decision unit 1306, the second cache unit 1307, and the second reading unit 1308.
  • the optional units may include the second storage area The classification unit 1305, the second decision unit 1306, the second cache unit 1307, and the second reading unit 1308. among them,
  • the second receiving unit 1301 is configured to receive data to be stored
  • the second identification unit 1302 is configured to identify the first data in the aforementioned data to be stored, wherein the aforementioned first data is data including a designated identifier, and the aforementioned designated identifier is used to indicate the read delay requirement of the aforementioned first data;
  • the second selection unit 1303 is configured to select the first storage area matching the first data read delay from the multiple storage areas of the aforementioned SSD according to the aforementioned designated identifier;
  • the second storage unit 1304 is configured to store the aforementioned first data in the aforementioned first storage area.
  • the foregoing device further includes a second storage area classification unit 1305, configured to: identify the second data in the foregoing data to be stored, and the foregoing second data is read from the foregoing SSD with a lower frequency than the foregoing Data of the first data; from the plurality of storage areas of the aforementioned SSD, select a second storage area that matches the read delay of the aforementioned second data, and the read delay of the aforementioned second storage area is higher than the aforementioned first storage area; The aforementioned second data is stored in the aforementioned second storage area.
  • a second storage area classification unit 1305 configured to: identify the second data in the foregoing data to be stored, and the foregoing second data is read from the foregoing SSD with a lower frequency than the foregoing Data of the first data; from the plurality of storage areas of the aforementioned SSD, select a second storage area that matches the read delay of the aforementioned second data, and the read delay of the aforementioned second storage area is higher than the aforementioned first storage area; The
  • the aforementioned SSD further includes a buffer storage area; the aforementioned device further includes a second cache unit 1307 configured to cache the aforementioned first data in the aforementioned buffer storage area.
  • the aforementioned second buffer unit 1307 is specifically configured to: after receiving the aforementioned write command of the first data, store the aforementioned first data in the aforementioned buffer storage area according to the aforementioned write command.
  • the aforementioned apparatus further includes a second reading unit 1308, configured to: when receiving the aforementioned first data read command, preferentially read the aforementioned first data from the aforementioned buffer storage area.
  • the aforementioned device further includes a second decision-making unit 1306, configured to store part of the aforementioned first data in the aforementioned first data storage area when the amount of the aforementioned first data is greater than the storage capacity of the aforementioned first storage area.
  • the aforementioned second storage area or, when the data amount of the aforementioned second data is greater than the storage capacity of the aforementioned second storage area, storing part of the aforementioned second data in the aforementioned first storage area.
  • the data storage device of the solid state drive SSD described in the embodiment of the present application refer to the related description of the data storage method of the solid state drive SSD in the method embodiments described in FIG. 6, FIG. 10, and FIG. 11. , I won’t repeat it here.
  • the functions of the various units involved in the data storage device of the solid-state hard disk SSD described in the embodiments of the present application are part of the functions of the SSD controller, but do not include all the functions of the SSD controller; for example, the implementation of this application
  • the data storage device mentioned in the example does not include the process of reading data and the description of related functions in general; however, in actual application scenarios, the device generally reads or writes data and performs related operations, which are only implemented in this application. Do not give too much description in the example.
  • An embodiment of the present application further provides a computer storage medium, wherein the computer storage medium can store a program, and the program can execute any part of the method described in the method embodiments corresponding to FIG. 6, FIG. 10, and FIG. 11. Or all steps.
  • the embodiment of the present application also provides a computer program, the computer program includes instructions, when the computer program is executed by the computer, the computer can execute any of the method embodiments described in the above-mentioned FIG. 6, FIG. 10, and FIG. 11 Some or all of the steps.
  • the disclosed device may be implemented in other ways.
  • the device embodiments described above are only illustrative, for example, the division of the above-mentioned units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or integrated. To another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical or other forms.
  • the units described above as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc., specifically a processor in a computer device) execute all or part of the steps of the foregoing methods of the various embodiments of the present application.
  • the aforementioned storage media may include: U disk, mobile hard disk, magnetic disk, optical disk, read-only memory (Read-Only Memory, abbreviation: ROM) or Random Access Memory (Random Access Memory, abbreviation: RAM), etc.
  • U disk mobile hard disk
  • magnetic disk magnetic disk
  • optical disk read-only memory
  • Read-Only Memory abbreviation: ROM
  • Random Access Memory Random Access Memory

Abstract

Disclosed are a data storage method and apparatus for a solid state disk and a solid state disk (SSD). According to the present application, the average read time delay of an SSD can be effectively reduced, and the service performance of the SSD in a time delay sensitive scene can be improved on the basis that additional material costs are not increased. The data storage method for a solid state disk can comprise: receiving data to be stored, and identifying first data, in the data to be stored, matching target data or first data including a designated identifier, wherein the target data is data, read from an SSD, with a frequency higher that a preset frequency threshold; selecting, from a plurality of storage regions of the SSD, a first storage region matching a read time delay of the first data; and storing the aforementioned first data in the aforementioned first storage region. By means of implementing the embodiments of the present application, the average read time delay of an SSD can be effectively reduced.

Description

一种固态硬盘的数据存储方法、装置及固态硬盘SSDData storage method and device of solid state hard disk and solid state hard disk SSD 技术领域Technical field
本申请涉及存储领域,尤其涉及一种固态硬盘的数据存储方法、装置及固态硬盘SSD。This application relates to the storage field, and in particular to a data storage method and device of a solid-state hard disk, and a solid-state hard disk SSD.
背景技术Background technique
固态硬盘(Solid State Disk,SSD)是一种广泛应用的存储设备,主要由控制单元和存储单元构成。其中,存储单元一般包括NAND Flash等多个闪存颗粒,每个闪存颗粒内部包括一个或者多个裸片(die),每个die包括多个物理块(block),block的容量大小一般在数百KB至数MB之间,每个block包括多个页(page),page的容量大小一般为4KB的倍数(如4KB或者16KB)。SSD通过闪存转换层(Flash Translation Layer,FTL)将数据均匀分布存储在各个NAND Flash上。由于SSD没有机械结构而不存在寻道过程,SSD的读写时延低至微秒级,读写带宽高至GB/s(Gigabyte/Second)的级别。Solid State Disk (SSD) is a widely used storage device, which is mainly composed of a control unit and a storage unit. Among them, the storage unit generally includes multiple flash memory particles such as NAND Flash. Each flash memory particle includes one or more dies, and each die includes multiple physical blocks. The capacity of the block is generally in the hundreds. Between KB and several MB, each block includes multiple pages (pages), and the size of the page is generally a multiple of 4KB (such as 4KB or 16KB). SSD uses Flash Translation Layer (FTL) to evenly distribute data and store data on each NAND Flash. Since the SSD has no mechanical structure and no seek process, the read and write latency of the SSD is as low as microseconds, and the read and write bandwidth is as high as GB/s (Gigabyte/Second).
在某些场景中,存储设备的读写时延对特定应用(Application,APP)的业务性能影响较大,比如关系型数据库管理系统中的查询操作。降低存储设备(如SSD)的平均读时延可以极大提升该类应用的业务性能。SSD平均读时延主要受NANDFlash介质本身的存取时延影响。为了降低SSD平均读时延,一般在SSD内部设计缓存模块,加快读命令的处理,进而降低SSD的平均读时延。在此类方案中,SSD设备除了包含控制单元和存储单元,还要包含缓存缓冲存储区模块。通常,该缓冲存储区模块利用存储级内存(Storage Class Memory,SCM)或者动态随机存取存储器(Dynamic Random Access Memory,DRAM)等存储介质的更低时延特性来降低SSD的平均读时延。但是,由于SCM或DRAM等介质成本高、容量小,采用该方案的SSD整盘成本高,实现复杂度高。并且,该方案降低平均读时延的效果与从缓冲存储区模块中直接获取目标数据的概率强相关。具体地,在实际产品中,由于SCM等介质的成本高以及掉电保护的约束,相对于SSD高达几百吉字节(Gigabyte,GB)甚至数太字节(Terabyte,TB)的NAND Flash存储容量,缓冲存储区模块的存储容量通常很小。因此,在实际应用中,读命令从缓冲存储区模块中直接获取目标数据的概率很低,导致SSD平均读时延高。In some scenarios, the read and write delay of the storage device has a greater impact on the business performance of a specific application (Application, APP), such as query operations in a relational database management system. Reducing the average read latency of storage devices (such as SSD) can greatly improve the business performance of this type of application. The average read latency of SSD is mainly affected by the access latency of the NANDFlash medium itself. In order to reduce the average read latency of the SSD, a cache module is generally designed inside the SSD to speed up the processing of read commands, thereby reducing the average read latency of the SSD. In this type of solution, the SSD device not only includes a control unit and a storage unit, but also includes a cache buffer storage area module. Generally, the buffer storage module utilizes the lower latency characteristics of storage media such as Storage Class Memory (SCM) or Dynamic Random Access Memory (DRAM) to reduce the average read latency of the SSD. However, due to the high cost and small capacity of media such as SCM or DRAM, the SSD using this solution has a high overall cost and high implementation complexity. Moreover, the effect of the solution in reducing the average read delay is strongly related to the probability of directly obtaining the target data from the buffer memory module. Specifically, in actual products, due to the high cost of SCM and other media and the constraints of power-down protection, compared to SSDs, up to hundreds of gigabytes (Gigabyte, GB) or even terabytes (Terabyte, TB) NAND Flash storage Capacity, the storage capacity of the buffer storage area module is usually very small. Therefore, in practical applications, the probability that the read command directly obtains the target data from the buffer memory module is very low, resulting in a high average read latency of the SSD.
因此,如何有效降低SSD的平均读时延,是本申请亟需解决的问题。Therefore, how to effectively reduce the average read delay of the SSD is an urgent problem to be solved in this application.
发明内容Summary of the invention
本申请实施例提供了一种固态硬盘存储方法、装置及固态硬盘SSD,能够有效降低SSD的平均读时延,提高SSD在时延敏感场景中的业务性能。The embodiments of the present application provide a solid-state hard disk storage method and device, and a solid-state hard disk SSD, which can effectively reduce the average read delay of the SSD and improve the service performance of the SSD in delay-sensitive scenarios.
第一方面,本申请实施例提供了一种固态硬盘SSD的数据存储方法,该方法可包括:接收待存储数据,识别该待存储数据中的第一数据,其中,前述第一数据为与目标数据匹配的数据,该目标数据为从SSD中读取频率高于预设频率阈值的数据;从SSD的多个存储区域(本申请以page单元为存储区域为例进行说明)中,选择与前述第一数据读时延匹配的第一存储区域;将该第一数据存储至前述第一存储区域。In the first aspect, an embodiment of the present application provides a data storage method of a solid state drive (SSD). The method may include: receiving data to be stored, and identifying first data in the data to be stored, wherein the aforementioned first data is the same as the target Data matching data, the target data is the data that is read from the SSD with a frequency higher than the preset frequency threshold; from the multiple storage areas of the SSD (this application takes the page unit as an example of the storage area for explanation), select the data with the aforementioned A first storage area matching the read delay of the first data; storing the first data in the aforementioned first storage area.
本申请实施例,通过从接收的待存储数据中识别第一数据(前述第一数据可以为需要 从前述SSD中快速读取的数据,比如从前述SSD中读取频率高于预设频率阈值的数据、包含指定标识的数据和数据集合中读取频率较高数据中的一种或者多种,其中,前述数据集合可以包括SSD从Host一次或者多次接收的数据),将前述第一数据存储至与其读时延匹配的第一存储区域,从而降低在读取前述第一数据的过程中产生的平均读时延,提高配置有前述SSD的设备的业务处理性能。区别于现有技术中,在SSD内置缓存模块导致SSD控制器为了判断读写命令是否命中缓存,而需要多次寻址过程;通过实施本申请实施例,在满足一定业务需求的情况下减少生产的物料成本(如SSD缓存模块的成本),同时避免了二次寻址而增加SSD控制器的处理负荷;更重要的是,基于SSD存储介质的特性对数据进行有目的性地进行匹配存储,降低方案实现复杂度,降低SSD平均读时延效果明显。可以理解的是,本申请实施例提及的读时延指代平均读时延,在本申请不作区分描述。In this embodiment of the application, the first data is identified from the received data to be stored (the aforementioned first data may be data that needs to be quickly read from the aforementioned SSD, for example, the frequency of reading from the aforementioned SSD is higher than the preset frequency threshold. One or more of the data, the data containing the designated identifier, and the data with higher read frequency in the data set, where the foregoing data set may include data received by the SSD from the Host one or more times), and the foregoing first data is stored To the first storage area matching the read delay, thereby reducing the average read delay in the process of reading the first data, and improving the service processing performance of the device equipped with the SSD. Different from the prior art, the built-in SSD cache module causes the SSD controller to determine whether the read/write command hits the cache, and requires multiple addressing processes; through the implementation of the embodiments of this application, the production is reduced while meeting certain business requirements. The cost of materials (such as the cost of the SSD cache module), while avoiding secondary addressing and increasing the processing load of the SSD controller; more importantly, based on the characteristics of the SSD storage medium, the data is matched and stored purposefully. Reduce the complexity of the implementation of the solution, and reduce the average read delay of the SSD, the effect is obvious. It is understandable that the read delay mentioned in the embodiment of the present application refers to the average read delay, which is not described separately in this application.
在一种可能的实现方式中,前述目标数据为在预设历史时间段内从前述SSD中读取频率高于预设频率阈值的数据;前述识别前述待存储数据中的第一数据,包括:将前述待存储数据中与前述目标数据内容相同的部分或者全部数据,识别为前述第一数据。本申请实施例,筛选待存储的数据中与预设历史时间段内目标数据内容相同的数据(比如,根据读取频率一致、数据有效位一致等条件判断两者相同),便于后续将第一数据存储至与之期望的读时延匹配的存储区域。In a possible implementation manner, the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period; the aforementioned identification of the first data in the aforementioned data to be stored includes: Identify part or all of the data that has the same content as the target data in the aforementioned data to be stored as the aforementioned first data. In the embodiment of this application, the data to be stored with the same content as the target data in the preset historical time period is filtered (for example, it is judged that the two are the same according to conditions such as consistent reading frequency and consistent data valid bits), so that the first The data is stored in a storage area that matches the expected read delay.
在一种可能的实现方式中,前述目标数据为在预设历史时间段内从前述SSD中读取频率高于预设频率阈值的数据;前述识别前述待存储数据中的第一数据,包括:将前述待存储数据中与前述目标数据类型相同的部分或者全部数据,识别为第一数据。本申请实施例,筛选待存储的数据中与预设历史时间段内目标数据类型相同的数据(例如,类型相同的情况可以包括:待存储数据中的部分或者全部数据与目标数据的数据来源相同或者相近;或者,待存储数据中的部分或者全部数据与目标数据都属于业务处理的相同环节需要的数据;或者用户(包括开发人员)对待存储数据中的部分或者全部数据与目标数据的读取需求相同等等),便于后续将第一数据存储至与之期望的读时延匹配的存储区域。In a possible implementation manner, the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period; the aforementioned identification of the first data in the aforementioned data to be stored includes: Part or all of the data to be stored that is of the same type as the target data is identified as the first data. In this embodiment of the application, the data to be stored is screened for data of the same type as the target data in the preset historical time period (for example, the same type may include: some or all of the data in the data to be stored has the same data source as the target data Or similar; or, part or all of the data to be stored and the target data belong to the same link of business processing; or users (including developers) to read some or all of the data in the stored data and the target data Same requirements, etc.), to facilitate subsequent storage of the first data in a storage area matching the expected read delay.
在一种可能的实现方式中,前述方法还包括:识别前述待存储数据中的第二数据,前述第二数据为从前述SSD中读取频率低于前述第一数据的数据;从前述SSD的多个存储区域中,选择与前述第二数据读时延匹配的第二存储区域,前述第二存储区域的读时延高于前述第一存储区域;将前述第二数据存储至前述第二存储区域。本申请实施例,通过识别符合特定数据特征且区别于第一数据的第二数据(如读取频率低于第一数据),并将前述第二数据存储至与之读时延匹配的第二存储区域,对数据的分类存储,有效基于存储区域的特性存储数据,提高所需数据的读取效率。本申请实施例对符合特定数据特征的第二数据以及前述特定数据特征不作具体限定。In a possible implementation manner, the foregoing method further includes: identifying second data in the foregoing data to be stored, where the foregoing second data is data whose frequency of reading from the foregoing SSD is lower than that of the foregoing first data; Among the multiple storage areas, select a second storage area that matches the read delay of the second data, and the read delay of the second storage area is higher than that of the first storage area; store the second data in the second storage area. In this embodiment of the application, the second data that meets the characteristics of the specific data and is different from the first data is identified (for example, the reading frequency is lower than the first data), and the foregoing second data is stored in the second data that matches the read delay. The storage area, the classified storage of data, effectively stores data based on the characteristics of the storage area, and improves the efficiency of reading the required data. The embodiment of the present application does not specifically limit the second data that meets the specific data characteristics and the aforementioned specific data characteristics.
在一种可能的实现方式中,前述方法还包括:统计在预设历史时间段内,从前述SSD中读取数据的读取频率;将前述SSD中读取频率高于前述预设频率阈值的数据确定为前述目标数据。本申请实施例,通过定时或者不定时地统计SSD中数据的读取频率,根据预设的读取频率阈值确定哪些SSD中的数据为目标数据。以确定出的目标数据作为后续待存储数据中第一数据的识别标准之一,其中目标数据以及预设频率阈值都可以根据实际需求以及实际使用情况而调整和更新。In a possible implementation manner, the foregoing method further includes: counting the read frequency of reading data from the foregoing SSD within a preset historical time period; and determining the read frequency of the foregoing SSD that is higher than the foregoing preset frequency threshold. The data is determined as the aforementioned target data. In the embodiment of the present application, the reading frequency of data in the SSD is counted regularly or irregularly, and the data in the SSD is determined as the target data according to a preset reading frequency threshold. The determined target data is used as one of the identification criteria of the first data in the subsequent data to be stored, wherein the target data and the preset frequency threshold can be adjusted and updated according to actual needs and actual usage.
在一种可能的实现方式中,统计在预设历史时间段内,从前述SSD中读取数据的读取频率,包括:统计前述SSD的多个存储区域中每一个存储区域存储的数据在预设历史时间段内的历史读取次数;根据前述历史读取次数,确定前述每一个存储区域存储的数据的前述读取频率。本申请实施例,通过对已经存储在固态硬盘中的数据的读取频率进行计算,有利于优化已存储数据的存储区域配置情况,便于后续根据实际的数据读取情况调节数据存储区域,提高所需数据的读取效率,进而提高了主控设备的业务处理性能。In a possible implementation manner, counting the frequency of reading data from the aforementioned SSD within a preset historical time period includes: counting the data stored in each of the multiple storage areas of the aforementioned SSD in the pre-determined period. Set the number of historical readings in the historical time period; according to the number of historical readings, determine the aforementioned reading frequency of the data stored in each of the aforementioned storage areas. In the embodiment of the application, by calculating the reading frequency of the data that has been stored in the solid-state hard disk, it is beneficial to optimize the storage area configuration of the stored data, and facilitate subsequent adjustments of the data storage area according to the actual data reading situation, and improve the overall performance. The efficiency of data reading is required, thereby improving the business processing performance of the main control device.
在一种可能的实现方式中,前述SSD还包括缓冲存储区;前述方法还包括:将前述第一数据缓存至前述缓冲存储区。本申请实施例,在结合前述第一方面实施例的基础上,可以增加缓冲存储区,通过缓冲存储区存储部分的数据;在SSD正常上电工作的情况下,便于主控(如处理器或者服务器)能够有概率地直接从缓冲存储区中获得所需要的数据,在本申请实施例的基础上进一步降低SSD的平均读时延,且适用于对成本要求低但对数据读取效率要求高的应用场景。可以理解的是,结合本申请中的方案并加入缓冲存储区,比现有技术中SSD内置缓冲存储区,在第一次寻址失败而需要二次寻址的情况下,能够降低SSD的平均读时延。In a possible implementation manner, the aforementioned SSD further includes a buffer storage area; the aforementioned method further includes: buffering the aforementioned first data in the aforementioned buffer storage area. In the embodiments of this application, based on the above-mentioned embodiments of the first aspect, a buffer storage area can be added to store part of the data through the buffer storage area; when the SSD is normally powered on, it is convenient for the main control (such as a processor or Server) can obtain the required data directly from the buffer storage area with probability, and further reduce the average read delay of SSD on the basis of the embodiment of the present application, and is suitable for low cost requirements but high data read efficiency requirements Application scenarios. It is understandable that, in combination with the solution in this application and adding a buffer storage area, compared to the SSD built-in buffer storage area in the prior art, it can reduce the average performance of the SSD when the first addressing fails and the second addressing is required. Read delay.
在一种可能的实现方式中,前述将第一数据缓存至前述缓冲存储区,包括:当接收前述第一数据的写命令后,根据前述写命令将前述第一数据存储至前述缓冲存储区。本申请实施例,根据接收的写命令将第一数据存储至缓冲存储区,能够准确存储数据。In a possible implementation manner, the aforementioned buffering of the first data in the aforementioned buffer storage area includes: after receiving a write command of the aforementioned first data, storing the aforementioned first data in the aforementioned buffer storage area according to the aforementioned write command. According to the embodiment of the present application, the first data is stored in the buffer storage area according to the received write command, and the data can be accurately stored.
在一种可能的实现方式中,前述方法还包括:当接收前述第一数据的读命令,优先从前述缓冲存储区中读取前述第一数据。本申请实施例,根据读命令从缓冲存储区中读取第一数据,在特定需求的场合,更加降低第一数据的读时延,提高设备处理速度。In a possible implementation manner, the foregoing method further includes: when receiving the read command of the foregoing first data, preferentially reading the foregoing first data from the foregoing buffer storage area. In the embodiment of the present application, the first data is read from the buffer storage area according to the read command, and the read delay of the first data is further reduced and the processing speed of the device is increased in the case of specific requirements.
在一种可能的实现方式中,前述方法还包括:当前述第一数据的数据量大于前述第一存储区域的存储容量,将前述第一数据中部分数据存储至前述第二存储区域;或者,当前述第二数据的数据量大于前述第二存储区域的存储容量,将前述第二数据中部分数据存储至前述第一存储区域。本申请实施例,根据数据量与存储区域的存储容量的关系存储数据,如在第二数据量大时将部分数据存储至第一存储区域;根据实际的数据量情况灵活存储数据,有效利用存储区域,有利于整体上降低平均读时延。In a possible implementation manner, the aforementioned method further includes: when the data amount of the aforementioned first data is greater than the storage capacity of the aforementioned first storage area, storing part of the aforementioned first data in the aforementioned second storage area; or, When the data amount of the aforementioned second data is greater than the storage capacity of the aforementioned second storage area, storing part of the aforementioned second data in the aforementioned first storage area. In the embodiments of the present application, data is stored according to the relationship between the amount of data and the storage capacity of the storage area. For example, when the amount of second data is large, part of the data is stored in the first storage area; the data is stored flexibly according to the actual amount of data, and the storage is effectively utilized. The area helps to reduce the average read delay as a whole.
第二方面,本申请实施例提供了一种固态硬盘SSD的数据存储方法,该方法可以包括:In the second aspect, an embodiment of the present application provides a data storage method of a solid state hard drive (SSD), and the method may include:
接收待存储数据,识别前述待存储数据中的第一数据,其中,前述第一数据为包含指定标识的数据,前述指定标识用于指示前述第一数据的读取时延需求;从前述SSD的多个存储区域中,根据前述指定标识选择与前述第一数据读时延匹配的第一存储区域;将前述第一数据存储至前述第一存储区域。The data to be stored is received, and the first data in the data to be stored is identified, where the first data is data containing a designated identifier, and the designated identifier is used to indicate the read delay requirement of the first data; Among the plurality of storage areas, a first storage area matching the read delay of the first data is selected according to the aforementioned designated identifier; the aforementioned first data is stored in the aforementioned first storage area.
本申请实施例,从接收的待存储数据中通过指定标识(如数据编号、命令或者字段等等)识别第一数据,将前述第一数据存储至与其读时延匹配的第一存储区域,从而降低在读取前述第一数据的过程中产生的平均读时延,提高配置有前述SSD的设备的业务处理性能。区别于现有技术中,在SSD内置缓存模块导致SSD控制器为了判断读写命令是否命中缓存,而需要多次寻址过程;通过实施本申请实施例,在满足一定业务需求的情况下减少生产成本,同时避免了二次寻址而增加SSD控制器的处理负荷;更重要的是,基于SSD存 储介质的特性对数据进行有目的性地进行匹配存储,降低方案实现复杂度,降低SSD平均读时延效果明显。In the embodiment of the present application, the first data is identified by a designated identifier (such as a data number, command or field, etc.) from the received data to be stored, and the aforementioned first data is stored in the first storage area matching its read delay, thereby The average read delay generated in the process of reading the foregoing first data is reduced, and the service processing performance of the device equipped with the foregoing SSD is improved. Different from the prior art, the built-in SSD cache module causes the SSD controller to determine whether the read/write command hits the cache, and requires multiple addressing processes; through the implementation of the embodiments of this application, the production is reduced while meeting certain business requirements. Cost, while avoiding secondary addressing and increasing the processing load of the SSD controller; more importantly, based on the characteristics of the SSD storage medium, the data is matched and stored purposefully, reducing the complexity of the implementation of the solution, and reducing the average read of the SSD The delay effect is obvious.
在一种可能的实现方式中,前述方法还包括:识别前述待存储数据中的第二数据,前述第二数据为从前述SSD中读取频率低于前述第一数据的数据;从前述SSD的多个存储区域中,选择与前述第二数据读时延匹配的第二存储区域,前述第二存储区域的读时延高于前述第一存储区域;将前述第二数据存储至前述第二存储区域。本申请实施例,通过识别符合特定数据特征且区别于第一数据的第二数据(如读取频率低于第一数据),并将前述第二数据存储至与之读时延匹配的第二存储区域,对数据的分类存储,有效基于存储区域的特性存储数据,提高所需数据的读取效率。In a possible implementation manner, the foregoing method further includes: identifying second data in the foregoing data to be stored, where the foregoing second data is data whose frequency of reading from the foregoing SSD is lower than that of the foregoing first data; Among the multiple storage areas, select a second storage area that matches the read delay of the second data, and the read delay of the second storage area is higher than that of the first storage area; store the second data in the second storage area. In this embodiment of the application, the second data that meets the characteristics of the specific data and is different from the first data is identified (for example, the reading frequency is lower than the first data), and the foregoing second data is stored in the second data that matches the read delay. The storage area, the classified storage of data, effectively stores data based on the characteristics of the storage area, and improves the efficiency of reading the required data.
在一种可能的实现方式中,前述SSD还包括缓冲存储区;前述方法还包括:将前述第一数据缓存至前述缓冲存储区。本申请实施例,在结合前述第二方面中实施例的基础上,可以增加缓冲存储区,通过缓冲存储区存储部分的数据;在SSD正常上电工作的情况下,便于主控能够有概率地直接从缓冲存储区中获得所需要的数据,在本申请实施例的基础上进一步降低SSD的平均读时延,且适用于对成本要求低但对数据读取效率要求高的应用场景。可以理解的是,结合本申请中的方案并加入缓冲存储区,比现有技术中SSD内置缓冲存储区,在第一次寻址失败而需要二次寻址的情况下,能够降低SSD的平均读时延。In a possible implementation manner, the aforementioned SSD further includes a buffer storage area; the aforementioned method further includes: buffering the aforementioned first data in the aforementioned buffer storage area. In the embodiments of this application, based on combining the embodiments in the aforementioned second aspect, a buffer storage area can be added to store part of the data through the buffer storage area; when the SSD is normally powered on, it is convenient for the main control to be able to probabilistically Obtaining the required data directly from the buffer storage area further reduces the average read delay of the SSD on the basis of the embodiments of the present application, and is suitable for application scenarios that require low cost but high data read efficiency. It is understandable that, in combination with the solution in this application and adding a buffer storage area, compared to the SSD built-in buffer storage area in the prior art, it can reduce the average performance of the SSD when the first addressing fails and the second addressing is required. Read delay.
在一种可能的实现方式中,前述将前述第一数据缓存至前述缓冲存储区,包括:当接收前述第一数据的写命令后,根据前述写命令将前述第一数据存储至前述缓冲存储区。本申请实施例,根据接收的写命令将第一数据存储至缓冲存储区,能够准确存储数据。In a possible implementation manner, the aforementioned buffering of the aforementioned first data in the aforementioned buffer storage area includes: after receiving a write command of the aforementioned first data, storing the aforementioned first data in the aforementioned buffer storage area according to the aforementioned write command . According to the embodiment of the present application, the first data is stored in the buffer storage area according to the received write command, and the data can be accurately stored.
在一种可能的实现方式中,前述方法还包括:当接收前述第一数据的读命令,优先从前述缓冲存储区中读取前述第一数据。本申请实施例,根据读命令从缓冲存储区中读取第一数据,在特定需求的场合,更加降低第一数据的平均读时延,提高设备处理速度。In a possible implementation manner, the foregoing method further includes: when receiving the read command of the foregoing first data, preferentially reading the foregoing first data from the foregoing buffer storage area. In the embodiment of the present application, the first data is read from the buffer storage area according to the read command, and the average read delay of the first data is further reduced and the processing speed of the device is increased in the case of a specific demand.
在一种可能的实现方式中,前述方法还包括:当前述第一数据的数据量大于前述第一存储区域的存储容量,将前述第一数据中部分数据存储至前述第二存储区域;或者,当前述第二数据的数据量大于前述第二存储区域的存储容量,将前述第二数据中部分数据存储至前述第一存储区域。本申请实施例,根据数据量与存储区域的存储容量的关系存储数据,如在第二数据量大时将部分数据存储至第一存储区域;根据实际的数据量情况灵活存储数据,有效利用存储区域,有利于整体上降低SSD平均读时延。In a possible implementation manner, the aforementioned method further includes: when the data amount of the aforementioned first data is greater than the storage capacity of the aforementioned first storage area, storing part of the aforementioned first data in the aforementioned second storage area; or, When the data amount of the aforementioned second data is greater than the storage capacity of the aforementioned second storage area, storing part of the aforementioned second data in the aforementioned first storage area. In the embodiments of the present application, data is stored according to the relationship between the amount of data and the storage capacity of the storage area. For example, when the amount of second data is large, part of the data is stored in the first storage area; data is stored flexibly according to the actual amount of data, and the storage is effectively utilized. The area helps to reduce the average read latency of the SSD as a whole.
第三方面,本申请实施例提供了一种固态硬盘SSD,前述SSD可以包括控制器、与前述控制器连接的存储器;其中,前述存储器可以包括多个不同种类的存储区域,每类存储区域的读时延不同;前述控制器,用于:接收待存储数据,识别前述待存储数据中的第一数据,其中,前述第一数据为与目标数据匹配的数据,前述目标数据为从前述SSD中读取频率高于预设频率阈值的数据;从前述多个存储区域中,选择与前述第一数据读时延匹配的第一存储区域;将前述第一数据存储至前述第一存储区域;前述第一存储区域,用于存储前述第一数据。In the third aspect, the embodiments of the present application provide a solid state drive SSD. The aforementioned SSD may include a controller and a memory connected to the aforementioned controller; wherein, the aforementioned memory may include a plurality of different types of storage areas, and each type of storage area has The read delay is different; the aforementioned controller is used to: receive the data to be stored, and identify the first data in the aforementioned data to be stored, wherein the aforementioned first data is data that matches the target data, and the aforementioned target data is from the aforementioned SSD Reading data with a frequency higher than a preset frequency threshold; selecting a first storage area matching the read delay of the first data from the plurality of storage areas; storing the first data in the first storage area; The first storage area is used to store the aforementioned first data.
在一种可能的实现方式中,前述控制器,具体用于:将前述待存储数据中与前述目标数据内容相同的部分或者全部数据,识别为前述第一数据。In a possible implementation manner, the aforementioned controller is specifically configured to: identify part or all of the aforementioned data to be stored that has the same content as the aforementioned target data as the aforementioned first data.
在一种可能的实现方式中,前述控制器,具体用于:将前述待存储数据中与前述目标数据类型相同的部分或者全部数据,识别为前述第一数据。In a possible implementation manner, the aforementioned controller is specifically configured to: identify part or all of the aforementioned data to be stored that is of the same type as the aforementioned target data as the aforementioned first data.
在一种可能的实现方式中,前述控制器,还用于:识别前述待存储数据中的第二数据,前述第二数据为从前述SSD中读取频率低于前述第一数据的数据;从前述多个存储区域中,选择与前述第二数据读时延匹配的第二存储区域,前述第二存储区域的读时延高于前述第一存储区域;将前述第二数据存储至前述第二存储区域;前述第二存储区域,用于存储前述第二数据。In a possible implementation manner, the aforementioned controller is further configured to: identify second data in the aforementioned data to be stored, and the aforementioned second data is data whose frequency of reading from the aforementioned SSD is lower than that of the aforementioned first data; Among the foregoing multiple storage areas, select a second storage area that matches the read delay of the second data, and the read delay of the second storage area is higher than that of the first storage area; store the second data to the second Storage area; the aforementioned second storage area is used to store the aforementioned second data.
在一种可能的实现方式中,前述控制器,还用于:统计在预设历史时间段内,从前述SSD中读取数据的读取频率;将前述SSD中读取频率高于前述预设频率阈值的数据确定为前述目标数据。In a possible implementation manner, the aforementioned controller is also used to: count the read frequency of reading data from the aforementioned SSD within a preset historical time period; and set the aforementioned read frequency from the SSD to be higher than the aforementioned preset The frequency threshold data is determined as the aforementioned target data.
在一种可能的实现方式中,前述控制器,具体用于:统计前述多个存储区域中每一个存储区域存储的数据在预设历史时间段内的历史读取次数;根据前述历史读取次数,确定前述每一个存储区域存储的数据的前述读取频率。In a possible implementation manner, the aforementioned controller is specifically configured to: count the historical reading times of data stored in each of the aforementioned multiple storage areas within a preset historical time period; according to the aforementioned historical reading times , Determine the aforementioned read frequency of the data stored in each of the aforementioned storage areas.
在一种可能的实现方式中,前述SSD还包括缓冲存储区;前述缓冲存储区与前述控制器连接;前述控制器,还用于:将前述第一数据缓存至前述缓冲存储区;前述缓冲存储区,用于存储前述第一数据。In a possible implementation manner, the aforementioned SSD further includes a buffer storage area; the aforementioned buffer storage area is connected to the aforementioned controller; the aforementioned controller is further used for: buffering the aforementioned first data to the aforementioned buffer storage area; the aforementioned buffer storage Area, used to store the aforementioned first data.
在一种可能的实现方式中,前述控制器,具体用于:当接收前述第一数据的写命令后,根据前述写命令将前述第一数据存储至前述缓冲存储区。In a possible implementation manner, the aforementioned controller is specifically configured to: after receiving a write command of the aforementioned first data, store the aforementioned first data in the aforementioned buffer storage area according to the aforementioned write command.
在一种可能的实现方式中,前述控制器,还用于:当接收前述第一数据的读命令,优先从前述缓冲存储区中读取前述第一数据。In a possible implementation manner, the aforementioned controller is further configured to: when receiving the aforementioned first data read command, preferentially read the aforementioned first data from the aforementioned buffer storage area.
在一种可能的实现方式中,前述控制器,还用于:当前述第一数据的数据量大于前述第一存储区域的存储容量,将前述第一数据中部分数据存储至前述第二存储区域;或者,当前述第二数据的数据量大于前述第二存储区域的存储容量,将前述第二数据中部分数据存储至前述第一存储区域。In a possible implementation manner, the aforementioned controller is further configured to: when the data amount of the aforementioned first data is greater than the storage capacity of the aforementioned first storage area, store part of the aforementioned first data in the aforementioned second storage area Or, when the data amount of the aforementioned second data is greater than the storage capacity of the aforementioned second storage area, store part of the aforementioned second data in the aforementioned first storage area.
第四方面,本申请实施例提供了一种固态硬盘SSD,可以包括控制器、与前述控制器连接的存储器;其中,前述存储器包括多个不同种类的存储区域,每类存储区域的读时延不同;前述控制器,用于:接收待存储数据,识别前述待存储数据中的第一数据,其中,前述第一数据为包含指定标识的数据,前述指定标识用于指示前述第一数据的读取时延需求;从前述多个存储区域中,根据前述指定标识选择与前述第一数据读时延匹配的第一存储区域;将前述第一数据存储至前述第一存储区域;前述第一存储区域,用于存储前述第一数据。In a fourth aspect, an embodiment of the present application provides a solid state drive SSD, which may include a controller and a memory connected to the aforementioned controller; wherein, the aforementioned memory includes a plurality of different types of storage areas, and the read delay of each type of storage area Different; the aforementioned controller is used to: receive the data to be stored, and identify the first data in the aforementioned data to be stored, wherein the aforementioned first data is data containing a designated identifier, and the aforementioned designated identifier is used to indicate the reading of the aforementioned first data Obtain the latency requirement; from the foregoing multiple storage areas, select the first storage area matching the foregoing first data read latency according to the foregoing designated identifier; store the foregoing first data in the foregoing first storage area; the foregoing first storage The area is used to store the aforementioned first data.
在一种可能的实现方式中,前述控制器,还用于:识别前述待存储数据中的第二数据,前述第二数据为从前述SSD中读取频率低于前述第一数据的数据;从前述多个存储区域中,选择与前述第二数据读时延匹配的第二存储区域,前述第二存储区域的读时延高于前述第一存储区域;将前述第二数据存储至前述第二存储区域;前述第二存储区域,用于存储前述第二数据。In a possible implementation manner, the aforementioned controller is further configured to: identify second data in the aforementioned data to be stored, and the aforementioned second data is data whose frequency of reading from the aforementioned SSD is lower than that of the aforementioned first data; Among the foregoing multiple storage areas, select a second storage area that matches the read delay of the second data, and the read delay of the second storage area is higher than that of the first storage area; store the second data to the second Storage area; the aforementioned second storage area is used to store the aforementioned second data.
在一种可能的实现方式中,前述SSD还包括缓冲存储区;前述缓冲存储区与前述控制 器连接;前述控制器,还用于:将前述第一数据缓存至前述缓冲存储区;前述缓冲存储区,用于存储前述第一数据。In a possible implementation manner, the aforementioned SSD further includes a buffer storage area; the aforementioned buffer storage area is connected to the aforementioned controller; the aforementioned controller is further used for: buffering the aforementioned first data to the aforementioned buffer storage area; the aforementioned buffer storage Area, used to store the aforementioned first data.
在一种可能的实现方式中,前述控制器,还用于:当接收前述第一数据的读命令,优先从前述缓冲存储区中读取前述第一数据。In a possible implementation manner, the aforementioned controller is further configured to: when receiving the aforementioned first data read command, preferentially read the aforementioned first data from the aforementioned buffer storage area.
第五方面,本申请实施例提供了一种固态硬盘SSD的数据存储装置,该装置可以包括:第一接收单元,用于接收待存储数据;第一识别单元,用于识别前述待存储数据中的第一数据,其中,前述第一数据为与目标数据匹配的数据,前述目标数据为从前述SSD中读取频率高于预设频率阈值的数据;第一选择单元,用于从前述SSD的多个存储区域中,选择与前述第一数据读时延匹配的第一存储区域;第一存储单元,用于将前述第一数据存储至前述第一存储区域。In a fifth aspect, an embodiment of the present application provides a data storage device for a solid state drive (SSD). The device may include: a first receiving unit for receiving data to be stored; and a first identifying unit for identifying the aforementioned data to be stored The first data, wherein, the first data is data that matches the target data, and the target data is data that is read from the SSD with a frequency higher than a preset frequency threshold; the first selection unit is used to obtain data from the SSD Among the multiple storage areas, the first storage area matching the read delay of the first data is selected; the first storage unit is used to store the first data in the first storage area.
在一种可能的实现方式中,前述目标数据为在预设历史时间段内从前述SSD中读取频率高于预设频率阈值的数据;前述第一识别单元,具体用于:将前述待存储数据中与前述目标数据内容相同的部分或者全部数据,识别为前述第一数据。In a possible implementation manner, the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period; the aforementioned first identification unit is specifically used to: Part or all of the data that has the same content as the aforementioned target data is identified as the aforementioned first data.
在一种可能的实现方式中,前述目标数据为在预设历史时间段内从前述SSD中读取频率高于预设频率阈值的数据;前述第一识别单元,具体用于:将前述待存储数据中与前述目标数据类型相同的部分或者全部数据,识别为前述第一数据。In a possible implementation manner, the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period; the aforementioned first identification unit is specifically used to: Part or all of the data with the same type as the aforementioned target data is identified as the aforementioned first data.
在一种可能的实现方式中,前述装置还包括第一存储区域分类单元,用于:识别前述待存储数据中的第二数据,前述第二数据为从前述SSD中读取频率低于前述第一数据的数据;从前述SSD的多个存储区域中,选择与前述第二数据读时延匹配的第二存储区域,前述第二存储区域的读时延高于前述第一存储区域;将前述第二数据存储至前述第二存储区域。In a possible implementation manner, the aforementioned device further includes a first storage area classification unit for identifying the second data in the aforementioned data to be stored, and the aforementioned second data is read from the aforementioned SSD with a lower frequency than the aforementioned first data. Data of one piece of data; from the multiple storage areas of the aforementioned SSD, select a second storage area that matches the read delay of the aforementioned second data, and the read delay of the aforementioned second storage area is higher than that of the aforementioned first storage area; The second data is stored in the aforementioned second storage area.
在一种可能的实现方式中,前述装置还包括目标数据确定单元,用于:统计在预设历史时间段内,从前述SSD中读取数据的读取频率;将前述SSD中读取频率高于前述预设频率阈值的数据确定为前述目标数据。In a possible implementation manner, the foregoing device further includes a target data determining unit, configured to: count the read frequency of reading data from the foregoing SSD within a preset historical time period; and set the read frequency of the foregoing SSD to be high The data at the aforementioned preset frequency threshold is determined as the aforementioned target data.
在一种可能的实现方式中,前述目标数据确定单元,具体用于:统计前述SSD的多个存储区域中每一个存储区域存储的数据的历史读取次数;根据前述历史读取次数,确定前述每一个存储区域存储的数据的前述读取频率。In a possible implementation manner, the aforementioned target data determining unit is specifically configured to: count the historical reading times of data stored in each of the multiple storage areas of the SSD; and determine the aforementioned historical reading times according to the aforementioned historical reading times. The aforementioned reading frequency of the data stored in each storage area.
在一种可能的实现方式中,前述SSD还包括缓冲存储区;前述装置还包括第一缓存单元,用于:将前述第一数据缓存至前述缓冲存储区。In a possible implementation manner, the aforementioned SSD further includes a buffer storage area; the aforementioned device further includes a first cache unit for: buffering the aforementioned first data in the aforementioned buffer storage area.
在一种可能的实现方式中,前述第一缓存单元,具体用于:当接收前述第一数据的写命令后,根据前述写命令将前述第一数据存储至前述缓冲存储区。In a possible implementation manner, the foregoing first buffer unit is specifically configured to store the foregoing first data in the foregoing buffer storage area according to the foregoing write command after receiving a write command of the foregoing first data.
在一种可能的实现方式中,前述装置还包括第一读取单元,用于:当接收前述第一数据的读命令,优先从前述缓冲存储区中读取前述第一数据。In a possible implementation manner, the aforementioned device further includes a first reading unit, configured to: when receiving the aforementioned first data read command, preferentially read the aforementioned first data from the aforementioned buffer storage area.
在一种可能的实现方式中,前述装置还包括第一决策单元,用于:当前述第一数据的数据量大于前述第一存储区域的存储容量,将前述第一数据中部分数据存储至前述第二存储区域;或者,当前述第二数据的数据量大于前述第二存储区域的存储容量,将前述第二数据中部分数据存储至前述第一存储区域。In a possible implementation manner, the aforementioned device further includes a first decision-making unit, configured to store part of the aforementioned first data in the aforementioned first data when the data amount of the aforementioned first data is greater than the storage capacity of the aforementioned first storage area. A second storage area; or, when the amount of the second data is greater than the storage capacity of the second storage area, store part of the second data in the first storage area.
第六方面,本申请实施例提供了一种固态硬盘SSD的数据存储装置,该装置可以包括:第二接收单元,用于接收待存储数据;第二识别单元,用于识别前述待存储数据中的第一数据,其中,前述第一数据为包含指定标识的数据,前述指定标识用于指示前述第一数据的读取时延需求;第二选择单元,用于从前述SSD的多个存储区域中,根据前述指定标识选择与前述第一数据读时延匹配的第一存储区域;第二存储单元,用于将前述第一数据存储至前述第一存储区域。In a sixth aspect, an embodiment of the present application provides a data storage device for a solid-state hard drive (SSD). The device may include: a second receiving unit for receiving data to be stored; and a second identifying unit for identifying the aforementioned data to be stored The aforementioned first data is data containing a designated identifier, and the aforementioned designated identifier is used to indicate the read delay requirement of the aforementioned first data; the second selection unit is used to obtain data from multiple storage areas of the aforementioned SSD Here, the first storage area that matches the read delay of the first data is selected according to the aforementioned designated identifier; the second storage unit is used to store the aforementioned first data in the aforementioned first storage area.
在一种可能的实现方式中,前述装置还包括第二存储区域分类单元,用于:识别前述待存储数据中的第二数据,前述第二数据为从前述SSD中读取频率低于前述第一数据的数据;从前述SSD的多个存储区域中,选择与前述第二数据读时延匹配的第二存储区域,前述第二存储区域的读时延高于前述第一存储区域;将前述第二数据存储至前述第二存储区域。In a possible implementation manner, the aforementioned device further includes a second storage area classification unit for identifying the second data in the aforementioned data to be stored, and the aforementioned second data is read from the aforementioned SSD with a lower frequency than the aforementioned first data. Data of one piece of data; from the multiple storage areas of the aforementioned SSD, select a second storage area that matches the read delay of the aforementioned second data, and the read delay of the aforementioned second storage area is higher than that of the aforementioned first storage area; The second data is stored in the aforementioned second storage area.
在一种可能的实现方式中,前述SSD还包括缓冲存储区;前述装置还包括第二缓存单元,用于:将前述第一数据缓存至前述缓冲存储区。In a possible implementation manner, the aforementioned SSD further includes a buffer storage area; the aforementioned device further includes a second cache unit for: buffering the aforementioned first data in the aforementioned buffer storage area.
在一种可能的实现方式中,前述第二缓存单元,具体用于:当接收前述第一数据的写命令后,根据前述写命令将前述第一数据存储至前述缓冲存储区。In a possible implementation manner, the foregoing second buffer unit is specifically configured to store the foregoing first data in the foregoing buffer storage area according to the foregoing write command after receiving the foregoing write command of the first data.
在一种可能的实现方式中,前述装置还包括第二读取单元,用于:当接收前述第一数据的读命令,优先从前述缓冲存储区中读取前述第一数据。In a possible implementation manner, the aforementioned device further includes a second reading unit, configured to: when receiving the aforementioned first data read command, preferentially read the aforementioned first data from the aforementioned buffer storage area.
在一种可能的实现方式中,前述装置还包括第二决策单元,用于:当前述第一数据的数据量大于前述第一存储区域的存储容量,将前述第一数据中部分数据存储至前述第二存储区域;或者,当前述第二数据的数据量大于前述第二存储区域的存储容量,将前述第二数据中部分数据存储至前述第一存储区域。In a possible implementation manner, the aforementioned device further includes a second decision-making unit, configured to store part of the aforementioned first data in the aforementioned first storage area when the amount of the aforementioned first data is greater than the storage capacity of the aforementioned first storage area. A second storage area; or, when the amount of the second data is greater than the storage capacity of the second storage area, store part of the second data in the first storage area.
第七方面,本申请实施例提供一种芯片组,该芯片组包括至少一个处理器,用于支持实现上述第一方面或者第二方面中所涉及的功能,例如,接收待存储数据,识别前述待存储数据中的第一数据。在一种可能的设计中,前述芯片组还包括至少一个第一存储器和至少一个第二存储器;其中,前述至少一个第一存储器和前述至少一个处理器通过线路互联,前述第一存储器中存储有指令;前述指令被前述处理器执行时,上述第一方面或者第二方面中任意一项前述的方法得以实现;前述至少一个第二存储器和前述至少一个处理器通过线路互联,前述第二存储器中存储上述第一方面或者第二方面中任意一项前述方法中的待存储数据。该芯片组,可以由芯片构成,也可以包含芯片和其他分立器件。In a seventh aspect, an embodiment of the present application provides a chipset that includes at least one processor for supporting the realization of the functions involved in the first or second aspect, for example, receiving data to be stored and identifying the aforementioned The first data in the data to be stored. In a possible design, the aforementioned chipset further includes at least one first memory and at least one second memory; wherein, the aforementioned at least one first memory and the aforementioned at least one processor are interconnected by wires, and the aforementioned first memory stores Instruction; when the foregoing instruction is executed by the foregoing processor, the foregoing method of any one of the foregoing first aspect or the foregoing second aspect is implemented; the foregoing at least one second memory and the foregoing at least one processor are interconnected by wires, and the foregoing second memory is Store the data to be stored in any one of the foregoing methods in the first aspect or the second aspect. The chipset can be composed of chips, or it can include chips and other discrete devices.
第八方面,本申请实施例提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,当该计算机程序被处理器执行时,实现第一方面或者第二方面的任一可能的实现方式所描述的方法。In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium in which a computer program is stored. When the computer program is executed by a processor, any one of the first aspect or the second aspect is implemented. Possible implementations are described in the method.
第九方面,本申请实施例提供一种计算机程序,该计算机程序包括指令,当该计算机程序被计算机执行时,使得计算机可以执行上述第一方面或者第二方面中任意一项的SSD 的数据存储方法所执行的流程。In a ninth aspect, an embodiment of the present application provides a computer program, the computer program includes instructions, when the computer program is executed by a computer, the computer can execute the data storage of the SSD of any one of the first aspect or the second aspect. The flow of the method.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍。In order to more clearly describe the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings that need to be used in the description of the embodiments.
图1是本申请实施例提供的一种固态硬盘SSD的数据存储架构示意图;FIG. 1 is a schematic diagram of a data storage architecture of a solid-state hard drive (SSD) provided by an embodiment of the present application;
图2是本申请实施例提供的一种SSD的逻辑模块示意图;FIG. 2 is a schematic diagram of a logical module of an SSD provided by an embodiment of the present application;
图3是本申请实施例提供的一种SSD数据交互通道示意图;FIG. 3 is a schematic diagram of an SSD data exchange channel provided by an embodiment of the present application;
图4是本申请实施例提供的一种SSD与Flash Die的连接示意图;FIG. 4 is a schematic diagram of a connection between SSD and Flash Die according to an embodiment of the present application;
图5是本申请实施例提供的一种SSD的数据存储流程示意图;FIG. 5 is a schematic diagram of a data storage process of an SSD provided by an embodiment of the present application;
图6是本申请实施例提供的一种SSD的数据存储方法示意图;FIG. 6 is a schematic diagram of an SSD data storage method provided by an embodiment of the present application;
图7是本申请实施例提供的另一种SSD的数据存储流程示意图;FIG. 7 is a schematic diagram of another SSD data storage process provided by an embodiment of the present application;
图8是本申请实施例提供的又一种SSD的数据存储流程示意图;FIG. 8 is a schematic diagram of another SSD data storage process provided by an embodiment of the present application;
图9是本申请实施例提供的一种SSD平均读时延分析示意图;FIG. 9 is a schematic diagram of an SSD average read delay analysis provided by an embodiment of the present application;
图10是本申请实施例提供的另一种SSD的数据存储方法示意图;FIG. 10 is a schematic diagram of another SSD data storage method provided by an embodiment of the present application;
图11是本申请实施例提供的再一种SSD的数据存储方法示意图;FIG. 11 is a schematic diagram of yet another SSD data storage method provided by an embodiment of the present application;
图12是本申请实施例提供的一种SSD的数据存储装置的结构示意图;FIG. 12 is a schematic structural diagram of an SSD data storage device provided by an embodiment of the present application;
图13是本申请实施例提供的另一种SSD的数据存储装置的结构示意图。FIG. 13 is a schematic structural diagram of another SSD data storage device provided by an embodiment of the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例进行描述。The embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
本申请的说明书和权利要求书及所述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third" and "fourth" in the specification and claims of the application and the drawings are used to distinguish different objects, rather than describing a specific order . In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes unlisted steps or units, or optionally also includes Other steps or units inherent in these processes, methods, products or equipment.
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference to "embodiments" herein means that a specific feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art clearly and implicitly understand that the embodiments described herein can be combined with other embodiments.
在本说明书中使用的术语“部件”、“模块”、“系统”等用于表示计算设备相关的实体、硬件、固件、硬件和软件的组合、软件、或执行中的软件。例如,部件可以是但不限于,在处理器上运行的进程、对象、可执行文件、执行线程和程序等。通过图示,在计算设备上运行的应用和计算设备都可以是部件。一个或多个部件可驻留在进程或执行线程中,部件可位于一个计算设备上或分布在2个或更多个计算设备之间。此外,这些部件可从在上面存储有各种数据结构的各种计算机可读介质执行。The terms "component", "module", "system" and the like used in this specification are used to refer to entities related to computing devices, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, the component may be, but is not limited to, a process, an object, an executable file, an execution thread, a program, etc. running on the processor. Through the illustration, both the application running on the computing device and the computing device can be components. One or more components may reside in a process or thread of execution, and the components may be located on one computing device or distributed among two or more computing devices. In addition, these components can be executed from various computer readable media having various data structures stored thereon.
首先,对本申请中的部分用语进行解释说明,以便于本领域技术人员理解。First of all, some terms in this application are explained to facilitate the understanding of those skilled in the art.
(1)固态驱动器(Solid State Drive,SSD),或称固态硬盘,是用固态电子存储芯片阵列而制成的硬盘。SSD由控制单元和存储单元(Flash芯片、DRAM芯片)组成,其芯片的工作温度范围很宽,应用领域广泛。固态硬盘的存储介质通常为两种,一种是采用闪存(Flash芯片)作为存储介质,另外一种是采用DRAM作为存储介质。本申请涉及的固态硬盘为基于闪存的固态硬盘,即采用Flash芯片作为存储介质的SSD。它的外观可以被制作成多种模样,例如:笔记本硬盘、微硬盘、存储卡、U盘等样式。(1) Solid State Drive (SSD), or solid state drive, is a hard drive made of an array of solid-state electronic storage chips. The SSD is composed of a control unit and a storage unit (Flash chip, DRAM chip). Its chip has a wide operating temperature range and has a wide range of applications. There are usually two types of storage media for solid-state hard drives, one is to use flash memory (Flash chip) as the storage medium, and the other is to use DRAM as the storage medium. The solid-state drive involved in this application is a flash-based solid-state drive, that is, an SSD that uses a Flash chip as a storage medium. Its appearance can be made into a variety of shapes, such as: notebook hard drives, micro hard drives, memory cards, U disks and other styles.
(2)NAND闪存(NAND Flash),是一种非失性存储技术。NAND Flash的存储单元划分有cell,die,block,page,cell等。cell是最小的记忆单元,多个cell组成一个page(页);多个page组成一个block(块);多个block组成一个die。NAND Flash除了具有断电后仍能保存数据的特性,还具有以下硬件特性:一个记忆单元经过写入(program),表示的数据可由逻辑1变成逻辑0,但无法再经由写入将此单元回复到逻辑1,需经过抹除(erase)才可回复逻辑1。一般快闪存储器中抹除的最小单位称为块(block)。抹除的操作时间一般大于读取和写入的操作时间。目前,大多数SSD的闪存颗粒主要分为单层存储单元(Single-Level Cell,SLC)、双层存储单元(Multi-Level Cell,MLC)、三层存储单元(Trinary-Level Cell,TLC)和四层存储单元(Quadruple-Level Cell,QLC),甚至还可能会出现多层存储单元;其中,TLC包括3D-TLC与2D-TLC;3D-TLC可以细分为32层3D-TLC、64层3D-TLC和96层3D-TLC。本申请各个实施例的方案不仅适用于2D结构的TLC,也适用于3D结构的TLC;本申请方案的适用范围不作限定。(2) NAND Flash is a non-destructive storage technology. NAND Flash memory cells are divided into cell, die, block, page, cell, etc. A cell is the smallest memory unit. Multiple cells form a page (page); multiple pages form a block (block); multiple blocks form a die. In addition to the feature that NAND Flash can save data after power off, it also has the following hardware features: After a memory cell is programmed, the data represented can be changed from logic 1 to logic 0, but this unit cannot be written to. Reverting to logic 1 requires erasing (erase) before reverting to logic 1. Generally, the smallest unit of erase in a flash memory is called a block. The operation time of erasing is generally longer than the operation time of reading and writing. At present, most SSD flash memory particles are mainly divided into single-level storage cells (Single-Level Cell, SLC), dual-level storage cells (Multi-Level Cell, MLC), three-level storage cells (Trinary-Level Cell, TLC) and Quadruple-Level Cells (Quadruple-Level Cell, QLC), and even multi-layer storage cells may appear; among them, TLC includes 3D-TLC and 2D-TLC; 3D-TLC can be subdivided into 32-layer 3D-TLC, 64-layer 3D-TLC and 96-layer 3D-TLC. The solutions of the various embodiments of the present application are not only applicable to TLC of 2D structure, but also applicable to TLC of 3D structure; the scope of application of the solutions of the present application is not limited.
(3)逻辑块地址(Logical Block Address,LBA),是描述存储设备上数据所在位置的通用机制,一般应用在硬盘等辅助记忆设备。LBA可以指某个数据区块的地址或是某个地址所指向的数据区块。例如,LBA就等于我们平常使用的门牌地址(如:中华人民共和国广东省广州市中山四路26号)。在电脑上所谓一个逻辑区块通常是512或1024位组。ISO-9660格式的标准CD则以2048位组为一个逻辑区块大小。(3) Logical block address (Logical Block Address, LBA) is a general mechanism for describing the location of data on a storage device, and is generally used in auxiliary memory devices such as hard disks. LBA can refer to the address of a certain data block or the data block pointed to by a certain address. For example, LBA is equal to the house address we usually use (for example: No. 26, Zhongshan 4th Road, Guangzhou City, Guangdong Province, People's Republic of China). The so-called logical block on a computer is usually 512 or 1024 bits. The standard CD in ISO-9660 format uses 2048 bits as a logical block size.
(4)物理块地址(Physics Block Address,PBA),相对于LBA来说,如GPS定位所使用的经纬度。比如,前述门牌地址的经纬度为:东经:113°16′40.0621″,北纬:23°07′37.6129″。在机械硬盘HDD上,由于HDD的数据可以直接覆盖,所以LBA和PBA的关系是1:1对应,即LBA=PBA。但在SSD上,由于NAND闪存的特性,导致LBA和PBA的关系不再是固定的。因此SSD需要FTL来作地址转化,以配合现有的文件系统。SSD的控制器是使用LBA和PBA的映射表来管理闪存的。当有需更新的数据要写入时,控制器会把新数据写入到空白的闪存空间(已擦除状态的)内,然后更新映射表数据,把LBA指向新的PBA。原来的PBA就成了无效数据,这个PBA若要再次写入数据就需先进行擦除的操作。(4) Physical Block Address (PBA), relative to LBA, such as the latitude and longitude used for GPS positioning. For example, the latitude and longitude of the aforementioned house address are: east longitude: 113°16′40.0621″, north latitude: 23°07′37.6129″. On the mechanical hard disk HDD, because the HDD data can be directly overwritten, the relationship between LBA and PBA is 1:1, that is, LBA=PBA. But on SSD, due to the characteristics of NAND flash memory, the relationship between LBA and PBA is no longer fixed. Therefore, SSD needs FTL for address conversion to match the existing file system. The SSD controller uses the mapping table of LBA and PBA to manage the flash memory. When there is data that needs to be updated to be written, the controller will write the new data into the blank flash memory space (in the erased state), and then update the mapping table data to point the LBA to the new PBA. The original PBA becomes invalid data. If the PBA wants to write data again, it needs to be erased first.
(5)闪存转换层(FlashTranslation Layer,FTL),是一种LBA到PBA的映射算法。闪存的读写单位为页(页的大小一般为4KB的倍数),但操作系统读写数据是按HDD的扇区尺寸进行的(512字节(Byte));另外,闪存擦除以block作单位,而且block未经擦除就无法正确存储数据,导致操作系统通用的文件系统无法管理SSD。为了不加重操作系统的负担的前提下解决该问题,SSD采用软件的方式把闪存的操作虚拟成磁盘的独立扇区操作,那么就要利用FTL。FTL存在于文件系统和物理介质(闪存)之间,操作系统只需操 作LBA即可,而LBA到PBA的所有转换工作,由FTL负责。具体地,当文件系统发送指令要写入或者更新一个特定的逻辑页时,FTL实际上是把数据写入到一个不同的空闲物理页并更新映射表(LBA和PBA的关联数据),并把这个页上包含的"旧数据"标记为"无效"(即更新后的数据已经写入新的PBA,旧地址的数据自然就失效了)。(5) Flash Translation Layer (FTL) is a mapping algorithm from LBA to PBA. The unit of reading and writing of flash memory is a page (the size of a page is generally a multiple of 4KB), but the operating system reads and writes data according to the sector size of the HDD (512 bytes (Byte)); in addition, flash erasing is done by block Units and blocks cannot store data correctly without being erased, causing the common file system of the operating system to be unable to manage SSDs. In order to solve this problem without increasing the burden of the operating system, SSD uses software to virtualize the operation of flash memory into independent sector operations of the disk, then FTL must be used. FTL exists between the file system and the physical medium (flash memory). The operating system only needs to operate the LBA, and FTL is responsible for all the conversion from LBA to PBA. Specifically, when the file system sends an instruction to write or update a specific logical page, FTL actually writes the data to a different free physical page and updates the mapping table (the associated data of LBA and PBA), and The "old data" contained on this page is marked as "invalid" (that is, the updated data has been written into the new PBA, and the data at the old address is naturally invalid).
(6)映射表(Map Table),用于当读取某个用户页(Host Page)时,SSD先查找该Host Page对应的物理页(Physical Page),然后再访问Flash读取相应的Host数据。其中,Host Page是Host访问SSD的基本单元;Host通过LBA访问SSD,每个LBA代表着一个Sector(一般为512B大小),操作系统一般以4K为单位访问SSD。而在SSD内部,SSD控制器(或称SSD主控)与Flash之间,是以Flash Page为基本单元访问Flash的,其中,Flash Page称为Physical Page。Host每写入一个Host Page,SSD主控会查找一个Physical Page把Host数据写入,SSD内部同时记录了这样一条映射(Map)。有了该映射关系后,下次Host需要读某个Host Page时,SSD知道从Flash的哪个位置进行数据的读取。(6) Map Table, used when reading a user page (Host Page), SSD first finds the physical page (Physical Page) corresponding to the Host Page, and then accesses Flash to read the corresponding Host data . Among them, Host Page is the basic unit for Host to access SSD; Host accesses SSD through LBA, and each LBA represents a Sector (usually 512B in size), and the operating system generally accesses SSD in 4K units. In the SSD, between the SSD controller (or SSD master) and Flash, Flash Page is the basic unit to access Flash, among which Flash Page is called Physical Page. Each time the Host writes a Host Page, the SSD master will find a Physical Page to write the Host data, and such a map is also recorded inside the SSD. With this mapping relationship, the next time the Host needs to read a Host Page, the SSD knows where to read the data from the Flash.
(7)缓冲区,或缓冲存储区,是内存空间的一部分,即在内存空间中预留了一定的存储空间,用来缓冲输入或输出的数据。缓冲区根据其对应的是输入设备还是输出设备,分为输入缓冲区和输出缓冲区。缓冲区的作用可以包括以下2点:1、数据可以直接送往缓冲区,高速设备不用再等待低速设备,提高了设备效率。例如:利用SSD存储数据,可以根据写命令直接将部分数据送往SSD的缓冲区。2、可以减少存储介质的读写次数。频繁的小块写操作会较大程度的加剧SSD寿命损耗。在将数据写入到SSD中的过程中,如果先将数据输入缓冲区中,待缓冲区满后再持久化存储到NAND Flash存储介质上就会大大减少NAND Flash介质的P/E(Program/Erase,编程/擦除)次数,起到保护SSD的作用。另外,从存储设备中读取数据,由于部分数据存储在缓冲区,可以直接从缓冲区读取目标数据,所以在一定程度上可以提高读取速度。在本申请的各个实施例中提及的buffer或者data buffer均为指代缓冲存储区。(7) The buffer, or buffer storage area, is a part of the memory space, that is, a certain storage space is reserved in the memory space for buffering input or output data. The buffer is divided into input buffer and output buffer according to whether it corresponds to an input device or an output device. The function of the buffer zone can include the following 2 points: 1. Data can be directly sent to the buffer zone, and high-speed devices no longer need to wait for low-speed devices, which improves the efficiency of the device. For example: using SSD to store data, part of the data can be directly sent to the buffer of the SSD according to the write command. 2. The number of reads and writes of storage media can be reduced. Frequent small block write operations will greatly aggravate the life loss of the SSD. In the process of writing data to the SSD, if you first input the data into the buffer, and then store it persistently on the NAND Flash storage medium after the buffer is full, it will greatly reduce the P/E of the NAND Flash medium. Erase, the number of times of programming/erase), plays a role in protecting the SSD. In addition, when reading data from a storage device, because part of the data is stored in the buffer, the target data can be read directly from the buffer, so the reading speed can be improved to a certain extent. The buffer or data buffer mentioned in the various embodiments of the present application refers to a buffer storage area.
(8)Host接口,或数据总线,可以包括SATA、SAS和PCIe等。其中,串行ATA(Serial Advanced Technology Attachment,Serial ATA)是一种计算机总线,负责主板和大容量存储设备(如硬盘及光盘驱动器)之间的数据传输,主要用于个人计算机;串行ATA与串列SCSI(Serial Attached SCSI,SAS)的两者排线兼容,SATA硬盘可接上SAS接口。SAS(Serial Attached SCSI),是串行连接SCSI接口,即串行连接小型计算机系统接口;与SATA硬盘相同,都是采用串行技术以获得更高的传输速度,并通过缩短连结线改善内部空间等。SAS是并行SCSI接口之后开发出的全新接口,为了改善存储系统的效能、可用性和扩充性,提供与SATA硬盘的兼容性。PCI Express总线(即PCIe)是较旧的PCI/PCI-X总线的高速串行替换;PCI Express基于点到点拓扑,单独的串行链路将每个设备连接到根系统(主机)。由于其共享总线拓扑,可以对单个方向上的PCI总线进行仲裁(在多个主机的情况下),并且一次限制为一个主机;此外,PCI Express总线链路支持任何两个端点之间的全双工通信,同时跨多个端点的并发访问没有固有的限制。(8) Host interface, or data bus, can include SATA, SAS, PCIe, etc. Among them, Serial ATA (Serial Advanced Technology Attachment, Serial ATA) is a computer bus that is responsible for data transmission between the motherboard and mass storage devices (such as hard disks and optical drives), and is mainly used in personal computers; The two cables of serial SCSI (Serial Attached SCSI, SAS) are compatible, and the SATA hard disk can be connected to the SAS interface. SAS (Serial Attached SCSI) is a serial-attached SCSI interface, that is, a serial-attached small computer system interface; the same as SATA hard disks, serial technology is used to obtain higher transmission speeds, and the internal space is improved by shortening the connection line Wait. SAS is a brand new interface developed after the parallel SCSI interface. In order to improve the performance, availability and expandability of the storage system, it provides compatibility with SATA hard drives. PCI Express bus (ie PCIe) is a high-speed serial replacement of the older PCI/PCI-X bus; PCI Express is based on a point-to-point topology, with a separate serial link connecting each device to the root system (host). Due to its shared bus topology, the PCI bus in a single direction can be arbitrated (in the case of multiple hosts), and limited to one host at a time; in addition, the PCI Express bus link supports full duplex between any two endpoints There are no inherent restrictions on industrial communications, and concurrent access across multiple endpoints at the same time.
(9)垃圾回收机制,该机制的基本原理是把SSD中的几个block中的有效数据(非垃圾数据)集中搬到一个新block上面,然后再把这几个block擦除掉而产生可用block。所以,一块刚买的新SSD,写入速度很快,那是因为一开始总能找到可用的block来进行写 入。但是,随着SSD的使用时间或者使用次数增加,它的写入速度会变慢。原因就在于SSD写满后,当需要写入新的数据,往往需要做上述的垃圾回收:把若干个block上面的有效数据搬移到某个block,然后擦掉原先的block,然后再把Host数据写入,导致比最初寻找可用的block来写入的耗时更多。(9) Garbage collection mechanism. The basic principle of this mechanism is to centrally move the valid data (non-garbage data) in several blocks in the SSD to a new block, and then erase these blocks to make them usable block. Therefore, a new SSD that has just been bought has a very fast writing speed, because it can always find a usable block for writing at the beginning. However, as the use time or number of uses of the SSD increases, its writing speed will slow down. The reason is that after the SSD is full, when new data needs to be written, it is often necessary to do the above-mentioned garbage collection: move the valid data on several blocks to a block, then erase the original block, and then put the Host data Writing, resulting in more time-consuming than the initial search for available blocks to write.
(10)磨损平衡(Wear Leveling,WL),是在SSD内部的一种保证block被均衡的使用的机制。WL包括两种算法:动态WL算法和静态WL算法。使不使用WL,以及使用何种WL算法,对SSD的寿命影响是很大的。Flash都是有一定寿命的,它是用P/E数(Program/Erase Count)来衡量的。如果SSD集中对某几个block进行擦写,那么这几个block很快就寿命耗尽。比如,有些数据是频繁需要更新的,那么这些数据所在block就需要频繁的进行擦写,这些block的寿命就可能很快的耗尽。相反,有些数据用户是很少更新的,比如一些只读文件,那么这些数据所在的block擦写的次数就很少。随着用户对SSD的使用,就会形成一些block有很高的PE数,而有些block的PE数却很低的。期望所有block的PE数都应该差不多,即这些block被均衡的使用。(10) Wear Leveling (WL) is a mechanism in SSD to ensure the balanced use of blocks. WL includes two algorithms: dynamic WL algorithm and static WL algorithm. Whether WL is used or not, and which WL algorithm is used, has a great impact on the lifespan of the SSD. Flash has a certain life span, which is measured by the P/E number (Program/Erase Count). If the SSD concentrates on erasing and writing certain blocks, these blocks will soon run out of life. For example, if some data needs to be updated frequently, then the block where the data is located needs to be frequently erased and written, and the life of these blocks may be exhausted quickly. On the contrary, some data users rarely update, such as some read-only files, so the number of erasing and writing of the block where the data is located is very small. As users use SSDs, some blocks will have very high PE counts, while some blocks will have very low PE counts. It is expected that the number of PEs of all blocks should be the same, that is, these blocks are used in a balanced manner.
(11)I/O接口,或IO接口,可以是控制对象与被控对象进行信息交换的纽带。主机通过I/O接口与外部设备进行数据交换。目前,绝大部分I/O接口涉及的具体程序都是可编程的,即它们的工作方式可由程序进行控制。(11) I/O interface, or IO interface, can be the link between the controlled object and the controlled object for information exchange. The host computer exchanges data with external devices through the I/O interface. At present, most of the specific programs involved in the I/O interface are programmable, that is, their working mode can be controlled by the program.
下面先对本申请实施例所基于的其中一种系统架构进行描述。请参见图1,图1是本申请实施例提供的一种固态硬盘SSD的数据存储架构示意图,图1所示的架构主要以固态硬盘SSD为主体,从数据写入的角度进行描述。本申请提出的固态硬盘的数据存储方法可以应用于该系统架构。该系统架构中包含了主控10(Host,图中以包含处理器101为例进行说明)和固态硬盘(SSD)20;其中,图1以控制器201和存储器202集成在固态硬盘20内部为例进行说明,固态硬盘20可以包括控制器201和存储器202;可选地,控制器201可以为独立于固态硬盘20的处理器件,通过与固态硬盘20中的存储器202连接,执行数据存储、数据读取以及数据更改等操作;而存储器202也可以为独立的存储器件,在此不再赘述。如图1所示,存储器202可以包括多个Flash存储区域,如Flash0、Flash1、…、Flash N等,N为大于0的整数。多个Flash存储区域中可以包括了多种不同读时延的存储区域,在此不对存储区域的具体读时延进行限定。The following first describes one of the system architectures on which the embodiments of the present application are based. Please refer to FIG. 1. FIG. 1 is a schematic diagram of a data storage architecture of a solid state drive SSD provided by an embodiment of the present application. The architecture shown in FIG. 1 mainly takes the solid state drive SSD as the main body and is described from the perspective of data writing. The data storage method of the solid-state hard disk proposed in this application can be applied to the system architecture. The system architecture includes a main control 10 (Host, the figure includes a processor 101 as an example for illustration) and a solid state drive (SSD) 20; among them, Figure 1 takes the controller 201 and the memory 202 integrated inside the solid state drive 20 as As an example, the solid-state hard disk 20 may include a controller 201 and a memory 202; optionally, the controller 201 may be a processing device independent of the solid-state hard disk 20, and is connected to the memory 202 in the solid-state hard disk 20 to perform data storage and data storage. Operations such as reading and data modification; and the memory 202 may also be an independent storage device, which will not be repeated here. As shown in FIG. 1, the memory 202 may include multiple Flash storage areas, such as Flash0, Flash1,..., FlashN, etc., where N is an integer greater than zero. The multiple Flash storage areas may include multiple storage areas with different read delays, and the specific read delays of the storage areas are not limited here.
具体地,当处理器101处理业务时,向SSD20发送目标数据的写命令,通过写命令指示SSD20根据预设的规则选择适合存储目标数据的目标存储区域,并在目标存储区域存储待存储的数据。匹配与适合存储目标数据的目标存储区域,以及存储目标数据的操作可以是同时进行或者存在合理的先后顺序。其中,所述写命令可以包括指示SSD20在特定存储区域(即目标存储区域)存储一定长度或者数据量的数据。例如,处理器101向SSD20发送了数据A的写命令a,SSD20通过数据总线接收到写命令a和数据A。SSD20的控制器201对写命令a进行分析,识别数据A是否属于第一数据(即符合经常被读取的特征或者被标识为经常读取的数据)的类型。在确认数据A为第一数据之后,从存储器202中的多个存储区域中选择读时延低的存储区域存储数据A。可选地,SSD20的控制器201可以在存储区域变更过程中,自主地根据待存储数据的读取频率对数据进行再分类识别,将不同 读取频率类别的数据存储至与该数据读时延匹配的存储区域,例如,待存储数据的历史读取频率越高,那么就将该待存储数据存储至读时延越低的存储区域。Specifically, when the processor 101 processes a service, it sends a write command of the target data to the SSD 20, and the write command instructs the SSD 20 to select a target storage area suitable for storing the target data according to preset rules, and store the data to be stored in the target storage area . The operation of matching and storing the target data in the target storage area and storing the target data may be performed simultaneously or in a reasonable order. Wherein, the write command may include instructing the SSD 20 to store data of a certain length or amount of data in a specific storage area (that is, a target storage area). For example, the processor 101 sends the write command a of the data A to the SSD 20, and the SSD 20 receives the write command a and the data A through the data bus. The controller 201 of the SSD 20 analyzes the write command a, and identifies whether the data A belongs to the type of the first data (that is, it conforms to the characteristic that is frequently read or is identified as the frequently read data). After confirming that the data A is the first data, a storage area with a low read latency is selected from a plurality of storage areas in the memory 202 to store the data A. Optionally, the controller 201 of the SSD 20 can automatically re-categorize and identify the data according to the reading frequency of the data to be stored during the storage area change process, and store the data of different reading frequency categories to the data reading delay. The matching storage area, for example, the higher the historical reading frequency of the data to be stored is, the data to be stored is stored in the storage area with the lower the reading delay.
可以理解的是,固态硬盘可以配置在不同的设备中,在不同的设备中对应不同主控的形式,本申请实施例对主控的形式不作限定,比如服务器或者个人电脑等。It is understandable that the solid state drive can be configured in different devices and correspond to different main control forms in different devices. The embodiment of the present application does not limit the main control form, such as a server or a personal computer.
当前述固态硬盘配置在个人电脑(即主控10为电脑)中,固态硬盘20通过数据总线与电脑的中央处理器CPU进行数据交互,例如,电脑通过数据总线向固态硬盘(SSD)20发送写命令,将特定的数据写入SSD。When the aforementioned solid state drive is configured in a personal computer (that is, the main control 10 is a computer), the solid state drive 20 interacts with the central processing unit CPU of the computer through a data bus. For example, the computer sends writes to the solid state drive (SSD) 20 through the data bus. Command to write specific data to SSD.
当前述固态硬盘配置在服务器(即主控10为服务器,该服务器为整个服务器网络的主服务器,处理服务器网络中所有的事务)中,服务器通过Wi-Fi、移动网络等或者有线连接的方式进行通信并对数据进行处理,例如,服务器通过数据总线向固态硬盘(SSD)20发送写命令,将特定的数据写入SSD20。其他结构以及功能类似前述提及的电子设备,在配置了SSD之后的具体数据存储场景也适用本申请实施例图示的应用场景,在此不再赘述。When the aforementioned solid state drive is configured in a server (that is, the main controller 10 is a server, the server is the main server of the entire server network, which handles all transactions in the server network), the server is performed through Wi-Fi, mobile network, or wired connection Communicate and process data. For example, the server sends a write command to the solid state drive (SSD) 20 through the data bus to write specific data to the SSD 20. Other structures and functions are similar to the aforementioned electronic devices, and the specific data storage scenario after the SSD is configured also applies to the application scenario illustrated in the embodiment of the present application, which will not be repeated here.
结合图1所示的系统架构,本申请实施例还提供了一种涉及Host与SSD交互的SSD数据存储设备图示,可以应用于图1所示系统架构,请参见图2,图2是本申请实施例提供的一种SSD的逻辑模块示意图;如图2所示,本申请实施例中SSD的内置逻辑模块可以包括:Interface模块(即接口203,也包含前述提及的数据总线)、controller模块(即SSD控制器201,也是前述控制器201)以及NAND Flash Array模块(即闪存阵列205,也是前述存储器202)。其中,Combined with the system architecture shown in FIG. 1, an embodiment of the present application also provides a diagram of an SSD data storage device involving the interaction between a Host and an SSD, which can be applied to the system architecture shown in FIG. A schematic diagram of the logic module of the SSD provided by the application embodiment; as shown in FIG. 2, the built-in logic module of the SSD in the embodiment of the application may include: Interface module (that is, interface 203, which also includes the aforementioned data bus), controller The module (that is, the SSD controller 201, which is also the aforementioned controller 201) and the NAND Flash Array module (that is, the flash memory array 205, which is also the aforementioned memory 202). among them,
Interface模块203,用以连接Host10而承担读写命令接收和数据传输的功能;本申请实施例对Host、Host包含的处理器以及Host中的其他内容不作限定,所以在图2中不具体描述和标识。The Interface module 203 is used to connect to Host 10 and undertake the functions of reading and writing command reception and data transmission; this embodiment of the application does not limit the Host, the processor contained in the Host, and other content in the Host, so it is not described in detail in Figure 2 Logo.
controller模块201,为SSD的控制单元(即控制器);可以理解的是,控制器(或称控制器单元)是SSD设备的大脑,承担SSD读写命令的处理、数据分布管理以及NAND Flash管理等等功能。可选地,本申请实施例在controller模块中设计了读属性识别(read attribute identification)功能模块2011,该功能模块用于识别待存储数据的属性(可用于判断并识别第一数据);例如,可以把判断该数据是否为读属性数据rd_attr_data(即从待存储数据中识别出第一数据),以及可以判断该数据是否为普通数据comm_data(即从待存储数据中识别出第二数据)。如图2所示,LP和UP(在本申请实施例中LP和UP的读时延比MP的读时延低)存储读属性数据,MP存储普通数据;可以理解的是,图2中所示的读属性数据以及普通数据都是示例性的描述。The controller module 201 is the control unit (ie controller) of the SSD; it can be understood that the controller (or controller unit) is the brain of the SSD device, responsible for the processing of SSD read and write commands, data distribution management, and NAND Flash management And so on. Optionally, in this embodiment of the application, a read attribute identification function module 2011 is designed in the controller module, and the function module is used to identify the attributes of the data to be stored (which can be used to determine and identify the first data); for example, It can be judged whether the data is read attribute data rd_attr_data (that is, the first data is identified from the data to be stored), and it can be judged whether the data is common data comm_data (that is, the second data is identified from the data to be stored). As shown in Figure 2, LP and UP (the read latency of LP and UP in the embodiment of this application is lower than the read latency of MP) store read attribute data, and MP stores ordinary data; it is understandable that as shown in Figure 2 The shown read attribute data and common data are exemplary descriptions.
NAND Flash Array模块202,可以包括SSD的NAND Flash介质颗粒组,是数据最终存储的物理载体。具体地,该模块可以包括图示的低内存页(Lower Page,LP)2021、中间页(Middle Page,MP)2022和高内存页(Upper Page,UP)2023,前述的页单元可以对应图1所示的Flash0-FlashN,具体的对应关系结合实际考量,在此不作限定;本申请实施例对LP2021、MP2022和UP2023的数量不作限定。可以理解的是,通常的SSD设备可以包含有多个NAND Flash颗粒;涉及SSD的FTL以及其他相关模块或者单元,请参见下文相关实施例的具体描述。本申请实施例对图中所示的接口、控制器以及闪存阵列的连接 关系不作限定。可以理解的是,本申请实施例对LP、MP和UP分别对应的中文翻译名称不作限定,以英文名称指代的事物为准。The NAND Flash Array module 202 may include the NAND Flash media particle group of the SSD, which is a physical carrier for the final storage of data. Specifically, the module may include the illustrated lower memory page (LP) 2021, middle page (MP) 2022, and upper memory page (UP) 2023. The aforementioned page unit may correspond to FIG. 1 The specific correspondence between Flash0-FlashN shown in combination with actual considerations is not limited here; the embodiment of the present application does not limit the number of LP2021, MP2022, and UP2023. It is understandable that a typical SSD device may include multiple NAND Flash particles; the FTL and other related modules or units related to the SSD, please refer to the specific description of the related embodiments below. The embodiment of the present application does not limit the connection relationship between the interface, the controller, and the flash memory array shown in the figure. It is understandable that the embodiments of the present application do not limit the Chinese translation names corresponding to LP, MP, and UP respectively, and the things referred to by the English names shall prevail.
为了便于理解本申请实施例,结合上述申请实施例中的SSD的逻辑模块和功能描述,对SSD基本原理进行相关描述,如下:In order to facilitate the understanding of the embodiments of the present application, in conjunction with the logical modules and functional descriptions of the SSD in the above-mentioned embodiments of the application, the basic principles of the SSD are described as follows:
从组成结构而言,SSD20可以包括SSD控制器201,存储器(或称Flash存储阵列)202以及跟Host接口(例如SATA接口),其中,在图3中对SATA接口不作详细描述,请参见后续实施例的介绍。SSD控制器201通过若干个通道(Channel)并行操作多块Flash颗粒。请参见图3,图3是本申请实施例提供的一种SSD数据交互通道示意图,图3所示涉及数据或者信息的双向传递情况,以SSD为主体进行描述,所以本申请实施例对Host的相关图示以及描述不作详细介绍;如图3所示,以SATA接口连接SSD与Host,Flash通道连接SSD控制器201和存储器202(包括Flash Die)为例,SSD控制器201与多个Flash颗粒(即多个Flash Die)之间有数个通道,每个通道上挂载了一个闪存颗粒。以8个通道为例,控制器通过8通道连接8个FlashDie;图3中的Flash通道(包括Flash通道1、Flash通道2和Flash通道M)以及FlashDie(包括FlashDie1、FlashDie2和FlashDieM)都是示例性的描述。In terms of composition structure, SSD20 can include SSD controller 201, memory (or Flash storage array) 202, and Host interface (such as SATA interface). The SATA interface is not described in detail in Figure 3, please refer to the subsequent implementation. The introduction of the example. The SSD controller 201 operates multiple Flash particles in parallel through a number of channels. Please refer to Figure 3. Figure 3 is a schematic diagram of an SSD data exchange channel provided by an embodiment of the present application. The two-way transmission of data or information shown in Figure 3 is described with SSD as the main body. Related illustrations and descriptions will not be introduced in detail; as shown in Figure 3, the SATA interface is connected to the SSD and the Host, and the Flash channel is connected to the SSD controller 201 and the memory 202 (including Flash Die) as an example. The SSD controller 201 and multiple Flash particles (Ie, multiple Flash Dies) There are several channels between each channel, and a flash memory particle is mounted on each channel. Taking 8 channels as an example, the controller connects 8 FlashDie through 8 channels; the Flash channel (including Flash channel 1, Flash channel 2 and Flash channel M) and FlashDie (including FlashDie1, FlashDie2 and FlashDieM) in Figure 3 are examples Sexual description.
可选地,SSD还可以包括板上DRAM,板上DRAM可以与控制器201连接,用于存储映射表,以节约SSD存储数据的空间。具体地,Host每写入一个Host Page,就会产生一个新的映射关系,该新映射关系会加入(第一次写)或者更改(覆盖写)Map Table。对绝大多数SSD而言,都有板载DRAM,其主要作用就是用来存储映射表(Map Table)。也会存在例外的情况,比如基于Sandforce主控的SSD,它并不支持板载DRAM,那么它工作时,绝大部分映射是存储在Flash里面,还有一部分存储在片上RAM中。当Host需要读取一笔数据时,对有板载DRAM的SSD来说,只要查找DRAM当中的映射表,获取到物理地址后访问Flash从而得到Host数据。这期间只需要访问一次Flash;而对Sandforce的SSD来说,它首先查看该Host Page对应的映射关系是否在RAM内,如果映射关系存在RAM内,直接根据映射关系读取Flash;如果该映射关系不在RAM内,那么它首先需要把映射关系从Flash里面读取出来,然后再根据这个映射关系读取Host数据;这就意味着相比有DRAM的SSD,它需要读取两次Flash才能把Host数据读取出来。对Host随机读来说,由于片上RAM有限,映射关系Cache命中(映射关系在片上RAM)的概率很小,所以对它来说,基本每次读都需要访问两次Flash,所以基于Sandforce主控的SSD随机读取性能不太理想。Optionally, the SSD may also include on-board DRAM, and the on-board DRAM may be connected to the controller 201 for storing a mapping table, so as to save the space of the SSD for storing data. Specifically, each time the Host writes a Host Page, a new mapping relationship is generated, and the new mapping relationship is added (written for the first time) or changed (written over) Map Table. For most SSDs, there are onboard DRAM, whose main function is to store the Map Table. There will be exceptions. For example, the SSD based on Sandforce's main control does not support onboard DRAM. When it works, most of the mapping is stored in Flash, and some of it is stored in on-chip RAM. When the Host needs to read a piece of data, for the SSD with onboard DRAM, it only needs to look up the mapping table in the DRAM, obtain the physical address and then access the Flash to obtain the Host data. During this period, you only need to access Flash once; for Sandforce SSD, it first checks whether the mapping relationship corresponding to the Host Page is in RAM, if the mapping relationship exists in RAM, it reads Flash directly according to the mapping relationship; if the mapping relationship is If it is not in RAM, then it first needs to read the mapping relationship from Flash, and then read the Host data according to this mapping relationship; this means that compared to SSD with DRAM, it needs to read the Flash twice to get the Host The data is read out. For Host random read, due to the limited on-chip RAM, the probability of the mapping relationship Cache hit (the mapping relationship is on the on-chip RAM) is very small, so for it, basically every read needs to access the Flash twice, so it is based on the Sandforce master control The SSD random read performance is not ideal.
请参见图4,图4是本申请实施例提供的一种SSD与Flash Die的连接示意图;为方便解释,图4中只示例性地展示了每个Die里的一个block,其中每个小方块表示一个page(假设大小为4KB)。以图4所示为例,在Channel0-3对应的四个block中每一个block都写入了4KB的数据,一共写入了16KB的数据。空白的区域表示没有写入数据,当所有Channel上的block都写满时(即图4中不存在代表空白区域的小方块时),SSD控制器201会挑选其他block以同样的方式继续写入。Please refer to FIG. 4, which is a schematic diagram of the connection between an SSD and Flash Die provided by an embodiment of the present application; for the convenience of explanation, FIG. 4 only exemplarily shows a block in each Die, and each small block Represents a page (assuming the size is 4KB). Take the example shown in Figure 4, each of the four blocks corresponding to Channel 0-3 has 4KB of data written, and a total of 16KB of data has been written. The blank area means that no data is written. When all the blocks on the Channel are full (that is, when there is no small block representing the blank area in Figure 4), the SSD controller 201 will select other blocks to continue writing in the same way .
当写满整个SSD的存储区域后,后续写入新的数据,则必须删除SSD中的部分数据以 腾出存储空间,便于后续的数据写入。在删除和写入数据的过程中,会导致一些block里面的数据变无效或者变老。可以理解的是,block中的数据变老或者无效,是指没有任何映射关系指向它们,它们被新的映射关系所取代,导致这些Flash空间不会被访问。比如,有一个Host Page A,开始时它存储在Flash空间的X,映射关系为A→X。后来,Host重写了该Host Page,由于Flash不能覆盖写,SSD内部必须寻找一个没有写过的位置写入新的数据,假设该位置为Y,建立新的映射关系A→Y,之前的映射关系解除,位置X上的数据变老失效,变为垃圾数据。When the entire storage area of the SSD is filled, and new data is subsequently written, part of the data in the SSD must be deleted to free up storage space for subsequent data writing. In the process of deleting and writing data, the data in some blocks will become invalid or become old. It is understandable that the data in the block becomes old or invalid, which means that there is no mapping relationship pointing to them, and they are replaced by the new mapping relationship, causing these Flash spaces to not be accessed. For example, there is a Host Page A, which is stored in X in the Flash space at the beginning, and the mapping relationship is A→X. Later, Host rewrote the Host Page. Since Flash cannot be overwritten, SSD must find a location that has not been written to write new data. Assuming that the location is Y, create a new mapping relationship A→Y, the previous mapping The relationship is released, and the data at location X becomes old and invalid, and becomes garbage data.
随着Host的持续写入,Flash存储空间慢慢变小,直到耗尽。如果不及时清除这些垃圾数据,Host就无法写入。SSD内部一般通过垃圾回收机制产生新的可用block。同时,SSD还有通过磨损平衡机制来保障SSD存储器中的block被均衡使用,延长SSD的使用寿命。可以理解的是,SSD中还会存在预留空间,不用于存储写入用户的数据(如第一数据、第二数据等)。这部分空间不仅仅可以用来做垃圾回收,并且SSD内部的一些系统数据,也需要预留空间来存储,比如前述映射表(Map Table),比如SSD固件,以及其它的一些SSD系统管理数据。As the Host continues to write, the Flash storage space gradually becomes smaller until it runs out. If the junk data is not cleared in time, the Host cannot write it. SSDs generally generate new available blocks through the garbage collection mechanism. At the same time, the SSD also uses a wear balance mechanism to ensure that the blocks in the SSD memory are used in a balanced manner, extending the service life of the SSD. It is understandable that there will still be reserved space in the SSD, which is not used to store data written to the user (such as the first data, the second data, etc.). This part of the space can not only be used for garbage collection, but also some system data inside the SSD needs to reserve space for storage, such as the aforementioned Map Table, such as SSD firmware, and other SSD system management data.
上面描述了SSD的基本原理,下面对SSD处理写命令的关键过程进行描述,请参见图5,图5是本申请实施例提供的一种SSD的数据存储流程示意图;如图5所示,SSD的工作步骤可以包括如下步骤的描述:The basic principle of SSD is described above, and the key process of SSD processing write commands is described below. Please refer to FIG. 5. FIG. 5 is a schematic diagram of a data storage process of an SSD provided by an embodiment of the present application; as shown in FIG. 5, The working steps of SSD can include the description of the following steps:
1、在SSD就绪后,SSD接收到Host下发的写命令。其中,SSD就绪可以包括对SSD上电,对SSD进行初始化等。1. After the SSD is ready, the SSD receives the write command issued by the Host. Among them, the SSD ready may include powering on the SSD, initializing the SSD, and so on.
2、SSD接收到写命令,通过控制器解析写命令,识别该写命令(该写命令一般用于存储目标数据)所携带(或指示)待存储数据的属性。比如,可预期的数据属性可以包括:读、频繁更新,以及很少更新等,具体的描述可以参见前文的可预期的数据属性的描述,在此不再赘述;本申请实施例在前述的方法实施例部分已经做了详细的说明,在此不再赘述。2. The SSD receives the write command, analyzes the write command through the controller, and recognizes the attribute of the data to be stored carried (or instructed) by the write command (the write command is generally used to store target data). For example, the predictable data attributes may include: read, frequent update, and rarely update, etc. For specific descriptions, please refer to the previous description of predictable data attributes, which will not be repeated here; the embodiment of the present application refers to the aforementioned method The detailed description has already been made in the embodiment part, and will not be repeated here.
3、SSD根据判断得到的待存储数据的属性,将数据存储至与之匹配的存储区域。具体地,如果是读属性的数据(即图示的Y),将该数据尽量存储到读时延低的page单元中;如果不是读属性的数据(即图示的N),将该数据尽量存储到读时延高的page单元中。3. The SSD stores the data in a matching storage area according to the attributes of the data to be stored obtained by the judgment. Specifically, if it is the data of the read attribute (that is, Y as shown in the figure), try to store the data in the page unit with low read latency; if it is not the data of the read attribute (that is, the N in the figure), try to store the data as much as possible Stored in the page unit with high read latency.
可选地,在根据写命令存储数据后,可以结束该流程或者向SSD控制反馈存储结果,进一步地,还可以向Host反馈存储结果。Optionally, after storing the data according to the write command, the process can be ended or the storage result can be fed back to the SSD control, and further, the storage result can also be fed back to the Host.
可选地,在前述步骤进行存储数据时,实现可以更灵活的存储方式。考虑到各种属性数据的容量比例不确定,在前述步骤中,读属性的数据(即第一数据)也可以保存到读时延高的page单元中,而除了第一数据以外的普通数据或者对读时延要求低的数据,也可以根据实际情况,选择性地保存到读时延低的page单元中。后续Host从SSD中读取读属性的数据时,读命令的完成时间就会很低。在实际业务场景中,采用本申请实施例的方案,能有效降低APP查询数据的时间。Optionally, when storing data in the foregoing steps, a more flexible storage method can be realized. Considering that the capacity ratio of various attribute data is uncertain, in the foregoing steps, the read attribute data (that is, the first data) can also be stored in the page unit with a high read delay, and ordinary data other than the first data or Data with low read delay requirements can also be selectively stored in page units with low read delay according to actual conditions. When the host subsequently reads the read attribute data from the SSD, the completion time of the read command will be very low. In actual business scenarios, adopting the solutions of the embodiments of this application can effectively reduce the time for APP to query data.
下面结合上述系统架构和本申请中提供的固态硬盘的数据存储原理,对本申请中提出 的技术问题进行具体分析和解决。In the following, in combination with the foregoing system architecture and the data storage principle of the solid-state hard disk provided in this application, the technical problems proposed in this application will be specifically analyzed and resolved.
请参见图6,图6是本申请实施例提供的一种SSD的数据存储方法示意图,该固态硬盘的数据存储方法应用于固态硬盘的数据存储系统(包括上述系统架构)。其中,所述固态硬盘的数据存储系统可以包括主控(如服务器或者电脑的处理器)和固态硬盘SSD,其中,SSD内部可以包括控制器和存储器。下面将结合附图6从固态硬盘中控制器的单侧进行描述,该方法可以包括以下步骤S601-步骤S603。Please refer to FIG. 6. FIG. 6 is a schematic diagram of an SSD data storage method provided by an embodiment of the present application. The data storage method of the solid state hard disk is applied to the data storage system of the solid state hard disk (including the above system architecture). Wherein, the data storage system of the solid-state hard disk may include a main controller (such as a processor of a server or a computer) and a solid-state hard disk SSD, where the SSD may include a controller and a memory. The following will describe from a single side of the controller in the solid state hard disk with reference to FIG. 6. The method may include the following steps S601 to S603.
步骤S601:接收待存储数据,识别所述待存储数据中的第一数据。Step S601: Receive data to be stored, and identify the first data in the data to be stored.
具体地,控制器(或SSD控制器)201通过固态硬盘的数据总线,从与固态硬盘20连接的设备(如处理器)接收待存储数据。然后,根据第一数据的数据特征,从待存储数据中识别出第一数据。其中,数据特征可以包括读取频率高于预设频率阈值、包含指定标识和在数据集合中读取频率排序靠前等等,本申请实施例对具体的数据特征不作限定。Specifically, the controller (or SSD controller) 201 receives the data to be stored from a device (such as a processor) connected to the solid state hard disk 20 through the data bus of the solid state hard disk. Then, according to the data characteristics of the first data, the first data is identified from the data to be stored. Among them, the data characteristics may include a reading frequency higher than a preset frequency threshold, including a designated identifier and a reading frequency ranking higher in the data set, etc. The embodiment of the present application does not limit the specific data characteristics.
在一种可能的实现方式中,前述目标数据为在预设历史时间段内从前述SSD中读取频率高于预设频率阈值的数据;前述识别前述待存储数据中的第一数据,包括:将前述待存储数据中与前述目标数据内容相同的部分或者全部数据,识别为前述第一数据。比如,根据读取频率一致、数据有效位一致等独特的特征判断两者相同。In a possible implementation manner, the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period; the aforementioned identification of the first data in the aforementioned data to be stored includes: Identify part or all of the data that has the same content as the target data in the aforementioned data to be stored as the aforementioned first data. For example, the two are judged to be the same based on unique characteristics such as the same reading frequency and the same valid data bits.
在一种可能的实现方式中,前述目标数据为在预设历史时间段内从前述SSD中读取频率高于预设频率阈值的数据;前述识别前述待存储数据中的第一数据,包括:将前述待存储数据中与前述目标数据类型相同的部分或者全部数据,识别为第一数据。其中,类型相同的情况可以包括:待存储数据中的部分或者全部数据与目标数据的数据来源相同或者相近;或者,待存储数据中的部分或者全部数据与目标数据都属于业务处理的相同环节需要的数据;或者用户(包括开发人员)对待存储数据中的部分或者全部数据与目标数据的读取需求相同等等。为了便于理解前述类型相同的情况,下面将举例进行相应的说明。在某个程序(如MySQL)存储某个文件内容的过程中,可以在SSD中先存储该文件(如几个GB的文件数据)中的部分数据。当该部分数据存储在SSD中并后续被经常读取,那么SSD控制器根据一定的识别规则(如将数据的读取频率与预设频率阈值进行比较),判断该部分数据(如几百兆的数据)为第一数据(即高频读取的数据)。关键的是,SSD控制器不仅将该部分识别为第一数据,还可以预判该部分数据从属的该文件的全部数据大概率是第一数据;当SSD接收该文件中其他数据的写命令时,SSD根据预判的前述结果,将属于该文件中的数据先识别为第一数据,将其存储至第一存储区域(即读时延低的存储区域)。再例如,SSD中的某存储区域的大部分数据在实际使用中经常被读取;当写命令指示SSD需要将部分或者全部待存储数据存储至前述的某存储区域,SSD控制器判断待存储数据的被指示的存储区域和前述某存储区域一致,将前述部分或者全部待存储数据识别为第一数据。In a possible implementation manner, the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period; the aforementioned identification of the first data in the aforementioned data to be stored includes: Part or all of the data to be stored that is of the same type as the target data is identified as the first data. Among them, the case of the same type may include: some or all of the data to be stored and the target data have the same or similar data source; or, some or all of the data to be stored and the target data belong to the same link of business processing needs Data; or users (including developers) have the same read requirements for some or all of the data to be stored and the target data, etc. In order to facilitate the understanding of the aforementioned situations of the same type, the corresponding description will be given below with examples. In the process of a certain program (such as MySQL) storing the content of a certain file, part of the data in the file (such as several GB of file data) can be stored in the SSD first. When this part of the data is stored in the SSD and is frequently read subsequently, the SSD controller judges the part of the data (such as hundreds of megabytes) according to certain identification rules (such as comparing the reading frequency of the data with a preset frequency threshold). The data) is the first data (that is, the high-frequency read data). The key point is that the SSD controller not only recognizes the part as the first data, but also predicts that all the data of the file to which the part of the data belongs is likely to be the first data; when the SSD receives a write command for other data in the file According to the aforementioned result of the pre-judgment, the SSD first recognizes the data belonging to the file as the first data, and stores it in the first storage area (that is, the storage area with low read latency). For another example, most of the data in a storage area in the SSD is often read in actual use; when the write command instructs the SSD to store part or all of the data to be stored in the aforementioned storage area, the SSD controller determines the data to be stored The indicated storage area of is consistent with the aforementioned certain storage area, and some or all of the aforementioned data to be stored is identified as the first data.
下面结合如下的例子,对如何识别接收但尚未存储的数据中读取频率符合要求的第一数据进行解释。识别接收但尚未存储的数据中读取频率符合要求的第一数据,一般会有如下两种情况:The following will explain how to identify the first data whose reading frequency meets the requirements among the data received but not yet stored. To identify the first data whose reading frequency meets the requirements among the data received but not yet stored, there are generally two situations as follows:
1、与目标数据成功匹配,可以参照目标数据类型的历史频率,例如,数据a属于A类数据,A类数据在SSD中存在历史频率,如何存储数据a就可以参考A类数据的频率。例如,数据a(可以理解为属于A类型的数据)所属的数据类型经常被主控读取(该情况可 以通过存储的历史读取记录分析数据a的读取情况后判断是否数据A经常被读取),那么控制器会将数据a判断为第一数据。1. To successfully match the target data, you can refer to the historical frequency of the target data type. For example, data a belongs to type A data, and type A data has historical frequency in the SSD. How to store data a can refer to the frequency of type A data. For example, the data type of data a (which can be understood as data belonging to type A) is often read by the master (in this case, you can analyze the reading situation of data a through the stored history reading records to determine whether data A is often read Take), then the controller will judge the data a as the first data.
2、若与目标数据匹配失败,导致没有历史频率可以参考并进行后续的存储操作,那么可以先存储再后续根据数据频率更改其存储区域。例如,将无法立即识别(可能由于与目标数据不匹配或者可能根据SSD预存的判断条件无法识别等等)的待存储数据中部分或者全部数据,存储至非第一存储区域;计算部分或者全部数据在预设历史时间段内从SSD中读取的频率;当读取的频率高于所述预设频率阈值,将所述部分或者全部数据识别为所述第一数据。识别为第一数据之后,将其存储至第一存储区域,并擦除原存储区域的数据,在映射表中重新建立数据映射关系。再例如,在数据B是一种对该SSD而言的新类型数据,没有可以参考的历史读取频率的情况下,可以先随机存储数据B,然后根据后续一段时间内(该时间段可以自主选择或者根据一定规则自动选取)的读取情况,计算数据B的读取频率;再根据数据B的读取频率匹配合适的存储区域(如page单元或称page;本申请实施例中page或page单元指代相同),降低后续读取该SSD中数据B的平均读时延。2. If the matching with the target data fails, resulting in no historical frequency to refer to and subsequent storage operations, then you can store it first and then subsequently change its storage area according to the data frequency. For example, store some or all of the data to be stored that cannot be immediately identified (maybe because it does not match the target data or cannot be identified based on the judgment conditions pre-stored in SSD, etc.) in a non-first storage area; calculate some or all of the data The frequency read from the SSD in the preset historical time period; when the read frequency is higher than the preset frequency threshold, the part or all of the data is identified as the first data. After the first data is identified, it is stored in the first storage area, the data in the original storage area is erased, and the data mapping relationship is re-established in the mapping table. For another example, if data B is a new type of data for the SSD and there is no historical reading frequency that can be referenced, data B can be stored randomly, and then according to the following period of time (this time period can be autonomous Select or automatically select according to certain rules) to calculate the reading frequency of data B; then match the appropriate storage area (such as page unit or page) according to the reading frequency of data B; page or page in the embodiment of this application The unit refers to the same), which reduces the average read delay for subsequent reading of data B in the SSD.
其中,包含第一数据特征的数据可以为读属性数据,所谓读属性数据可以指的是处理器运行时(如运行APP时)读该数据的平均时延对业务性能影响较大的数据,该类数据的特点是经常被读取、多个读请求组成一个业务事务(具体可以为处理一个业务事务需要对SSD存储器进行多次读取)等等。其中,可预期的属性可以包括:读、频繁更新以及很少更新等等。读为从SSD读取数据的操作,读可以包括对关键数据的读取和对频繁数据的读取,其中,关键数据的读取一般对读取时延要求较高;例如,在业务处理的过程中,对涉及到关键数据,需要快速获取到这些关键数据,期望读时延越低越好。频繁数据的读取一般是对所需数据经常性地读取,读取频率较高,但可能并不要求单次读取的读时延很低。更新为一种对SSD进行写入(或称存储数据)的操作,更新可以只写入不读取或者读取的次数偏少。频繁更新与很少更新对应,是根据写入数据的频率进行的区分。Among them, the data containing the first data feature can be read attribute data. The so-called read attribute data can refer to data that has a greater impact on business performance by the average delay of reading the data when the processor is running (such as when running an APP). The characteristics of the class data are that it is frequently read, multiple read requests form a business transaction (specifically, the SSD memory needs to be read multiple times to process a business transaction) and so on. Among them, the predictable attributes can include: read, frequently updated, rarely updated, and so on. Reading is the operation of reading data from SSD. Reading can include reading of key data and reading of frequent data. The reading of key data generally requires high read latency; for example, in business processing In the process, for the key data involved, it is necessary to quickly obtain these key data, and it is expected that the lower the read delay, the better. Frequent data reading generally refers to frequently reading the required data, and the reading frequency is high, but it may not require a low read delay for a single reading. The update is an operation to write (or store data) to the SSD, and the update can only be written but not read or the number of reads is too small. Frequent updates correspond to infrequent updates, which are distinguished based on the frequency of writing data.
例如,请参见图2,SSD控制器201通过固态硬盘的接口203,从与固态硬盘连接的设备(如处理器101)接收待存储数据。然后,通过读属性识别功能模块2011,从待存储数据中识别出第一数据。For example, referring to FIG. 2, the SSD controller 201 receives the data to be stored from the device (such as the processor 101) connected to the solid state hard disk through the interface 203 of the solid state hard disk. Then, through the read attribute recognition function module 2011, the first data is recognized from the data to be stored.
其中,所述第一数据可以为从所述SSD中读取频率高于预设频率阈值的数据,或者所述第一数据可以为包含指定标识的数据。第一数据可以具体为在预设的历史时间段内从SSD中读取频率高于预设频率阈值的数据,其中,预设的历史时间段可以包括在接收该次待存储数据之前的时间段。例如,首先,根据实际的应用场景预设固定的频率阈值;然后,在存储数据过程中以该预设的频率阈值作为标准,将大于预设频率阈值的数据识别为第一数据。Wherein, the first data may be data whose reading frequency is higher than a preset frequency threshold from the SSD, or the first data may be data including a designated identifier. The first data may specifically be data with a frequency higher than a preset frequency threshold that is read from the SSD within a preset historical time period, where the preset historical time period may include the time period before the data to be stored is received. . For example, first, a fixed frequency threshold is preset according to the actual application scenario; then, in the process of storing data, the preset frequency threshold is used as a standard, and data greater than the preset frequency threshold is identified as the first data.
或者,第一数据可以是从SSD中读取频率在接收的数据集合(所述数据集合可以包括SSD从Host一次或者多次接收的数据)中读取频率较高的数据(如对数据集合中的数据按照数据的读取频率进行排序,可以选取前三类读取频率的数据作为第一数据)。为了能够直观地描述前述的第一数据,下面结合本申请实施例架构以及方法,对本申请实施例提供的一种SSD设备进行具体的描述。Alternatively, the first data may be data with a higher reading frequency in the received data set (the data set may include data received by the SSD from the Host one or more times) from the SSD (such as the data set in the data set). The data is sorted according to the reading frequency of the data, and the data of the first three types of reading frequency can be selected as the first data). In order to be able to intuitively describe the foregoing first data, the following specifically describes an SSD device provided in an embodiment of the present application in conjunction with the architecture and method of the embodiment of the present application.
请参见图7,图7是本申请实施例提供的另一种SSD的数据存储流程示意图;在本申 请实施例中,SSD20内部可以包括控制器201和存储器(即闪存阵列202);本申请实施例中的SSD20还可以包括接口(Interface,即前述数据总线,或称Interface模块)203、控制器201(即SSD控制器,或称controller模块)以及闪存阵列202(即前述存储器,或称NAND Flash Array模块)。其中,控制器201可以包括闪存转换层(FTL)2012和读属性识别功能模块2011。SSD20的interface模块203可以提供接收数据的I/O接口(即接口203);该模块可以独立于控制器和存储器,也可以与控制器和存储器中的任意一个或者两者集成在一起,本申请实施例对此不作限定;Host的处理器101向SSD20的控制器201发送写命令,不仅可以包含或者指示待存储数据的存储位置和数据量,还可以对待存储数据的数据属性进行标记,如标记部分待存储数据为第一数据(如图7所示的待存储数据W1和待存储数据W2)。例如,在处理器处理应用的业务时,运行的APP(应用软件)通过处理器给SSD20下发写命令,在写命令中标记待写入数据的属性。SSD控制器203通过接口不仅能够识别出数据的长度和确定需要存储的区域,还可以识别数据的读属性(该数据已经被标记为读属性的数据),并继续存储数据的操作。本申请实施例对各个模块的作用不再赘述,请参见前述设备实施例或者方法实施例的相关描述;本申请实施例对各个模块的功能和具体结构不做限定。结合图7所示的内容,本申请实施例的SSD工作步骤描述如下:Please refer to FIG. 7, which is a schematic diagram of another SSD data storage process provided by an embodiment of the present application; in the embodiment of the present application, the SSD 20 may include a controller 201 and a memory (that is, a flash memory array 202); The SSD 20 in the example can also include an interface (Interface, the aforementioned data bus, or Interface module) 203, a controller 201 (i.e. SSD controller, or controller module), and a flash memory array 202 (i.e., the aforementioned memory, or NAND Flash). Array module). The controller 201 may include a flash memory conversion layer (FTL) 2012 and a read attribute recognition function module 2011. The interface module 203 of the SSD20 can provide an I/O interface (ie interface 203) for receiving data; this module can be independent of the controller and the memory, or can be integrated with either or both of the controller and the memory. The embodiment does not limit this; the processor 101 of the Host sends a write command to the controller 201 of the SSD 20, which can not only include or indicate the storage location and data volume of the data to be stored, but also mark the data attributes of the data to be stored, such as a mark Part of the data to be stored is the first data (the data to be stored W1 and the data to be stored W2 as shown in FIG. 7). For example, when the processor is processing application services, the running APP (application software) issues a write command to the SSD 20 through the processor, and the attribute of the data to be written is marked in the write command. The SSD controller 203 can not only identify the length of the data and determine the area to be stored through the interface, but also identify the read attribute of the data (the data has been marked as read attribute data), and continue the operation of storing the data. The role of each module in the embodiment of this application will not be repeated, please refer to the related description of the aforementioned device embodiment or method embodiment; the embodiment of this application does not limit the function and specific structure of each module. With reference to the content shown in FIG. 7, the working steps of the SSD in the embodiment of the present application are described as follows:
1、SSD的接口203向Host的处理器101提供能接收数据的I/O接口(即接口203),用于接收待存储数据W,其中,所述待存储数据W可以是在处理器中还没有向SSD发送的未标记数据。1. The interface 203 of the SSD provides an I/O interface (ie interface 203) capable of receiving data to the processor 101 of the Host for receiving the data W to be stored, wherein the data W to be stored may be stored in the processor or There is no untagged data sent to the SSD.
2、在处理器101运行APP时,通过前述I/O接口下发写命令时,在写命令中标记待写入数据的属性,如标记的W1和W2,标记W1为第一数据,标记W2为第二数据。如图7所示,处理器101中包含的W1和W2是已经被标记的数据。2. When the processor 101 runs the APP, when a write command is issued through the aforementioned I/O interface, mark the attributes of the data to be written in the write command, such as marked W1 and W2, mark W1 as the first data, mark W2 For the second data. As shown in FIG. 7, W1 and W2 contained in the processor 101 are already marked data.
3、SSD控制器201中的读属性识别(read attribute identification)功能模块2011识别命令的数据属性,比如识别并区分W1和W2,识别出W1是第一数据,识别出W2是第二数据。其中,图7中的W1可以参考图2中的读属性数据,W2可以参考图2中的普通数据。3. The read attribute identification function module 2011 in the SSD controller 201 identifies the data attribute of the command, such as identifying and distinguishing W1 and W2, identifying W1 as the first data, and identifying W2 as the second data. Among them, W1 in FIG. 7 may refer to the read attribute data in FIG. 2, and W2 may refer to the ordinary data in FIG. 2.
4、根据前述所识别的数据属性,通过FTL模块2012将待写入数据分发并存储到NAND Flash介质上;其中,如果是读属性的数据,将该数据尽量存储到读时延低的page单元中,图中以Lower Page(对应的存储区域读时延低)优先存储W1(待存储的读属性数据,即第一数据)为例进行说明,也可以根据实际情况将部分W1存储至UP;如果不是读属性的数据,将该数据尽量存储到读时延高的page单元中。本申请实施例对具体数据和具体存储区域的读时延匹配关系不作限定。在申请实施例中,假设LP以及UP的读时延低于MP,但是需要理解的是,不同品牌不同产品的存储区域的读时延固有参数存在区别,可以结合本申请实施例的基础上,根据实际应用情况进行调整。4. According to the aforementioned identified data attributes, distribute and store the data to be written on the NAND Flash media through the FTL module 2012; among them, if it is the data of the read attribute, try to store the data in the page unit with low read latency In the figure, the lower page (corresponding to the storage area with low read latency) preferentially stores W1 (the read attribute data to be stored, that is, the first data) as an example for illustration, and part of W1 can also be stored in UP according to the actual situation; If it is not the data of the read attribute, try to store the data in the page unit with high read delay. The embodiment of the present application does not limit the matching relationship between the specific data and the read delay of the specific storage area. In the application embodiment, it is assumed that the read latency of LP and UP is lower than MP, but it should be understood that there are differences in the inherent parameters of the read latency of the storage area of different brands and different products, which can be combined on the basis of the embodiments of this application, Adjust according to actual application.
可以理解的是,本申请实施例对待存储数据的数据量不作限定,对应用的场景不作限定。在本申请实施例中,APP将标记数据写入SSD是一种示例性的场景描述。It is understandable that the embodiment of the present application does not limit the amount of data to be stored, and does not limit the application scenario. In the embodiment of the present application, writing the tag data into the SSD by the APP is an exemplary scenario description.
或者,第一数据可以是包含指定标识的数据,所述指定标识用于标记第一数据;指定标识可以通过人为设置,也可以根据一定的标记规则进行智能标记。当第一数据为包含指定标识的数据,指定标识的内容还可以包括被标识的数据的预设读取频率或者读取优先级 等,本申请实施例对指定标识的具体内容不作限定。例如,指定标识标记对应数据的读取优先级为高优先级,那么在选择该数据对应的存储区域时,选择读时延低的存储区域存储该数据。再例如,指定标识标记对应数据的预设读取频率为高频读取,那么在选择该数据对应的存储区域时,选择读时延低的存储区域存储该数据。Alternatively, the first data may be data containing a designated identifier, and the designated identifier is used to mark the first data; the designated identifier may be manually set, or smart marking may be performed according to a certain marking rule. When the first data is data containing a designated identifier, the content of the designated identifier may also include the preset reading frequency or read priority of the identified data, and the specific content of the designated identifier is not limited in the embodiment of the present application. For example, if the read priority of the data corresponding to the designated identification mark is high priority, then when the storage area corresponding to the data is selected, the storage area with low read latency is selected to store the data. For another example, if the preset reading frequency of the data corresponding to the designated identification mark is high-frequency reading, when the storage area corresponding to the data is selected, a storage area with a low read delay is selected to store the data.
上面的申请实施例提供的一种SSD设备,需要与Host配合完成数据识别以及存储;下面为了直观地说明前述包含标识的第一数据,本申请实施例提供另外一种不同SSD设备以及实施方案,与前述申请实施例的区别在于,本申请实施例涉及SSD中增加了读写频率统计模块而不需要与Host配合,能够独自完成对数据的识别以及存储等操作。The above application embodiment provides an SSD device that needs to cooperate with the Host to complete data identification and storage; in order to intuitively illustrate the aforementioned first data containing the identifier, this application embodiment provides another different SSD device and implementation solution. The difference from the foregoing application embodiment is that the embodiment of the application involves the addition of a read and write frequency statistics module to the SSD without the need to cooperate with the Host, and can independently complete operations such as data identification and storage.
请参见图8,图8是本申请实施例提供的又一种SSD的数据存储流程示意图。本申请实施例的SSD20内部可以包括控制器201和存储器(即闪存阵列202),具体地,还可以包括接口Interface203(即前述数据总线,或称Interface模块)、控制器(controller)201以及闪存阵列202(即前述存储器,或称NAND Flash Array模块);本申请实施例的SSD还可以包括读属性识别功能模块2011和读写频率统计(Read/Write frequency statistics)模块2013。其中,控制器201还可以包括内存转换层(FTL)2012。本申请实施例对各个模块的作用不再赘述,请参见前述设备实施例或者方法实施例的相关描述;本申请实施例对各个模块的功能和具体结构不做限定。Please refer to FIG. 8. FIG. 8 is a schematic diagram of another SSD data storage process provided by an embodiment of the present application. The SSD 20 in the embodiment of the present application may include a controller 201 and a memory (that is, a flash memory array 202), specifically, it may also include an interface 203 (that is, the aforementioned data bus, or interface module), a controller (controller) 201, and a flash memory array. 202 (that is, the aforementioned memory, or NAND Flash Array module); the SSD in the embodiment of the present application may also include a read attribute recognition function module 2011 and a read/write frequency statistics (Read/Write frequency statistics) module 2013. Wherein, the controller 201 may also include a memory translation layer (FTL) 2012. The role of each module in the embodiment of this application will not be repeated, please refer to the related description of the aforementioned device embodiment or method embodiment; the embodiment of this application does not limit the function and specific structure of each module.
具体地,SSD20通过控制器201在内部智能地识别待持久化存储的数据(如图8所示的数据W)的属性,然后将识别后的不同数据(如图8所示的数据W1和数据W2,为数据W中被控制器区分后的待存储数据)存储到不同的page单元中。如图8所示,SSD内部设计的读写频率统计模块2013,该模块会统计各个存储区域的历史读写次数并计算各个区域的读写频率。存储区域的划分粒度可以多样,比如,按LBA来划分。读属性识别功能模块2011根据读写频率统计模块的信息判断数据的属性。可以理解的是,接口Interface模块203可以独立于控制器和存储器,也可以与控制器和存储器中任意一个或两者集成在一起,本申请实施例对此不作限定。结合图8所示的内容,本申请实施例的SSD工作步骤描述如下:Specifically, the SSD 20 intelligently recognizes the attributes of the data to be persistently stored (data W as shown in FIG. 8) through the controller 201, and then combines the identified different data (data W1 and data as shown in FIG. 8). W2, the data to be stored after being distinguished by the controller in the data W) is stored in different page units. As shown in Figure 8, the read and write frequency statistics module 2013 designed inside the SSD will count the historical read and write times of each storage area and calculate the read and write frequency of each area. The granularity of the storage area can be various, for example, divided by LBA. The reading attribute recognition function module 2011 judges the attribute of the data according to the information of the reading and writing frequency statistics module. It can be understood that the interface module 203 may be independent of the controller and the memory, or may be integrated with either or both of the controller and the memory, which is not limited in the embodiment of the present application. With reference to the content shown in FIG. 8, the working steps of the SSD in the embodiment of the present application are described as follows:
1、在运行APP的过程中,处理器通过I/O接口向SSD20下发写命令,其中,写命令用于指示SSD接收并存储部分或者全部待存储数据W,其中,所述待存储数据W可以是在处理器中没有标记的数据。1. In the process of running the APP, the processor issues a write command to the SSD 20 through the I/O interface, where the write command is used to instruct the SSD to receive and store part or all of the data to be stored W, where the data to be stored W It can be data that is not marked in the processor.
2、SSD控制器201中的读属性识别功能模块2011根据读写频率统计模块2013判断待存储数据W的属性。如图8所示,在控制器中,可以将数据W中部分数据被识别为第一数据(例如待存储数据W1)或者部分数据被识别为第二数据(例如待存储数据W2);可以理解的是,第一数据和第二数据的判定是可以根据具体的规则以及数据的读写情况,重新判断和识别的,例如,将读取频率高于预设读取频率阈值的数据识别为第一数据,或者数据集合中读取频率较高的一个或者多个数据识别为第一数据;本申请实施例对此不作限定。2. The read attribute recognition function module 2011 in the SSD controller 201 determines the attribute of the data W to be stored according to the read and write frequency statistics module 2013. As shown in FIG. 8, in the controller, part of the data in the data W may be identified as the first data (for example, the data to be stored W1) or part of the data may be identified as the second data (for example, the data to be stored W2); However, the judgment of the first data and the second data can be re-judgmented and identified according to specific rules and the reading and writing of the data. For example, the data whose reading frequency is higher than the preset reading frequency threshold is identified as the first data. A piece of data, or one or more pieces of data with a higher reading frequency in a data set are identified as the first data; this embodiment of the present application does not limit this.
3、根据前述识别的数据W的属性,通过FTL模块2012将待写入数据(包括待存储数据W1和待存储数据W2)分发并存储到NAND Flash介质上;其中,如果是读属性的数据,将该数据尽量存储到读时延低的page单元中,图中以Lower Page(对应的存储区域读 时延低)存储W1(待存储的读属性数据,即第一数据),MP存储待存储数据W2为例进行说明;如果不是读属性的数据,将该数据尽量存储到读时延高的page单元中。在申请实施例中,假设LP以及UP的读时延低于MP,但是需要理解的是,不同品牌不同产品的存储区域的读时延固有参数存在区别,可以结合本申请实施例的基础上,根据实际应用情况进行调整;本申请实施例对具体数据和具体存储区域的读时延匹配关系不作限定。3. According to the attributes of the data W identified above, the data to be written (including the data to be stored W1 and the data to be stored W2) are distributed and stored on the NAND Flash medium through the FTL module 2012; among them, if it is the data of the read attribute, Try to store this data in the page unit with low read latency. In the figure, Lower Page (corresponding to the storage area with low read latency) is used to store W1 (the read attribute data to be stored, that is, the first data), and MP is stored to be stored. The data W2 is taken as an example for description; if it is not the data of the read attribute, try to store the data in the page unit with high read delay. In the application embodiment, it is assumed that the read latency of LP and UP is lower than MP, but it should be understood that there are differences in the inherent parameters of the read latency of the storage area of different brands and different products, which can be combined on the basis of the embodiments of this application, Adjustments are made according to actual application conditions; the embodiment of the present application does not limit the matching relationship between the specific data and the read delay of the specific storage area.
可以理解的是,在目前业界的SSD产品中,一般会将Host下发的数据均匀存储在NAND Flash的3种page单元中;SSD平均读时延就是3种page的平均时延与控制器本身的数据传输时延之和。It is understandable that in the current SSD products in the industry, the data issued by the Host is generally evenly stored in the three page units of NAND Flash; the average read delay of the SSD is the average delay of the three pages and the controller itself The sum of data transmission delays.
请参见图9,图9是本申请实施例提供的一种SSD平均读时延分析示意图;如图9所示,某SSD产品的平均读时延总共是86us(图9中以and_A表示),如图9中(A)部分所示,是NAND Flash中3种page(Lower Page,Middle Page和Upper Page)读时延平均值66us(图9中以avg1表示)与SSD控制器数据传送的时延平均值20us(图9中以avg2表示)的总和(即and_A=avg1+avg2)。根据本申请中的任意实施例,针对同样的前述SSD产品,将APP经常读取的读属性数据存储在LP和UP中,在最佳情况下,如图9中(B)部分所示,APP读取数据时都是从LP和UP中获取,读时延的平均值为59us(图9中以avg3表示),以及SSD控制器数据传送的时延平均值也为20us(图中以avg4表示),那么SSD的读时延平均值(图9中以and_B表示)则是
Figure PCTCN2019102909-appb-000001
(即and_B=avg3+avg4),比未采用本方案的SSD产品降低了8%的读时延。可以理解的是,本申请实施例对待存储数据的数据量不作限定,对应用的场景不作限定。在本申请实施例中,APP向SSD写入未标记数据是一种示例性的场景描述。需要说明的是,本申请实施例中所描述的SSD的功能可参见图6、图10以及图11中的所述的方法实施例中的相关描述,此处不再赘述。
Please refer to Figure 9. Figure 9 is a schematic diagram of an SSD average read latency analysis provided by an embodiment of the present application; as shown in Figure 9, the average read latency of a certain SSD product is 86us in total (indicated by and_A in Figure 9). As shown in part (A) in Figure 9, it is the average read delay of 66us (represented by avg1 in Figure 9) of the three page (Lower Page, Middle Page and Upper Page) read delays in NAND Flash and the delay of data transmission from the SSD controller. The sum of the mean value 20us (represented by avg2 in Figure 9) (ie and_A=avg1+avg2). According to any embodiment of this application, for the same aforementioned SSD product, the read attribute data frequently read by APP is stored in LP and UP. In the best case, as shown in part (B) of Figure 9, APP When reading data, it is obtained from LP and UP. The average read delay is 59us (indicated by avg3 in Figure 9), and the average delay of SSD controller data transmission is also 20us (indicated by avg4 in the figure) , Then the average read latency of SSD (represented by and_B in Figure 9) is
Figure PCTCN2019102909-appb-000001
(That is, and_B=avg3+avg4), which reduces the read delay by 8% compared with SSD products that do not adopt this solution. It is understandable that the embodiment of the present application does not limit the amount of data to be stored, and does not limit the application scenario. In the embodiment of the present application, the APP writing unmarked data to the SSD is an exemplary scenario description. It should be noted that, for the functions of the SSD described in the embodiments of the present application, reference may be made to related descriptions in the method embodiments described in FIG. 6, FIG. 10, and FIG. 11, which will not be repeated here.
可选地,前述的第一数据分类(如高于预设频率阈值、包含指定标识等)可以存在分类交叉的情况,例如,对数据A初始化标识为第一数据(即包含指定标识),但是在实际写入、更新和读取等过程中,计算发现数据A的读取频率低,或者优先级低于其他类型的数据,或者不要求低读时延等等;那么可以将数据A重新归类为非第一数据。又例如,数据B在某业务处理阶段读取频率低,但是在另一个业务处理阶段需要对数据B进行高频读取,可以对数据B的属性进行重新判断,或者对数据B增加具备时效性的指定标识等。本申请实施例对第一数据的分类以及识别方式不作具体限定。Optionally, the aforementioned first data classification (for example, higher than a preset frequency threshold, including a designated identifier, etc.) may have a situation where the classification overlaps, for example, the initial identifier for data A is the first data (that is, the designated identifier is included), but In the actual writing, updating, and reading process, the calculation found that the read frequency of data A is low, or the priority is lower than other types of data, or low read latency is not required, etc.; then data A can be returned The class is non-first data. For another example, data B has a low read frequency in a certain business processing stage, but data B needs to be read at a high frequency in another business processing stage. The attributes of data B can be re-judged, or data B can be added with timeliness The designated logo, etc. The embodiment of the present application does not specifically limit the classification and recognition mode of the first data.
可选地,控制器在接受待存储数据的同时识别待存储数据中的第一数据。Optionally, the controller recognizes the first data in the data to be stored while receiving the data to be stored.
可以理解的是,控制器一次性接收的待存储数据的数据量根据控制器的内置存储模块大小决定,一般控制器接收到的除了待存储数据还有写命令,其中,写命令用于指示控制器将一定长度或者数据量的待存储数据存储至指定的区域。It is understandable that the data volume of the data to be stored received by the controller at one time is determined by the size of the built-in storage module of the controller. Generally, in addition to the data to be stored, the controller receives a write command, where the write command is used to instruct the control The device stores a certain length or amount of data to be stored in a designated area.
步骤S602:从所述SSD的多个存储区域中,选择与所述第一数据读时延匹配的第一存储区域。Step S602: From the multiple storage areas of the SSD, select a first storage area that matches the first data read delay.
具体地,控制器根据第一数据选择存储器中与所述第一数据所期望读时延匹配的第一存储区域,比如,根据第一数据的数据特征(如由于经常读取而要求读时延较低),所匹配 出的第一存储区域的读时延在SSD的多个存储区域的读时延中是相对较低或者最低的。本申请实施例对数据所期望读时延涉及的具体内容不作限定。其中,所述第一存储区域可以是图1中的Flash0-Flash N中某一个或者某几个存储区域。Specifically, the controller selects the first storage area in the memory that matches the expected read delay of the first data according to the first data, for example, according to the data characteristics of the first data (for example, the read delay is required due to frequent reading). Lower), the read delay of the matched first storage area is relatively low or the lowest among the read delays of the multiple storage areas of the SSD. The embodiment of the present application does not limit the specific content involved in the expected read delay of the data. Wherein, the first storage area may be one or several storage areas among Flash0-FlashN in FIG. 1.
例如,请参见图2,SSD控制器203根据读属性数据,选择闪存阵列205中与所述读属性数据所期望的读时延匹配的存储区域2021(LP)和存储区域2023(UP)。For example, referring to FIG. 2, the SSD controller 203 selects the storage area 2021 (LP) and the storage area 2023 (UP) in the flash memory array 205 that match the read delay expected by the read attribute data according to the read attribute data.
可选地,第一数据还可以根据具体数据对应的重要性以及读取频率,分类为不同优先级的第一数据,比如,优先级最高的第一数据一般应该优先存储至第一存储区域中读时延最低的存储区域,而优先级稍低的第一数据可以等待前述优先级最高的第一数据存储完后,再存储至相同或者读时延比前述读时延最低要稍高的存储区域,本申请实施例对不影响本申请核心的具体存储方式不作具体限定。Optionally, the first data can also be classified into first data with different priorities according to the importance and reading frequency of the specific data. For example, the first data with the highest priority should generally be stored in the first storage area first. The storage area with the lowest read delay, and the first data with a slightly lower priority can wait for the first data with the highest priority to be stored, and then store it to the storage with the same or slightly higher read delay than the lowest read delay. Area, the embodiment of the application does not specifically limit the specific storage method that does not affect the core of the application.
可选地,SSD的多个存储区域可以分类为低读时延的存储区域、中读时延的存储区域和高读时延的存储区域。例如,当前业界大部分SSD产品采用的是TLC类型的介质。TLC NAND Flash的一个cell单元中可以存储3个比特(bit)的信息。在逻辑划分上,cell中的每个bit属于不同的page,所以TLC NAND Flash可以包括3种page单元,分别具体是Lower Page、Middle Page和Upper Page;这三种page(页)单元的名称与其读时延长短没有必然的联系。由于NAND Flash的编程方式原理不作详细说明,以及编程差异,每个page单元的存储特性有差异,特别是读操作(或称读命令)的时延,本申请实施例不作具体限定。比如,东芝BiCS4TLC的Lower Page的读时延约是60us、而Middle Page的约是80us、Upper Page的约是58us。可以理解的是,Middle Page的读时延比其他两个page高了近20%。这种读时延的差异性在QLC NAND Flash介质上也存在;可以理解的是,就目前的现有技术而言,本申请实施例比较适用于TLC和QLC,但本申请实施例对本申请中涉及的各个实施例应用的介质不作限定。Optionally, the multiple storage areas of the SSD may be classified into a storage area with low read latency, a storage area with medium read latency, and a storage area with high read latency. For example, most SSD products in the industry currently use TLC-type media. One cell of TLC NAND Flash can store 3 bits of information. In terms of logical division, each bit in a cell belongs to a different page, so TLC NAND Flash can include three types of page units, specifically Lower Page, Middle Page, and Upper Page; the names of these three page (page) units and their There is no inevitable connection to the lengthening of the reading time. Since the principle of the NAND Flash programming method is not described in detail, and the programming difference, the storage characteristics of each page unit are different, especially the delay of the read operation (or read command), which is not specifically limited in the embodiment of the present application. For example, the read latency of the Lower Page of Toshiba BiCS4TLC is about 60us, while that of the Middle Page is about 80us, and that of the Upper Page is about 58us. It is understandable that the read latency of Middle Page is nearly 20% higher than that of the other two pages. This difference in read latency also exists on QLC NAND Flash media; it is understandable that, as far as the current prior art is concerned, the embodiments of this application are more suitable for TLC and QLC, but the embodiments of this application are more effective in this application. The media applied in the various embodiments involved are not limited.
可选地,不同类型的存储介质一般会包括不同分类的page。下面以MLC为例来说明page的读时延差异。cell中的每个bit属于不同的page;MLC的一个cell存储2bit的信息,因此cell会有4种状态(11、10、01、00),而Flash用4种电荷量来表示前述4种cell状态。Flash通过不同的读取电压来判断当前cell中存储的数据。例如,对于Lower Page,只用一个读取电压就可以判断该page的数据是0还是1,但对于Upper Page可能就要依次用3个读电压多次读取cell后才能判断该page是0还是1。Upper Page的读取过程会比Lower Page花费更多的读取代价(如读取时间),所以读操作的时延有差别。可以理解的是,由于NAND Flash的存取方式差异,Flash中每个page读取代价不一,所以读操作的时延有差别。可以理解的是,NAND Flash介质可以根据cell存储的数据量,分为SLC、MLC、TLC和QLC等4大类型,本申请实施例比较适合TLC和QLC两种NAND Flash介质。Optionally, different types of storage media generally include pages of different categories. The following takes MLC as an example to illustrate the difference in page read delay. Each bit in the cell belongs to a different page; a cell of MLC stores 2 bits of information, so the cell has 4 states (11, 10, 01, 00), and Flash uses 4 kinds of charge to represent the aforementioned 4 kinds of cells status. Flash uses different read voltages to determine the data stored in the current cell. For example, for Lower Page, only one read voltage can be used to determine whether the data of the page is 0 or 1, but for Upper Page, it may be necessary to read the cell multiple times with three read voltages to determine whether the page is 0 or 1. The reading process of Upper Page will cost more reading cost (such as reading time) than Lower Page, so the delay of reading operation is different. It is understandable that due to the difference in NAND Flash access methods, the cost of reading each page in Flash is different, so the delay of the read operation is different. It is understandable that NAND Flash media can be classified into four types: SLC, MLC, TLC, and QLC according to the amount of data stored in the cell. The embodiment of the present application is more suitable for both TLC and QLC NAND Flash media.
步骤S603:将所述第一数据存储至所述第一存储区域。Step S603: Store the first data in the first storage area.
具体地,控制器可以直接通过接收的写命令将第一数据存储至存储器中的第一存储区域。可选地,控制器接收写命令并分析写命令,获取控制器应该执行的任务。控制器将SSD通过数据总线获得的数据,直接根据写命令将这些数据从数据总线存储至相应的存储区域,而不经过控制器。例如,请参见图2,SSD控制器203根据写命令将读属性数据存储至存储区域2021(LP)和存储区域2023(UP)。Specifically, the controller may directly store the first data in the first storage area in the memory through the received write command. Optionally, the controller receives the write command and analyzes the write command to obtain the tasks that the controller should perform. The controller directly stores the data obtained by the SSD through the data bus from the data bus to the corresponding storage area according to the write command without passing through the controller. For example, referring to FIG. 2, the SSD controller 203 stores the read attribute data in the storage area 2021 (LP) and the storage area 2023 (UP) according to the write command.
本申请实施例,通过从接收的待存储数据中识别第一数据(所述第一数据可以为需要从所述SSD中快速读取的数据,比如从所述SSD中读取频率高于预设频率阈值的数据、包含指定标识的数据和数据集合中读取频率较高数据中的一种或者多种,其中,所述数据集合可以包括SSD从Host一次或者多次接收的数据),将所述第一数据存储至与其读时延匹配的第一存储区域,从而降低在读取所述第一数据的过程中产生的平均读时延,提高配置有所述SSD的设备的业务处理性能。区别于现有技术中,在SSD内置缓存模块导致SSD控制器为了判断读写命令是否命中缓存,而需要多次寻址过程;本申请实施例中,可以通过去除SSD内部的缓存模块(或称数据缓存模块)而实现在满足一定业务需求的情况下减少生产的物料成本,同时避免了数据缓存模块进行二次寻址而增加SSD控制器的处理负荷;更重要的是,基于SSD存储介质的特性对数据进行有目的性地进行合理存储,降低方案实现复杂度,降低SSD平均读时延效果明显。In this embodiment of the application, the first data is identified from the received data to be stored (the first data may be data that needs to be read quickly from the SSD, for example, the reading frequency from the SSD is higher than a preset One or more of frequency threshold data, data containing a designated identifier, and data with a higher read frequency in the data set, where the data set may include data received by the SSD from the Host one or more times), and The first data is stored in the first storage area matching the read delay, thereby reducing the average read delay generated in the process of reading the first data, and improving the service processing performance of the device equipped with the SSD. Different from the prior art, the built-in cache module of the SSD causes the SSD controller to determine whether the read/write command hits the cache, and multiple addressing processes are required; in the embodiment of the present application, the internal cache module (or called Data caching module) to reduce the cost of production materials while meeting certain business requirements, and at the same time avoid the data caching module’s secondary addressing and increase the processing load of the SSD controller; more importantly, the SSD storage medium-based The feature stores data in a purposeful and reasonable manner, reduces the complexity of the solution implementation, and reduces the average read delay of the SSD. The effect is obvious.
请参见图10,图10是本申请实施例提供的另一种SSD的数据存储方法示意图,该固态硬盘的数据存储方法应用于固态硬盘的数据存储系统(包括上述系统架构)。其中,所述固态硬盘的数据存储系统可以包括主控(如服务器或者电脑的处理器)和固态硬盘SSD,其中,SSD内部可以包括控制器和存储器。下面将结合附图从固态硬盘中控制器的单侧进行描述,该方法可以包括以下步骤S1001-步骤S1010,可选的步骤还可以包括步骤S1004-步骤S1010。Please refer to FIG. 10. FIG. 10 is a schematic diagram of another SSD data storage method provided by an embodiment of the present application. The data storage method of the solid state disk is applied to the data storage system of the solid state disk (including the above system architecture). Wherein, the data storage system of the solid-state hard disk may include a main controller (such as a processor of a server or a computer) and a solid-state hard disk SSD, where the SSD may include a controller and a memory. The following will describe from a single side of the controller in the solid state hard disk with reference to the accompanying drawings. The method may include the following steps S1001-step S1010, and optional steps may also include step S1004-step S1010.
步骤S1001:接收待存储数据,识别所述待存储数据中的第一数据。Step S1001: Receive data to be stored, and identify the first data in the data to be stored.
具体地,请参见前述步骤S601的具体描述,在此不再赘述。Specifically, please refer to the specific description of the foregoing step S601, which will not be repeated here.
在一种可能的实现方式中,前述目标数据为在预设历史时间段内从前述SSD中读取频率高于预设频率阈值的数据;前述识别前述待存储数据中的第一数据,包括:将前述待存储数据中与前述目标数据内容相同的部分或者全部数据,识别为前述第一数据。例如,根据读取频率是否一致、数据有效位是否一致等条件判断两者是否相同。In a possible implementation manner, the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period; the aforementioned identification of the first data in the aforementioned data to be stored includes: Identify part or all of the data that has the same content as the target data in the aforementioned data to be stored as the aforementioned first data. For example, it can be judged whether the two are the same according to conditions such as whether the reading frequency is consistent and whether the data valid bit is consistent.
在一种可能的实现方式中,前述目标数据为在预设历史时间段内从前述SSD中读取频率高于预设频率阈值的数据;前述识别前述待存储数据中的第一数据,包括:将前述待存储数据中与前述目标数据类型相同的部分或者全部数据,识别为前述第一数据。例如,判断待存储数据中的部分或者全部数据与目标数据的数据来源是否相同或者相近;或者,是否都属于业务处理的相同环节需要的数据;或者用户(包括开发人员)对待存储数据中的部分或者全部数据与目标数据的读取需求是否相同等等。本申请实施例对具体的识别条件不作限定。In a possible implementation manner, the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period; the aforementioned identification of the first data in the aforementioned data to be stored includes: Identify part or all of the data to be stored that has the same type as the target data as the first data. For example, judging whether some or all of the data in the data to be stored is the same or similar to the data source of the target data; or whether they belong to the data required by the same link of business processing; or users (including developers) treat part of the stored data Or whether the reading requirements of all data and target data are the same, and so on. The embodiments of the present application do not limit specific identification conditions.
在一种可能的实现方式中,前述方法还包括:统计在预设历史时间段内,从前述SSD中读取数据的读取频率;将前述SSD中读取频率高于前述预设频率阈值的数据确定为前述目标数据。例如,控制器201确定数据在预设历史时间段内从所述SSD中读取的频率,将频率高于预设频率阈值的数据,识别为所述目标数据。其中,所述目标数据可以是从所述SSD中读取频率高于预设频率阈值的数据。例如,在通过APP读取用户信息(如姓名、出生日期、交易记录、聊天记录等)的情况下,用户信息为待存储数据,聊天记录以及姓名等内容为待存储数据中的每一个数据。控制器可以根据APP运行过程中,处理器经常性调 用的数据类型以及数据对象,对这些数据的历史读取频率进行计算。比如,聊天记录和交易记录对应的读取频率高于预设频率阈值,那么这两类数据是经常从SSD中读取的数据,可以识别(或称判断)为第一数据。可选地,对每一份待存储数据的,控制器可以针对每次接收并存储数据中的数据都进行一次读取频率计算。或者,对于同一类型或者同一种类的数据(比如聊天记录中涉及的多条文字、图片以及语音等数据)可以保留历史计算的读取频率,然后根据历史计算的读取频率对归属于聊天记录的数据进行识别,判断是否为第一数据。可选地,在历史计算的读取频率基础上,可以结合后续计算的读取频率对各个类型或者种类的数据的读取频率进行更新。In a possible implementation manner, the foregoing method further includes: counting the read frequency of reading data from the foregoing SSD within a preset historical time period; and determining the read frequency of the foregoing SSD that is higher than the foregoing preset frequency threshold. The data is determined as the aforementioned target data. For example, the controller 201 determines the frequency at which data is read from the SSD within a preset historical time period, and identifies data with a frequency higher than a preset frequency threshold as the target data. Wherein, the target data may be data whose read frequency is higher than a preset frequency threshold from the SSD. For example, in the case of reading user information (such as name, date of birth, transaction history, chat history, etc.) through the APP, the user information is data to be stored, and content such as chat history and name is each data in the data to be stored. The controller can calculate the historical reading frequency of these data according to the data types and data objects frequently called by the processor during the running of the APP. For example, if the reading frequency corresponding to the chat history and the transaction history is higher than the preset frequency threshold, then these two types of data are data that are frequently read from the SSD, and can be identified (or judged) as the first data. Optionally, for each piece of data to be stored, the controller may perform a reading frequency calculation for each data in the received and stored data. Or, for the same type or the same type of data (such as multiple texts, pictures, and voices involved in the chat history), the reading frequency of the historical calculation can be retained, and then the reading frequency of the historical calculation can be used for the data belonging to the chat history. The data is identified, and it is judged whether it is the first data. Optionally, based on the historically calculated reading frequency, the reading frequency of each type or category of data may be updated in combination with the reading frequency calculated subsequently.
步骤S1002:从所述SSD的多个存储区域中,选择与所述第一数据读时延匹配的第一存储区域。Step S1002: From the multiple storage areas of the SSD, select a first storage area matching the first data read delay.
具体地,请参见前述步骤S602的具体描述,在此不再赘述。Specifically, please refer to the specific description of the foregoing step S602, which will not be repeated here.
步骤S1003:将所述第一数据存储至所述第一存储区域。Step S1003: Store the first data in the first storage area.
具体地,请参见前述步骤S603的具体描述,在此不再赘述。Specifically, please refer to the specific description of the foregoing step S603, which will not be repeated here.
步骤S1004:识别所述待存储数据中的第二数据。Step S1004: Identify the second data in the data to be stored.
具体地,所述第二数据可以包括从所述SSD中读取频率低于所述第一数据的数据。具体识别第二数据的过程可以参考前述步骤S601的具体描述,在此不再赘述。Specifically, the second data may include data whose frequency of reading from the SSD is lower than that of the first data. For the specific process of identifying the second data, reference may be made to the specific description of the foregoing step S601, which is not repeated here.
步骤S1005:从所述SSD的多个存储区域中,选择与所述第二数据读时延匹配的第二存储区域。Step S1005: Select a second storage area matching the second data read delay from the multiple storage areas of the SSD.
具体地,所述第二存储区域的读时延高于所述第一存储区域。选择第二存储区域的具体过程可以参考前述步骤S602的具体描述,在此不再赘述。Specifically, the read delay of the second storage area is higher than that of the first storage area. For the specific process of selecting the second storage area, reference may be made to the specific description of the foregoing step S602, which will not be repeated here.
步骤S1006:将所述第二数据存储至所述第二存储区域。Step S1006: Store the second data in the second storage area.
具体地,控制器201将第二数据存储至所述第二存储区域的过程可以参考前述步骤S603的具体描述,在此不再赘述。Specifically, for the process of the controller 201 storing the second data in the second storage area, reference may be made to the specific description of the foregoing step S603, which will not be repeated here.
步骤S1007:当所述第一数据的数据量大于所述第一存储区域的存储容量,将所述第一数据中部分数据存储至所述第二存储区域。Step S1007: When the data amount of the first data is greater than the storage capacity of the first storage area, store part of the first data in the second storage area.
具体地,在待存储数据中既存储第一数据也存在第二数据的情况下,当第一数据的数据量大于能够容纳(或称存储)第一数据的存储区域的存储容量,控制器201将部分第一数据(比如在第一数据中读取频率较低的第一数据)存储至所述第二存储区域,以达到对数据的灵活存储。部分数据可以包括超出所述第一存储区域的存储容量的部分第一数据,例如,在部分的第一数据已经存满了第一存储区域,超出所述第一存储区域的存储容量的部分第一数据存储至第二存储区域。再例如,在第一数据的部分没有存满第一存储区域的情况下,由于第一数据量大于第一存储区域的容量,可以先对其中的数据根据读频率进行筛选排序,将读频率排序靠前的存储在第一存储区域,剩余数据可以选择存储在第二存储区域。Specifically, in the case where both the first data and the second data are stored in the data to be stored, when the data volume of the first data is greater than the storage capacity of the storage area capable of accommodating (or storing) the first data, the controller 201 Part of the first data (for example, the first data that is read less frequently among the first data) is stored in the second storage area, so as to achieve flexible storage of the data. The partial data may include a part of the first data that exceeds the storage capacity of the first storage area. For example, the part of the first data that has already filled the first storage area, and the part of the first data that exceeds the storage capacity of the first storage area. A data is stored in the second storage area. For another example, in the case where the first storage area is not full in the part of the first data, since the amount of the first data is greater than the capacity of the first storage area, the data in the first storage area can be filtered and sorted according to the read frequency, and the read frequency is sorted. The top ones are stored in the first storage area, and the remaining data can be optionally stored in the second storage area.
可选地,部分数据还可以包括其他存储情况下的第一数据,例如,在第一数据的部分没有存满第一存储区域的情况下,由于第一数据量大于第一存储区域的容量,可以先对其中的数据根据读频率进行筛选排序,将读频率排序靠前的存储在第一存储区域,剩余数据可以选择存储在第二存储区域。Optionally, the part of the data may also include first data in other storage conditions. For example, in the case where the first storage area is not full in the part of the first data, since the amount of the first data is greater than the capacity of the first storage area, The data in it can be sorted and sorted according to the read frequency first, the read frequency sorted first is stored in the first storage area, and the remaining data can be optionally stored in the second storage area.
应当理解的是,本申请实施例提供的方案为一种降低SSD平均读时延的方案,但涉及到实际具体数据存储时,会根据数据的情况(如数据类型、数据量和数据长度等)灵活为待存储数据匹配存储区域,既实现对全部数据的存储以防丢失,也在一定程度上能够降低读时延,所以本申请实施例在不与本申请中各个实施例矛盾的前提下,对实际具体数据灵活存储的方式不作限定。It should be understood that the solution provided in the embodiments of this application is a solution to reduce the average read latency of SSDs, but when it comes to actual specific data storage, it will be based on data conditions (such as data type, data volume, and data length, etc.) It is flexible to match the storage area for the data to be stored, which not only realizes the storage of all data to prevent loss, but also reduces the read delay to a certain extent. Therefore, the embodiments of the present application are not contradictory to the various embodiments of the present application. There is no limitation on the flexible storage method of actual specific data.
步骤S1008:当所述第二数据的数据量大于所述第二存储区域的存储容量,将所述第二数据中部分数据存储至所述第一存储区域。Step S1008: When the data amount of the second data is greater than the storage capacity of the second storage area, store part of the second data in the first storage area.
具体地,在待存储数据中既存储第一数据也存在第二数据的情况下,当第二数据的数据量大于能够容纳(或称存储)第二数据的存储区域的存储容量,控制器201将部分第二数据存储至所述第一存储区域,以达到对数据的灵活存储;进一步地,能够在第二数据占比高的情况下,以及第一存储区域满足第一数据存储的前提下,利用第一存储区域存储第二数据,不仅能够满足第一数据的快速读取,还能提高第二数据的读取效率,有效降低SSD的读时延。本申请实施例提供的方案为一种降低SSD平均读时延的方案,但涉及到实际具体数据存储时,应当理解的是,会根据数据的情况(如数据类型、数据量和数据长度等)灵活为待存储数据匹配存储区域,既实现对全部数据的存储以防丢失,也在一定程度上能够降低读时延,所以本申请实施例在不与本申请中各个实施例矛盾的前提下,对实际具体数据灵活存储的方式不作限定。Specifically, in the case where both the first data and the second data are stored in the data to be stored, when the data amount of the second data is greater than the storage capacity of the storage area capable of accommodating (or storing) the second data, the controller 201 Part of the second data is stored in the first storage area to achieve flexible storage of the data; further, it can be used when the proportion of the second data is high and the first storage area satisfies the first data storage Using the first storage area to store the second data can not only satisfy the fast reading of the first data, but also improve the reading efficiency of the second data, and effectively reduce the read delay of the SSD. The solution provided by the embodiments of this application is a solution to reduce the average read latency of SSD, but when it comes to actual specific data storage, it should be understood that it will be based on the data situation (such as data type, data volume, and data length, etc.) It is flexible to match the storage area for the data to be stored, which not only realizes the storage of all data to prevent loss, but also reduces the read delay to a certain extent. Therefore, the embodiments of the present application are not contradictory to the various embodiments of the present application. There is no limitation on the flexible storage method of actual specific data.
步骤S1009:将所述第一数据缓存至所述缓冲存储区。Step S1009: Buffer the first data in the buffer storage area.
具体地,在使用步骤S1009的加速方案中,后续控制器201针对接收到的读命令,一般会有如下两种处理结果:(1)从缓冲存储区模块中直接获取数据,在该操作下读时延比较低;(2)从NAND Flash芯片中获取数据并同步保存到缓冲存储区模块中,这样读命令的时延(即读时延)可能比前述的结果(1)高;所以,该加速方案的降低读时延效果与从缓冲存储区模块中直接获取到数据的概率强相关。虽然涉及到以上两种处理情况,但本申请实施例以第二种情况为前提进行说明。例如,SSD的控制器201根据写命令将部分的第一数据存储至缓冲存储区;在控制器201接收到读命令时,可以同时从缓冲存储区和存储器202查询并读取第一数据,或者优先从缓冲存储区查询并读取第一数据,当目标第一数据在缓冲存储区中查找失败后,随即向SSD的存储器202查询并读取目标第一数据。所述SSD还可以包括缓冲存储区缓冲存储区;其中,所述缓冲存储区用于存储所述第一数据;数据缓存(缓冲存储区)模块,可以只用于缓存Host所发命令(可以包括读命令和写命令)涉及的data,也可以缓存SSD内部的元数据。Specifically, in the acceleration scheme using step S1009, the subsequent controller 201 generally has the following two processing results for the received read command: (1) Obtain data directly from the buffer memory module, and read under this operation The delay is relatively low; (2) The data is obtained from the NAND Flash chip and stored in the buffer memory module synchronously. In this way, the delay of the read command (that is, the read delay) may be higher than the aforementioned result (1); therefore, the The effect of the acceleration scheme in reducing the read delay is strongly related to the probability of obtaining data directly from the buffer memory module. Although the above two processing situations are involved, the embodiments of the present application are described on the premise of the second situation. For example, the controller 201 of the SSD stores part of the first data in the buffer storage area according to the write command; when the controller 201 receives the read command, it can query and read the first data from the buffer storage area and the memory 202 at the same time, or The first data is queried and read from the buffer storage area first, and when the target first data fails to be searched in the buffer storage area, the memory 202 of the SSD is queried and read the target first data immediately. The SSD may also include a buffer storage area; wherein the buffer storage area is used to store the first data; a data cache (buffer storage area) module may only be used to cache commands sent by the Host (which may include The data involved in the read command and write command can also be cached in the metadata of the SSD.
可选地,控制器201在接收被标识的第一数据后,并根据第一数据携带的标识,将第一数据存入缓冲存储区。本申请实施例不仅可以采用通过SSD内部统计数据的读频率来识别第一数据(或者其他合理的方式识别第一数据,在此不再赘述),还在识别第一数据以及匹配对应存储区域的方案基础上,再结合SSD的缓冲存储区缓存部分的第一数据。例如,识别出的第一数据部分存入缓冲存储区,同时也在存储器202(即NAND Flash介质)匹配的存储区域中备份存储相同的完整数据。当该数据需要被读取时,可以先从缓冲存储区中读取数据。如果第一次读取过程中,概率命中所需要的数据,那么就不需要二次寻址。在SSD上电正常工作的过程中,可以直接从缓冲存储区中进行该数据的读取;即使突发断电 的情况,也可以在下次上电工作时从存储器中获取到备份的该数据,既降低了平均读时延也保障了数据的正常存储。Optionally, after receiving the identified first data, the controller 201 stores the first data in the buffer storage area according to the identification carried in the first data. The embodiment of the application can not only use the reading frequency of the internal statistics data of the SSD to identify the first data (or other reasonable ways to identify the first data, which will not be repeated here), but also identify the first data and match the corresponding storage area. On the basis of the scheme, the first data in the buffer storage area of the SSD is combined to cache part. For example, the identified first data part is stored in the buffer storage area, and at the same time, the same complete data is backed up and stored in the storage area matched by the memory 202 (that is, the NAND Flash medium). When the data needs to be read, the data can be read from the buffer storage area first. If during the first reading process, the probability hits the required data, then there is no need for secondary addressing. When the SSD is powered on and working normally, the data can be read directly from the buffer storage area; even in the case of sudden power failure, the backup data can be obtained from the memory when it is powered on the next time. It not only reduces the average read delay but also guarantees the normal storage of data.
步骤S1010:当接收所述第一数据的读命令,优先从所述缓冲存储区中读取所述第一数据。Step S1010: When receiving the read command of the first data, preferentially read the first data from the buffer storage area.
具体地,SSD控制器201根据第一数据的命令(可以包含第一数据的特定标识或者第一数据的存储区域或者第一数据的数据量),优先从缓冲存储区中读取部分或者全部存储缓冲存储区的第一数据;可以理解的是,优先从缓冲存储区中读取也不一定代表能够第一时间从缓冲存储区中获取需要的数据,因为所需要的数据可能会由于存储容量等问题并没有存储在缓冲存储区。Specifically, the SSD controller 201 preferentially reads part or all of the storage from the buffer storage area according to the command of the first data (which may include the specific identification of the first data or the storage area of the first data or the data amount of the first data). The first data in the buffer storage area; it can be understood that the priority of reading from the buffer storage area does not necessarily mean that the required data can be obtained from the buffer storage area in the first time, because the required data may be due to storage capacity, etc. The problem is not stored in the buffer storage area.
在一种可能的实现方式中,SSD控制器201从接收的命令中识别出读命令,优先处理识别出的读命令,对与读命令匹配的数据进行读取;进一步地,可以结合本申请实施例,从而有效降低SSD的平均读时延。具体地,SSD控制器判断接收到的或由SSD控制器生成的命令是否为读命令;若为读命令,则SSD优先处理前述读命令以及相关操作。本申请实施例对读命令的处理方式(包括对优化读命令的处理方式)不作具体描述以及限定。In a possible implementation manner, the SSD controller 201 recognizes the read command from the received command, processes the recognized read command preferentially, and reads the data matching the read command; further, it can be implemented in conjunction with this application For example, thereby effectively reducing the average read latency of SSD. Specifically, the SSD controller judges whether the command received or generated by the SSD controller is a read command; if it is a read command, the SSD preferentially processes the aforementioned read command and related operations. The embodiment of the present application does not specifically describe and limit the processing method of the read command (including the processing method of the optimized read command).
本申请实施例,通过从接收的待存储数据中识别第一数据(所述第一数据可以为需要从所述SSD中快速读取的数据,比如从所述SSD中读取频率高于预设频率阈值的数据、包含指定标识的数据和数据集合中读取频率较高数据中的一种或者多种,其中,所述数据集合可以包括SSD从Host一次或者多次接收的数据),将所述第一数据存储至与其读时延匹配的第一存储区域,从而降低在读取所述第一数据的过程中产生的平均读时延,提高配置有所述SSD的设备的业务处理性能。区别于现有技术中,在SSD内置缓存模块导致SSD控制器为了判断读写命令是否命中缓存,而需要多次寻址过程;本申请实施例中,可以通过去除SSD内部的缓存模块(或称数据缓存模块)而实现在满足一定业务需求的情况下减少生产的物料成本,同时避免了数据缓存模块进行二次寻址而增加SSD控制器的处理负荷;更重要的是,基于SSD存储介质的特性对数据进行有目的性地进行合理存储,降低方案实现复杂度,降低SSD平均读时延效果明显。In this embodiment of the application, the first data is identified from the received data to be stored (the first data may be data that needs to be read quickly from the SSD, for example, the reading frequency from the SSD is higher than a preset One or more of frequency threshold data, data containing a designated identifier, and data with a higher read frequency in the data set, where the data set may include data received by the SSD from the Host one or more times), and The first data is stored in the first storage area matching the read delay, thereby reducing the average read delay generated in the process of reading the first data, and improving the service processing performance of the device equipped with the SSD. Different from the prior art, the built-in cache module of the SSD causes the SSD controller to determine whether the read/write command hits the cache, and multiple addressing processes are required; in the embodiment of the present application, the internal cache module (or called Data caching module) to reduce the cost of production materials while meeting certain business requirements, and at the same time avoid the data caching module’s secondary addressing and increase the processing load of the SSD controller; more importantly, the SSD storage medium-based The feature stores data in a purposeful and reasonable manner, reduces the complexity of the solution implementation, and reduces the average read delay of the SSD. The effect is obvious.
进一步地,通过从待存储的数据中,根据第一数据的数据特征识别第一数据,有利于便于后续的数据分类存储,将第一数据高效地存储至与之读时延匹配的存储区域。其中,数据特征可以包括读取频率高于预设频率阈值、包含指定标识和在数据集合中读取频率靠前等,本申请实施例对具体的数据特征不作限定。进一步地,通过对已经存储在固态硬盘中的数据的读取频率进行计算,有利于优化已存储数据的存储区域,能够根据实际的数据读取情况调节数据存储位置,提高数据的读取效率,进而提高了主控设备的业务处理性能。进一步地,通过识别符合特定数据特征(区别于第一数据的数据特征)的第二数据,并将所述第二数据存储至与之读时延匹配的第二存储区域,对数据的分类存储,有效基于存储区域的特性存储数据,提高数据的读取效率。本申请实施例对符合特定数据特征的第二数据以及所述特定数据特征不作限定。Further, by identifying the first data according to the data characteristics of the first data from the data to be stored, it is beneficial to facilitate subsequent data classification and storage, and efficiently store the first data in a storage area matching the read delay. Among them, the data characteristics may include reading frequency higher than a preset frequency threshold, including a designated identifier, and reading frequency higher in the data set, etc. The specific data characteristics are not limited in the embodiment of the present application. Further, by calculating the reading frequency of the data that has been stored in the solid state drive, it is helpful to optimize the storage area of the stored data, and the data storage location can be adjusted according to the actual data reading situation, and the data reading efficiency can be improved. In turn, the service processing performance of the main control device is improved. Further, by identifying second data that meets specific data characteristics (data characteristics that are different from the first data), and storing the second data in a second storage area matching the read delay, the data is classified and stored , Effectively store data based on the characteristics of the storage area, and improve the efficiency of data reading. The embodiment of the present application does not limit the second data that meets the specific data feature and the specific data feature.
进一步地,根据数据量与存储区域的存储容量的关系存储数据,如在第二数据量大时将部分数据存储至第一存储区域;根据实际的数据量情况灵活存储数据,有效利用存储区域,有利于整体上降低读时延。Further, store data according to the relationship between the amount of data and the storage capacity of the storage area, such as storing part of the data in the first storage area when the amount of second data is large; store data flexibly according to the actual amount of data, and effectively use the storage area, It helps to reduce the read delay as a whole.
进一步地,可以重新增加缓冲存储区模块;通过缓冲存储区存储部分的数据;在SSD正常上电工作的情况下,便于主控(如处理器或者服务器)能够有概率地直接从缓冲存储区中获得所需要的数据,在本申请实施例的基础上进一步降低SSD的平均读时延,且适用于对成本要求低但对数据读取效率要求高的应用场景。比现有技术中SSD内置缓冲存储区,在第一次寻址失败而需要二次寻址的情况下,能够降低SSD的平均读时延。Further, the buffer storage area module can be added again; part of the data is stored through the buffer storage area; when the SSD is normally powered on, it is convenient for the main control (such as a processor or server) to be directly from the buffer storage area with probability Obtaining the required data further reduces the average read delay of the SSD on the basis of the embodiments of the present application, and is suitable for application scenarios that require low cost but high data read efficiency. Compared with the SSD built-in buffer storage area in the prior art, the average read latency of the SSD can be reduced when the first addressing fails and the second addressing is required.
请参见图11,图11是本申请实施例提供的再一种SSD的数据存储方法示意图,该固态硬盘的数据存储方法应用于固态硬盘的数据存储系统(包括上述系统架构)。其中,所述固态硬盘的数据存储系统可以包括主控(如服务器或者电脑的处理器)和固态硬盘SSD,其中,SSD内部可以包括控制器和存储器。下面将结合附图11从固态硬盘中控制器的单侧进行描述,该方法可以包括以下步骤S1101-步骤S1106,可选的步骤还可以包括步骤S1104-步骤S1106。Please refer to FIG. 11. FIG. 11 is a schematic diagram of another SSD data storage method provided by an embodiment of the present application. The data storage method of the solid state hard disk is applied to the data storage system of the solid state hard disk (including the above-mentioned system architecture). Wherein, the data storage system of the solid-state hard disk may include a main controller (such as a processor of a server or a computer) and a solid-state hard disk SSD, where the SSD may include a controller and a memory. The following will describe from a single side of the controller in the solid state hard disk with reference to FIG. 11. The method may include the following steps S1101-step S1106, and optional steps may also include step S1104-step S1106.
步骤S1101:接收待存储数据,识别所述待存储数据中的第一数据。Step S1101: Receive the data to be stored, and identify the first data in the data to be stored.
具体地,请参见图6对应的前述步骤S601的具体描述,在此不再赘述;其中,所述第一数据为包含指定标识的数据,所述指定标识用于指示所述第一数据的读取时延需求。例如,主控对数据进行标识后,数据有第一数据的标识。或者,数据A本身携带指定第一数据的标识;控制器根据写命令,直接从接收的数据中,通过第一数据的标识将数据识别为第一数据。Specifically, please refer to the detailed description of the foregoing step S601 corresponding to FIG. 6, which will not be repeated here; wherein, the first data is data including a designated identifier, and the designated identifier is used to indicate the reading of the first data. Take the delay requirement. For example, after the master has identified the data, the data has the identification of the first data. Alternatively, the data A itself carries an identifier specifying the first data; the controller directly recognizes the data as the first data from the received data according to the write command through the identifier of the first data.
步骤S1102:从所述SSD的多个存储区域中,根据所述指定标识选择与所述第一数据读时延匹配的第一存储区域。Step S1102: From the multiple storage areas of the SSD, select a first storage area matching the first data read delay according to the designated identifier.
具体地,所述指定标识用于指示所述第一数据的读取时延需求;根据指定标识的内容(如指定标识标记了该第一数据的具体读取频率或者读取优先级,前述内容都可以认为反映的是读取时延的需求),将所述第一数据存储至与其期望的读时延匹配的第一存储区域。例如,从标识中确定该第一数据的读取频率最高,那么可以将该第一数据存储至SSD中读时延最小的存储区域。Specifically, the designated identifier is used to indicate the read delay requirement of the first data; according to the content of the designated identifier (for example, the designated identifier marks the specific read frequency or read priority of the first data, the foregoing content It can be considered that it reflects the demand of read delay), and the first data is stored in the first storage area that matches the expected read delay. For example, if it is determined from the identifier that the reading frequency of the first data is the highest, then the first data can be stored in the storage area of the SSD with the smallest reading delay.
在一种可能的实现方式中,将所述待存储数据中包含所述指定标识的数据,识别为所述第一数据。例如,控制器201将携带指定标识的数据识别为第一数据,其中,该数据可以是在数据的字段中的某位置包含固定字符,或者该数据和标识绑定在一起,但标识并不占用数据的字段。再例如,指定标识可以是数据对应的ID或者编号,以编号1是第一数据为例,当识别出接收的命令中数据编号为1,那么就将对应的数据存储至第一存储区域。本申请实施例对指定标识的具体形式以及数据如何包含指定标识不作限定。In a possible implementation manner, the data including the designated identifier in the to-be-stored data is identified as the first data. For example, the controller 201 recognizes the data carrying the designated identifier as the first data, where the data may include a fixed character in a certain position in the data field, or the data and the identifier are bound together, but the identifier does not occupy Data fields. For another example, the designated identifier may be the ID or number corresponding to the data. Taking the number 1 as the first data as an example, when it is recognized that the data number in the received command is 1, then the corresponding data is stored in the first storage area. The embodiments of this application do not limit the specific form of the designated identifier and how the data contains the designated identifier.
步骤S1103:将所述第一数据存储至所述第一存储区域。Step S1103: Store the first data in the first storage area.
具体地,请参见图6对应的前述步骤S603的具体描述,在此不再赘述。Specifically, please refer to the specific description of the foregoing step S603 corresponding to FIG. 6, which will not be repeated here.
在一种可能的实现方式中,所述方法还包括:当所述第一数据的数据量大于所述第一存储区域的存储容量,将所述第一数据中部分数据存储至所述第二存储区域;或者,当所述第二数据的数据量大于所述第二存储区域的存储容量,将所述第二数据中部分数据存储至所述第一存储区域。In a possible implementation, the method further includes: when the data amount of the first data is greater than the storage capacity of the first storage area, storing part of the data in the first data in the second Storage area; or, when the data amount of the second data is greater than the storage capacity of the second storage area, store part of the second data in the first storage area.
在一种可能的实现方式中,所述SSD还包括缓冲存储区;所述方法还包括:将所述第 一数据缓存至所述缓冲存储区。可选地,所述将所述第一数据缓存至所述缓冲存储区,包括:当接收所述第一数据的写命令后,根据所述写命令将所述第一数据存储至所述缓冲存储区。可选地,所述方法还包括:当接收所述第一数据的读命令,优先从所述缓冲存储区中读取所述第一数据。In a possible implementation manner, the SSD further includes a buffer storage area; the method further includes: buffering the first data in the buffer storage area. Optionally, the buffering the first data in the buffer storage area includes: after receiving a write command of the first data, storing the first data in the buffer according to the write command Storage area. Optionally, the method further includes: when receiving a read command of the first data, preferentially reading the first data from the buffer storage area.
步骤S1104:识别所述待存储数据中的第二数据。Step S1104: Identify the second data in the data to be stored.
具体地,请参见图10对应的前述步骤S1004的具体描述,在此不再赘述;其中,所述第二数据为从所述SSD中读取频率低于所述第一数据的数据。例如,第一数据的指定标识标记第一数据为高频读取的数据,第二数据的读取频率应该为在一定区间范围内低于第一数据的读取频率,不与本申请中其他实施例存在矛盾之处;再例如,第一数据的指定标识标记第一数据为低频读取的数据,第二数据的读取频率也应该为在一定区间范围内低于第一数据的读取频率,甚至可以与第一数据的读取频率近似。Specifically, please refer to the specific description of the aforementioned step S1004 corresponding to FIG. 10, which will not be repeated here; wherein, the second data is data whose frequency of reading from the SSD is lower than that of the first data. For example, the designated identification of the first data marks that the first data is high-frequency read data, and the reading frequency of the second data should be lower than the reading frequency of the first data within a certain range, which is not the same as other data in this application. There are contradictions in the embodiment; for another example, the designated identification of the first data marks that the first data is low-frequency read data, and the reading frequency of the second data should also be lower than that of the first data within a certain range. The frequency can even be similar to the reading frequency of the first data.
在一种可能的实现方式中,将待存储数据中未包含标识的数据识别为第二数据,将所述第二数据存储至非第一存储区域等读时延偏高的存储区域(如第二存储区域)。In a possible implementation, the data that does not contain an identifier in the data to be stored is identified as the second data, and the second data is stored in a storage area with a high read delay such as a non-first storage area (such as the first storage area). Two storage area).
在一种可能的实现方式中,SSD接收到的数据标识还可以用于标记数据为第一数据,或者将数据标记为第二数据。例如,主控对数据C标记为高频读取的数据,同时在下发写入命令时加入字段c;SSD控制器通过接口接收命令和数据时,直接根据字段c确定该数据为第一数据(即高频读取的数据),然后将其存储至低读时延的第一存储区域。或者,主控对数据C标记为低频读取的数据,同时在下发写入命令时加入字段d;SSD控制器通过接口接收命令和数据时,直接根据字段d确定该数据为第二数据(即低频读取的数据),然后将其存储至高读时延的第二存储区域。可选地,根据后续该数据的读取频率变化情况可以更改其存储区域;例如,原本标记为高频读取的数据,在后续的一段时间段内读取频率很低,可以根据一定规则将其存储至其他存储区域,利于腾出存储空间方便其他高频数据的写入;或者,原本标记为低频读取的数据,在后续的一段时间段内读取频率很高,可以根据一定规则将其存储至第一存储区域,利于提高SSD的数据处理效率,降低SSD的平均读时延。In a possible implementation manner, the data identifier received by the SSD may also be used to mark the data as the first data or to mark the data as the second data. For example, the main controller marks data C as high-frequency read data, and adds field c when issuing a write command; when the SSD controller receives commands and data through the interface, it directly determines that the data is the first data according to field c ( That is, high-frequency read data), and then store it in the first storage area with low read latency. Or, the main controller marks data C as low-frequency read data, and adds field d when issuing a write command; when the SSD controller receives commands and data through the interface, it directly determines that the data is the second data according to field d (ie Low-frequency read data), and then store it in the second storage area with high read latency. Optionally, the storage area can be changed according to the subsequent changes in the reading frequency of the data; for example, the data originally marked as high-frequency reading will have a low reading frequency in the subsequent period of time, and the data can be changed according to certain rules. It is stored in other storage areas to free up storage space to facilitate the writing of other high-frequency data; or, the data originally marked as low-frequency read will have a high read frequency in the subsequent period of time, and it can be changed according to certain rules. It is stored in the first storage area, which is beneficial to improve the data processing efficiency of the SSD and reduce the average read delay of the SSD.
步骤S1105:从所述SSD的多个存储区域中,选择与所述第二数据读时延匹配的第二存储区域。Step S1105: Select a second storage area matching the second data read delay from the multiple storage areas of the SSD.
具体地,请参见图10对应的前述步骤S1005的具体描述,在此不再赘述;其中,所述第二存储区域的读时延高于所述第一存储区域。Specifically, please refer to the detailed description of the foregoing step S1005 corresponding to FIG. 10, which will not be repeated here; wherein, the read delay of the second storage area is higher than that of the first storage area.
步骤S1106:将所述第二数据存储至所述第二存储区域。Step S1106: Store the second data in the second storage area.
具体地,请参见图10对应的前述步骤S1006的具体描述,在此不再赘述。Specifically, please refer to the specific description of the foregoing step S1006 corresponding to FIG. 10, which will not be repeated here.
上述详细阐述了几种本申请的方法实施例,下面提供了本申请实施例的几种相关装置。The foregoing describes in detail several method embodiments of the present application, and several related devices of the embodiments of the present application are provided below.
请参见图12,图12是本申请实施例提供的一种SSD的数据存储装置的结构示意图,所述固态硬盘SSD的数据存储装置12包括第一接收单元1201、第一识别单元1202、第一选择单元1203、第一存储单元1204、第一存储区域分类单元1205、第一决策单元1206、第一缓存单元1207、第一读取单元1208和目标数据确定单元1209,可选的单元可以包括第一存储区域分类单元1205、第一决策单元1206、第一缓存单元1207、第一读取单元1208 和目标数据确定单元1209。其中,Please refer to FIG. 12, which is a schematic structural diagram of an SSD data storage device provided by an embodiment of the present application. The data storage device 12 of the solid state hard disk SSD includes a first receiving unit 1201, a first identifying unit 1202, and a first The selection unit 1203, the first storage unit 1204, the first storage area classification unit 1205, the first decision unit 1206, the first cache unit 1207, the first reading unit 1208, and the target data determination unit 1209. The optional units may include the first A storage area classification unit 1205, a first decision-making unit 1206, a first caching unit 1207, a first reading unit 1208, and a target data determining unit 1209. among them,
第一接收单元1201,用于接收待存储数据;The first receiving unit 1201 is configured to receive data to be stored;
第一识别单元1202,用于识别前述待存储数据中的第一数据,其中,前述第一数据为与目标数据匹配的数据,前述目标数据为从前述SSD中读取频率高于预设频率阈值的数据;The first identification unit 1202 is configured to identify the first data in the aforementioned data to be stored, wherein the aforementioned first data is data that matches the target data, and the aforementioned target data is that the reading frequency from the aforementioned SSD is higher than a preset frequency threshold The data;
第一选择单元1203,用于从所述SSD的多个存储区域中,选择与所述第一数据读时延匹配的第一存储区域;The first selection unit 1203 is configured to select a first storage area matching the first data read delay from a plurality of storage areas of the SSD;
第一存储单元1204,用于将所述第一数据存储至所述第一存储区域。The first storage unit 1204 is configured to store the first data in the first storage area.
在一种可能的实现方式中,前述目标数据为在预设历史时间段内从前述SSD中读取频率高于预设频率阈值的数据;前述第一识别单元1202,具体用于:将前述待存储数据中与前述目标数据内容相同的部分或者全部数据,识别为前述第一数据。In a possible implementation manner, the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period; the aforementioned first identification unit 1202 is specifically configured to: Part or all of the data in the stored data that has the same content as the aforementioned target data is identified as the aforementioned first data.
在一种可能的实现方式中,前述目标数据为在预设历史时间段内从前述SSD中读取频率高于预设频率阈值的数据;前述第一识别单元1202,具体用于:将前述待存储数据中与前述目标数据类型相同的部分或者全部数据,识别为前述第一数据。In a possible implementation manner, the aforementioned target data is data whose frequency is higher than a preset frequency threshold read from the aforementioned SSD within a preset historical time period; the aforementioned first identification unit 1202 is specifically configured to: Some or all data of the same type as the aforementioned target data in the stored data is identified as the aforementioned first data.
在一种可能的实现方式中,所述装置12还包括第一存储区域分类单元1205,用于:In a possible implementation manner, the device 12 further includes a first storage area classification unit 1205, configured to:
识别所述待存储数据中的第二数据,所述第二数据为从所述SSD中读取频率低于所述第一数据的数据;可以理解的是,对所述第二数据的识别还可以通过前述第一识别单元1202来处理。Identify the second data in the data to be stored, where the second data is data that is read from the SSD with a lower frequency than the first data; it is understandable that the identification of the second data is also It can be processed by the aforementioned first identification unit 1202.
从所述SSD的多个存储区域中,选择与所述第二数据读时延匹配的第二存储区域,所述第二存储区域的读时延高于所述第一存储区域;可以理解的是,所述第一存储区域分类单元1205的主要功能是根据存储数据选择合适的存储区域;例如,将存储器中NAND Flash介质对应的存储单元按读时延等特征进行分类管理,比如,所有的Flash颗粒中读时延较低的Lower Page归为一类存储区。所述第一存储区域分类单元1205可以接受第一存储单元1204的调用,即在存储区域选择完成后,可以利用第一存储单元1204进行存储。From the multiple storage areas of the SSD, select a second storage area that matches the second data read delay, and the read delay of the second storage area is higher than that of the first storage area; it is understandable Yes, the main function of the first storage area classification unit 1205 is to select a suitable storage area according to the stored data; for example, the storage unit corresponding to the NAND Flash medium in the memory is classified and managed according to characteristics such as read delay, for example, all Lower Pages with low read latency in Flash particles are classified as a type of storage area. The first storage area classification unit 1205 can accept the call of the first storage unit 1204, that is, after the storage area selection is completed, the first storage unit 1204 can be used for storage.
将所述第二数据存储至所述第二存储区域。可以理解的是,本申请实施例中提及的第一存储区域分类单元1205的识别、选择(或匹配)以及存储功能都是示例性的描述;该存储分类单元可以结合部分其他单元,或者不依赖其他单元而实现相应的功能,因此本申请实施例对该存储区域分类单元的具体功能不作限定。Storing the second data in the second storage area. It is understandable that the identification, selection (or matching) and storage functions of the first storage area classification unit 1205 mentioned in the embodiments of this application are all exemplary descriptions; the storage classification unit may be combined with some other units, or not Relying on other units to achieve corresponding functions, therefore, the embodiment of the present application does not limit the specific functions of the storage area classification unit.
在一种可能的实现方式中,前述装置还包括目标数据确定单元1209,用于:统计在预设历史时间段内,从前述SSD中读取数据的读取频率;将前述SSD中读取频率高于前述预设频率阈值的数据确定为前述目标数据。In a possible implementation manner, the foregoing device further includes a target data determining unit 1209, configured to: count the read frequency of reading data from the foregoing SSD within a preset historical time period; and compare the read frequency from the foregoing SSD Data higher than the aforementioned preset frequency threshold is determined as the aforementioned target data.
在一种可能的实现方式中,所述目标数据确定单元1209,具体用于:In a possible implementation manner, the target data determining unit 1209 is specifically configured to:
统计所述SSD的多个存储区域中每一个存储区域存储的数据的历史读取次数;根据所述历史读取次数,确定所述每一个存储区域存储的数据的所述读取频率。Counting the historical reading times of the data stored in each storage area of the multiple storage areas of the SSD; and determining the reading frequency of the data stored in each storage area according to the historical reading times.
在一种可能的实现方式中,所述SSD还包括缓冲存储区;所述装置12还包括第一缓存单元1207,用于:将所述第一数据缓存至所述缓冲存储区。In a possible implementation manner, the SSD further includes a buffer storage area; the device 12 further includes a first caching unit 1207 configured to cache the first data in the buffer storage area.
在一种可能的实现方式中,所述第一缓存单元1207,具体用于:In a possible implementation manner, the first caching unit 1207 is specifically configured to:
当接收所述第一数据的写命令后,根据所述写命令将所述第一数据存储至所述缓冲存储区。After receiving the write command of the first data, the first data is stored in the buffer storage area according to the write command.
在一种可能的实现方式中,所述装置12还包括第一读取单元1208,用于:当接收所述第一数据的读命令,优先从所述缓冲存储区中读取所述第一数据。可选地,当接收所述第一数据的读命令,优先从所述缓冲存储区中读取所述第一数据失败的情况下,还可以从NANDFlash中读取所需要的数据。In a possible implementation manner, the device 12 further includes a first reading unit 1208, configured to: when receiving a read command of the first data, preferentially read the first data from the buffer storage area. data. Optionally, when receiving the read command of the first data and preferentially reading the first data from the buffer storage area fails, the required data can also be read from the NANDFlash.
在一种可能的实现方式中,所述装置12还包括第一决策单元1206,用于:In a possible implementation manner, the device 12 further includes a first decision-making unit 1206, configured to:
当所述第一数据的数据量大于所述第一存储区域的存储容量,将所述第一数据中部分数据存储至所述第二存储区域;或者,当所述第二数据的数据量大于所述第二存储区域的存储容量,将所述第二数据中部分数据存储至所述第一存储区域。When the data amount of the first data is greater than the storage capacity of the first storage area, store part of the first data in the second storage area; or, when the data amount of the second data is greater than The storage capacity of the second storage area stores part of the second data in the first storage area.
本申请实施例,通过接收单元接收待存储数据,并从中识别第一数据,再根据选择单元选择合适的第一存储区域,基于存储单元将所述第一数据存储至与其读时延匹配的第一存储区域,从而降低在读取所述第一数据的过程中产生的平均读时延,提高配置有所述SSD的设备的业务处理性能。其中,第一数据可以为需要从所述SSD中快速读取的数据,比如从所述SSD中读取频率高于预设频率阈值的数据、包含指定标识的数据和数据集合中读取频率较高数据中的一种或者多种,所述数据集合可以包括SSD从Host一次或者多次接收的数据。区别于现有技术中,在SSD内置缓存模块导致SSD控制器为了判断读写命令是否命中缓存,而需要多次寻址过程;本申请实施例中,可以通过去除SSD内部的缓存模块(或称数据缓存模块)而实现在满足一定业务需求的情况下减少生产的物料成本,同时避免了数据缓存模块进行二次寻址而增加SSD控制器的处理负荷;更重要的是,基于SSD存储介质的特性对数据进行有目的性地进行合理存储,降低方案实现复杂度,降低SSD平均读时延效果明显。In this embodiment of the application, the data to be stored is received through the receiving unit, and the first data is identified therefrom, and then a suitable first storage area is selected according to the selection unit, and the first data is stored to the first data matching its read delay based on the storage unit. A storage area, thereby reducing the average read delay generated in the process of reading the first data, and improving the service processing performance of the device equipped with the SSD. Wherein, the first data may be data that needs to be read quickly from the SSD, such as data whose reading frequency is higher than a preset frequency threshold from the SSD, data containing a designated identifier, and a data set with a relatively high reading frequency. One or more types of high data. The data set may include data received by the SSD from the Host one or more times. Different from the prior art, the built-in cache module of the SSD causes the SSD controller to determine whether the read/write command hits the cache, and multiple addressing processes are required; in the embodiment of the present application, the internal cache module (or called Data caching module) to reduce the cost of production materials while meeting certain business requirements, and at the same time avoid the data caching module’s secondary addressing and increase the processing load of the SSD controller; more importantly, the SSD storage medium-based The feature stores data in a purposeful and reasonable manner, reduces the complexity of the solution implementation, and reduces the average read delay of the SSD. The effect is obvious.
进一步地,通过接收单元中的识别单元,根据第一数据的数据特征,从待存储的数据中识别第一数据,有利于便于后续的数据分类存储,将第一数据高效地存储至与之读时延匹配的存储区域。其中,数据特征可以包括读取频率高于预设频率阈值、包含指定标识和在数据集合中读取频率靠前等,本申请实施例对具体的数据特征不作限定。进一步地,通过识别单元对已经存储在固态硬盘中的数据的读取频率进行计算,有利于优化已存储数据的存储区域,能够根据实际的数据读取情况调节数据存储位置,提高数据的读取效率,进而提高了主控设备的业务处理性能。进一步地,通过存储区域分类单元识别符合特定数据特征(区别于第一数据的数据特征)的第二数据,并将所述第二数据存储至与之读时延匹配的第二存储区域,对数据的分类存储,有效基于存储区域的特性存储数据,提高数据的读取效率。本申请实施例对符合特定数据特征的第二数据以及所述特定数据特征不作限定。进一步地,通过决策单元根据数据量与存储区域的存储容量的关系存储数据,如在第二数据量大时将部分数据存储至第一存储区域;根据实际的数据量情况灵活存储数据,有效利用存储区域,有利于整体上降低读时延。进一步地,可以通过增加的缓冲存储区存储部分的数据;在SSD正常上电工作的情况下,便于主控(如处理器或者服务器)能够有概率地直接从缓冲存储区中获得所需要的数据,在本申请实施例的基础上进一步降低SSD的平均读时延,且适用于对成本要求低但对数据读取效率要求高的应用场景。比现有技术中SSD内置缓冲存储区,在第一次寻址失败而需要二次寻址的情况下,能够降低SSD的平均读时延。Further, through the identification unit in the receiving unit, according to the data characteristics of the first data, the first data is identified from the data to be stored, which facilitates subsequent data classification and storage, and efficiently stores the first data to be read. Storage area for delay matching. Among them, the data characteristics may include reading frequency higher than a preset frequency threshold, including a designated identifier, and reading frequency higher in the data set, etc. The specific data characteristics are not limited in the embodiment of the present application. Further, the reading frequency of the data already stored in the solid state drive is calculated by the identification unit, which is beneficial to optimize the storage area of the stored data, and can adjust the data storage location according to the actual data reading situation, and improve the data reading Efficiency, thereby improving the business processing performance of the main control device. Further, the storage area classification unit identifies the second data that meets the specific data characteristics (data characteristics that are different from the first data), and stores the second data in a second storage area that matches the read delay. The classified storage of data effectively stores data based on the characteristics of the storage area and improves the efficiency of data reading. The embodiment of the present application does not limit the second data that meets the specific data feature and the specific data feature. Further, the decision unit stores data according to the relationship between the amount of data and the storage capacity of the storage area, such as storing part of the data in the first storage area when the amount of the second data is large; stores the data flexibly according to the actual amount of data, and makes effective use of The storage area helps to reduce the overall read delay. Further, part of the data can be stored through the increased buffer storage area; when the SSD is normally powered on, it is convenient for the main control (such as a processor or server) to obtain the required data directly from the buffer storage area with probability , On the basis of the embodiments of the present application, the average read delay of the SSD is further reduced, and it is suitable for application scenarios that require low cost but high data read efficiency. Compared with the SSD built-in buffer storage area in the prior art, when the first addressing fails and the second addressing is required, the average read delay of the SSD can be reduced.
需要说明的是,本申请实施例中所描述的固态硬盘SSD的数据存储装置可参见上述图6、图10以及图11中所述的方法实施例中的固态硬盘SSD的数据存储方法的相关描述,此处不再赘述。可以理解的是,本申请实施例中所描述的固态硬盘SSD的数据存储装置涉及的各个单元功能为SSD控制器的部分功能,但不包括所述SSD控制器所有的功能;例如,本申请实施例所提及的数据存储装置不包含在一般情况下读取数据的过程以及相关功能的描述;但实际的应用场景中,装置一般都会对数据进行读或写以及相关操作,只是在本申请实施例中不作过多描述。It should be noted that, for the data storage device of the solid state drive SSD described in the embodiment of the present application, refer to the related description of the data storage method of the solid state drive SSD in the method embodiments described in FIG. 6, FIG. 10, and FIG. 11. , I won’t repeat it here. It is understandable that the functions of the various units involved in the data storage device of the solid state drive SSD described in the embodiments of the present application are part of the functions of the SSD controller, but do not include all the functions of the SSD controller; for example, the implementation of this application The data storage device mentioned in the example does not include the process of reading data and the description of related functions in general; however, in actual application scenarios, the device generally reads or writes data and performs related operations, which are only implemented in this application. Do not give too much description in the example.
请参见图13,图13是本申请实施例提供的另一种SSD的数据存储装置的结构示意图,所述固态硬盘SSD的数据存储装置13,可以包括第二接收单元1301、第二识别单元1302、第二选择单元1303、第二存储单元1304、第二存储区域分类单元1305、第二决策单元1306、第二缓存单元1307和第二读取单元1308,可选的单元可以包括第二存储区域分类单元1305、第二决策单元1306、第二缓存单元1307和第二读取单元1308。其中,Please refer to FIG. 13, which is a schematic structural diagram of another SSD data storage device provided by an embodiment of the present application. The data storage device 13 of the solid state hard disk SSD may include a second receiving unit 1301 and a second identifying unit 1302. , The second selection unit 1303, the second storage unit 1304, the second storage area classification unit 1305, the second decision unit 1306, the second cache unit 1307, and the second reading unit 1308. The optional units may include the second storage area The classification unit 1305, the second decision unit 1306, the second cache unit 1307, and the second reading unit 1308. among them,
第二接收单元1301,用于接收待存储数据;The second receiving unit 1301 is configured to receive data to be stored;
第二识别单元1302,用于识别前述待存储数据中的第一数据,其中,前述第一数据为包含指定标识的数据,前述指定标识用于指示前述第一数据的读取时延需求;The second identification unit 1302 is configured to identify the first data in the aforementioned data to be stored, wherein the aforementioned first data is data including a designated identifier, and the aforementioned designated identifier is used to indicate the read delay requirement of the aforementioned first data;
第二选择单元1303,用于从前述SSD的多个存储区域中,根据前述指定标识选择与前述第一数据读时延匹配的第一存储区域;The second selection unit 1303 is configured to select the first storage area matching the first data read delay from the multiple storage areas of the aforementioned SSD according to the aforementioned designated identifier;
第二存储单元1304,用于将前述第一数据存储至前述第一存储区域。The second storage unit 1304 is configured to store the aforementioned first data in the aforementioned first storage area.
在一种可能的实现方式中,前述装置还包括第二存储区域分类单元1305,用于:识别前述待存储数据中的第二数据,前述第二数据为从前述SSD中读取频率低于前述第一数据的数据;从前述SSD的多个存储区域中,选择与前述第二数据读时延匹配的第二存储区域,前述第二存储区域的读时延高于前述第一存储区域;将前述第二数据存储至前述第二存储区域。In a possible implementation manner, the foregoing device further includes a second storage area classification unit 1305, configured to: identify the second data in the foregoing data to be stored, and the foregoing second data is read from the foregoing SSD with a lower frequency than the foregoing Data of the first data; from the plurality of storage areas of the aforementioned SSD, select a second storage area that matches the read delay of the aforementioned second data, and the read delay of the aforementioned second storage area is higher than the aforementioned first storage area; The aforementioned second data is stored in the aforementioned second storage area.
在一种可能的实现方式中,前述SSD还包括缓冲存储区;前述装置还包括第二缓存单元1307,用于:将前述第一数据缓存至前述缓冲存储区。In a possible implementation manner, the aforementioned SSD further includes a buffer storage area; the aforementioned device further includes a second cache unit 1307 configured to cache the aforementioned first data in the aforementioned buffer storage area.
在一种可能的实现方式中,前述第二缓存单元1307,具体用于:当接收前述第一数据的写命令后,根据前述写命令将前述第一数据存储至前述缓冲存储区。In a possible implementation manner, the aforementioned second buffer unit 1307 is specifically configured to: after receiving the aforementioned write command of the first data, store the aforementioned first data in the aforementioned buffer storage area according to the aforementioned write command.
在一种可能的实现方式中,前述装置还包括第二读取单元1308,用于:当接收前述第一数据的读命令,优先从前述缓冲存储区中读取前述第一数据。In a possible implementation manner, the aforementioned apparatus further includes a second reading unit 1308, configured to: when receiving the aforementioned first data read command, preferentially read the aforementioned first data from the aforementioned buffer storage area.
在一种可能的实现方式中,前述装置还包括第二决策单元1306,用于:当前述第一数据的数据量大于前述第一存储区域的存储容量,将前述第一数据中部分数据存储至前述第二存储区域;或者,当前述第二数据的数据量大于前述第二存储区域的存储容量,将前述第二数据中部分数据存储至前述第一存储区域。In a possible implementation manner, the aforementioned device further includes a second decision-making unit 1306, configured to store part of the aforementioned first data in the aforementioned first data storage area when the amount of the aforementioned first data is greater than the storage capacity of the aforementioned first storage area. The aforementioned second storage area; or, when the data amount of the aforementioned second data is greater than the storage capacity of the aforementioned second storage area, storing part of the aforementioned second data in the aforementioned first storage area.
需要说明的是,本申请实施例中所描述的固态硬盘SSD的数据存储装置可参见上述图6、图10以及图11中所述的方法实施例中的固态硬盘SSD的数据存储方法的相关描述,此处不再赘述。可以理解的是,本申请实施例中所描述的固态硬盘SSD的数据存储装置涉及的各个单元功能为SSD控制器的部分功能,但不包括所述SSD控制器所有的功能;例如, 本申请实施例所提及的数据存储装置不包含在一般情况下读取数据的过程以及相关功能的描述;但实际的应用场景中,装置一般都会对数据进行读或写以及相关操作,只是在本申请实施例中不作过多描述。It should be noted that, for the data storage device of the solid state drive SSD described in the embodiment of the present application, refer to the related description of the data storage method of the solid state drive SSD in the method embodiments described in FIG. 6, FIG. 10, and FIG. 11. , I won’t repeat it here. It is understandable that the functions of the various units involved in the data storage device of the solid-state hard disk SSD described in the embodiments of the present application are part of the functions of the SSD controller, but do not include all the functions of the SSD controller; for example, the implementation of this application The data storage device mentioned in the example does not include the process of reading data and the description of related functions in general; however, in actual application scenarios, the device generally reads or writes data and performs related operations, which are only implemented in this application. Do not give too much description in the example.
本申请实施例还提供一种计算机存储介质,其中,该计算机存储介质可存储有程序,该程序可以执行包括上述图6、图10以及图11对应的方法实施例中记载的任意一种的部分或全部步骤。An embodiment of the present application further provides a computer storage medium, wherein the computer storage medium can store a program, and the program can execute any part of the method described in the method embodiments corresponding to FIG. 6, FIG. 10, and FIG. 11. Or all steps.
本申请实施例还提供一种计算机程序,该计算机程序包括指令,当该计算机程序被计算机执行时,使得计算机可以执行上述图6、图10以及图11对应的方法实施例中记载的任意一种的部分或全部步骤。The embodiment of the present application also provides a computer program, the computer program includes instructions, when the computer program is executed by the computer, the computer can execute any of the method embodiments described in the above-mentioned FIG. 6, FIG. 10, and FIG. 11 Some or all of the steps.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in an embodiment, reference may be made to related descriptions of other embodiments.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可能可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that this application is not limited by the described sequence of actions. Because according to this application, some steps may be performed in other order or at the same time. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed device may be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the above-mentioned units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or integrated. To another system, or some features can be ignored, or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical or other forms.
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以为个人计算机、服务器或者网络设备等,具体可以是计算机设备中的处理器)执行本申请各个实施例上述方法的全部或部分步骤。其中,而前述的存储介质可包括:U盘、移动硬盘、磁碟、光盘、只读存储器(Read-Only Memory,缩写:ROM)或者随机存取存储器 (Random Access Memory,缩写:RAM)等各种可以存储程序代码的介质。If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc., specifically a processor in a computer device) execute all or part of the steps of the foregoing methods of the various embodiments of the present application. Among them, the aforementioned storage media may include: U disk, mobile hard disk, magnetic disk, optical disk, read-only memory (Read-Only Memory, abbreviation: ROM) or Random Access Memory (Random Access Memory, abbreviation: RAM), etc. A medium that can store program codes.
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions recorded in the embodiments are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims (23)

  1. 一种固态硬盘SSD的数据存储方法,其特征在于,包括:A data storage method for a solid state hard disk (SSD) is characterized in that it comprises:
    接收待存储数据,识别所述待存储数据中的第一数据,其中,所述第一数据为与目标数据匹配的数据,所述目标数据为从所述SSD中读取频率高于预设频率阈值的数据;The data to be stored is received, and the first data in the data to be stored is identified, where the first data is data that matches the target data, and the target data is that the frequency of reading from the SSD is higher than a preset frequency Threshold data;
    从所述SSD的多个存储区域中,选择与所述第一数据读时延匹配的第一存储区域;Selecting a first storage area matching the read delay of the first data from a plurality of storage areas of the SSD;
    将所述第一数据存储至所述第一存储区域。Storing the first data in the first storage area.
  2. 根据权利要求1所述的方法,其特征在于,所述目标数据为在预设历史时间段内从所述SSD中读取频率高于预设频率阈值的数据;所述识别所述待存储数据中的第一数据,包括:The method according to claim 1, wherein the target data is data that is read from the SSD within a preset historical period of time with a frequency higher than a preset frequency threshold; the identification of the data to be stored The first data in includes:
    将所述待存储数据中与所述目标数据内容相同的部分或者全部数据,识别为所述第一数据。Identify part or all of the data that has the same content as the target data in the to-be-stored data as the first data.
  3. 根据权利要求1所述的方法,其特征在于,所述目标数据为在预设历史时间段内从所述SSD中读取频率高于预设频率阈值的数据;所述识别所述待存储数据中的第一数据,包括:The method according to claim 1, wherein the target data is data that is read from the SSD within a preset historical period of time with a frequency higher than a preset frequency threshold; the identification of the data to be stored The first data in includes:
    将所述待存储数据中与所述目标数据类型相同的部分或者全部数据,识别为所述第一数据。Identify part or all of the data to be stored that is of the same type as the target data as the first data.
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-3, wherein the method further comprises:
    识别所述待存储数据中的第二数据,所述第二数据为从所述SSD中读取频率低于所述第一数据的数据;Identifying second data in the to-be-stored data, where the second data is data with a lower frequency of reading from the SSD than the first data;
    从所述SSD的多个存储区域中,选择与所述第二数据读时延匹配的第二存储区域,所述第二存储区域的读时延高于所述第一存储区域;Selecting a second storage area matching the second data read delay from the multiple storage areas of the SSD, and the read delay of the second storage area is higher than that of the first storage area;
    将所述第二数据存储至所述第二存储区域。Storing the second data in the second storage area.
  5. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    统计在预设历史时间段内,从所述SSD中读取数据的读取频率;Count the reading frequency of reading data from the SSD in a preset historical time period;
    将所述SSD中读取频率高于所述预设频率阈值的数据确定为所述目标数据。The data in the SSD whose reading frequency is higher than the preset frequency threshold is determined as the target data.
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述SSD还包括缓冲存储区;所述方法还包括:The method according to any one of claims 1-5, wherein the SSD further comprises a buffer storage area; the method further comprises:
    将所述第一数据缓存至所述缓冲存储区。The first data is buffered in the buffer storage area.
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:The method according to claim 6, wherein the method further comprises:
    当接收所述第一数据的读命令,优先从所述缓冲存储区中读取所述第一数据。When receiving the read command of the first data, the first data is preferentially read from the buffer storage area.
  8. 一种固态硬盘SSD的数据存储方法,其特征在于,包括:A data storage method for a solid state hard disk (SSD) is characterized in that it comprises:
    接收待存储数据,识别所述待存储数据中的第一数据,其中,所述第一数据为包含指定标识的数据,所述指定标识用于指示所述第一数据的读取时延需求;Receiving data to be stored, and identifying first data in the data to be stored, where the first data is data including a designated identifier, and the designated identifier is used to indicate a read delay requirement of the first data;
    从所述SSD的多个存储区域中,根据所述指定标识选择与所述第一数据读时延匹配的第一存储区域;From the plurality of storage areas of the SSD, selecting a first storage area matching the first data read delay according to the designated identifier;
    将所述第一数据存储至所述第一存储区域。Storing the first data in the first storage area.
  9. 根据权利要求8所述的方法,其特征在于,所述方法还包括:The method according to claim 8, wherein the method further comprises:
    识别所述待存储数据中的第二数据,所述第二数据为从所述SSD中读取频率低于所述第一数据的数据;Identifying second data in the data to be stored, where the second data is data whose frequency of reading from the SSD is lower than that of the first data;
    从所述SSD的多个存储区域中,选择与所述第二数据读时延匹配的第二存储区域,所述第二存储区域的读时延高于所述第一存储区域;Selecting a second storage area matching the second data read delay from the multiple storage areas of the SSD, and the read delay of the second storage area is higher than that of the first storage area;
    将所述第二数据存储至所述第二存储区域。Storing the second data in the second storage area.
  10. 根据权利要求8或9所述的方法,其特征在于,所述SSD还包括缓冲存储区;所述方法还包括:The method according to claim 8 or 9, wherein the SSD further comprises a buffer storage area; the method further comprises:
    将所述第一数据缓存至所述缓冲存储区。The first data is buffered in the buffer storage area.
  11. 根据权利要求10所述的方法,其特征在于,所述方法还包括:The method according to claim 10, wherein the method further comprises:
    当接收所述第一数据的读命令,优先从所述缓冲存储区中读取所述第一数据。When receiving the read command of the first data, the first data is preferentially read from the buffer storage area.
  12. 一种固态硬盘SSD,其特征在于,包括控制器、与所述控制器连接的存储器;其中,所述存储器包括多个不同种类的存储区域,每类存储区域的读时延不同;A solid state hard disk SSD, which is characterized by comprising a controller and a memory connected to the controller; wherein the memory includes a plurality of different types of storage areas, and each type of storage area has a different read delay;
    所述控制器,用于:The controller is used for:
    接收待存储数据,识别所述待存储数据中的第一数据,其中,所述第一数据为与目标数据匹配的数据,所述目标数据为从所述SSD中读取频率高于预设频率阈值的数据;The data to be stored is received, and the first data in the data to be stored is identified, where the first data is data that matches the target data, and the target data is that the frequency of reading from the SSD is higher than a preset frequency Threshold data;
    从所述多个存储区域中,选择与所述第一数据读时延匹配的第一存储区域;Selecting a first storage area matching the first data read delay from the plurality of storage areas;
    将所述第一数据存储至所述第一存储区域;Storing the first data in the first storage area;
    所述第一存储区域,用于存储所述第一数据。The first storage area is used to store the first data.
  13. 根据权利要求12所述的SSD,其特征在于,所述目标数据为在预设历史时间段内从所述SSD中读取频率高于预设频率阈值的数据;所述控制器,具体用于:The SSD according to claim 12, wherein the target data is data with a frequency higher than a preset frequency threshold that is read from the SSD within a preset historical time period; the controller is specifically configured to :
    将所述待存储数据中与所述目标数据内容相同的部分或者全部数据,识别为所述第一数据。Identify part or all of the data that has the same content as the target data in the to-be-stored data as the first data.
  14. 根据权利要求12所述的SSD,其特征在于,所述目标数据为在预设历史时间段内从所述SSD中读取频率高于预设频率阈值的数据;所述控制器,具体用于:The SSD according to claim 12, wherein the target data is data with a frequency higher than a preset frequency threshold that is read from the SSD within a preset historical time period; the controller is specifically configured to :
    将所述待存储数据中与所述目标数据类型相同的部分或者全部数据,识别为所述第一 数据。Identify part or all of the data that is of the same type as the target data in the to-be-stored data as the first data.
  15. 根据权利要求12-14任一项所述的SSD,其特征在于,所述控制器,还用于:The SSD according to any one of claims 12-14, wherein the controller is further configured to:
    识别所述待存储数据中的第二数据,所述第二数据为从所述SSD中读取频率低于所述第一数据的数据;Identifying second data in the to-be-stored data, where the second data is data with a lower frequency of reading from the SSD than the first data;
    从所述多个存储区域中,选择与所述第二数据读时延匹配的第二存储区域,所述第二存储区域的读时延高于所述第一存储区域;Selecting a second storage area matching the second data read delay from the plurality of storage areas, and the read delay of the second storage area is higher than that of the first storage area;
    将所述第二数据存储至所述第二存储区域;Storing the second data in the second storage area;
    所述第二存储区域,用于存储所述第二数据。The second storage area is used to store the second data.
  16. 根据权利要求12所述的SSD,其特征在于,所述控制器,还用于:The SSD according to claim 12, wherein the controller is further configured to:
    统计在预设历史时间段内,从所述SSD中读取数据的读取频率;Count the reading frequency of reading data from the SSD in a preset historical time period;
    将所述SSD中读取频率高于所述预设频率阈值的数据确定为所述目标数据。The data in the SSD whose reading frequency is higher than the preset frequency threshold is determined as the target data.
  17. 根据权利要求12-16任一项所述的SSD,其特征在于,所述SSD还包括缓冲存储区;所述缓冲存储区与所述控制器连接;The SSD according to any one of claims 12-16, wherein the SSD further comprises a buffer storage area; the buffer storage area is connected to the controller;
    所述控制器,还用于:将所述第一数据缓存至所述缓冲存储区;The controller is further configured to: buffer the first data to the buffer storage area;
    所述缓冲存储区,用于存储所述第一数据。The buffer storage area is used to store the first data.
  18. 根据权利要求17所述的SSD,其特征在于,所述控制器,还用于:The SSD according to claim 17, wherein the controller is further configured to:
    当接收所述第一数据的读命令,优先从所述缓冲存储区中读取所述第一数据。When receiving the read command of the first data, the first data is preferentially read from the buffer storage area.
  19. 一种固态硬盘SSD,其特征在于,包括控制器、与所述控制器连接的存储器;其中,所述存储器包括多个不同种类的存储区域,每类存储区域的读时延不同;A solid state hard disk SSD, which is characterized by comprising a controller and a memory connected to the controller; wherein the memory includes a plurality of different types of storage areas, and each type of storage area has a different read delay;
    所述控制器,用于:The controller is used for:
    接收待存储数据,识别所述待存储数据中的第一数据,其中,所述第一数据为包含指定标识的数据,所述指定标识用于指示所述第一数据的读取时延需求;Receiving data to be stored, and identifying first data in the data to be stored, where the first data is data including a designated identifier, and the designated identifier is used to indicate a read delay requirement of the first data;
    从所述多个存储区域中,根据所述指定标识选择与所述第一数据读时延匹配的第一存储区域;Selecting a first storage area matching the first data read delay from the plurality of storage areas according to the designated identifier;
    将所述第一数据存储至所述第一存储区域;Storing the first data in the first storage area;
    所述第一存储区域,用于存储所述第一数据。The first storage area is used to store the first data.
  20. 根据权利要求19所述的SSD,其特征在于,所述控制器,还用于:The SSD according to claim 19, wherein the controller is further configured to:
    识别所述待存储数据中的第二数据,所述第二数据为从所述SSD中读取频率低于所述第一数据的数据;Identifying second data in the data to be stored, where the second data is data whose frequency of reading from the SSD is lower than that of the first data;
    从所述多个存储区域中,选择与所述第二数据读时延匹配的第二存储区域,所述第二存储区域的读时延高于所述第一存储区域;Selecting a second storage area matching the second data read delay from the plurality of storage areas, and the read delay of the second storage area is higher than that of the first storage area;
    将所述第二数据存储至所述第二存储区域;Storing the second data in the second storage area;
    所述第二存储区域,用于存储所述第二数据。The second storage area is used to store the second data.
  21. 根据权利要求19或20所述的SSD,其特征在于,所述SSD还包括缓冲存储区;所述缓冲存储区与所述控制器连接;The SSD according to claim 19 or 20, wherein the SSD further comprises a buffer storage area; the buffer storage area is connected to the controller;
    所述控制器,还用于:将所述第一数据缓存至所述缓冲存储区;The controller is further configured to: buffer the first data to the buffer storage area;
    所述缓冲存储区,用于存储所述第一数据。The buffer storage area is used to store the first data.
  22. 根据权利要求21所述的SSD,其特征在于,所述控制器,还用于:The SSD according to claim 21, wherein the controller is further configured to:
    当接收所述第一数据的读命令,优先从所述缓冲存储区中读取所述第一数据。When receiving the read command of the first data, the first data is preferentially read from the buffer storage area.
  23. 一种芯片组,其特征在于,所述芯片组包括至少一个处理器、至少一个第一存储器和至少一个第二存储器;其中,所述至少一个第一存储器和所述至少一个处理器通过线路互联,所述第一存储器中存储有指令;所述指令被所述处理器执行时,权利要求1-11中任意一项所述的方法得以实现;所述至少一个第二存储器和所述至少一个处理器通过线路互联,所述第二存储器中存储权利要求1-11中任意一项所述方法中的待存储数据。A chipset, characterized in that the chipset includes at least one processor, at least one first memory, and at least one second memory; wherein, the at least one first memory and the at least one processor are interconnected by wires , The first memory stores instructions; when the instructions are executed by the processor, the method according to any one of claims 1-11 is implemented; the at least one second memory and the at least one The processors are interconnected by wires, and the second memory stores the data to be stored in the method according to any one of claims 1-11.
PCT/CN2019/102909 2019-08-27 2019-08-27 Data storage method and apparatus for solid state disk and solid state disk (ssd) WO2021035555A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201980099647.5A CN114303123A (en) 2019-08-27 2019-08-27 Data storage method and device of solid state disk and Solid State Disk (SSD)
PCT/CN2019/102909 WO2021035555A1 (en) 2019-08-27 2019-08-27 Data storage method and apparatus for solid state disk and solid state disk (ssd)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/102909 WO2021035555A1 (en) 2019-08-27 2019-08-27 Data storage method and apparatus for solid state disk and solid state disk (ssd)

Publications (1)

Publication Number Publication Date
WO2021035555A1 true WO2021035555A1 (en) 2021-03-04

Family

ID=74684898

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/102909 WO2021035555A1 (en) 2019-08-27 2019-08-27 Data storage method and apparatus for solid state disk and solid state disk (ssd)

Country Status (2)

Country Link
CN (1) CN114303123A (en)
WO (1) WO2021035555A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114489484A (en) * 2021-12-27 2022-05-13 得一微电子股份有限公司 Data storage method of SSD, terminal device and storage medium
CN116994628A (en) * 2023-06-30 2023-11-03 珠海妙存科技有限公司 Flash memory particle grading method, controller and medium based on offset read voltage
CN116994628B (en) * 2023-06-30 2024-04-12 珠海妙存科技有限公司 Flash memory particle grading method, controller and medium based on offset read voltage

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114816571B (en) * 2022-04-15 2023-06-16 西安广和通无线通信有限公司 Method, device, equipment and storage medium for plug-in flash memory

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101127004A (en) * 2007-09-24 2008-02-20 中兴通讯股份有限公司 System and method for accessing data on flash memory
US20090172256A1 (en) * 2007-12-31 2009-07-02 Phison Electronics Corp. Data writing method for flash memory, and flash memory controller and storage device thereof
CN103608782A (en) * 2011-05-15 2014-02-26 苹果公司 Selective data storage in LSB and MSB pages
CN104813270A (en) * 2012-12-04 2015-07-29 苹果公司 Hinting of deleted data from host to storage device
CN105242871A (en) * 2014-06-06 2016-01-13 华为技术有限公司 Data writing method and apparatus
CN106873912A (en) * 2017-02-16 2017-06-20 郑州云海信息技术有限公司 The dynamic partition storage method and device, system of TLC chip solid state hard discs
CN107562378A (en) * 2017-08-28 2018-01-09 记忆科技(深圳)有限公司 A kind of method for lifting the solid storage device life-span

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101127004A (en) * 2007-09-24 2008-02-20 中兴通讯股份有限公司 System and method for accessing data on flash memory
US20090172256A1 (en) * 2007-12-31 2009-07-02 Phison Electronics Corp. Data writing method for flash memory, and flash memory controller and storage device thereof
CN103608782A (en) * 2011-05-15 2014-02-26 苹果公司 Selective data storage in LSB and MSB pages
CN104813270A (en) * 2012-12-04 2015-07-29 苹果公司 Hinting of deleted data from host to storage device
CN105242871A (en) * 2014-06-06 2016-01-13 华为技术有限公司 Data writing method and apparatus
CN106873912A (en) * 2017-02-16 2017-06-20 郑州云海信息技术有限公司 The dynamic partition storage method and device, system of TLC chip solid state hard discs
CN107562378A (en) * 2017-08-28 2018-01-09 记忆科技(深圳)有限公司 A kind of method for lifting the solid storage device life-span

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114489484A (en) * 2021-12-27 2022-05-13 得一微电子股份有限公司 Data storage method of SSD, terminal device and storage medium
CN116994628A (en) * 2023-06-30 2023-11-03 珠海妙存科技有限公司 Flash memory particle grading method, controller and medium based on offset read voltage
CN116994628B (en) * 2023-06-30 2024-04-12 珠海妙存科技有限公司 Flash memory particle grading method, controller and medium based on offset read voltage

Also Published As

Publication number Publication date
CN114303123A (en) 2022-04-08

Similar Documents

Publication Publication Date Title
US11334479B1 (en) Configuring write parallelism for namespaces in a nonvolatile memory controller
CN107844431B (en) Mapping table updating method, memory control circuit unit and memory storage device
US8166233B2 (en) Garbage collection for solid state disks
US8626987B2 (en) Flash memory system and defragmentation method
TWI385518B (en) Data storing method for a flash memory and storage system
WO2017000658A1 (en) Storage system, storage management device, storage device, hybrid storage device, and storage management method
US9582416B2 (en) Data erasing method, memory control circuit unit and memory storage apparatus
US20110264884A1 (en) Data storage device and method of operating the same
US20180089074A1 (en) Techniques to Manage Key-Value Storage at a Memory or Storage Device
EP3752905B1 (en) Append only streams for storing data on a solid state device
KR20150118778A (en) Storage controller, storage device, storage system and method of operation of the storage controller
CN107665091B (en) Data reading method, data writing method and storage controller thereof
TW201807580A (en) Data transmission method, and storage controller and list management circuit using the same
WO2021035555A1 (en) Data storage method and apparatus for solid state disk and solid state disk (ssd)
WO2017022082A1 (en) Flash memory package and storage system including flash memory package
CN107943710B (en) Memory management method and memory controller using the same
CN110312986B (en) Opportunistic use of streams for storing data on solid state devices
JP2021533467A (en) Logical vs. physical table fragment
US20180232154A1 (en) Append Only Streams For Storing Data On A Solid State Device
US20230273878A1 (en) Storage device for classifying data based on stream class number, storage system, and operating method thereof
CN112860193A (en) Finishing instruction processing method, memory control circuit unit and storage device
EP4307129A1 (en) Method for writing data into solid-state hard disk
KR20200032404A (en) Data Storage Device and Operation Method Thereof, Storage System Having the Same
CN112799601A (en) Effective data merging method, memory storage device and control circuit unit
TWI795680B (en) Method and apparatus for data reads in host performance acceleration mode

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

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

Country of ref document: EP

Kind code of ref document: A1