[go: up one dir, main page]

WO2016107442A1 - Method for writing data to solid state drive and solid state drive - Google Patents

Method for writing data to solid state drive and solid state drive Download PDF

Info

Publication number
WO2016107442A1
WO2016107442A1 PCT/CN2015/098109 CN2015098109W WO2016107442A1 WO 2016107442 A1 WO2016107442 A1 WO 2016107442A1 CN 2015098109 W CN2015098109 W CN 2015098109W WO 2016107442 A1 WO2016107442 A1 WO 2016107442A1
Authority
WO
WIPO (PCT)
Prior art keywords
written data
data
area
nand flash
write
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2015/098109
Other languages
French (fr)
Chinese (zh)
Inventor
吴黎明
黄斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of WO2016107442A1 publication Critical patent/WO2016107442A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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

  • Embodiments of the present invention relate to storage technologies, and in particular, to a method for writing data to a solid state hard disk and a solid state hard disk.
  • SSDs Solid State Drives
  • fixed disks are widely used in servers, desktops, notebooks, mobile devices, game consoles, etc.
  • the SSD 10 mostly uses the semiconductor NAND Flash 14 as a storage medium of the memory; and provides backup power through the capacitor 15 to prevent data in the memory 13 from being lost when power is lost; receiving the read by the host 11 through the controller 12 Write operation request and read and write to memory 13 or NAND Flash 14.
  • the memory 13 is used as an intermediary, and the data corresponding to the read operation request is read from the NAND Flash 14 to the memory 13, and then returned to the host 11; or, The data corresponding to the write operation request is first written into the memory 13 and then transferred to the NAND Flash 14.
  • the power supply is interrupted, and the capacitor 15 is required to provide the backup power, and the data in the memory 13 is written to the NAND Flash 14.
  • NAND Flash and capacitors are the main sources of failure for SSDs. Therefore, in SSDs, the presence of capacitors and excessive reading and writing of NAND Flash may result in a shorter lifetime of the SSD.
  • Embodiments of the present invention provide a method for writing data into a solid state hard disk and a solid state hard disk to increase the service life of the SSD and improve the reliability of the SSD.
  • an embodiment of the present invention provides a method for writing data into a solid state hard disk SSD.
  • the method includes a controller and a memory, the storage medium of the memory comprising a NAND flash and a non-volatile memory NVM, the NVM including a write area, the method comprising:
  • the pre-written data is written to the write area.
  • the method further includes:
  • the page in the NAND Flash storing the pre-written data is invalidated.
  • the method after the writing the pre-write data into the write area, the method also includes:
  • mapping relationship is saved, the mapping relationship including a correspondence between a logical address of the pre-written data and a location where the pre-written data is written into the write area.
  • the method further includes:
  • the pre-written data is migrated to the read region.
  • the method further includes:
  • an embodiment of the present invention provides a method for writing data into a solid state hard disk SSD.
  • the method includes a controller and a memory, the storage medium of the memory including a NAND flash and a non-volatile memory NVM, the NVM including a write area and a read area, the method comprising:
  • the pre-written data in the read region is migrated to the write region.
  • the method further includes:
  • the first mapping relationship includes a correspondence between a logical address of the pre-written data and a location of the pre-written data in the read region
  • the second mapping relationship includes a correspondence between a logical address of the pre-written data and a location of the pre-written data in the write area.
  • the method further includes:
  • the pre-written data is migrated to the read region.
  • the method further includes:
  • the NVM further includes a free area, where After the pre-written data in the read area is migrated to the write area, the method further includes:
  • N pages are adjusted from the pages reserved for the write area to the read area, and the N is the number of pages corresponding to the pre-written data.
  • an embodiment of the present invention provides a solid state hard disk SSD, where the SSD includes a controller and a memory, and the storage medium of the memory includes a NAND flash and a nonvolatile memory NVM, where the NVM includes a write area, where
  • the controller is configured to receive a write operation request, the write operation request includes pre-writing data, determine that the pre-write data is not stored in the write area, and write the pre-write data into the Describe area
  • the write area is for storing the pre-written data.
  • the controller is further configured to:
  • the page in the NAND Flash storing the pre-written data is invalidated.
  • the controller is further configured to:
  • mapping relationship is saved, the mapping relationship including a correspondence between a logical address of the pre-written data and a position at which the pre-written data is written into the write area.
  • the controller is further configured to:
  • the pre-written data is migrated to the read region.
  • the controller is further configured to:
  • an embodiment of the present invention provides a solid state hard disk SSD, where the SSD includes a controller and a memory, and the storage medium of the memory includes a NAND flash and a nonvolatile memory NVM, and the NVM includes a write area and a read area. ,among them,
  • the controller is configured to receive a write operation request, the write operation request includes pre-writing data, determine that the pre-write data has been stored in the read area, and: perform the pre-in the read area The write data is migrated to the write area.
  • the controller is further configured to:
  • the first mapping relationship includes a correspondence between a logical address of the pre-written data and a location of the pre-written data in the read region
  • the second mapping relationship includes a correspondence between a logical address of the pre-written data and a location of the pre-written data in the write area.
  • the controller is further configured to:
  • the pre-written data is migrated to the read region.
  • the controller is further configured to:
  • the NVM further includes a free area, the control Also used to:
  • N pages are adjusted from pages reserved for the write area
  • the N is the number of pages corresponding to the pre-written data.
  • Embodiments of the present invention provide a method for writing data into a solid state hard disk and a solid state hard disk, and writing prewritten data to a write area of the NVM, thereby reducing access to the NAND Flash, that is, reducing the accessed frequency of the NAND Flash in the SSD.
  • FIG. 1 is a schematic diagram of an application scenario of a prior art SSD
  • FIG. 2 is a schematic diagram of data stored in a storage unit of an SLC
  • FIG. 3 is a schematic diagram of data stored in a storage unit of an MLC
  • FIG. 4 is a schematic structural view of an SSD according to the present invention.
  • FIG. 5 is a diagram showing an example of the structure of an NVM in an SSD according to the present invention.
  • Embodiment 6 is a flowchart of Embodiment 1 of a method for writing data into an SSD according to the present invention
  • Embodiment 7 is a flowchart of Embodiment 2 of a method for writing data into an SSD according to the present invention.
  • FIG. 8 is a diagram showing an example of a mapping relationship in an embodiment of the present invention.
  • NAND Flash is a physical medium in which an SSD actually stores data.
  • NAND Flash includes single-level cell storage (English: Single Level Cell, SLC for short), multi-level cell storage (English: Multi Level Cell, MLC for short), and three-layer cell storage (English: Triple Level Cell) , referred to as: TLC) several.
  • SLC and MLC are mainly used.
  • TLC has a low number of erases and is currently used primarily in consumer electronics.
  • the SLC technology is characterized in that the oxide film in the floating gate and the source is thinner, and the stored charge is removed by applying a voltage to the charge of the floating gate when writing data, and then passing through the source. In this way, one information unit can be stored, which provides fast program programming and reading.
  • this technology is limited by silicon efficiency (English: Silicon efficiency), and it is necessary to use advanced process enhancement technology to upgrade SLC processing technology.
  • the SLC stores 1 bit (English: bit) of data in each storage unit, and whether the stored data is "0" or "1” is determined based on a voltage threshold.
  • NAND Flash write ie programming, is to charge it, so that the voltage of NAND Flash exceeds the voltage decision point A shown in Figure 2, the memory cell means "0", that is, it has been written; if there is no charge or voltage
  • the threshold is lower than the voltage decision point A, it means "1", that is, erase, and the horizontal axis in Fig. 2 represents voltage.
  • MLC memory-based computer-based computer-based computer-based computer-based computer-based system
  • MLC uses a large number of voltage levels, each unit stores two bits of data, and the data density is relatively large.
  • the SLC stores two values of 0 and 1, while the MLC can store more than four values at a time. Therefore, MLC has a relatively high storage density.
  • the MLC stores 2 bits of data in each storage unit, and the stored data is "00", or "01", or “10", or “11” is also a determination based on a voltage threshold.
  • the voltage is less than the voltage decision point B, it represents “11”; when the voltage is at the voltage decision point Between B and the voltage determination point C, it represents “10”; when the voltage is between the voltage determination point C and the voltage determination point D, it means “01”; and when the voltage reaches the voltage determination point D or more, it means "00".
  • a memory cell of the TLC can store 3 bits, so it requires 8 levels of potential for encoding and decoding. In essence, TLC belongs to MLC.
  • the new storage medium includes, for example, phase change memory (English: Phase Change Random Access Memory, PCROM/PCM), magnetoresistive random access memory (MRAM), and resistive random access memory.
  • phase change memory English: Phase Change Random Access Memory, PCROM/PCM
  • MRAM magnetoresistive random access memory
  • resistive random access memory resistive random access memory.
  • the present invention is not limited in terms of memory (English: Resistive Random Access Memory, RRAM/ReRAM for short) and spin transfer torque random access memory (STT-RAM).
  • NVM non-volatile memory
  • NAND Flash will exist for a long time as the main storage medium based on the protection of existing investment and cost considerations.
  • new non-volatile storage media will gradually play an important role until the NAND Flash is gradually replaced.
  • an embodiment of the present invention provides an SSD.
  • the SSD 40 includes a controller 42 and a memory, and the storage medium of the memory includes a NAND Flash 44 and an NVM 43.
  • NVM is different from ordinary memory in that the NVM medium itself has the characteristics of power loss without losing data.
  • NVM has the following features: cache write, make a complete page in NVM, and then judge whether to transfer to NAND Flash according to the accessed frequency of the page and the size of NVM; accelerate read, will be accessed High frequency data is migrated to NVM.
  • Figure 5 shows the area division of the NVM.
  • the NVM 50 may include four logical areas: a metadata area 51, a read area 52, a write area 53, and a free area 54, Implement partition management for NVM.
  • the role of each region is as follows:
  • the metadata area 51 is used to store metadata of the SSD.
  • the metadata may be a mapping relationship, a first input first output (referred to as a FIFO) doubly linked list, and the like.
  • the read area 52 is used for read acceleration, and the page whose access frequency (ie, the number of reads) in the SSD is higher than or equal to the preset threshold is migrated to the read area 52.
  • the write area 53 all write operations to the SSD, is written to the write area 53 first.
  • the elimination of the area after it is full is eliminated according to the strategy of least recently accessed frequency.
  • the free area 54 which is shared by the read area 52 and the write area 53, provides a free page for a read operation or a write operation, and the read operation and the write operation perform free area sharing according to the ratio of the read area 52 and the write area 53.
  • the ratio of the write area to the read area in the NVM is adjustable. Normally, the write area is much larger than the read area. In particular, there can be only write areas and no read areas in the NVM. In addition, different application scenarios require different performance requirements and erasing times for SSDs. Therefore, based on the service life of SSD, the performance of SSD, and the cost considerations, SSDs that meet the required number of erasing times can be equipped according to the actual business needs of users, and the ratio of NVM and NAND can be matched to provide users with cost-effective products. To avoid the extra expenses caused by over-provisioning and improve resource utilization.
  • the controller 42 is configured to execute the technical solution protected by the following method embodiments, for example, the technical solution shown in FIG. 6, to implement writing of data to the write area of the NVM 43, the write area for storing pre-write Into the data.
  • NVM has the ability to write data in units of bits (bits) and can be rewritten in bits.
  • an embodiment of the present invention provides a method for writing data to an SSD, which may be performed by a controller in an SSD.
  • the method includes:
  • the pre-written data may have It is stored in the write area, and therefore, in S602, it is first determined that the pre-write data is not stored in the write area.
  • writing pre-write data to the write area of the NVM can reduce access to the NAND Flash, that is, reduce the accessed frequency of the NAND Flash in the SSD, thereby reducing wear on the NAND Flash; and, due to the non-volatile of the NVM The data stored in the NVM is not lost. Therefore, the SSD does not need a capacitor to provide backup power when the power supply is interrupted. For the above reasons, the service life of the SSD of the embodiment of the present invention is increased.
  • the method of writing data to the SSD may further include: determining whether the pre-written data is stored in the NAND Flash; if the pre-written data is stored in the NAND Flash, storing the pre-written data in the NAND Flash.
  • the page is set to invalid. This embodiment can avoid storing two identical data in the SSD, thereby causing waste of storage space.
  • the method may further include: saving a mapping relationship, where the mapping relationship includes a correspondence between a logical address of the pre-written data and a position where the pre-written data is written in the write area.
  • the controller 42 can conveniently read and write the NVM 43 and the NAND Flash 44.
  • the NAND Flash 44 is used to store data whose accessed frequency (ie, the number of readings) is lower than a preset threshold, and thus The method may further include: determining whether the accessed frequency of the pre-written data reaches a preset threshold; when the accessed frequency of the pre-written data reaches a preset threshold, migrating the pre-written data to the read area to implement pre-writing The incoming data migrates from the write area to the read area, speeding up the reading of the pre-written data.
  • the method may further include: determining whether the accessed frequency of the page in the NAND Flash is greater than or equal to a preset threshold; when the accessed frequency of the page in the NAND Flash is greater than or equal to a preset threshold, the migrated access frequency is greater than or equal to Presetting the threshold data into the read area of the NVM to implement data migration from NAND Flash to the read area, speeding up the reading of the data, utilizing the temporal locality and spatial locality of the data, and frequently modifying the data. And other hotspot data is stored in NVM, reducing wear and tear on NAND Flash.
  • controller 42 can also be used to perform the steps as shown in FIG. As shown in Figure 7
  • the embodiment of the invention provides a method for writing data into an SSD, the method comprising:
  • the pre-written data in the read area is migrated to the write area.
  • the node corresponding to the pre-written data in the second doubly linked list may be updated to the tail of the first doubly linked list.
  • Each node in the first doubly linked list is used to store a logical address of each page in the write area; each node in the second doubly linked list is used to store a logical address of each page in the read area.
  • the pre-written data is already stored in the read area of the NVM, it is migrated to the write area. In the specific implementation, only the nodes in the read area are migrated to the write area.
  • the embodiment of the present invention migrates the pre-written data stored in the read area to the write area.
  • the migration involves only two different areas in the NVM, and is independent of the NAND Flash. Therefore, the NAND Flash access can be reduced, that is, the NAND Flash in the SSD is reduced. The frequency of access is reduced, thereby reducing the wear and tear on NAND Flash; and, due to the non-volatile nature of NVM, the data stored in the NVM is not lost, so the SSD does not need a capacitor to provide backup power when the power supply is interrupted. For the above reasons, the service life of the SSD of the embodiment of the present invention is increased.
  • the method may further include: updating the first mapping relationship to the second mapping relationship.
  • the first mapping relationship includes a correspondence between a logical address of the pre-written data and a location of the pre-written data in the read area;
  • the second mapping relationship includes a logical address of the pre-written data and a pre-written data in the write area. The correspondence between the locations.
  • the controller 42 can conveniently read and write the NVM 43 and the NAND Flash 44.
  • the NAND Flash 44 is used to store data whose accessed frequency (ie, the number of readings) is lower than a preset threshold, and thus The method may further include: determining whether the accessed frequency of the pre-written data reaches a preset threshold; when the accessed frequency of the pre-written data reaches a preset threshold, migrating the pre-written data to the read area to implement pre-writing The incoming data migrates from the write area to the read area, speeding up the reading of the pre-written data.
  • the method may further include: determining the accessed frequency of the page in the NAND Flash Whether it is greater than or equal to the preset threshold; when the accessed frequency of the page in the NAND Flash is greater than or equal to the preset threshold, the data in the page whose accessed frequency is greater than or equal to the preset threshold is migrated to the read area of the NVM to implement data from NAND Flash migrates to the read area, speeds up the reading of the data, and utilizes the temporal locality and spatial locality of the data to store frequently modified data and other hotspot data in the NVM, reducing wear and tear on the NAND Flash.
  • the NVM 43 may further include a free area.
  • the method may further include: adjusting, in the free area, N pages to the read area from the page reserved for the write area, wherein N is a pre-written data corresponding to The number of pages.
  • the controller 42 also needs to acquire the storage location to determine the subsequent operation. Specifically, it is explained from the following application scenarios.
  • pre-written data is stored in the NAND Flash in the SSD.
  • the application scenario includes at least two implementations.
  • pre-written data occupies a complete page in NAND Flash.
  • the mapping relationship is updated, that is, the logical address of the pre-written data is pointed to the position where the pre-written data is written to the write area.
  • the mapping relationship includes the correspondence between logical addresses and physical addresses of all pages in the SSD.
  • the pre-written data occupies a non-complete page in the NAND Flash.
  • data other than the portion of the NAND Flash corresponding to the range of the logical address of the pre-written data is transferred to the write area of the NVM in the page corresponding to the pre-written data; in the write area, the combination is written.
  • the pre-written data and the data migrated to the write area constitute a new page; then, the direction of the logical address of the pre-written data in the mapping relationship is updated to point to the address of the above new page.
  • the first implementation manner is used to indicate that the size of the pre-written data is exactly an integer multiple of the page in the NAND Flash.
  • the logical address and the physical address in the mapping relationship need to be updated.
  • Corresponding relationship may be, in the mapping relationship, increasing the correspondence between the logical address of the pre-written data and its physical address in the NVM;
  • the second implementation manner is used to indicate that the size of the pre-written data is not a page in the NAND Flash The processing of integer multiples.
  • the size of the pre-written data is 4 KB
  • the pre-written data is stored in the first page of the NAND Flash
  • the size of the page in the NAND Flash is 8 KB
  • the first page corresponds to a logical address and a physical address in the mapping relationship.
  • the address of the new page is saved to the tail of the first doubly linked list, and each node in the first doubly linked list is used to store the logical address of each page in the write area.
  • each node in the first doubly linked list is used to represent a page in the write area.
  • the node has a predecessor pointer and a successor pointer.
  • the predecessor pointer points to the predecessor node of the first doubly linked list, and the subsequent pointer points to the subsequent node of the first doubly linked list; in addition, the node also includes the logical address of the page.
  • the size of the write area determines the number of nodes contained in the first doubly linked list.
  • the first doubly linked list is used to record the order of the pages in the write area, thereby facilitating the management of the write area. For example, when data is written, the information of the corresponding page is inserted into the tail of the first doubly linked list; when it is eliminated, the page is selected from the header of the first doubly linked list.
  • the pre-written data is already stored in the write area of the NVM in the SSD.
  • the application scenario includes at least the following implementation manner: receiving a write operation request sent by the requester, the write operation request includes pre-writing data, determining that the pre-write data is stored in a write area, and storing pre-write in the write area. The location of the data is rewritten to the pre-written data.
  • the node corresponding to the pre-written data in the first doubly linked list is adjusted to the tail of the first doubly linked list.
  • internal migration of data stored in the write area is implemented. If the pre-written data is already stored in the write area, it is migrated to the corresponding node in the first doubly linked list to the end of the first doubly linked list.
  • the method may further include: saving an address of the page corresponding to the pre-written data to a tail of the first doubly linked list.
  • the write area Before the pre-write data is written into the write area, if it is determined that the write area is full, starting from the header of the first doubly linked list, determining that the number of times the page corresponding to the node in the first doubly linked list is greater than or equal to the second threshold Transmitting the data in the page of the page corresponding to the pre-written data to the read area; saving the address of the page in the read area to the second doubly linked list, and the nodes in the second doubly linked list are used The logical address of each page in the storage read area. Similar to the write area, the read area corresponds to the second doubly linked list, and the structure of the second doubly linked list is the same as that of the first doubly linked list, and details are not described herein again.
  • the first doubly linked list is determined from the first part of the first doubly linked list. If the number of times of reading the page corresponding to the node is less than the second threshold, the data in the page corresponding to the number of pages corresponding to the pre-written data is migrated to the NAND Flash from the header of the second doubly linked list to update the data in the read area in real time. When the storage space is insufficient, the data with low access frequency is migrated to NAND Flash in time to further ensure the performance of the SSD.
  • the number of migrations corresponding to the NAND Flash is accumulated; if it is determined that the number of migrations is greater than or equal to the third threshold, the page of the third threshold is selected from the NVM to migrate to the NAND Flash, and the selected page is the first corresponding to the write region.
  • the pre-written data is stored in the write area.
  • the storage space in each area of the NVM and the NAND Flash is sufficient, and perform the data stored therein according to the above description.
  • the adjustment ensures that each storage medium in the SSD has enough space to meet the above requirements.
  • the data stored in the SSD is essentially stored in NVM or NAND Flash.
  • the NVM stores data that is accessed frequently
  • the NAND Flash stores data that is accessed less frequently.
  • the frequency of the frequency of access can be judged in a variety of ways. For example, a preset threshold is set, and a storage location of the data is obtained according to a comparison between the frequency of the accessed data and the preset threshold in a fixed time. At this time, the accessed frequency of the page where the data is located is saved in the mapping relationship; or The frequency at which the data is located in the above mapping relationship reflects the frequency of access of the data, and the like, and the present invention is not limited. The reading of the stored data in the SSD of the present invention is described below in several specific embodiments.
  • the method may further include: accumulating the number of readings of the page where the pre-read data is located, wherein the mapping relationship includes the number of readings of all pages in the SSD.
  • the accessed frequency of the data may be represented by the number of readings, and the number of readings is included in the preset mapping relationship.
  • the accessed frequency of the data may also be implemented in other forms, and details are not described herein again.
  • the mapping relationship may be expressed in the form of a mapping table as shown in FIG. 8.
  • each block represents a basic mapping unit whose size is, for example, 4 KB or 8 KB.
  • a structure may also be used to represent a field corresponding to a preset mapping relationship.
  • the field corresponding to the single mapping relationship includes a physical address of the NVM or the NAND; an indication bit for indicating that the page corresponding to the block is located in the NVM or the NAND, for example, the indicator bit can be represented by one bit; and The read count of the page corresponding to this box.
  • the size of the page varies with the size of the page in the NAND.
  • the size of the page in the prior art is usually 4 KB/8 KB, but the present invention is not limited thereto.
  • the physical address of the pre-read data is located in the NAND Flash.
  • the method may further include: determining, for each page where the pre-read data is located, if the number of readings of the page where the pre-read data is located is greater than or equal to a second threshold, and If there is a free page in the NVM, the data in the page whose read count is greater than or equal to the second threshold is migrated to the free page in the NVM.
  • the embodiment of the present invention migrates the data stored in the NAND Flash and whose accessed frequency is higher than the second threshold to the NVM, so as to implement dynamic adjustment of the stored data in the SSD, and avoid excessive access of the NAND Flash.
  • Saving the data whose read count is greater than or equal to the second threshold to the NVM, compared with the NAND Flash, can improve the speed of data reading, and utilize the temporal locality and spatial locality of the data to frequently modify the data. And other hotspot data is stored in NVM, reducing wear and tear on NAND Flash.
  • the number of migrations corresponding to the NAND Flash may also be accumulated.
  • the number of pages migrating from NAND Flash to NVM can be obtained, thereby reasonably adjusting the proportion of space occupied by NAND Flash and NVM in SSD, or migrating data of the same number of pages in NVM to NAND Flash.
  • the migration of the data to the NVM may include: if it is determined that the number of times the page in which the pre-read data is located is greater than or equal to the second threshold, and the read area includes a free page, the number of times the read count is greater than or equal to the second threshold The data is migrated to the free page of the read area.
  • the third threshold is selected from the NVM to migrate to the NAND Flash, wherein the third threshold is determined by the ratio of the NVM to the NAND Flash in the SSD. .
  • the third threshold is small; correspondingly, if the space occupied by the NVM is smaller than the space occupied by the NAND Flash, the third threshold is larger.
  • the NVM includes a write area. If the physical address of the pre-read data is located in the write area of the NVM, after the number of times of reading the page where the pre-read data is accumulated, the method may further include: updating the address of the page where the pre-read data is located to the first doubly linked list. a tail, wherein each node in the first doubly linked list is used to store a logical address of each page in the write area.
  • the metadata area may include the first doubly linked list, the second doubly linked list, the preset mapping relationship, and the like.
  • the embodiment of the present invention stores data with high access frequency in the NVM, thereby reducing access to the NAND Flash, that is, reducing the accessed frequency of the NAND Flash in the SSD, and reducing wear and tear on the NAND Flash; and, due to the NVM
  • the non-volatile feature the data stored in the NVM is not lost, so the SSD does not need a capacitor to provide backup power when the power supply is interrupted. For the above reasons, the service life of the SSD of the embodiment of the present invention is increased.
  • the embodiment of the present invention does not limit the size of reading and writing. It can be any size read or write.
  • the default mapping relationship of the SSD such as the mapping table, has a basic management granularity, such as 4 KB, or 8 KB, or even 16 KB. This management granularity is generally the same as the size of the NAND Flash page, and can be different.
  • the basic management unit for SDD reading and writing is the page.
  • the size of the read and write operation request sent by the host to the SSD may be arbitrary. Take the page size as 8KB as an example. If the data to be read is relatively large, it is 32KB, then you need to read 4 pages and feed the relevant data back to the host; if the data read is relatively small, For 2KB, only the corresponding 2KB of data is returned to the host.
  • the SSD uses NAND Flash and NVM to store data hierarchically, that is, the data is stored in NAND Flash or NVM. Due to the non-volatile characteristics of the NVM, the SSD does not include a capacitor. The problem of data loss is lost, and the absence of capacitors in the SSD will increase the service life of the SSD and greatly improve the reliability of the SSD.
  • the disclosed apparatus and methods may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the unit or module is only a logical function division.
  • there may be another division manner for example, multiple units or modules may be used. Combinations can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or module, and may be electrical, mechanical or otherwise.
  • the modules described as separate components may or may not be physically separated.
  • the components displayed as modules may or may not be physical modules, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • the aforementioned program can be stored in a computer readable storage medium.
  • the program when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes: ROM, RAM, disk or A variety of media such as optical discs that can store program code.

