WO2015055020A1 - Procédé et appareil d'écriture de données - Google Patents

Procédé et appareil d'écriture de données Download PDF

Info

Publication number
WO2015055020A1
WO2015055020A1 PCT/CN2014/080509 CN2014080509W WO2015055020A1 WO 2015055020 A1 WO2015055020 A1 WO 2015055020A1 CN 2014080509 W CN2014080509 W CN 2014080509W WO 2015055020 A1 WO2015055020 A1 WO 2015055020A1
Authority
WO
WIPO (PCT)
Prior art keywords
data block
valid data
sectors
valid
cache
Prior art date
Application number
PCT/CN2014/080509
Other languages
English (en)
Chinese (zh)
Inventor
龚涛
梁剑
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2015055020A1 publication Critical patent/WO2015055020A1/fr

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0866Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
    • G06F12/0871Allocation or management of cache space
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0804Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with main memory updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1032Reliability improvement, data loss prevention, degraded operation etc
    • G06F2212/1036Life time enhancement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/21Employing a record carrier using a specific recording technology
    • G06F2212/214Solid state disk

Definitions

  • the present invention relates to communications technologies, and in particular, to a method and apparatus for writing data. Background technique
  • the current Solid State Device is basically a flash-based medium. Inside an SSD, there are multiple flash granules. Each flash granule is internally divided into several blocks. Each block consists of blocks. Divided into several pages. Flash media cannot convert 0/1 bits to any bit (Wt) bits, and can only be erased and programmed with a certain granularity.
  • the erased granularity is a block, which means that all the Wt bits in the specified block are set to 1;
  • the programmed granularity is a page, which means that the bit specified in the page is set to 0.
  • the page is the minimum granularity for reading and writing inside the SSD, but the SSD is compatible with the hard disk drive (HDD).
  • HDD hard disk drive
  • the process of writing data to the SSD by the host is as follows:
  • the data to be written by the host is first given to the storage array, and the storage array sends the data to the cache in the storage array, and the cache sends the response to the host.
  • the SSD may have a problem of excessive write penalty and write amplification times.
  • write penalty means that the amount of data written to the flash memory is greater than the amount of data written to the SSD, and the write penalty is a special write amplification.
  • write amplification means that the amount of data written to the flash memory is greater than the amount of data written to the SSD, and the write penalty is a special write amplification.
  • Embodiments of the present invention provide a method and apparatus for writing data, which are used to solve the problem of increasing the amount of data written into an SSD due to too many write amplification and write penalty times.
  • a first aspect of the embodiments of the present invention provides a method for writing data, where the method is applied to a storage device, where the storage device includes a controller and a solid state hard disk, and the controller includes a cache, the cache Include multiple pages, each page including multiple sectors, the method includes:
  • the data in the target valid data block is written to the solid state hard disk.
  • the determining, by the cache, the first valid data block includes:
  • a maximum contiguous valid data block is obtained as the first valid data block, the first valid data block including a maximum of consecutive valid sectors.
  • the dirty sector includes data to be written to a solid state hard disk, where the clean sector includes Write data to the solid state drive.
  • a second aspect of the embodiments of the present invention provides an apparatus for writing data, where the storage device includes a controller and a solid state hard disk, the controller includes a cache, and the cache includes a plurality of pages, and each page includes Multiple sectors, including:
  • a determining module configured to determine a first valid data block in the cache, the first valid data block includes a plurality of consecutive valid sectors, and the wired sector holds data; Determining a second valid data block in the valid data block, the second valid data block refers to a valid data block including a dirty sector; determining a target valid data block in the second valid data block, the target valid data block Contains multiple pages, any of which contains dirty sectors;
  • a write module configured to write data in the target valid data block to the solid state hard disk.
  • the determining module is specifically configured to: traverse all sectors of the preset designated area in the buffer; and obtain a maximum continuous valid data block as The first valid data block includes the most consecutive valid sectors in the first valid data block.
  • the dirty sector includes data to be written to the solid state hard disk, where the clean sector includes Write data to the solid state drive.
  • the first valid data block including the consecutive effective sectors is determined in the cache, and then the valid data block including the dirty sector is determined in the first valid data block, and finally determined in the second valid data block.
  • Target data block each page contained in the target data block has a dirty sector, and the target data block is written into the SSD, thereby reducing the clean sectors written in the SSD as much as possible, thereby reducing the write SSD The amount of data has been extended to extend the life of the SSD.
  • Embodiment 1 is a schematic flowchart of Embodiment 1 of a method for writing data according to the present invention
  • FIG. 2 is a schematic diagram of a sector structure of a method for writing data according to a second embodiment of the present invention
  • FIG. 3 is a schematic diagram of a sector structure of a method for writing data according to a third embodiment of the present invention
  • FIG. 5 is a schematic diagram of a sector structure of a method for writing data according to Embodiment 5 of the present invention
  • FIG. 6 is a schematic diagram of a structure of a device for writing data according to Embodiment 1 of the present invention; Schematic;
  • FIG. 7 is a schematic structural diagram of Embodiment 1 of a storage device according to the present invention. detailed description
  • the embodiment of the present invention is applied to a storage device, where the storage device includes a controller and an SSD.
  • the controller includes a cache, and the cache further includes a plurality of pages, and each page includes multiple sectors. If the data is stored in the sector, the sector is a valid sector, and if no data is saved, it is an invalid sector.
  • the effective sector includes a dirty sector and a clean sector, wherein the dirty sector includes data to be written to the SSD, and the clean sector includes data that has been written into the SSD.
  • FIG. 1 is a schematic flowchart of a first embodiment of a method for writing data according to the present invention.
  • FIG. 2 is a schematic structural diagram of a sector of a method for writing data according to a second embodiment of the present invention. As shown in FIG. 1, the method includes:
  • the first valid data block includes a plurality of consecutive valid sectors in which data is stored.
  • the cache contains a large number of sectors, which can divide a continuous effective sector into a valid data block, and one or more first valid data blocks can be determined in the cache.
  • the dirty sector indicates that the data in the sector is actually written to the SSD, and the data in the dirty sector is different from the current data in the corresponding location in the SSD, and the dirty sector cannot be written new before being erased.
  • the data in the clean sector is the data read by the host from the SSD, and is left in the cache, so the data in the clean sector is the same as the data in the corresponding location in the SSD.
  • Both dirty and clean sectors are valid sectors.
  • the invalid sector can be a blank sector without any content, that is, the host does not read the data of the corresponding sector from the SSD, and there is currently no data in the invalid sector in the cache.
  • the determined first valid data block does not contain an invalid sector.
  • the first valid data block in which the dirty sector is not included is culled, and the remaining first valid data block is taken as the second valid data block.
  • the target valid data block contains multiple pages, any of which contains dirty sectors.
  • Each of the foregoing second valid data blocks may include a plurality of pages. If there are pages in the plurality of pages in which all sectors are clean sectors, such pages are removed from the second valid data block to form The new valid data block is used as the target valid data block, so that each page contained in the target valid data block contains dirty sectors.
  • At least one first valid data block is determined in the cache, and then the first valid data block containing only the clean sector is removed, and then the page containing only the clean sector is removed, and finally the target data block is obtained.
  • the target data block is written to the SSD, which reduces the clean sectors written into the SSD as much as possible, thereby reducing the amount of data written to the SSD and realizing the extended service life of the SSD.
  • FIG. 3 is a schematic diagram of a sector structure of a method for writing data according to a third embodiment of the present invention
  • FIG. 4 is a schematic diagram of a sector structure of a method for writing data according to a fourth embodiment of the present invention
  • FIG. 3, FIG. 4, and FIG. 5, for six consecutive pages it is assumed that one page contains eight sectors, wherein each square represents one sector, and the blank square represents a clean sector, "twill "The shaded squares represent dirty sectors, and the "dot" shaded squares indicate invalid sectors.
  • determining the first valid data block in the cache is: traversing all the sectors of the preset designated area in the cache; acquiring the largest continuous valid data block as the first valid data block, the maximum continuous validity
  • the data block includes the most consecutive valid sectors.
  • the largest contiguous block of data here refers to including as many valid sectors as possible.
  • the capacity of the cache is generally large.
  • the cache does not directly manage the page or sector, but manages a larger granularity. For example, it can manage a page group (page group). ), the above preset designated area refers to the page selected by the preset algorithm.
  • the designated area is six consecutive pages as shown in FIG. 3.
  • the 48 sectors are traversed, and three largest consecutive valid data blocks are obtained as the first valid data block.
  • data blocks A, B, and C are data blocks A, B, and C, respectively.
  • Data block A includes a total of 4 sectors of a3-a6, data block B includes a total of 20 a8-d3, and data block C includes a total of 19 sectors of d6-f8.
  • the 3 first valid data blocks are all included in the most consecutive valid sectors, and there are no invalid sectors.
  • the second valid data block is determined in the three first valid data blocks, that is, the data blocks in which all sectors in the three largest consecutive valid data blocks are clean sectors are culled, that is, the data block A is culled because a3 -a6 are all clean sectors.
  • the remaining data blocks B and C are the second valid data blocks, and the data blocks B and C contain dirty sectors. Further processing the second valid data blocks B and C, processing in units of pages, culling pages in which all sectors in the second valid data block are clean sectors, and data blocks B and C spanning multiple pages As shown in FIG. 4, the data block B spans 4 pages.
  • block C spans 3 pages, but the portions of the 3 pages spanned contain dirty sectors, d8 in d6-d8 is dirty, and el in el-e8 is dirty, fl- In f8, fl, f2, ⁇ , and f8 are dirty sectors, and the resulting target continuous valid data block F is the same as the data block C, that is, the sector in the data block C is not culled.
  • the target data blocks thus determined are data blocks D, E, and F, and finally the data in data blocks D, E, and F are written to the SSD.
  • each data block generates an input/output (Input/Output, I/O for short) when writing to the SSD.
  • I/O input/output
  • an I/O indicates a write request or a read request.
  • the preset designated area in the cache for example, the preset designated area shown in FIG. 3, if the prior art is used, one can simply write the dirty sector directly to the SSD, so that five I/ are generated.
  • the two I/Os of d2 and d8-el may be written.
  • the SSD generates unnecessary junk pages, which will cause write amplification.
  • the two I/Os of fl- ⁇ and f8 will also generate write amplification.
  • the clean sectors written in the SSD are reduced as much as possible, and the write amplification and the write penalty are reduced, thereby reducing the amount of data written into the SSD, thereby realizing the extension of the service life of the SSD, and also Reduce I/O generation and reduce overall overhead.
  • FIG. 6 is a schematic structural diagram of Embodiment 1 of a device for writing data according to the present invention.
  • the storage device includes a controller and a solid state hard disk, and the controller includes a cache, and the cache includes multiple pages. Each page includes multiple sectors.
  • the apparatus includes: a determining module 601 and a writing module 602, wherein:
  • a determining module 601 configured to determine a first valid data block in the cache, the first valid data block includes a plurality of consecutive valid sectors, the wired sector holds data; Determining a second valid data block in the data block, the second valid data block refers to a valid data block including a dirty sector; determining a target valid data block in the second valid data block, in the target valid data block Contains multiple pages, any of which contains dirty sectors.
  • the writing module 602 is configured to write data in the target valid data block to the solid state hard disk.
  • the determining module 601 is configured to: traverse all sectors in the preset designated area in the buffer; and obtain a maximum continuous valid data block as the first valid data block, where the first The valid data block includes the most consecutive valid sectors. .
  • the dirty sector includes data to be written into the solid state hard disk
  • the clean sector includes data that has been written into the solid state hard disk.
  • FIG. 7 is a schematic structural diagram of Embodiment 1 of a storage device according to the present disclosure.
  • the storage device 110 includes: a processor 701, a memory 702, a system bus (abbreviated as bus) 703, and a communication interface 704, a processor 701, a memory 702, and a communication interface. 704 are connected by system bus 703 and communicate with each other.
  • a processor 701, a memory 702, and a communication interface. 704 are connected by system bus 703 and communicate with each other.
  • Processor 701 can be a central processing unit.
  • the memory 702 is used to store instruction information.
  • Communication interface 704 is used to communicate with external devices.
  • the processor 701 runs the instruction information in the memory 702, and the method flow described in FIG. 1 can be performed.
  • the processor 701 is configured to determine, in the cache, a first valid data block, where the first valid data block includes a plurality of consecutive valid sectors, and the wired sector stores data; Determining a second valid data block in the first valid data block, the second valid data block refers to a valid data block including a dirty sector; determining a target valid data block in the second valid data block, The target valid data block contains a plurality of pages, and any one of the pages contains a dirty sector. It is also used to write data in the target valid data block to the solid state hard disk.
  • the processor 701 is specifically configured to: traverse all sectors of the preset designated area in the buffer; and obtain a maximum continuous valid data block as the first valid data block, where the first The valid data block includes the most consecutive valid sectors.
  • the dirty sector includes data to be written into the solid state hard disk
  • the clean sector includes data that has been written into the solid state hard disk.
  • 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: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