Landscapes

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

Abstract

A method for writing data to a solid state drive and the solid state drive. The SSD (40) comprises a controller (42) and a storage. Storage media of the storage comprise an NAND Flash (44) and an NVM (43). The NVM (43) comprises a writing area. The method comprises: receiving a writing request, the writing request comprising pre-written data (S601); determining that the pre-written data is not stored in the writing area (S602); and writing the pre-written data to the writing area (S603). By writing the pre-written data to the writing area of the NVM, the access frequency of the NAND Flash can be reduced, that is, the access frequency of the NAND Flash in the SSD is reduced, and thereby reducing wearing to the NAND Flash; moreover, because the NVM is nonvolatile, data stored in the NVM will not be lost when power is off, and the SSD does not need a capacitor to supply back-up power when power supply is interrupted. Based on the foregoing reasons, the service life of the SSD can be extended.

Description

将数据写入固态硬盘的方法及固态硬盘Method for writing data to solid state hard disk and solid state hard disk 技术领域Technical field

本发明实施例涉及存储技术,尤其涉及一种将数据写入固态硬盘的方法及固态硬盘。Embodiments of the present invention relate to storage technologies, and in particular, to a method for writing data to a solid state hard disk and a solid state hard disk.

背景技术Background technique

固态硬盘(Solid State Drives,简称:SSD),简称固盘,广泛应用于服务器、台式机、笔记本、移动设备、游戏机等。Solid State Drives (SSDs), referred to as fixed disks, are widely used in servers, desktops, notebooks, mobile devices, game consoles, etc.

如图1所示,SSD 10多采用半导体NAND Flash14作为存储器的存储介质;并通过电容15来提供备电,以避免内存13中的数据在掉电时丢失;通过控制器12接收主机11的读写操作请求,并对内存13或NAND Flash14进行读写。As shown in FIG. 1 , the SSD 10 mostly uses the semiconductor NAND Flash 14 as a storage medium of the memory; and provides backup power through the capacitor 15 to prevent data in the memory 13 from being lost when power is lost; receiving the read by the host 11 through the controller 12 Write operation request and read and write to memory 13 or NAND Flash 14.