Procédé et appareil d'écriture de données, le procédé comportant les étapes consistant à: déterminer dans une antémémoire un premier bloc de données valide comportant une pluralité de secteurs valides contigus où sont sauvegardées des données; déterminer dans le premier bloc de données valide un deuxième bloc de données valide faisant référence à un bloc de données valide contenant des secteurs pollués; déterminer dans le deuxième bloc de données valide un bloc de données valide visé contenant une pluralité de pages, n'importe quelle page contenant des données polluées; et écrire les données du bloc de données valide visé dans un disque électronique (SSD). Le nombre de secteurs sains écrits dans le SSD est réduit autant que possible, et le volume de données écrites dans le SSD est donc réduit pour prolonger la durée de vie en service du SSD.
PCT/CN2014/080509 2013-10-18 2014-06-23 Procédé et appareil d'écriture de données WO2015055020A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310495179.8A CN103513941B (zh) 2013-10-18 2013-10-18 写入数据的方法及装置
CN201310495179.8 2013-10-18

Publications (1)

Publication Number Publication Date
WO2015055020A1 true WO2015055020A1 (fr) 2015-04-23

Family

ID=49896741

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/080509 WO2015055020A1 (fr) 2013-10-18 2014-06-23 Procédé et appareil d'écriture de données

Country Status (2)