现有技术中,当读写操作请求是针对NAND Flash 14时,需通过内存13作为中介,从NAND Flash 14读取读操作请求对应的数据到内存13,然后再返回给主机11;或者,将写操作请求对应的数据先写入内存13,然后再转存至NAND Flash 14。这样,若缓存在内存13中的写操作请求对应的数据还未转存至NAND Flash 14时,供电中断,需要电容15提供备电,将内存13中的数据写到NAND Flash 14。In the prior art, when the read/write operation request is for the NAND Flash 14, the memory 13 is used as an intermediary, and the data corresponding to the read operation request is read from the NAND Flash 14 to the memory 13, and then returned to the host 11; or, The data corresponding to the write operation request is first written into the memory 13 and then transferred to the NAND Flash 14. Thus, if the data corresponding to the write operation request buffered in the memory 13 has not been transferred to the NAND Flash 14, the power supply is interrupted, and the capacitor 15 is required to provide the backup power, and the data in the memory 13 is written to the NAND Flash 14.

然而,基于历史数据统计,NAND Flash和电容是SSD的主要故障源。因此,SSD中,电容的存在及对NAND Flash过多的读写可能导致SSD的使用寿命较短。However, based on historical data statistics, NAND Flash and capacitors are the main sources of failure for SSDs. Therefore, in SSDs, the presence of capacitors and excessive reading and writing of NAND Flash may result in a shorter lifetime of the SSD.

发明内容Summary of the invention

本发明实施例提供一种将数据写入固态硬盘的方法及固态硬盘,以增长SSD的使用寿命,提升SSD的可靠性。Embodiments of the present invention provide a method for writing data into a solid state hard disk and a solid state hard disk to increase the service life of the SSD and improve the reliability of the SSD.

第一方面,本发明实施例提供一种将数据写入固态硬盘SSD的 方法,所述SSD包括控制器和存储器,所述存储器的存储介质包括NAND Flash和非易失性存储器NVM,所述NVM包括写区域,所述方法包括:In a first aspect, an embodiment of the present invention provides a method for writing data into a solid state hard disk SSD. The method includes a controller and a memory, the storage medium of the memory comprising a NAND flash and a non-volatile memory NVM, the NVM including a write area, the method comprising:

接收写操作请求,所述写操作请求包括预写入数据;Receiving a write operation request, the write operation request including pre-written data;

确定所述预写入数据未存储在所述写区域;Determining that the pre-written data is not stored in the write area;

将所述预写入数据写入所述写区域。The pre-written data is written to the write area.

根据第一方面,在第一方面的第一种可能的实现方式中,所述方法还包括:According to the first aspect, in a first possible implementation manner of the first aspect, the method further includes:

判断所述预写入数据是否已存储在所述NAND Flash;Determining whether the pre-written data has been stored in the NAND Flash;

若所述预写入数据已存储在所述NAND Flash,将NAND Flash中存储所述预写入数据的页置为无效。If the pre-written data is already stored in the NAND Flash, the page in the NAND Flash storing the pre-written data is invalidated.

根据第一方面或第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述将所述预写入数据写入所述写区域之后,所述方法还包括:According to the first aspect, or the first possible implementation manner of the first aspect, in the second possible implementation manner of the first aspect, after the writing the pre-write data into the write area, The method also includes:

保存映射关系,所述映射关系包括所述预写入数据的逻辑地址与所述预写入数据写入所述写区域的位置之间的对应关系。A mapping relationship is saved, the mapping relationship including a correspondence between a logical address of the pre-written data and a location where the pre-written data is written into the write area.

根据第一方面、第一方面的第一种至第二种可能的实现方式中任意一种,在第一方面的第三种可能的实现方式中,所述方法还包括:According to the first aspect, the first to the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the method further includes:

判断所述预写入数据的被访问频率是否达到预设阈值;Determining whether the accessed frequency of the pre-written data reaches a preset threshold;

当所述预写入数据的被访问频率达到所述预设阈值时,迁移所述预写入数据至所述读区域。When the accessed frequency of the pre-written data reaches the preset threshold, the pre-written data is migrated to the read region.

根据第一方面、第一方面的第一种至第三种可能的实现方式中任意一种,在第一方面的第四种可能的实现方式中,所述方法还包括:According to the first aspect, the first to the third possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, the method further includes:

判断所述NAND Flash中页的被访问频率是否大于或等于所述预设阈值;Determining whether the accessed frequency of the page in the NAND Flash is greater than or equal to the preset threshold;

当所述NAND Flash中页的被访问频率大于或等于所述预设阈值时,迁移所述被访问频率大于或等于所述预设阈值的页中的数据至所述NVM的读区域。And when the accessed frequency of the page in the NAND Flash is greater than or equal to the preset threshold, migrating the data in the page whose accessed frequency is greater than or equal to the preset threshold to the read region of the NVM.

第二方面,本发明实施例提供一种将数据写入固态硬盘SSD的 方法,所述SSD包括控制器和存储器,所述存储器的存储介质包括NAND Flash和非易失性存储器NVM,所述NVM包括写区域和读区域,所述方法包括:In a second aspect, an embodiment of the present invention provides a method for writing data into a solid state hard disk SSD. The method includes a controller and a memory, the storage medium of the memory including a NAND flash and a non-volatile memory NVM, the NVM including a write area and a read area, the method comprising:

接收写操作请求,所述写操作请求包括预写入数据;Receiving a write operation request, the write operation request including pre-written data;

确定所述预写入数据已存储在所述读区域;Determining that the pre-written data has been stored in the read area;

将所述读区域中的所述预写入数据迁移至所述写区域。The pre-written data in the read region is migrated to the write region.

根据第二方面,在第二方面的第一种可能的实现方式中,所述将所述读区域中的所述预写入数据迁移至所述写区域之后,所述方法还包括:According to the second aspect, in a first possible implementation manner of the second aspect, after the pre-writing data in the read area is migrated to the write area, the method further includes:

更新第一映射关系为第二映射关系,所述第一映射关系包括所述预写入数据的逻辑地址与所述预写入数据在所述读区域的位置之间的对应关系,所述第二映射关系包括所述预写入数据的逻辑地址与所述预写入数据在所述写区域的位置之间的对应关系。Updating the first mapping relationship to a second mapping relationship, where the first mapping relationship includes a correspondence between a logical address of the pre-written data and a location of the pre-written data in the read region, where The second mapping relationship includes a correspondence between a logical address of the pre-written data and a location of the pre-written data in the write area.

根据第二方面或第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,所述方法还包括:According to the second aspect or the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, the method further includes:

判断所述预写入数据的被访问频率是否达到预设阈值;Determining whether the accessed frequency of the pre-written data reaches a preset threshold;

当所述预写入数据的被访问频率达到所述预设阈值时,迁移所述预写入数据至所述读区域。When the accessed frequency of the pre-written data reaches the preset threshold, the pre-written data is migrated to the read region.

根据第二方面、第二方面的第一种至第二种可能的实现方式中任意一种,在第二方面的第三种可能的实现方式中,所述方法还包括:According to the second aspect, the first to the second possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, the method further includes:

判断所述NAND Flash中页的被访问频率是否大于或等于所述预设阈值;Determining whether the accessed frequency of the page in the NAND Flash is greater than or equal to the preset threshold;

当所述NAND Flash中页的被访问频率大于或等于所述预设阈值时,迁移所述被访问频率大于或等于所述预设阈值的页中的数据至所述NVM的读区域。And when the accessed frequency of the page in the NAND Flash is greater than or equal to the preset threshold, migrating the data in the page whose accessed frequency is greater than or equal to the preset threshold to the read region of the NVM.

根据第二方面、第二方面的第一种至第三种可能的实现方式中任意一种,在第二方面的第四种可能的实现方式中,所述NVM还包括空闲区域,所述将所述读区域中的所述预写入数据迁移至所述写区域之后,所述方法还包括: According to the second aspect, the first to the third possible implementation manner of the second aspect, in a fourth possible implementation manner of the second aspect, the NVM further includes a free area, where After the pre-written data in the read area is migrated to the write area, the method further includes:

在所述空闲区域中,从预留给所述写区域的页中调整N页给所述读区域,所述N为所述预写入数据对应的页数。In the free area, N pages are adjusted from the pages reserved for the write area to the read area, and the N is the number of pages corresponding to the pre-written data.

第三方面,本发明实施例提供一种固态硬盘SSD,所述SSD包括控制器和存储器,所述存储器的存储介质包括NAND Flash和非易失性存储器NVM,所述NVM包括写区域,其中,In a third aspect, an embodiment of the present invention provides a solid state hard disk SSD, where the SSD includes a controller and a memory, and the storage medium of the memory includes a NAND flash and a nonvolatile memory NVM, where the NVM includes a write area, where

所述控制器,用于接收写操作请求,所述写操作请求包括预写入数据;确定所述预写入数据未存储在所述写区域;及,将所述预写入数据写入所述写区域;The controller is configured to receive a write operation request, the write operation request includes pre-writing data, determine that the pre-write data is not stored in the write area, and write the pre-write data into the Describe area

所述写区域用于存储所述预写入数据。The write area is for storing the pre-written data.

根据第三方面,在第三方面的第一种可能的实现方式中,所述控制器还用于:According to the third aspect, in a first possible implementation manner of the third aspect, the controller is further configured to:

判断所述预写入数据是否已存储在所述NAND Flash;Determining whether the pre-written data has been stored in the NAND Flash;

若所述预写入数据已存储在所述NAND Flash,将NAND Flash中存储所述预写入数据的页置为无效。If the pre-written data is already stored in the NAND Flash, the page in the NAND Flash storing the pre-written data is invalidated.

根据第三方面或第三方面的第一种可能的实现方式,在第三方面的第二种可能的实现方式中,所述控制器还用于:According to the third aspect or the first possible implementation manner of the third aspect, in a second possible implementation manner of the third aspect, the controller is further configured to:

保存映射关系,所述映射关系包括预写入数据的逻辑地址与所述预写入数据写入所述写区域的位置之间的对应关系。A mapping relationship is saved, the mapping relationship including a correspondence between a logical address of the pre-written data and a position at which the pre-written data is written into the write area.

根据第三方面、第三方面的第一种至第二种可能的实现方式中任意一种,在第三方面的第三种可能的实现方式中,所述控制器还用于:According to the third aspect, the first to the second possible implementation manner of the third aspect, in a third possible implementation manner of the third aspect, the controller is further configured to:

判断所述预写入数据的被访问频率是否达到预设阈值;Determining whether the accessed frequency of the pre-written data reaches a preset threshold;

当所述预写入数据的被访问频率达到所述预设阈值时,迁移所述预写入数据至所述读区域。When the accessed frequency of the pre-written data reaches the preset threshold, the pre-written data is migrated to the read region.

根据第三方面、第三方面的第一种至第三种可能的实现方式中任意一种,在第三方面的第四种可能的实现方式中,所述控制器还用于:According to the third aspect, the first to the third possible implementation manner of the third aspect, in a fourth possible implementation manner of the third aspect, the controller is further configured to:

判断所述NAND Flash中页的被访问频率是否大于或等于所述预设阈值;Determining whether the accessed frequency of the page in the NAND Flash is greater than or equal to the preset threshold;

当所述NAND Flash中页的被访问频率大于或等于所述预设阈值时,迁移所述被访问频率大于或等于所述预设阈值的页中的数据至所 述NVM的读区域。When the accessed frequency of the page in the NAND Flash is greater than or equal to the preset threshold, migrating the data in the page whose accessed frequency is greater than or equal to the preset threshold to the location The read area of the NVM.

第四方面,本发明实施例提供一种固态硬盘SSD,所述SSD包括控制器和存储器,所述存储器的存储介质包括NAND Flash和非易失性存储器NVM,所述NVM包括写区域和读区域,其中,In a fourth aspect, an embodiment of the present invention provides a solid state hard disk SSD, where the SSD includes a controller and a memory, and the storage medium of the memory includes a NAND flash and a nonvolatile memory NVM, and the NVM includes a write area and a read area. ,among them,

所述控制器,用于接收写操作请求,所述写操作请求包括预写入数据;确定所述预写入数据已存储在所述读区域;及,将所述读区域中的所述预写入数据迁移至所述写区域。The controller is configured to receive a write operation request, the write operation request includes pre-writing data, determine that the pre-write data has been stored in the read area, and: perform the pre-in the read area The write data is migrated to the write area.

根据第四方面,在第四方面的第一种可能的实现方式中,所述控制器还用于:According to the fourth aspect, in a first possible implementation manner of the fourth aspect, the controller is further configured to:

更新第一映射关系为第二映射关系,所述第一映射关系包括所述预写入数据的逻辑地址与所述预写入数据在所述读区域的位置之间的对应关系,所述第二映射关系包括所述预写入数据的逻辑地址与所述预写入数据在所述写区域的位置之间的对应关系。Updating the first mapping relationship to a second mapping relationship, where the first mapping relationship includes a correspondence between a logical address of the pre-written data and a location of the pre-written data in the read region, where The second mapping relationship includes a correspondence between a logical address of the pre-written data and a location of the pre-written data in the write area.

根据第四方面或第四方面的第一种可能的实现方式,在第四方面的第二种可能的实现方式中,所述控制器还用于:According to the fourth aspect or the first possible implementation manner of the fourth aspect, in a second possible implementation manner of the fourth aspect, the controller is further configured to:

判断所述预写入数据的被访问频率是否达到预设阈值;Determining whether the accessed frequency of the pre-written data reaches a preset threshold;

当所述预写入数据的被访问频率达到所述预设阈值时,迁移所述预写入数据至所述读区域。When the accessed frequency of the pre-written data reaches the preset threshold, the pre-written data is migrated to the read region.

根据第四方面、第四方面的第一种至第二种可能的实现方式中任意一种,在第四方面的第三种可能的实现方式中,所述控制器还用于:According to the fourth aspect, the first to the second possible implementation manner of the fourth aspect, in a third possible implementation manner of the fourth aspect, the controller is further configured to:

判断所述NAND Flash中页的被访问频率是否大于或等于所述预设阈值;Determining whether the accessed frequency of the page in the NAND Flash is greater than or equal to the preset threshold;

当所述NAND Flash中页的被访问频率大于或等于所述预设阈值时,迁移所述被访问频率大于或等于所述预设阈值的页中的数据至所述NVM的读区域。And when the accessed frequency of the page in the NAND Flash is greater than or equal to the preset threshold, migrating the data in the page whose accessed frequency is greater than or equal to the preset threshold to the read region of the NVM.

根据第四方面、第四方面的第一种至第三种可能的实现方式中任意一种,在第四方面的第四种可能的实现方式中,所述NVM还包括空闲区域,所述控制器还用于:According to the fourth aspect, the first to the third possible implementation manner of the fourth aspect, in a fourth possible implementation manner of the fourth aspect, the NVM further includes a free area, the control Also used to:

在所述空闲区域中,从预留给所述写区域的页中调整N页给所 述读区域,所述N为所述预写入数据对应的页数。In the free area, N pages are adjusted from pages reserved for the write area In the reading area, the N is the number of pages corresponding to the pre-written data.

本发明实施例提供一种将数据写入固态硬盘的方法及固态硬盘,将预写入数据写入NVM的写区域,从而能减少对NAND Flash访问,即降低SSD中NAND Flash的被访问频率,减少对NAND Flash的磨损;且,由于NVM的非易失特性,存储于NVM的数据掉电不丢失,因此,在供电中断时,SSD无需电容提供备电。基于上述原因,本发明实施例SSD的使用寿命增长。Embodiments of the present invention provide a method for writing data into a solid state hard disk and a solid state hard disk, and writing prewritten data to a write area of the NVM, thereby reducing access to the NAND Flash, that is, reducing the accessed frequency of the NAND Flash in the SSD. Reduce the wear and tear on NAND Flash; and, due to the non-volatile nature of NVM, the data stored in NVM is not lost. Therefore, in the event of power interruption, SSD does not need capacitors to provide backup power. For the above reasons, the service life of the SSD of the embodiment of the present invention is increased.

附图说明DRAWINGS

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图做一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description of the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any inventive labor.

图1为现有技术SSD的应用场景示意图;FIG. 1 is a schematic diagram of an application scenario of a prior art SSD;

图2为SLC的存储单元中所存储数据的示意图;2 is a schematic diagram of data stored in a storage unit of an SLC;

图3为MLC的存储单元中所存储数据的示意图;3 is a schematic diagram of data stored in a storage unit of an MLC;

图4为本发明SSD的结构示意图;4 is a schematic structural view of an SSD according to the present invention;

图5为本发明SSD中NVM的结构示例图;5 is a diagram showing an example of the structure of an NVM in an SSD according to the present invention;

图6为本发明将数据写入SSD的方法实施例一的流程图;6 is a flowchart of Embodiment 1 of a method for writing data into an SSD according to the present invention;

图7为本发明将数据写入SSD的方法实施例二的流程图;7 is a flowchart of Embodiment 2 of a method for writing data into an SSD according to the present invention;

图8为本发明实施例中映射关系示例图。FIG. 8 is a diagram showing an example of a mapping relationship in an embodiment of the present invention.

具体实施方式detailed description

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有 做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. Based on the embodiments of the present invention, those of ordinary skill in the art are not All other embodiments obtained under the premise of creative labor are within the scope of the invention.

现有技术中,NAND Flash是SSD实际存储数据的物理介质。其中,NAND Flash包括单层式单元储存(英文:Single Level Cell,简称:SLC)、多层式单元储存(英文:Multi Level Cell,简称:MLC)、三层式单元储存(英文:Triple Level Cell,简称:TLC)几种。在企业级存储领域,主要用到SLC和MLC。TLC这种介质的擦写次数较低,目前主要用在消费级的电子产品上。In the prior art, NAND Flash is a physical medium in which an SSD actually stores data. Among them, NAND Flash includes single-level cell storage (English: Single Level Cell, SLC for short), multi-level cell storage (English: Multi Level Cell, MLC for short), and three-layer cell storage (English: Triple Level Cell) , referred to as: TLC) several. In the enterprise storage area, SLC and MLC are mainly used. TLC has a low number of erases and is currently used primarily in consumer electronics.

SLC技术特点是在浮置栅极与源极之中的氧化薄膜更薄,在写入数据时通过对浮置栅极的电荷加电压,然后通过源极,即可将所储存的电荷消除,通过这样的方式,便可储存1个信息单元,这种技术能提供快速的程序编程与读取。但该技术受限于硅效率(英文:Silicon efficiency),须用较先进的流程强化技术,才能向上提升SLC处理技术。The SLC technology is characterized in that the oxide film in the floating gate and the source is thinner, and the stored charge is removed by applying a voltage to the charge of the floating gate when writing data, and then passing through the source. In this way, one information unit can be stored, which provides fast program programming and reading. However, this technology is limited by silicon efficiency (English: Silicon efficiency), and it is necessary to use advanced process enhancement technology to upgrade SLC processing technology.

SLC在每个存储单元里存储1比特(英文:bit)的数据,存储的数据是“0”还是“1”是由基于电压阈值来判定。对于NAND Flash的写入,即编程,就是对其充电,使得NAND Flash的电压超过图2所示的电压判定点A,存储单元就表示“0”,也就是已写入;如果没有充电或者电压阈值低于电压判定点A,就表示“1”,也就是擦除,图2中横轴代表电压。The SLC stores 1 bit (English: bit) of data in each storage unit, and whether the stored data is "0" or "1" is determined based on a voltage threshold. For NAND Flash write, ie programming, is to charge it, so that the voltage of NAND Flash exceeds the voltage decision point A shown in Figure 2, the memory cell means "0", that is, it has been written; if there is no charge or voltage When the threshold is lower than the voltage decision point A, it means "1", that is, erase, and the horizontal axis in Fig. 2 represents voltage.

英特尔公司在1997年9月最先开发成功MLC,其作用是将两个单位的信息存入一个浮置栅极(英文:Floating Gate),然后利用不同电位的电荷,通过内存储存的电压控制精准读写。MLC通过使用大量的电压等级,每一个单元储存两位数据,数据密度比较大。SLC储存0和1两个值,而MLC可以一次储存4个以上的值。因此,MLC有比较高的储存密度。In September 1997, Intel first developed the MLC. Its function is to store two units of information into a floating gate (English: Floating Gate), and then use the charge of different potentials to control the voltage stored in the memory. Read and write. MLC uses a large number of voltage levels, each unit stores two bits of data, and the data density is relatively large. The SLC stores two values of 0 and 1, while the MLC can store more than four values at a time. Therefore, MLC has a relatively high storage density.

如图3所示,MLC在每个存储单元里存储2bit的数据,存储的数据是“00”,或“01”,或“10”,或“11”也是基于电压阈值的判定。当电压小于电压判定点B时,代表”11”;当电压在电压判定点 B和电压判定点C之间,则代表“10”;电压在电压判定点C和电压判定点D之间,则表示”01”;而电压达到电压判定点D以上,则表示”00”。As shown in FIG. 3, the MLC stores 2 bits of data in each storage unit, and the stored data is "00", or "01", or "10", or "11" is also a determination based on a voltage threshold. When the voltage is less than the voltage decision point B, it represents "11"; when the voltage is at the voltage decision point Between B and the voltage determination point C, it represents "10"; when the voltage is between the voltage determination point C and the voltage determination point D, it means "01"; and when the voltage reaches the voltage determination point D or more, it means "00".

TLC的一个存储单元可以存储3bit,因此需要8个等级的电位进行编码解码才能实现。实质上,TLC属于MLC。A memory cell of the TLC can store 3 bits, so it requires 8 levels of potential for encoding and decoding. In essence, TLC belongs to MLC.

当前业界关于新的存储介质的研究方兴未艾,各种新的技术或新型的存储介质层出不穷。新的存储介质例如有相变内存(英文:Phase Change Random Access Memory,简称:PCRAM/PCM)、磁阻式随机存取内存(英文:Magnetoresistive Random Access Memory,简称:MRAM)、阻变式随机存取内存(英文:Resistive Random Access Memory,简称:RRAM/ReRAM)和自旋转移力矩随机存取内存(英文:spin transfer torque random access memory,简称:STT-RAM)等,本发明不予限制。The current research on new storage media is on the rise, and various new technologies or new types of storage media are emerging. The new storage medium includes, for example, phase change memory (English: Phase Change Random Access Memory, PCROM/PCM), magnetoresistive random access memory (MRAM), and resistive random access memory. The present invention is not limited in terms of memory (English: Resistive Random Access Memory, RRAM/ReRAM for short) and spin transfer torque random access memory (STT-RAM).

上面提到的这几种新型的存储介质,都属于非易失性存储介质(英文:non-volatile memory,简称:NVM)。在可预见的将来,基于保护现有投资和成本上的考虑,NAND Flash作为主要存储介质将长期存在。同时,新型的非易失的存储介质将逐步担当重要角色,直至逐步取代NAND Flash。在这个演变过程中,可能存在同一SSD上有多种介质共存的情况。The above-mentioned several new types of storage media belong to non-volatile storage media (English: non-volatile memory, referred to as: NVM). In the foreseeable future, NAND Flash will exist for a long time as the main storage medium based on the protection of existing investment and cost considerations. At the same time, new non-volatile storage media will gradually play an important role until the NAND Flash is gradually replaced. In this evolution, there may be cases where multiple media coexist on the same SSD.

基于上述原因,本发明实施例提供一种SSD。For the above reasons, an embodiment of the present invention provides an SSD.

如图4所示,SSD 40包括控制器42和存储器,存储器的存储介质包括NAND Flash 44和NVM 43。As shown in FIG. 4, the SSD 40 includes a controller 42 and a memory, and the storage medium of the memory includes a NAND Flash 44 and an NVM 43.

其中,NVM与普通内存不同的是,NVM介质本身具备掉电不丢失数据的特性。基于此特性,NVM具备如下功能特性:缓存写,在NVM中凑成完整的页,再根据该页的被访问频率以及NVM的容量大小判断是否转写到NAND Flash上;加速读,将被访问频率高的数据迁移到NVM。Among them, NVM is different from ordinary memory in that the NVM medium itself has the characteristics of power loss without losing data. Based on this feature, NVM has the following features: cache write, make a complete page in NVM, and then judge whether to transfer to NAND Flash according to the accessed frequency of the page and the size of NVM; accelerate read, will be accessed High frequency data is migrated to NVM.

图5示出了NVM的区域划分。如图5所示,NVM 50可以包括4个逻辑区域:元数据区域51、读区域52、写区域53和空闲区域54, 实现对NVM的分区管理。各区域的作用如下:Figure 5 shows the area division of the NVM. As shown in FIG. 5, the NVM 50 may include four logical areas: a metadata area 51, a read area 52, a write area 53, and a free area 54, Implement partition management for NVM. The role of each region is as follows:

元数据区域51,用于存放SSD的元数据。例如,元数据可以为映射关系、写操作对应的先入先出(First Input First Output,简称:FIFO)双向链表等。The metadata area 51 is used to store metadata of the SSD. For example, the metadata may be a mapping relationship, a first input first output (referred to as a FIFO) doubly linked list, and the like.

读区域52,用于读加速,SSD中被访问频率(即读次数)高于或等于预设阈值的页,会被迁移到读区域52。The read area 52 is used for read acceleration, and the page whose access frequency (ie, the number of reads) in the SSD is higher than or equal to the preset threshold is migrated to the read area 52.

写区域53,对SSD的所有写操作,都是先写入该写区域53。该区域写满后的淘汰,按最近最少被访问频率的策略淘汰。The write area 53, all write operations to the SSD, is written to the write area 53 first. The elimination of the area after it is full is eliminated according to the strategy of least recently accessed frequency.

空闲区域54,该区域由读区域52和写区域53共用,为读操作或写操作提供空闲的页,读操作和写操作按照读区域52和写区域53的比例进行空闲区域分享。The free area 54, which is shared by the read area 52 and the write area 53, provides a free page for a read operation or a write operation, and the read operation and the write operation perform free area sharing according to the ratio of the read area 52 and the write area 53.

补充说明的是,NVM中写区域和读区域的比例可调。通常情况下,写区域远大于读区域,特别地,NVM中可以只有写区域,没有读区域。另外,不同的应用场景对SSD的性能要求和擦写次数要求是不一样的。因此,基于SSD的使用寿命、SSD的性能以及成本上的考量,可以按照用户的实际业务需求配备满足要求擦写次数的SSD,通过调配NVM和NAND的搭配比例,为用户提供性价比较高的产品,避免过度配置带来的额外开支,提高资源利用率。It is added that the ratio of the write area to the read area in the NVM is adjustable. Normally, the write area is much larger than the read area. In particular, there can be only write areas and no read areas in the NVM. In addition, different application scenarios require different performance requirements and erasing times for SSDs. Therefore, based on the service life of SSD, the performance of SSD, and the cost considerations, SSDs that meet the required number of erasing times can be equipped according to the actual business needs of users, and the ratio of NVM and NAND can be matched to provide users with cost-effective products. To avoid the extra expenses caused by over-provisioning and improve resource utilization.

具体地,控制器42用于执行以下方法实施例所保护的技术方案,例如,如图6所示的技术方案,以实现将数据写入NVM 43的写区域,该写区域用于存储预写入数据。其中,NVM具备按字节(Byte)寻址,将数据以位(bit)为单位写入及可按位改写的能力。Specifically, the controller 42 is configured to execute the technical solution protected by the following method embodiments, for example, the technical solution shown in FIG. 6, to implement writing of data to the write area of the NVM 43, the write area for storing pre-write Into the data. Among them, NVM has the ability to write data in units of bits (bits) and can be rewritten in bits.

如图6所示,本发明实施例提供一种将数据写入SSD的方法,该方法可以由SSD中的控制器来执行。该方法包括:As shown in FIG. 6, an embodiment of the present invention provides a method for writing data to an SSD, which may be performed by a controller in an SSD. The method includes:

S601、接收写操作请求,该写操作请求包括预写入数据。S601. Receive a write operation request, where the write operation request includes pre-written data.

S602、确定该预写入数据未存储在写区域。S602. Determine that the pre-written data is not stored in the write area.