Country Link
CN (1) CN103513941B (fr)
WO (1) WO2015055020A1 (fr)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103513941B (zh) * 2013-10-18 2016-08-17 华为技术有限公司 写入数据的方法及装置
CN111399783B (zh) * 2020-04-22 2024-01-16 Oppo广东移动通信有限公司 存储设备的数据写入方法、装置、电子设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156753A (zh) * 2011-04-29 2011-08-17 中国人民解放军国防科学技术大学 面向固态硬盘文件系统的数据页缓存方法
CN102725752A (zh) * 2011-10-20 2012-10-10 华为技术有限公司 处理脏数据的方法及装置
CN102999441A (zh) * 2012-11-15 2013-03-27 清华大学 一种细粒度内存访问的方法
CN103513941A (zh) * 2013-10-18 2014-01-15 华为技术有限公司 写入数据的方法及装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8266501B2 (en) * 2009-09-29 2012-09-11 Micron Technology, Inc. Stripe based memory operation
CN101819509A (zh) * 2010-04-19 2010-09-01 清华大学深圳研究生院 一种固态硬盘读写方法
CN103279561A (zh) * 2013-06-13 2013-09-04 三珠数码软件开发(上海)有限公司 一种提高数据库数据随机读写速度的方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156753A (zh) * 2011-04-29 2011-08-17 中国人民解放军国防科学技术大学 面向固态硬盘文件系统的数据页缓存方法
CN102725752A (zh) * 2011-10-20 2012-10-10 华为技术有限公司 处理脏数据的方法及装置
CN102999441A (zh) * 2012-11-15 2013-03-27 清华大学 一种细粒度内存访问的方法
CN103513941A (zh) * 2013-10-18 2014-01-15 华为技术有限公司 写入数据的方法及装置