S603、将预写入数据写入写区域。S603. Write pre-write data to the write area.

具体地,对SSD 40的所有写操作,都是先写入写区域。Specifically, all write operations to the SSD 40 are written to the write area first.

对于将要写入SSD 40的上述预写入数据,该预写入数据可能已 存储在写区域中,因此,执行S602,首先确定该预写入数据未存储在写区域。For the above pre-written data to be written to the SSD 40, the pre-written data may have It is stored in the write area, and therefore, in S602, it is first determined that the pre-write data is not stored in the write area.

本发明实施例将预写入数据写入NVM的写区域,可以减少对NAND Flash访问,即降低SSD中NAND Flash的被访问频率,从而减少对NAND Flash的磨损;且,由于NVM的非易失特性,存储于NVM的数据掉电不丢失,因此,在供电中断时,SSD无需电容提供备电。基于上述原因,本发明实施例SSD的使用寿命增长。In the embodiment of the present invention, writing pre-write data to the write area of the NVM can reduce access to the NAND Flash, that is, reduce the accessed frequency of the NAND Flash in the SSD, thereby reducing wear on the NAND Flash; and, due to the non-volatile of the NVM The data stored in the NVM is not lost. Therefore, the SSD does not need a capacitor to provide backup power when the power supply is interrupted. For the above reasons, the service life of the SSD of the embodiment of the present invention is increased.

在上述实施例中,将数据写入SSD的方法还可以包括:判断预写入数据是否已存储在NAND Flash;若预写入数据已存储在NAND Flash,将NAND Flash中存储预写入数据的页置为无效。该实施例可避免在SSD中保存两份相同的数据,进而造成存储空间的浪费。In the above embodiment, the method of writing data to the SSD may further include: determining whether the pre-written data is stored in the NAND Flash; if the pre-written data is stored in the NAND Flash, storing the pre-written data in the NAND Flash. The page is set to invalid. This embodiment can avoid storing two identical data in the SSD, thereby causing waste of storage space.

进一步地,S603之后,该方法还可以包括:保存映射关系,该映射关系包括预写入数据的逻辑地址与预写入数据写入写区域的位置之间的对应关系。同时参考图4,根据该映射关系,控制器42可以方便地对NVM 43和NAND Flash 44进行读写。Further, after S603, the method may further include: saving a mapping relationship, where the mapping relationship includes a correspondence between a logical address of the pre-written data and a position where the pre-written data is written in the write area. Referring to FIG. 4 at the same time, according to the mapping relationship, the controller 42 can conveniently read and write the NVM 43 and the NAND Flash 44.

由于NVM 43的读区域用于存储被访问频率(即读次数)高于或等于预设阈值的数据,NAND Flash 44用于存储被访问频率(即读次数)低于预设阈值的数据,因此,上述方法还可以包括:判断预写入数据的被访问频率是否达到预设阈值;当预写入数据的被访问频率达到预设阈值时,迁移预写入数据至读区域,以实现预写入数据从写区域迁移至读区域,加速对预写入数据的读取。Since the read area of the NVM 43 is used to store data whose accessed frequency (ie, the number of reads) is higher than or equal to a preset threshold, the NAND Flash 44 is used to store data whose accessed frequency (ie, the number of readings) is lower than a preset threshold, and thus The method may further include: determining whether the accessed frequency of the pre-written data reaches a preset threshold; when the accessed frequency of the pre-written data reaches a preset threshold, migrating the pre-written data to the read area to implement pre-writing The incoming data migrates from the write area to the read area, speeding up the reading of the pre-written data.

同理,该方法还可以包括:判断NAND Flash中页的被访问频率是否大于或等于预设阈值;当NAND Flash中页的被访问频率大于或等于预设阈值时,迁移被访问频率大于或等于预设阈值的页中的数据至NVM的读区域,以实现数据从NAND Flash迁移至读区域,加速对该数据的读取,利用数据的时间局部性和空间局部性,将频繁被修改的数据以及其它热点数据存储在NVM,减少对NAND Flash的磨损。Similarly, the method may further include: determining whether the accessed frequency of the page in the NAND Flash is greater than or equal to a preset threshold; when the accessed frequency of the page in the NAND Flash is greater than or equal to a preset threshold, the migrated access frequency is greater than or equal to Presetting the threshold data into the read area of the NVM to implement data migration from NAND Flash to the read area, speeding up the reading of the data, utilizing the temporal locality and spatial locality of the data, and frequently modifying the data. And other hotspot data is stored in NVM, reducing wear and tear on NAND Flash.

另外,控制器42还可以用于执行如图7所示的步骤。如图7所 示,本发明实施例提供一种将数据写入SSD的方法,该方法包括:In addition, the controller 42 can also be used to perform the steps as shown in FIG. As shown in Figure 7 The embodiment of the invention provides a method for writing data into an SSD, the method comprising:

S701、接收写操作请求,该写操作请求包括预写入数据。S701. Receive a write operation request, where the write operation request includes pre-write data.

S702、确定预写入数据已存储在读区域。S702. Determine that the pre-written data is stored in the read area.

S703、将读区域中的预写入数据迁移至写区域。S703. The pre-written data in the read area is migrated to the write area.

具体地,可以将第二双向链表中预写入数据对应的结点更新至第一双向链表的尾部。其中,第一双向链表中各结点用于存储写区域中各页的逻辑地址;第二双向链表中各结点用于存储读区域中各页的逻辑地址。以实现NVM中读区域和写区域所存储数据的相互迁移。Specifically, the node corresponding to the pre-written data in the second doubly linked list may be updated to the tail of the first doubly linked list. Each node in the first doubly linked list is used to store a logical address of each page in the write area; each node in the second doubly linked list is used to store a logical address of each page in the read area. To achieve mutual migration of data stored in the read area and the write area in the NVM.

若预写入数据已存储在NVM的读区域,则将其迁移至写区域,具体实现中仅迁移读区域中的节点至写区域即可。If the pre-written data is already stored in the read area of the NVM, it is migrated to the write area. In the specific implementation, only the nodes in the read area are migrated to the write area.

本发明实施例将已存储在读区域的预写入数据迁移至写区域,该迁移仅涉及NVM中两个不同区域,与NAND Flash无关,因此,可以减少对NAND Flash访问,即降低SSD中NAND Flash的被访问频率,从而减少对NAND Flash的磨损;且,由于NVM的非易失特性,存储于NVM的数据掉电不丢失,因此,在供电中断时,SSD无需电容提供备电。基于上述原因,本发明实施例SSD的使用寿命增长。The embodiment of the present invention migrates the pre-written data stored in the read area to the write area. The migration involves only two different areas in the NVM, and is independent of the NAND Flash. Therefore, the NAND Flash access can be reduced, that is, the NAND Flash in the SSD is reduced. The frequency of access is reduced, thereby reducing the wear and tear on NAND Flash; and, due to the non-volatile nature of NVM, the data stored in the NVM is not lost, so the SSD does not need a capacitor to provide backup power when the power supply is interrupted. For the above reasons, the service life of the SSD of the embodiment of the present invention is increased.

上述实施例中,S703之后,该方法还可以包括:更新第一映射关系为第二映射关系。其中,第一映射关系包括预写入数据的逻辑地址与预写入数据在读区域的位置之间的对应关系;第二映射关系包括预写入数据的逻辑地址与预写入数据在写区域的位置之间的对应关系。同时参考图4,根据该映射关系,控制器42可以方便地对NVM 43和NAND Flash 44进行读写。In the foregoing embodiment, after S703, the method may further include: updating the first mapping relationship to the second mapping relationship. The first mapping relationship includes a correspondence between a logical address of the pre-written data and a location of the pre-written data in the read area; the second mapping relationship includes a logical address of the pre-written data and a pre-written data in the write area. The correspondence between the locations. Referring to FIG. 4 at the same time, according to the mapping relationship, the controller 42 can conveniently read and write the NVM 43 and the NAND Flash 44.

由于NVM 43的读区域用于存储被访问频率(即读次数)高于或等于预设阈值的数据,NAND Flash 44用于存储被访问频率(即读次数)低于预设阈值的数据,因此,上述方法还可以包括:判断预写入数据的被访问频率是否达到预设阈值;当预写入数据的被访问频率达到预设阈值时,迁移预写入数据至读区域,以实现预写入数据从写区域迁移至读区域,加速对预写入数据数据的读取。Since the read area of the NVM 43 is used to store data whose accessed frequency (ie, the number of reads) is higher than or equal to a preset threshold, the NAND Flash 44 is used to store data whose accessed frequency (ie, the number of readings) is lower than a preset threshold, and thus The method may further include: determining whether the accessed frequency of the pre-written data reaches a preset threshold; when the accessed frequency of the pre-written data reaches a preset threshold, migrating the pre-written data to the read area to implement pre-writing The incoming data migrates from the write area to the read area, speeding up the reading of the pre-written data.

同理,该方法还可以包括:判断NAND Flash中页的被访问频率 是否大于或等于预设阈值;当NAND Flash中页的被访问频率大于或等于预设阈值时,迁移被访问频率大于或等于预设阈值的页中的数据至NVM的读区域,以实现数据从NAND Flash迁移至读区域,加速对该数据的读取,利用数据的时间局部性和空间局部性,将频繁被修改的数据以及其它热点数据存储在NVM,减少对NAND Flash的磨损。Similarly, the method may further include: determining the accessed frequency of the page in the NAND Flash Whether it is greater than or equal to the preset threshold; when the accessed frequency of the page in the NAND Flash is greater than or equal to the preset threshold, the data in the page whose accessed frequency is greater than or equal to the preset threshold is migrated to the read area of the NVM to implement data from NAND Flash migrates to the read area, speeds up the reading of the data, and utilizes the temporal locality and spatial locality of the data to store frequently modified data and other hotspot data in the NVM, reducing wear and tear on the NAND Flash.

进一步地,NVM 43还可以包括空闲区域,S703之后,该方法还可以包括:在空闲区域中,从预留给写区域的页中调整N页给读区域,其中,N为预写入数据对应的页数。Further, the NVM 43 may further include a free area. After S703, the method may further include: adjusting, in the free area, N pages to the read area from the page reserved for the write area, wherein N is a pre-written data corresponding to The number of pages.

对于SSD中已存储上述预写入数据的情况,控制器42还需获取存储位置,以确定后续操作。具体地,分别从以下几种应用场景说明。For the case where the above pre-written data has been stored in the SSD, the controller 42 also needs to acquire the storage location to determine the subsequent operation. Specifically, it is explained from the following application scenarios.

第一种应用场景中,预写入数据已存储在SSD中的NAND Flash。该应用场景至少包括两种实现方式。In the first application scenario, pre-written data is stored in the NAND Flash in the SSD. The application scenario includes at least two implementations.

第一种实现方式中,预写入数据在NAND Flash中占用完整的页。此时,更新映射关系,即将上述预写入数据的逻辑地址指向预写入数据写入写区域的位置。其中,映射关系包括SSD中所有页的逻辑地址与物理地址的对应关系。In the first implementation, pre-written data occupies a complete page in NAND Flash. At this time, the mapping relationship is updated, that is, the logical address of the pre-written data is pointed to the position where the pre-written data is written to the write area. The mapping relationship includes the correspondence between logical addresses and physical addresses of all pages in the SSD.

第二种实现方式中,预写入数据在NAND Flash中占用非完整的页。此时,将NAND Flash中与预写入数据对应的页中除与预写入数据的逻辑地址的范围相同的部分之外的数据迁移至NVM的写区域;在写区域中,组合已写入的预写入数据和迁移至写区域的数据组成新的页;然后,更新映射关系中预写入数据的逻辑地址的指向,使其指向上述新的页的地址。In the second implementation, the pre-written data occupies a non-complete page in the NAND Flash. At this time, data other than the portion of the NAND Flash corresponding to the range of the logical address of the pre-written data is transferred to the write area of the NVM in the page corresponding to the pre-written data; in the write area, the combination is written. The pre-written data and the data migrated to the write area constitute a new page; then, the direction of the logical address of the pre-written data in the mapping relationship is updated to point to the address of the above new page.

其中,上述两种实现方式的区别在于:第一种实现方式用于说明预写入数据的大小正好是NAND Flash中页的整数倍,此时,仅需更新映射关系中逻辑地址与物理地址的对应关系即可,在映射关系中,增加该预写入数据的逻辑地址及其在NVM中的物理地址的对应关系;第二种实现方式用于说明预写入数据的大小不是NAND Flash中页的整数倍时的处理。 The difference between the foregoing two implementation manners is that the first implementation manner is used to indicate that the size of the pre-written data is exactly an integer multiple of the page in the NAND Flash. In this case, only the logical address and the physical address in the mapping relationship need to be updated. Corresponding relationship may be, in the mapping relationship, increasing the correspondence between the logical address of the pre-written data and its physical address in the NVM; the second implementation manner is used to indicate that the size of the pre-written data is not a page in the NAND Flash The processing of integer multiples.

例如,预写入数据的大小为4KB,且该预写入数据已存储在NAND Flash中第一页,NAND Flash中页的大小为8KB,第一页在映射关系中对应一逻辑地址和物理地址。在写入该预写入数据时,将第一页中除与预写入数据的逻辑地址的范围相同的部分之外的数据迁移至写区域;在写区域中,组合预写入数据和迁移至写区域的数据组成新的页;然后,更新映射关系预设映射关系中预写入数据的逻辑地址的指向,使其指向组合后新的页的地址。For example, the size of the pre-written data is 4 KB, and the pre-written data is stored in the first page of the NAND Flash, and the size of the page in the NAND Flash is 8 KB, and the first page corresponds to a logical address and a physical address in the mapping relationship. . When writing the pre-written data, data other than the same portion of the first page as the logical address of the pre-written data is migrated to the write area; in the write area, the pre-written data and the migration are combined The data to the write area constitutes a new page; then, the mapping of the logical address of the pre-written data in the mapping relationship preset relationship is updated to point to the address of the combined new page.

可选地,将上述新的页的地址保存至第一双向链表的尾部,该第一双向链表中各结点用于存储写区域中各页的逻辑地址。Optionally, the address of the new page is saved to the tail of the first doubly linked list, and each node in the first doubly linked list is used to store the logical address of each page in the write area.

具体地,第一双向链表中每一个结点用于表示写区域中一页。结点有前驱指针和后继指针,前驱指针指向第一双向链表的前驱结点,后继指针指向第一双向链表的后继结点;另外,结点中还包括页的逻辑地址。写区域的大小决定了第一双向链表中包含的结点的个数。采用第一双向链表记录写区域中各个页的先后顺序,从而方便对写区域的管理。例如,在写入数据的时候,会将对应的页的信息插入第一双向链表的尾部;淘汰的时候,会从第一双向链表的首部选取页。Specifically, each node in the first doubly linked list is used to represent a page in the write area. The node has a predecessor pointer and a successor pointer. The predecessor pointer points to the predecessor node of the first doubly linked list, and the subsequent pointer points to the subsequent node of the first doubly linked list; in addition, the node also includes the logical address of the page. The size of the write area determines the number of nodes contained in the first doubly linked list. The first doubly linked list is used to record the order of the pages in the write area, thereby facilitating the management of the write area. For example, when data is written, the information of the corresponding page is inserted into the tail of the first doubly linked list; when it is eliminated, the page is selected from the header of the first doubly linked list.

第二种应用场景中,预写入数据已存储在SSD中的NVM的写区域。该应用场景下,至少包括以下实现方式:接收请求方发送的写操作请求,该写操作请求包括预写入数据;确定上述预写入数据已存储在写区域;在写区域中存储预写入数据的位置重新写入预写入数据。In the second application scenario, the pre-written data is already stored in the write area of the NVM in the SSD. The application scenario includes at least the following implementation manner: receiving a write operation request sent by the requester, the write operation request includes pre-writing data, determining that the pre-write data is stored in a write area, and storing pre-write in the write area. The location of the data is rewritten to the pre-written data.

将第一双向链表中预写入数据对应的结点调整至第一双向链表的尾部。该应用场景中,实现写区域所存储数据的内部迁移。若预写入数据已存储在写区域,则将其在第一双向链表中对应的结点迁移至第一双向链表的尾部。The node corresponding to the pre-written data in the first doubly linked list is adjusted to the tail of the first doubly linked list. In this application scenario, internal migration of data stored in the write area is implemented. If the pre-written data is already stored in the write area, it is migrated to the corresponding node in the first doubly linked list to the end of the first doubly linked list.

可选地,S603之后,该方法还可以包括:将预写入数据对应的页的地址保存至第一双向链表的尾部。Optionally, after S603, the method may further include: saving an address of the page corresponding to the pre-written data to a tail of the first doubly linked list.

以及,根据预写入数据对应的页数,更新NVM中已写入页的计数;若判断计数大于或等于第一阈值,则从NVM迁移第一阈值个数的页至NAND Flash,以实现NVM有足够的空间供新数据的写入和/ 或SSD中其他区域所存储数据的迁移,实现SSD中存储数据的动态调整。And updating the count of the written pages in the NVM according to the number of pages corresponding to the pre-written data; if the judgment count is greater than or equal to the first threshold, migrating the first threshold number of pages from the NVM to the NAND Flash to implement the NVM There is enough space for new data to be written and / Or the migration of data stored in other areas of the SSD to achieve dynamic adjustment of the stored data in the SSD.

特别地,在预写入数据写入写区域之前,若判断写区域已满,自第一双向链表的首部开始,判断第一双向链表中结点对应的页的读次数大于或等于第二阈值,则迁移预写入数据对应的页数的页中的数据至读区域;将页中的数据在读区域中对应的页的地址保存至第二双向链表,该第二双向链表中各结点用于存储读区域中各页的逻辑地址。与写区域类似,读区域对应第二双向链表,该第二双向链表的结构与第一双向链表的结构相同,此处不再赘述。Specifically, before the pre-write data is written into the write area, if it is determined that the write area is full, starting from the header of the first doubly linked list, determining that the number of times the page corresponding to the node in the first doubly linked list is greater than or equal to the second threshold Transmitting the data in the page of the page corresponding to the pre-written data to the read area; saving the address of the page in the read area to the second doubly linked list, and the nodes in the second doubly linked list are used The logical address of each page in the storage read area. Similar to the write area, the read area corresponds to the second doubly linked list, and the structure of the second doubly linked list is the same as that of the first doubly linked list, and details are not described herein again.

迁移预写入数据对应的页数的页中的数据至读区域之前,若判断读区域已满,或,若判断写区域已满,自第一双向链表的首部开始,判断第一双向链表中结点对应的页的读次数小于第二阈值,则自第二双向链表的首部开始,迁移预写入数据对应的页数的页中的数据至NAND Flash,以实时更新读区域中数据,在存储空间不足时,及时将被访问频率低的数据迁移至NAND Flash,进一步保证SSD的性能。If the data in the page corresponding to the pre-written data is migrated to the read area, if it is judged that the read area is full, or if it is determined that the write area is full, the first doubly linked list is determined from the first part of the first doubly linked list. If the number of times of reading the page corresponding to the node is less than the second threshold, the data in the page corresponding to the number of pages corresponding to the pre-written data is migrated to the NAND Flash from the header of the second doubly linked list to update the data in the read area in real time. When the storage space is insufficient, the data with low access frequency is migrated to NAND Flash in time to further ensure the performance of the SSD.

同时,累加NAND Flash对应的迁移次数;若判断迁移次数大于或等于第三阈值,则从NVM选取该第三阈值个数的页迁移至NAND Flash,所选取的页为从写区域对应的第一双向链表的首部开始的该第三阈值个数的页,其中,该第三阈值由SSD中NVM与NAND Flash所占的比例确定。该实施例可平衡SSD中NAND Flash与NVM所存储的数据,避免数据全部存储在NVM中,造成NAND Flash的存储空间的浪费。At the same time, the number of migrations corresponding to the NAND Flash is accumulated; if it is determined that the number of migrations is greater than or equal to the third threshold, the page of the third threshold is selected from the NVM to migrate to the NAND Flash, and the selected page is the first corresponding to the write region. The third threshold number of pages starting from the header of the doubly linked list, wherein the third threshold is determined by the ratio of NVM to NAND Flash in the SSD. This embodiment balances the data stored in the NAND Flash and the NVM in the SSD, and prevents the data from being completely stored in the NVM, thereby causing waste of the storage space of the NAND Flash.

该第二种应用场景中,预写入数据已存储在写区域,此时,在覆盖写的同时,考虑NVM中各区域及NAND Flash中存储空间是否充足,并根据上述说明进行其中所存储数据的调整,从而保证SSD中各存储介质有足够的空间以满足上述需求。In the second application scenario, the pre-written data is stored in the write area. At this time, while covering the write, consider whether the storage space in each area of the NVM and the NAND Flash is sufficient, and perform the data stored therein according to the above description. The adjustment ensures that each storage medium in the SSD has enough space to meet the above requirements.

综上,存储在SSD中的数据,实质上是存储在NVM或NAND Flash。具体地,NVM保存被访问频率高的数据,NAND Flash保存被访问频率较低的数据。被访问频率的高低可以通过多种方式判断, 例如,设定一预设阈值,根据固定时间内数据被访问频率与该预设阈值的对比,获得数据的存储位置,此时,数据所在页的被访问频率保存在上述映射关系之中;或者,数据所在页在上述映射关系中的位置反应数据的被访问频率,等等,本发明不予限制。下面以几个具体的实施例对本发明SSD中已存储数据的读取。In summary, the data stored in the SSD is essentially stored in NVM or NAND Flash. Specifically, the NVM stores data that is accessed frequently, and the NAND Flash stores data that is accessed less frequently. The frequency of the frequency of access can be judged in a variety of ways. For example, a preset threshold is set, and a storage location of the data is obtained according to a comparison between the frequency of the accessed data and the preset threshold in a fixed time. At this time, the accessed frequency of the page where the data is located is saved in the mapping relationship; or The frequency at which the data is located in the above mapping relationship reflects the frequency of access of the data, and the like, and the present invention is not limited. The reading of the stored data in the SSD of the present invention is described below in several specific embodiments.

在上述实施例的基础上,该方法还可以包括:累加预读取数据所在的页的读次数,其中,上述映射关系包括SSD中所有页的读次数。该实施例中,数据的被访问频率可以通过读次数体现,该读次数包含在预设映射关系中。可选地,数据的被访问频率还可以通过其它形式实现,此处不再赘述。Based on the foregoing embodiment, the method may further include: accumulating the number of readings of the page where the pre-read data is located, wherein the mapping relationship includes the number of readings of all pages in the SSD. In this embodiment, the accessed frequency of the data may be represented by the number of readings, and the number of readings is included in the preset mapping relationship. Optionally, the accessed frequency of the data may also be implemented in other forms, and details are not described herein again.

其中,映射关系可以表示为如图8所示的映射表的形式。在图8中,每一个方框代表一个基本的映射单元,其大小例如为4KB或者8KB。对应地,还可以使用一个结构体来表示与预设映射关系对应的字段。其中,单个映射关系对应的字段包括NVM或NAND的物理地址;用于指示该方框对应的页位于NVM或NAND的指示位,例如,该指示位可以用一个比特(bit)位来表示;及该方框对应的页的读计数。需说明的是,页的大小随NAND中页的大小的变化而变化。现有技术中页的大小通常为4KB/8KB,但本发明不以此为限制。The mapping relationship may be expressed in the form of a mapping table as shown in FIG. 8. In Fig. 8, each block represents a basic mapping unit whose size is, for example, 4 KB or 8 KB. Correspondingly, a structure may also be used to represent a field corresponding to a preset mapping relationship. The field corresponding to the single mapping relationship includes a physical address of the NVM or the NAND; an indication bit for indicating that the page corresponding to the block is located in the NVM or the NAND, for example, the indicator bit can be represented by one bit; and The read count of the page corresponding to this box. It should be noted that the size of the page varies with the size of the page in the NAND. The size of the page in the prior art is usually 4 KB/8 KB, but the present invention is not limited thereto.

一种实施例中,预读取数据的物理地址位于NAND Flash。累加预读取数据所在的页的读次数之后,该方法还可以包括:对预读取数据所在的每一页,若判断预读取数据所在的页的读次数大于或等于第二阈值,且NVM中有空闲页,则将读次数大于或等于第二阈值的页中的数据迁移至NVM中空闲页。本发明实施例将原存储在NAND Flash中的、被访问频率高于第二阈值的数据迁移至NVM,以实现SSD中存储数据的动态调整,避免NAND Flash被过多访问。将被读取次数大于或等于第二阈值的数据,保存至NVM,相对于存储在NAND Flash,可以提高数据读取的速度,利用数据的时间局部性和空间局部性,将频繁被修改的数据以及其它热点数据存储在NVM,减少对NAND Flash的磨损。 In one embodiment, the physical address of the pre-read data is located in the NAND Flash. After accumulating the number of readings of the page where the pre-read data is located, the method may further include: determining, for each page where the pre-read data is located, if the number of readings of the page where the pre-read data is located is greater than or equal to a second threshold, and If there is a free page in the NVM, the data in the page whose read count is greater than or equal to the second threshold is migrated to the free page in the NVM. The embodiment of the present invention migrates the data stored in the NAND Flash and whose accessed frequency is higher than the second threshold to the NVM, so as to implement dynamic adjustment of the stored data in the SSD, and avoid excessive access of the NAND Flash. Saving the data whose read count is greater than or equal to the second threshold to the NVM, compared with the NAND Flash, can improve the speed of data reading, and utilize the temporal locality and spatial locality of the data to frequently modify the data. And other hotspot data is stored in NVM, reducing wear and tear on NAND Flash.

可选地,将NAND Flash中数据迁移至NVM之后,还可以累加NAND Flash对应的迁移次数。这样,即可获取从NAND Flash迁移至NVM的页数,从而合理调整SSD中NAND Flash及NVM所占用空间的比例,或,将NVM中同等页数的数据迁移至NAND Flash。Optionally, after the data in the NAND Flash is migrated to the NVM, the number of migrations corresponding to the NAND Flash may also be accumulated. In this way, the number of pages migrating from NAND Flash to NVM can be obtained, thereby reasonably adjusting the proportion of space occupied by NAND Flash and NVM in SSD, or migrating data of the same number of pages in NVM to NAND Flash.

进一步地,当NVM中包括读区域时,若确定预读取数据所在的页的读次数大于或等于第二阈值,且NVM中有空闲页,则将读次数大于或等于第二阈值的页中的数据迁移至NVM,可以包括:若判断预读取数据所在的页的读次数大于或等于第二阈值,且读区域中包括空闲页,则将读次数大于或等于第二阈值的页中的数据迁移至读区域的空闲页。Further, when the read area is included in the NVM, if it is determined that the read count of the page where the pre-read data is located is greater than or equal to the second threshold, and there is a free page in the NVM, the number of times the read count is greater than or equal to the second threshold is The migration of the data to the NVM may include: if it is determined that the number of times the page in which the pre-read data is located is greater than or equal to the second threshold, and the read area includes a free page, the number of times the read count is greater than or equal to the second threshold The data is migrated to the free page of the read area.

在上述基础上,若确定上述迁移次数大于或等于第三阈值,则从NVM选取第三阈值个数的页迁移至NAND Flash,其中,第三阈值由SSD中NVM与NAND Flash所占的比例确定。在SSD中,若NVM占用的空间大于NAND Flash占用的空间,第三阈值较小;对应地,若NVM占用的空间小于NAND Flash占用的空间,第三阈值较大。On the basis of the above, if it is determined that the number of migrations is greater than or equal to the third threshold, the third threshold is selected from the NVM to migrate to the NAND Flash, wherein the third threshold is determined by the ratio of the NVM to the NAND Flash in the SSD. . In the SSD, if the space occupied by the NVM is larger than the space occupied by the NAND Flash, the third threshold is small; correspondingly, if the space occupied by the NVM is smaller than the space occupied by the NAND Flash, the third threshold is larger.