Also Published As

Publication number Publication date
CN103513941A (zh) 2014-01-15
CN103513941B (zh) 2016-08-17

Similar Documents

Publication Publication Date Title
US9910597B2 (en) Memory system having a plurality of writing modes
US10127166B2 (en) Data storage controller with multiple pipelines
US10114578B2 (en) Solid state disk and data moving method
JP6163532B2 (ja) メモリシステムコントローラを含む装置
CN104583930B (zh) 数据迁移的方法、控制器和数据迁移装置
EP2778888B1 (fr) Sélection entre des unités de mémoire non volatile ayant différentes tailles d'unité de données adressables minimales
KR101643273B1 (ko) 저장 매체에 데이터를 저장하는 방법, 그를 이용한 데이터 저장 장치, 및 그것을 포함한 시스템
CN102122235B (zh) 一种raid4系统及其数据读写方法
KR101678868B1 (ko) 플래시 주소 변환 장치 및 그 방법
CN113971104A (zh) 用于存储装置的基于奇偶校验的故障保护的系统及方法
US9400603B2 (en) Implementing enhanced performance flash memory devices
KR101663066B1 (ko) 하이브리드 디바이스에서의 고체 상태 메모리 커맨드 큐
KR20130088173A (ko) 트랜잭션 로그 복구
US20120159050A1 (en) Memory system and data transfer method
JP2011505046A (ja) メモリの寿命を延長するためにメモリ内のスペア領域を増加させること
CN103838676B (zh) 数据存储系统、数据存储方法及pcm桥
US20130198438A1 (en) Data storage apparatus and method for compaction processing
JP2009163647A (ja) ディスクアレイ装置
JP2020154525A (ja) メモリシステムおよび情報処理システム
CN103034458A (zh) 固态硬盘中实现独立磁盘冗余阵列的方法及装置
US9933955B1 (en) Power safe write buffer for data storage device
CN105005510A (zh) 应用于固态硬盘阻变存储器缓存的纠错保护架构及方法
US10083117B2 (en) Filtering write request sequences
WO2015055020A1 (fr) Procédé et appareil d'écriture de données
KR101653999B1 (ko) 낸드 플래시 기반의 스토리지 시스템 및 데이터 보존 강화 방법

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

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

Country of ref document: EP

Kind code of ref document: A1