另一种实施例中,NVM包括写区域。若预读取数据的物理地址位于NVM的写区域,上述累加预读取数据所在的页的读次数之后,该方法还可以包括:更新预读取数据所在的页的地址至第一双向链表的尾部,其中,第一双向链表中各结点用于存储写区域中各页的逻辑地址。In another embodiment, the NVM includes a write area. If the physical address of the pre-read data is located in the write area of the NVM, after the number of times of reading the page where the pre-read data is accumulated, the method may further include: updating the address of the page where the pre-read data is located to the first doubly linked list. a tail, wherein each node in the first doubly linked list is used to store a logical address of each page in the write area.

通过上述实施例可知,元数据区域可以存储有上述第一双向链表、第二双向链表及预设映射关系等。According to the foregoing embodiment, the metadata area may include the first doubly linked list, the second doubly linked list, the preset mapping relationship, and the like.

综合上述实施例,本发明实施例在NVM中存储被访问频率高的数据,从而能减少对NAND Flash访问,即降低SSD中NAND Flash的被访问频率,减少对NAND Flash的磨损;且,由于NVM的非易失特性,存储于NVM的数据掉电不丢失,因此,在供电中断时,SSD无需电容提供备电。基于上述原因,本发明实施例SSD的使用寿命增长。According to the foregoing embodiment, the embodiment of the present invention stores data with high access frequency in the NVM, thereby reducing access to the NAND Flash, that is, reducing the accessed frequency of the NAND Flash in the SSD, and reducing wear and tear on the NAND Flash; and, due to the NVM The non-volatile feature, the data stored in the NVM is not lost, so the SSD does not need a capacitor to provide backup power when the power supply is interrupted. For the above reasons, the service life of the SSD of the embodiment of the present invention is increased.

在实际应用中,本发明实施例对读取和写入的大小是不做任何限 制的,可以是任何大小的读取或写入。但SSD的预设映射关系,例如映射表,存在一个基本的管理粒度,比如4KB,或者8KB,甚至16KB。这个管理粒度一般跟NAND Flash的页(page)的大小一样,也可以不一样。另外,SDD读写的基本管理单位是页。In practical applications, the embodiment of the present invention does not limit the size of reading and writing. It can be any size read or write. However, the default mapping relationship of the SSD, such as the mapping table, has a basic management granularity, such as 4 KB, or 8 KB, or even 16 KB. This management granularity is generally the same as the size of the NAND Flash page, and can be different. In addition, the basic management unit for SDD reading and writing is the page.

主机下发到SSD上的读写操作请求的大小可能是任意的。以页的大小为8KB为例说明:如果要读取的数据比较大,为32KB,那么需要读取4个页,并把相关的数据凑到一起反馈给主机;如果读取的数据比较小,为2KB,则只把对应的这2KB的数据返回给主机。The size of the read and write operation request sent by the host to the SSD may be arbitrary. Take the page size as 8KB as an example. If the data to be read is relatively large, it is 32KB, then you need to read 4 pages and feed the relevant data back to the host; if the data read is relatively small, For 2KB, only the corresponding 2KB of data is returned to the host.

本发明实施例中SSD采用NAND Flash和NVM对数据进行分级存储,即,数据存储在NAND Flash或NVM中,因NVM的非易失特性,从而在SSD中不包含电容的情况下,也不会产生数据掉电丢失的问题,且SSD中不包含电容还会增长SSD的使用寿命,极大提升SSD的可靠性。In the embodiment of the present invention, the SSD uses NAND Flash and NVM to store data hierarchically, that is, the data is stored in NAND Flash or NVM. Due to the non-volatile characteristics of the NVM, the SSD does not include a capacitor. The problem of data loss is lost, and the absence of capacitors in the SSD will increase the service life of the SSD and greatly improve the reliability of the SSD.

在本申请所提供的几个实施例中,应该理解到,所揭示的设备和方法,可以通过其它的方式实现。例如,以上所描述的设备实施例仅仅是示意性的,例如,所述单元或模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或模块可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,设备或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided herein, it should be understood that the disclosed apparatus and methods may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the unit or module is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or modules may be used. Combinations can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or module, and may be electrical, mechanical or otherwise.

所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated. The components displayed as modules may or may not be physical modules, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment.

本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者 光盘等各种可以存储程序代码的介质。One of ordinary skill in the art will appreciate that all or part of the steps to implement the various method embodiments described above may be accomplished by hardware associated with the program instructions. The aforementioned program can be stored in a computer readable storage medium. The program, when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes: ROM, RAM, disk or A variety of media such as optical discs that can store program code.

最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。 Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that The technical solutions described in the foregoing embodiments may be modified, or some or all of the technical features may be equivalently replaced; and the modifications or substitutions do not deviate from the technical solutions of the embodiments of the present invention. range.

Claims (20)

一种将数据写入固态硬盘SSD的方法,所述SSD包括控制器和存储器,其特征在于,所述存储器的存储介质包括NAND Flash和非易失性存储器NVM,所述NVM包括写区域,所述方法包括:A method of writing data to a solid state drive SSD, the SSD comprising a controller and a memory, wherein the storage medium of the memory comprises a NAND flash and a non-volatile memory NVM, the NVM comprising a write area, The methods include: 接收写操作请求,所述写操作请求包括预写入数据;Receiving a write operation request, the write operation request including pre-written data; 确定所述预写入数据未存储在所述写区域;Determining that the pre-written data is not stored in the write area; 将所述预写入数据写入所述写区域。The pre-written data is written to the write area. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising: 判断所述预写入数据是否已存储在所述NAND Flash;Determining whether the pre-written data has been stored in the NAND Flash; 若所述预写入数据已存储在所述NAND Flash,将NAND Flash中存储所述预写入数据的页置为无效。If the pre-written data is already stored in the NAND Flash, the page in the NAND Flash storing the pre-written data is invalidated. 根据权利要求1或2所述的方法,其特征在于,所述将所述预写入数据写入所述写区域之后,所述方法还包括:The method according to claim 1 or 2, wherein after the writing of the pre-written data to the write area, the method further comprises: 保存映射关系,所述映射关系包括所述预写入数据的逻辑地址与所述预写入数据写入所述写区域的位置之间的对应关系。A mapping relationship is saved, the mapping relationship including a correspondence between a logical address of the pre-written data and a location where the pre-written data is written into the write area. 根据权利要求1-3任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 3, wherein the method further comprises: 判断所述预写入数据的被访问频率是否达到预设阈值;Determining whether the accessed frequency of the pre-written data reaches a preset threshold; 当所述预写入数据的被访问频率达到所述预设阈值时,迁移所述预写入数据至所述读区域。When the accessed frequency of the pre-written data reaches the preset threshold, the pre-written data is migrated to the read region. 根据权利要求1-4任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 4, wherein the method further comprises: 判断所述NAND Flash中页的被访问频率是否大于或等于所述预设阈值;Determining whether the accessed frequency of the page in the NAND Flash is greater than or equal to the preset threshold; 当所述NAND Flash中页的被访问频率大于或等于所述预设阈值时,迁移所述被访问频率大于或等于所述预设阈值的页中的数据至所述NVM的读区域。And when the accessed frequency of the page in the NAND Flash is greater than or equal to the preset threshold, migrating the data in the page whose accessed frequency is greater than or equal to the preset threshold to the read region of the NVM. 一种将数据写入固态硬盘SSD的方法,所述SSD包括控制器 和存储器,其特征在于,所述存储器的存储介质包括NAND Flash和非易失性存储器NVM,所述NVM包括写区域和读区域,所述方法包括:A method of writing data to a solid state drive SSD, the SSD including a controller And a memory, wherein the storage medium of the memory comprises a NAND flash and a non-volatile memory NVM, the NVM comprising a write area and a read area, the method comprising: 接收写操作请求,所述写操作请求包括预写入数据;Receiving a write operation request, the write operation request including pre-written data; 确定所述预写入数据已存储在所述读区域;Determining that the pre-written data has been stored in the read area; 将所述读区域中的所述预写入数据迁移至所述写区域。The pre-written data in the read region is migrated to the write region. 根据权利要求6所述的方法,其特征在于,所述将所述读区域中的所述预写入数据迁移至所述写区域之后,所述方法还包括:The method according to claim 6, wherein after the migrating the pre-written data in the read area to the write area, the method further comprises: 更新第一映射关系为第二映射关系,所述第一映射关系包括所述预写入数据的逻辑地址与所述预写入数据在所述读区域的位置之间的对应关系,所述第二映射关系包括所述预写入数据的逻辑地址与所述预写入数据在所述写区域的位置之间的对应关系。Updating the first mapping relationship to a second mapping relationship, where the first mapping relationship includes a correspondence between a logical address of the pre-written data and a location of the pre-written data in the read region, where The second mapping relationship includes a correspondence between a logical address of the pre-written data and a location of the pre-written data in the write area. 根据权利要求6或7所述的方法,其特征在于,所述方法还包括:The method according to claim 6 or 7, wherein the method further comprises: 判断所述预写入数据的被访问频率是否达到预设阈值;Determining whether the accessed frequency of the pre-written data reaches a preset threshold; 当所述预写入数据的被访问频率达到所述预设阈值时,迁移所述预写入数据至所述读区域。When the accessed frequency of the pre-written data reaches the preset threshold, the pre-written data is migrated to the read region. 根据权利要求6-8任一项所述的方法,其特征在于,所述方法还包括:The method of any of claims 6-8, wherein the method further comprises: 判断所述NAND Flash中页的被访问频率是否大于或等于所述预设阈值;Determining whether the accessed frequency of the page in the NAND Flash is greater than or equal to the preset threshold; 当所述NAND Flash中页的被访问频率大于或等于所述预设阈值时,迁移所述被访问频率大于或等于所述预设阈值的页中的数据至所述NVM的读区域。And when the accessed frequency of the page in the NAND Flash is greater than or equal to the preset threshold, migrating the data in the page whose accessed frequency is greater than or equal to the preset threshold to the read region of the NVM. 根据权利要求6-9任一项所述的方法,其特征在于,所述NVM还包括空闲区域,所述将所述读区域中的所述预写入数据迁移至所述写区域之后,所述方法还包括:The method according to any one of claims 6 to 9, wherein the NVM further comprises a free area, after the pre-written data in the read area is migrated to the write area, The method also includes: 在所述空闲区域中,从预留给所述写区域的页中调整N页给所述读区域,所述N为所述预写入数据对应的页数。 In the free area, N pages are adjusted from the pages reserved for the write area to the read area, and the N is the number of pages corresponding to the pre-written data. 一种固态硬盘SSD,所述SSD包括控制器和存储器,其特征在于,所述存储器的存储介质包括NAND Flash和非易失性存储器NVM,所述NVM包括写区域,其中,A solid state drive SSD, the SSD comprising a controller and a memory, wherein the storage medium of the memory comprises a NAND flash and a non-volatile memory NVM, wherein the NVM comprises a write area, wherein 所述控制器,用于接收写操作请求,所述写操作请求包括预写入数据;确定所述预写入数据未存储在所述写区域;及,将所述预写入数据写入所述写区域;The controller is configured to receive a write operation request, the write operation request includes pre-writing data, determine that the pre-write data is not stored in the write area, and write the pre-write data into the Describe area 所述写区域用于存储所述预写入数据。The write area is for storing the pre-written data. 根据权利要求11所述的SSD,其特征在于,所述控制器还用于:The SSD of claim 11 wherein said controller is further configured to: 判断所述预写入数据是否已存储在所述NAND Flash;Determining whether the pre-written data has been stored in the NAND Flash; 若所述预写入数据已存储在所述NAND Flash,将NAND Flash中存储所述预写入数据的页置为无效。If the pre-written data is already stored in the NAND Flash, the page in the NAND Flash storing the pre-written data is invalidated. 根据权利要求11或12所述的SSD,其特征在于,所述控制器还用于:The SSD according to claim 11 or 12, wherein the controller is further configured to: 保存映射关系,所述映射关系包括预写入数据的逻辑地址与所述预写入数据写入所述写区域的位置之间的对应关系。A mapping relationship is saved, the mapping relationship including a correspondence between a logical address of the pre-written data and a position at which the pre-written data is written into the write area. 根据权利要求11-13任一项所述的SSD,其特征在于,所述控制器还用于:The SSD according to any one of claims 11 to 13, wherein the controller is further configured to: 判断所述预写入数据的被访问频率是否达到预设阈值;Determining whether the accessed frequency of the pre-written data reaches a preset threshold; 当所述预写入数据的被访问频率达到所述预设阈值时,迁移所述预写入数据至所述读区域。When the accessed frequency of the pre-written data reaches the preset threshold, the pre-written data is migrated to the read region. 根据权利要求11-14任一项所述的SSD,其特征在于,所述控制器还用于:The SSD according to any one of claims 11 to 14, wherein the controller is further configured to: 判断所述NAND Flash中页的被访问频率是否大于或等于所述预设阈值;Determining whether the accessed frequency of the page in the NAND Flash is greater than or equal to the preset threshold; 当所述NAND Flash中页的被访问频率大于或等于所述预设阈值时,迁移所述被访问频率大于或等于所述预设阈值的页中的数据至所述NVM的读区域。And when the accessed frequency of the page in the NAND Flash is greater than or equal to the preset threshold, migrating the data in the page whose accessed frequency is greater than or equal to the preset threshold to the read region of the NVM. 一种固态硬盘SSD,所述SSD包括控制器和存储器,其特 征在于,所述存储器的存储介质包括NAND Flash和非易失性存储器NVM,所述NVM包括写区域和读区域,其中,A solid state hard disk SSD, the SSD including a controller and a memory The memory medium of the memory includes a NAND flash and a non-volatile memory NVM, and the NVM includes a write area and a read area, where 所述控制器,用于接收写操作请求,所述写操作请求包括预写入数据;确定所述预写入数据已存储在所述读区域;及,将所述读区域中的所述预写入数据迁移至所述写区域。The controller is configured to receive a write operation request, the write operation request includes pre-writing data, determine that the pre-write data has been stored in the read area, and: perform the pre-in the read area The write data is migrated to the write area. 根据权利要求16所述的SSD,其特征在于,所述控制器还用于:The SSD of claim 16, wherein the controller is further configured to: 更新第一映射关系为第二映射关系,所述第一映射关系包括所述预写入数据的逻辑地址与所述预写入数据在所述读区域的位置之间的对应关系,所述第二映射关系包括所述预写入数据的逻辑地址与所述预写入数据在所述写区域的位置之间的对应关系。Updating the first mapping relationship to a second mapping relationship, where the first mapping relationship includes a correspondence between a logical address of the pre-written data and a location of the pre-written data in the read region, where The second mapping relationship includes a correspondence between a logical address of the pre-written data and a location of the pre-written data in the write area. 根据权利要求16或17所述的SSD,其特征在于,所述控制器还用于:The SSD according to claim 16 or 17, wherein the controller is further configured to: 判断所述预写入数据的被访问频率是否达到预设阈值;Determining whether the accessed frequency of the pre-written data reaches a preset threshold; 当所述预写入数据的被访问频率达到所述预设阈值时,迁移所述预写入数据至所述读区域。When the accessed frequency of the pre-written data reaches the preset threshold, the pre-written data is migrated to the read region. 根据权利要求16-18任一项所述的SSD,其特征在于,所述控制器还用于:The SSD according to any one of claims 16 to 18, wherein the controller is further configured to: 判断所述NAND Flash中页的被访问频率是否大于或等于所述预设阈值;Determining whether the accessed frequency of the page in the NAND Flash is greater than or equal to the preset threshold; 当所述NAND Flash中页的被访问频率大于或等于所述预设阈值时,迁移所述被访问频率大于或等于所述预设阈值的页中的数据至所述NVM的读区域。And when the accessed frequency of the page in the NAND Flash is greater than or equal to the preset threshold, migrating the data in the page whose accessed frequency is greater than or equal to the preset threshold to the read region of the NVM. 根据权利要求16-19任一项所述的SSD,其特征在于,所述NVM还包括空闲区域,所述控制器还用于:The SSD according to any one of claims 16 to 19, wherein the NVM further includes a free area, and the controller is further configured to: 在所述空闲区域中,从预留给所述写区域的页中调整N页给所述读区域,所述N为所述预写入数据对应的页数。 In the free area, N pages are adjusted from the pages reserved for the write area to the read area, and the N is the number of pages corresponding to the pre-written data.
PCT/CN2015/098109 2014-12-31 2015-12-21 Method for writing data to solid state drive and solid state drive Ceased WO2016107442A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410852946.0A CN105808156B (en) 2014-12-31 2014-12-31 Method for writing data to solid state drive and solid state drive
CN201410852946.0 2014-12-31

Publications (1)

Publication Number Publication Date
WO2016107442A1 true WO2016107442A1 (en) 2016-07-07

Family

ID=56284227

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/098109 Ceased WO2016107442A1 (en) 2014-12-31 2015-12-21 Method for writing data to solid state drive and solid state drive

Country Status (2)

Country Link
CN (2) CN111638852B (en)
WO (1) WO2016107442A1 (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI607448B (en) * 2016-09-07 2017-12-01 群聯電子股份有限公司 Data writing method, memory control circuit unit and mempry storage apparatus
CN108984124A (en) * 2018-07-13 2018-12-11 深圳忆联信息系统有限公司 Reduce the method, apparatus, computer equipment and storage medium for writing amplification
CN110286995A (en) * 2018-03-19 2019-09-27 北京兆易创新科技股份有限公司 A kind of data read-write method and device
CN110389712A (en) * 2018-04-20 2019-10-29 武汉海康存储技术有限公司 Method for writing data and its device, solid state hard disk and computer readable storage medium
CN110795045A (en) * 2019-10-30 2020-02-14 中国科学院微电子研究所 Data migration method and system of hybrid memory and electronic equipment
CN111143279A (en) * 2019-12-29 2020-05-12 浪潮电子信息产业股份有限公司 Data migration method, device and equipment and readable storage medium
CN111581117A (en) * 2019-02-19 2020-08-25 睿宽智能科技有限公司 Redirection method for unmapped addresses of solid state drives
CN112435706A (en) * 2020-11-05 2021-03-02 北京中电华大电子设计有限责任公司 Nonvolatile memory application level erasing life evaluation method
CN115079934A (en) * 2021-03-12 2022-09-20 深圳市云海麒麟计算机系统有限公司 Management method for prolonging service life of solid state disk
US20230153173A1 (en) * 2021-11-15 2023-05-18 International Business Machines Corporation Dynamic database object description adjustment

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109119106B (en) * 2017-06-26 2022-08-02 中兴通讯股份有限公司 Data storage method, device and computer readable storage medium
CN110109915B (en) * 2018-01-18 2024-01-05 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for managing hash tables
CN109144422A (en) * 2018-08-31 2019-01-04 浪潮电子信息产业股份有限公司 A method, device, device and storage medium for writing data of solid state hard disk
CN110908926B (en) * 2018-09-14 2022-03-22 慧荣科技股份有限公司 Data storage device and writing method of logical-to-physical address mapping table
CN111367463B (en) * 2018-12-25 2023-05-09 兆易创新科技集团股份有限公司 Method and device for managing storage space
KR102781472B1 (en) * 2019-01-22 2025-03-17 에스케이하이닉스 주식회사 Storage device, computing system having the storage device and operating method thereof
CN111897744B (en) * 2019-05-05 2024-06-14 兆易创新科技集团股份有限公司 Data writing method, device, electronic device and storage medium
CN110515549B (en) * 2019-08-16 2022-03-22 浪潮电子信息产业股份有限公司 A data migration method and device
CN110989924B (en) * 2019-10-30 2022-10-18 烽火通信科技股份有限公司 Metadata storage performance optimization method and storage server
CN111208940A (en) * 2019-12-24 2020-05-29 华东师范大学 A read-write separation method based on multi-channel flash memory
WO2021232427A1 (en) * 2020-05-22 2021-11-25 Yangtze Memory Technologies Co., Ltd. Flush method for mapping table of ssd
WO2022021280A1 (en) * 2020-07-31 2022-02-03 华为技术有限公司 Storage controller, storage control method, solid state disk and storage system
CN112717419A (en) * 2021-01-04 2021-04-30 厦门梦加网络科技股份有限公司 Game data storage method
CN113254364B (en) * 2021-05-24 2022-07-19 山东创恒科技发展有限公司 Information storage device for embedded system
CN113760782A (en) * 2021-08-23 2021-12-07 南京森根科技股份有限公司 Dynamically adjustable annular cache system and control method thereof
CN113835639B (en) * 2021-09-26 2024-03-19 深圳大普微电子科技有限公司 I/O request processing method, device, equipment and readable storage medium
CN114328281B (en) * 2021-11-30 2023-11-14 苏州浪潮智能科技有限公司 Solid state disk abnormal power failure processing method and device, electronic equipment and medium
CN115657972B (en) * 2022-12-27 2023-06-06 北京特纳飞电子技术有限公司 Solid state disk writing control method and device and solid state disk
CN115904255B (en) * 2023-01-19 2023-05-16 苏州浪潮智能科技有限公司 Data request method, device, equipment and storage medium
CN116627354B (en) * 2023-07-20 2023-09-15 湖南博匠信息科技有限公司 High-performance data writing method and data recording equipment for solid state disk

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102591748A (en) * 2011-12-29 2012-07-18 记忆科技(深圳)有限公司 Solid state disc and power failure protection method and system thereof
CN102646069A (en) * 2012-02-23 2012-08-22 华中科技大学 Method for prolonging service life of solid-state disk
CN102955787A (en) * 2011-08-22 2013-03-06 陈思达 Using method for file directory table, file writing method and main circuit board, CPU (central processing unit) and external storage applying same
CN103377152A (en) * 2012-04-26 2013-10-30 深圳市朗科科技股份有限公司 Write operation control method and write operation device for solid state disk
CN103473186A (en) * 2012-06-07 2013-12-25 鸿富锦精密工业(深圳)有限公司 SSD (solid state disc) data protection circuit

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8856423B1 (en) * 2007-04-10 2014-10-07 Marvell International Ltd. Dual-purpose nonvolatile memory for code and data storage
JP2009205335A (en) * 2008-02-27 2009-09-10 Hitachi Ltd Storage system using two kinds of memory devices for cache and method for controlling the storage system
KR20100007409A (en) * 2008-07-14 2010-01-22 엘지전자 주식회사 Storage apparatus and method of media file
CN101673188B (en) * 2008-09-09 2011-06-01 上海华虹Nec电子有限公司 Data access method for solid state disk
KR101515525B1 (en) * 2008-10-02 2015-04-28 삼성전자주식회사 Memory device and operating method of memory device
CN101493794B (en) * 2009-01-19 2011-12-21 成都市华为赛门铁克科技有限公司 Flash memory data processing method and device
CN102360273A (en) * 2011-09-26 2012-02-22 北京邦诺存储科技有限公司 Equipment and method for controlling cooperative storage of memory and nonvolatile caching device
CN102981969A (en) * 2012-11-21 2013-03-20 记忆科技(深圳)有限公司 Method for deleting repeated data and solid hard disc thereof
CN103473179B (en) * 2013-08-09 2017-04-19 记忆科技(深圳)有限公司 Background system and method for deleting repeating data in solid state disk
CN103885728B (en) * 2014-04-04 2016-08-17 华中科技大学 A kind of disk buffering system based on solid-state disk

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102955787A (en) * 2011-08-22 2013-03-06 陈思达 Using method for file directory table, file writing method and main circuit board, CPU (central processing unit) and external storage applying same
CN102591748A (en) * 2011-12-29 2012-07-18 记忆科技(深圳)有限公司 Solid state disc and power failure protection method and system thereof
CN102646069A (en) * 2012-02-23 2012-08-22 华中科技大学 Method for prolonging service life of solid-state disk
CN103377152A (en) * 2012-04-26 2013-10-30 深圳市朗科科技股份有限公司 Write operation control method and write operation device for solid state disk
CN103473186A (en) * 2012-06-07 2013-12-25 鸿富锦精密工业(深圳)有限公司 SSD (solid state disc) data protection circuit

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI607448B (en) * 2016-09-07 2017-12-01 群聯電子股份有限公司 Data writing method, memory control circuit unit and mempry storage apparatus
CN110286995A (en) * 2018-03-19 2019-09-27 北京兆易创新科技股份有限公司 A kind of data read-write method and device
CN110389712A (en) * 2018-04-20 2019-10-29 武汉海康存储技术有限公司 Method for writing data and its device, solid state hard disk and computer readable storage medium
CN108984124A (en) * 2018-07-13 2018-12-11 深圳忆联信息系统有限公司 Reduce the method, apparatus, computer equipment and storage medium for writing amplification
CN111581117A (en) * 2019-02-19 2020-08-25 睿宽智能科技有限公司 Redirection method for unmapped addresses of solid state drives
CN110795045A (en) * 2019-10-30 2020-02-14 中国科学院微电子研究所 Data migration method and system of hybrid memory and electronic equipment
CN110795045B (en) * 2019-10-30 2024-04-09 中国科学院微电子研究所 Hybrid memory data migration method, system and electronic device
CN111143279A (en) * 2019-12-29 2020-05-12 浪潮电子信息产业股份有限公司 Data migration method, device and equipment and readable storage medium
CN111143279B (en) * 2019-12-29 2022-04-22 浪潮电子信息产业股份有限公司 Data migration method, device and equipment and readable storage medium
CN112435706A (en) * 2020-11-05 2021-03-02 北京中电华大电子设计有限责任公司 Nonvolatile memory application level erasing life evaluation method
CN112435706B (en) * 2020-11-05 2023-06-30 北京中电华大电子设计有限责任公司 Nonvolatile memory application level erasing life evaluation method
CN115079934A (en) * 2021-03-12 2022-09-20 深圳市云海麒麟计算机系统有限公司 Management method for prolonging service life of solid state disk
US20230153173A1 (en) * 2021-11-15 2023-05-18 International Business Machines Corporation Dynamic database object description adjustment
US12373263B2 (en) * 2021-11-15 2025-07-29 International Business Machines Corporation Dynamic database object description adjustment

Also Published As

Publication number Publication date
CN111638852B (en) 2025-02-28
CN111638852A (en) 2020-09-08
CN105808156B (en) 2020-04-28
CN105808156A (en) 2016-07-27

Similar Documents

Publication Publication Date Title
CN105808156B (en) Method for writing data to solid state drive and solid state drive
US20240233816A1 (en) Lifetime mixed level non-volatile memory system
CN107844431B (en) Mapping table updating method, memory control circuit unit and memory storage device
CN110955384B (en) Data storage device and non-volatile memory control method
US20230176965A1 (en) Media management based on data access metrics
KR102698414B1 (en) Relocation of data within memory at different transfer rates based on temperature
JP6166476B2 (en) Memory module and information processing system
US20150046636A1 (en) Storage device, computer system and methods of operating same
CN103838676B (en) Data-storage system, date storage method and PCM bridges
US9268681B2 (en) Heterogeneous data paths for systems having tiered memories
KR102585883B1 (en) Operating method of memory system and memory system
US11734189B2 (en) Caching of logical-to-physical mapping information in a memory sub-system
CN114816236A (en) Data Migration Technology
CN105339910A (en) Virtual nand capacity extension in a hybrid drive
US11829650B2 (en) Memory sub-system data migration
KR20220114078A (en) Perform media management actions based on changing the write mode of data blocks in the cache
CN115145480B (en) Partitioned block scratch pad component with partitioned namespace memory subsystem
US12026385B2 (en) Automatic wordline status bypass management
TW202522201A (en) Systems and methods for reducing write buffer size in non-volatile storage devices
US20230126685A1 (en) Storage device and electronic system
CN106326135A (en) Method and device for translating data of non-volatile memory NVM
CN113870924B (en) Techniques for saturating a host interface
US12189943B2 (en) Cluster namespace for a memory device
US20240345947A1 (en) Virtual indexing in a memory device
KR20230097866A (en) Storage device including memory controller and operation method thereof

Legal Events

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

Ref document number: 15875120

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

Country of ref document: EP

Kind code of ref document: A1