WO2018072420A1 - Storage management method and storage device - Google Patents

Storage management method and storage device Download PDF

Info

Publication number
WO2018072420A1
WO2018072420A1 PCT/CN2017/081335 CN2017081335W WO2018072420A1 WO 2018072420 A1 WO2018072420 A1 WO 2018072420A1 CN 2017081335 W CN2017081335 W CN 2017081335W WO 2018072420 A1 WO2018072420 A1 WO 2018072420A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
target data
logical address
life cycle
initial
Prior art date
Application number
PCT/CN2017/081335
Other languages
French (fr)
Chinese (zh)
Inventor
陈业夫
王万振
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2018072420A1 publication Critical patent/WO2018072420A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0647Migration mechanisms
    • G06F3/0649Lifecycle management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0658Controller construction arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0688Non-volatile semiconductor memory arrays

Definitions

  • This application relates to the field of computers, and more particularly to storage management techniques.
  • the storage medium of many computers (such as desktops) and controllers of disk arrays may include an SSD (Solid State Disk).
  • SSDs Solid State Disk
  • the SSD is widely used as a read-only cache, and hotspot data that is frequently accessed in the mechanical hard disk is placed in the SSD.
  • LBA Logical Block Address
  • the relationship between the physical storage address and the logical storage address needs to be established. That is, a forward index needs to be established in the system memory so that the corresponding segments and blocks can be found from the LBA. For example, if the hotspot data corresponding to LBA a is written to block x on segment r, a forward index a--->(r, x) is established. In addition, you need to create an inverted index (find the corresponding LBA from segment and block). For example, if the hotspot data corresponding to LBA a is written to block x on segment r as an example, the reverse index to be established is (r, x)--->a.
  • the present application provides a storage management method and a storage device to solve the problem that an invalid forward index may be searched and data may be read incorrectly during data reading.
  • the embodiment of the present invention provides the following technical solutions:
  • an embodiment of the present application provides a storage management method, where the method is applied to a storage device, where the storage device includes a processor and a solid state drive (SSD), the solid state drive includes a plurality of data areas, each data An area includes one or more blocks, and in the method performed by the processor, an initial lifecycle number is assigned to an object (eg, a storage disk, a data area), at the end of the lifetime or at the beginning of a new lifetime , giving the object a new lifecycle number. Before using this object, you need to compare whether the initial lifecycle number is consistent with the current lifecycle number. If they are inconsistent, the object is invalid and will not be used continuously. This will avoid reading the wrong data.
  • SSD solid state drive
  • the above object is specifically a data area, such as a segment.
  • the step performed by the processor includes: receiving a read data instruction including a logical address of the target data; searching in the index data according to the logical address, to obtain a target data area corresponding to the logical address and an initial life cycle number thereof (index The data includes a correspondence between the logical address and an initial life cycle number of the target data area; obtaining a life cycle number of the target data area, and when determining that the life cycle number is inconsistent with the initial life cycle number, The above read data instruction is not executed. Further, when it is determined that the life cycle number is the same as the initial life cycle number, the target data stored in the target data area is read.
  • the read data instruction will not be executed. That is, reading in the present invention
  • the life cycle number is used to identify whether the index data is invalid. If it is invalid, the read data command is not executed, thereby avoiding reading the wrong data.
  • the processor may also delete the index data corresponding to the logical address. This avoids reading invalid index data and improves reading efficiency.
  • the storage device can also write the target data before receiving the read data command described above.
  • the writing process may include: the processor receiving the write data instruction (including the target data and its logical address), determining the target data area corresponding to the target data and its initial life cycle number, and saving the logical address and the initial life cycle number.
  • the correspondence between the two is related to the aforementioned index data.
  • an initial lifecycle number can be assigned to the target data region after the target data is written.
  • each data region is assigned a raw lifecycle number (typically 0) at the factory, or when the SSD is first initialized. In the process of using SSD, monotonous increment or monotonous decrement is performed based on the original life cycle number.
  • the current life cycle number of the target data area can be used as the initial life cycle number.
  • the existing storage management method establishes a forward index and a reverse index.
  • the index data including the initial life cycle number of the target data region is established, and the index data in this embodiment is similar to the existing forward index, but In contrast, the correspondence between the logical address and the initial life cycle number is increased. In the meantime, in this embodiment, the previous reverse index is no longer maintained, which reduces memory consumption and reduces management complexity.
  • the storage device may also release the data area after the write process and before the read process.
  • the releasing process may include receiving an instruction to release the target data area, and modifying the initial life cycle number to the life cycle number.
  • the initial lifecycle number can be increased by m to get a new lifecycle number.
  • m can be a positive integer or a negative integer.
  • the storage device may also perform data deletion.
  • the deleting process may include: receiving a delete data instruction, the delete data instruction including a logical address of the target data; and setting the index data corresponding to the logical address to be invalid.
  • the forward index corresponding to LBA a is a--->> (r, x)
  • the reverse index is (r, x)-- ->a
  • you need to find (r, x) from the forward index a then invalidate the reverse index (r, x) ---> a, and finally invalidate the forward index a---> (r, x).
  • the index data corresponding to the logical address is directly set to be invalid, so that the operation steps can be greatly reduced.
  • an embodiment of the present invention provides a storage device, which has a function of realizing the behavior of the storage device in the foregoing method.
  • the functions may be implemented by hardware or by corresponding software implemented by hardware.
  • the hardware or software includes one or more modules corresponding to the functions described above.
  • the structure of the storage device includes: a processor and a memory, the processor executing the execution of the storage device by running a software program stored in the memory, calling data stored in the memory Methods.
  • an embodiment of the present invention provides a computer storage medium for storing computer software instructions for use in the foregoing storage device, including a program designed to perform the above aspects.
  • the read data instruction in the reading process, if the initial life cycle number of the target data area of the index data record is different from the current life cycle number of the target data area, the read data instruction is not executed. That is, in the reading process of the present invention, the life cycle number is used to identify whether the index data is invalid, and if it is invalid, the data reading instruction is not executed, thereby avoiding Read the wrong data.
  • Figure 1 is a schematic diagram of the forward and reverse indexes
  • FIG. 2a is a schematic diagram of an application environment provided by an embodiment of the present application.
  • FIG. 2b is an exemplary structural diagram of a storage device according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a general computer architecture of a controller of a storage device according to an embodiment of the present invention
  • FIG. 4 and 6-9 are exemplary flowcharts of a storage management method provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of index data provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of another exemplary structure of a storage device according to an embodiment of the present invention.
  • the embodiment of the present application is to protect a storage management method and a storage device.
  • the storage device may be a disk array or the like.
  • composition diagram of the storage device depicted in FIG. 2a which includes a controller 201 and a disk enclosure 202.
  • Controller 201 can be a computing device such as a server, desktop computer, or the like. An operating system and other applications are installed on the controller 201. The controller 201 can receive an input/output (I/O) request from the application host, store the data carried in the I/O request, and write the data into the disk enclosure 202. In an application scenario, the controller 201 can be connected to an application host (not shown) through a SAN network. A schematic diagram of the structure of the controller 201 can be seen in FIG.
  • the disk enclosure 202 can include one or more hard disks.
  • at least one of the hard disks is a Solid State Device (SSD).
  • SSD Solid State Device
  • the SSD can also be installed in the slot of the controller 201.
  • the controller 201 may include a processor 1, a memory 2, and a communication interface 3 connected through a bus (which may further include a front-end interface card and a back-end interface). Card), as well as input device 4 and output device 5.
  • a bus which may further include a front-end interface card and a back-end interface). Card
  • the front end interface card can be used to communicate with the application host, and the processor 1 of the controller 201 can receive various operation instructions of the application host through the front end interface card.
  • the processor 1 of the controller 201 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
  • the processor 1 of the controller 201 can be configured to receive a write data request or a read data request from the application host, process the write data request or read the data request, request the read data or read the data. The request is sent to the SSD 21 and other operations.
  • the memory 2 is used to store the program.
  • the memory 2 in this embodiment may also integrate a buffer function, for example, for buffering data received from the application host or data read from the solid state hard disk 21.
  • the controller 201 may temporarily save the multiple write data requests in the memory 2, and when the capacity of the memory 2 reaches the water level line, send it to the solid state.
  • the hard disk 21 is persistently stored.
  • Memory 2 may contain high speed RAM memory and may also include non-volatile memory, such as at least one disk memory. It can be understood that the memory 2 can be a random access memory. (Random-Access Memory, RAM), disk, hard disk, optical disk, solid state disk (SSD) or non-volatile memory, etc. can be stored in non-transitory machines. Read the media. It should be noted that, in the embodiment, the memory 2 and the cache may also be separately set.
  • the backend interface card can be used to communicate with the SSD 21, and the processor 1 of the controller 201 can send data to the SSD 21 for storage via the backend interface card.
  • the solid state hard disk 21 may further include an SSD controller and a storage medium.
  • the SSD controller is configured to perform operations such as a write data request or a read data request sent by the processor 1.
  • controller 201 belongs to the system controller and is different from the controller of the SSD itself.
  • the SSD controller includes a Flash Translation Layer (FTL), and the correspondence between the logical address and the physical address of the data stored in the FTL. Therefore, the FTL is used to convert the logical address carried in the write data request or the read data request into a physical address in which the data is stored in the SSD, and the physical address in which the data is stored in the SSD may be the actual address in which the data is stored in the SSD, or may be The actual address is virtualized based on the address visible only to the SSD controller (the system controller is not visible).
  • FTL Flash Translation Layer
  • the storage medium in a solid state drive usually consists of several flash memory chips. Each flash chip includes a number of blocks. In general, the standard capacity of a block may be 2 to the power of N (M), where N is a positive integer.
  • the SSD storage space presents a number of consecutive logical spaces to the system controller.
  • a continuous logical space is referred to as a segment, and each segment corresponds to a logical space.
  • the address is called a logical address.
  • each segment corresponds to one or more blocks. It should be noted that the SSD controller does not sense the existence of the segment.
  • Segment is a piece of logical space perceived by the system controller, corresponding to a logical address (also known as a logical address interval). For example, the logical address range corresponding to one segment is 0MB-1023MB; the logical address interval corresponding to another segment is 1024MB-2047MB; the logical address interval corresponding to one segment is 2048MB-3071MB, and so on.
  • FIG. 4 shows an interactive exemplary process of the storage management method provided by the embodiment of the present invention, which solves the problem that an invalid forward index may be searched during the process of reading data, and the wrong data is read. .
  • the method shown in FIG. 4 is applied in the application scenario shown in FIG. 2a, and the processor 1 of the controller 201 in the storage device shown in FIG. 3 interacts with other components.
  • the interaction process includes:
  • Processor 1 of controller 201 receives a read data instruction (from the application system).
  • the above read data instruction includes a logical address of the target data.
  • the processor 1 can receive the above read data command through the front end interface card of the communication interface 3.
  • the logical address is an LBA (Logical Block Address). Unless otherwise stated, the LBA will be described as an example.
  • the processor 1 of the controller 201 searches in the index data (maintained by the memory 2) according to the above logical address to acquire the target data area corresponding to the logical address and the initial life cycle number of the target data area.
  • the index data corresponding to each logical address LBA is maintained in the memory 2 of the controller 201. See Figure 5, any index
  • the data includes a correspondence between a logical address and an initial life cycle number of the data area, and a correspondence between the logical address and the physical address.
  • the index data is created after the data is written to the SSD. Assume that the data corresponding to LBA a is written in block x of segment r, and the initial lifetime number of segment r is h, then the index data corresponding to LBA a can be a--->(r,x,h) Or a--->(h,r,x).
  • the read data command includes LBA a
  • the segment r corresponding to LBA a is the target data region
  • the h recorded in is the initial life cycle number of the target data area.
  • section 403 the processor 1 of the controller 201 acquires the current life cycle number of the target data area
  • the correspondence between the data area and the current life cycle number is maintained in the memory 2 of the controller 201.
  • the storage device can divide the storage space of the SSD into a plurality of data areas (the size is approximately several tens of MB), and number the data areas according to the storage address of the SSD from low to high, and Maintain the correspondence between each data area and the life cycle number. Since the data area is large (relative to the block), the amount of memory consumed by maintaining the correspondence between the data area and the life cycle number is small.
  • processor 1 of controller 201 can look up Table 1 above to obtain the current lifecycle number of the target data region.
  • the lifecycle number of the data area will change. For example, after releasing a data area, the lifecycle number of the data area will change. This article will introduce it later.
  • section 404 when it is determined that the life cycle number of the acquired target data area does not coincide with the initial life cycle number, the processor 1 of the controller 201 does not execute the above read data instruction.
  • the read data instruction will not be executed.
  • the read data instruction is not executed. That is, in the reading process of the present invention, the life cycle number is used to identify whether the index data is invalid. If it is invalid, the read data command is not executed, thereby avoiding reading the erroneous data.
  • the foregoing interaction process may further include:
  • the processor 1 of the controller 201 deletes the index data corresponding to the logical address in the read data command.
  • FIG. 6 is another interactive exemplary process of a storage management method according to an embodiment of the present invention.
  • the focus of this embodiment is to introduce the writing process of the above target data.
  • the method shown in FIG. 6 can be applied in the application scenario shown in FIG. 2a, and is mainly performed by the processor 1 of the controller 201 in the storage device shown in FIG. 3 interacting with other components.
  • the interaction process includes:
  • Processor 1 of controller 201 receives a write data instruction (from the application system).
  • the write data instruction includes the above target data and a logical address.
  • the processor 1 can receive the above write data command through the front end interface card of the communication interface 3.
  • the solid state hard disk 21 sequentially allocates a block (generally several KB to several tens of KB) to the target data from the free data area, and writes the target data into the allocated block.
  • a block generally several KB to several tens of KB
  • the processor 1 of the controller 201 can transmit data to the SSD 21 for storage via the backend interface card.
  • the SSD controller in the solid state hard disk 21 sequentially allocates a block (generally several KB to several tens of KB) to the target data from the free data area, and writes the target data into the allocated block.
  • the processor 1 of the controller 201 determines a target data area corresponding to the target data and an initial life cycle number of the target data area.
  • the current life cycle number of the target data area can be used as the initial life cycle number.
  • the target data is written into the block x of the segment r, and the target data region is segment r
  • the life cycle number h of the segment r (time T0) can be obtained by querying the above table 1.
  • an initial lifecycle number can be assigned to the target data area after the target data is written and stored in Table 1 above.
  • each data region is assigned a raw lifecycle number (typically 0) at the factory, or when the SSD is first initialized.
  • the accumulation or subtraction is performed on the basis of the original life cycle number (described later in this article), and the accumulated or subtracted results are stored in Table 1 above.
  • the processor 1 of the controller 201 saves the correspondence between the above logical address and the initial life cycle number of the target data area to the above index data.
  • the index data created is a--->(r,x, h) or a--->(h,r,x).
  • the existing storage management method establishes a forward index and a reverse index.
  • the initial life cycle number including the target data region is established.
  • Index data the index data in this embodiment is similar to the existing forward index, but in addition, the correspondence between the logical address and the initial life cycle number is increased.
  • the reverse index is no longer maintained, and the memory consumption is reduced and the management complexity is reduced.
  • FIG. 7 provides an interactive exemplary process involving the release of data regions.
  • the method shown in FIG. 7 is applied in the application scenario shown in FIG. 2a, and the processor 1 of the controller 201 in the storage device shown in FIG. 3 interacts with other components.
  • the interaction process includes:
  • processor 1 of controller 201 receives an instruction to release the target data region
  • the instruction to release the target data area is internally triggered by the storage device.
  • the storage device will detect that the data area has run out, and will choose to release some used segments, and then accept new data writes.
  • Processor 1 of controller 201 modifies the initial lifecycle number.
  • the initial lifecycle number can be increased by m to get a new lifecycle number.
  • m can be a positive integer or a negative integer. More specifically, m can take +1.
  • each data area is assigned a raw lifecycle number (typically 0) at the factory or when the SSD is first initialized.
  • monotonous increment or monotonous decrement is performed based on the original life cycle number.
  • the data area may be monotonically incremented by m each time the data area is released on the basis of the original life cycle number.
  • the 700 portion is executed after the correspondence between saving the logical address and the initial life cycle number of the target data region to the index data (that is, after the 604 portion), before receiving the read data instruction (that is, before the 601 portion) .
  • the release mode provided by the embodiment of the present invention only needs to modify the initial life cycle number, avoids complicated operations, and improves processing efficiency.
  • the storage device may perform operations such as deleting target data, rewriting target data, and the like.
  • FIG. 8 illustrates an interactive exemplary process involving deletion of target data.
  • the method shown in FIG. 8 is applied in the application scenario shown in FIG. 2a, and the processor 1 of the controller 201 in the storage device shown in FIG. 3 interacts with other components.
  • the interaction process includes:
  • Processor 1 of controller 201 receives a delete data instruction (from the application system).
  • the delete data instruction includes a logical address of the above target data.
  • the processor 1 can receive the above-described delete data command through the front end interface card of the communication interface 3.
  • the processor 1 of the controller 201 sets the index data corresponding to the above logical address to be invalid.
  • the index data corresponding to the above logical address may be deleted.
  • the index data corresponding to the logical address is directly set to be invalid, so that the operation steps can be greatly reduced.
  • FIG. 9 shows an interactive exemplary flow involving repeated writing of the target data.
  • the method shown in FIG. 9 is applied in the application scenario shown in FIG. 2a, and the processor 1 of the controller 201 in the storage device shown in FIG. 3 interacts with other components.
  • the interaction process includes:
  • Processor 1 of controller 201 receives a write data instruction (from the application system).
  • the write data instruction includes the above target data and a logical address.
  • Section 902 the SSD controller in the SSD 21 sequentially allocates a block (generally several KB to several tens of KB) for the target data from the free data area, and writes the target data into the allocated block.
  • a block generally several KB to several tens of KB
  • the target data corresponding to the previous LBA a is written to the block x on the segment r.
  • the target data is allocated block y on the segment s, and the target data corresponding to the LBA a is written to Block y on segment s.
  • the processor 1 of the memory controller 201 determines a new target data area corresponding to the target data and an initial life cycle number of the new target data area.
  • section 904 the processor 1 of the controller 201 saves the correspondence between the above logical address and the initial life cycle number of the new target data area to the above index data.
  • the index data corresponding to LBA a is updated from a--->(r,x,h) or a--->(h,r,x) to a--->(i,s , y) or a---> (s, y, i).
  • the repeated write mode provided in this embodiment directly updates the index data corresponding to the logical address, thereby greatly reducing the operation steps.
  • the idea of the present invention can also be applied to, for example, storage management of a storage disk. If the storage disk is released or damaged, add m to the initial lifecycle number of the storage disk to get a new lifecycle number. When the storage disk is accessed, the initial life cycle number is the same as the current life cycle number. If the value is inconsistent, the storage disk is invalid and cannot be accessed.
  • FIG. 10 is a schematic diagram of a possible structure of a storage device involved in the foregoing embodiment, including:
  • the receiving module 101 is configured to receive a read data instruction (including a logical address of the target data);
  • the searching module 102 is configured to search the index data according to the foregoing logical address to obtain the target data area corresponding to the logical address and the initial life cycle number of the target data area.
  • the index data includes a correspondence between the logical address and an initial lifecycle number of the target data area.
  • the obtaining module 103 is configured to obtain a life cycle number of the target data area.
  • the reading module 104 is configured to not execute the read data command when determining that the life cycle number does not match the initial life cycle number.
  • the foregoing storage device may further include a writing module 105, configured to:
  • the target data area and the initial life cycle number may be determined by the obtaining module 103;
  • the writing module 105 can also perform the aforementioned operation of repeatedly writing the target data.
  • the foregoing storage device may further include a release module 106 for After receiving the instruction to release the target data area, the initial life cycle number is modified to the above life cycle number.
  • the instruction to release the target data area is received before the receiving module 101 receives the read data command after the write module 105 saves the correspondence between the logical address and the initial life cycle number of the target data area to the index data.
  • the foregoing storage device may further include a deleting module 107, configured to receive a delete data instruction (including a logical address of the target data) from the application system, and corresponding to the logical address.
  • the index data is set to invalid.
  • the receiving module 101 can be used to support the storage device to communicate with other devices, for example, to support the storage device to communicate with other devices, such as the ones shown in FIG. 4, FIG. 6, FIG. 7, FIG. 8, FIG. instruction.
  • the lookup module 102 can execute the portion 402 of FIG. 4, the portion 603 shown in FIG. 6 (find the initial life cycle number), the portion 402, the portion 603 shown in FIG. 7, or the portion 903 shown in FIG. (Find the initial lifecycle number).
  • the reading module 104 can perform the 404 portion and the 405 portion shown in FIG. 4 or 7.
  • the write module 105 can directly execute portions 601-604 shown in Figures 6 or 7, or can perform portions 601-604 shown in Figures 6 or 7 by interacting with other modules. Furthermore, the write module can perform the 901-904 portion shown in Figure 9 directly or by interacting with other modules.
  • the release module 106 can perform the 700-701 portion shown in Figure 7 directly or by interacting with other modules.
  • the steps of a method or algorithm described in connection with the present disclosure may be implemented in a hardware, or may be implemented by a processor executing software instructions.
  • the software instructions may be comprised of corresponding software modules that may be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable hard disk, CD-ROM, or any other form of storage well known in the art.
  • An exemplary storage medium is coupled to the processor to enable the processor to read information from, and write information to, the storage medium.
  • the storage medium can also be an integral part of the processor.
  • the processor and the storage medium can be located in an ASIC. Additionally, the ASIC can be located in the user equipment.
  • the processor and the storage medium may also reside as discrete components in the user equipment.
  • the functions described herein can be implemented in hardware, software, firmware, or any combination thereof.
  • the functions may be stored in a computer readable medium or transmitted as one or more instructions or code on a computer readable medium.
  • Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another.
  • a storage medium may be any available media that can be accessed by a general purpose or special purpose computer.

Abstract

The present application relates to the field of computers, and in particular, to storage management technology. A storage management method, comprising: receiving a data read command (comprising the logical address of target data); according to the logical address, searching index data for a target data area corresponding to the logical address and the initial lifecycle number of the target data area; acquiring the lifecycle number of the target data area; when it is determined that the lifecycle number is inconsistent with the initial lifecycle number, not executing the data read command. In the present invention, during the reading process, if the initial lifecycle number of the target data area recorded by the index data is different from the current lifecycle number, the data read command is not executed. That is, during the reading process of the present invention, whether the index data is invalid is identified by means of the lifecycle number; if the index data is invalid, the data read command is not executed, thereby avoiding incorrect data from being read.

Description

存储管理方法及存储设备Storage management method and storage device 技术领域Technical field
本申请涉及计算机领域,特别是涉及存储管理技术。This application relates to the field of computers, and more particularly to storage management techniques.
背景技术Background technique
目前,很多计算机(例如台式机)、磁盘阵列的控制器的存储介质可包括SSD(Solid State Disk,固态硬盘)。相对于传统机械硬盘,SSD具有优异的读写性能,但其容量较小(因为价格较贵)。所以,广泛使用了SSD作为只读缓存,将机械硬盘中访问比较频繁的热点数据放在SSD中。Currently, the storage medium of many computers (such as desktops) and controllers of disk arrays may include an SSD (Solid State Disk). Compared to traditional mechanical hard drives, SSDs have excellent read and write performance, but their capacity is small (because they are more expensive). Therefore, the SSD is widely used as a read-only cache, and hotspot data that is frequently accessed in the mechanical hard disk is placed in the SSD.
上述热点数据使用LBA(Logical Block Address,逻辑区块地址)来标识,请参见图1,存储系统会将SSD的存储空间划为若干个segment(其大小大致是几十MB),并按照SSD的存储地址从低到高的顺序加以编号,每一segment又包括若干个block。The above hotspot data is identified by LBA (Logical Block Address). Referring to Figure 1, the storage system divides the storage space of the SSD into several segments (the size is roughly several tens of MB), and according to the SSD The storage addresses are numbered in order from low to high, and each segment includes several blocks.
在将热点数据写入SSD的存储空间(物理存储空间)后,需建立物理存储地址与逻辑存储地址之间的关系。也即,需要在系统内存中建立正向索引,以便可从LBA找到相应的segment和block。举例来讲,假定LBA a对应的热点数据写入segment r上的block x,则建立正向索引a--->(r,x)。此外,还需要建立一个反向索引(从segment和block找到相应的LBA)。仍以LBA a对应的热点数据写入segment r上的block x为例,需建立的反向索引为(r,x)--->a。After the hotspot data is written into the storage space (physical storage space) of the SSD, the relationship between the physical storage address and the logical storage address needs to be established. That is, a forward index needs to be established in the system memory so that the corresponding segments and blocks can be found from the LBA. For example, if the hotspot data corresponding to LBA a is written to block x on segment r, a forward index a--->(r, x) is established. In addition, you need to create an inverted index (find the corresponding LBA from segment and block). For example, if the hotspot data corresponding to LBA a is written to block x on segment r as an example, the reverse index to be established is (r, x)--->a.
当SSD上所有segment用完后,需要将一些segment释放。被释放的segment所对应的正向索引是无效的。因此,在读取数据过程中,可能会搜索到无效的正向索引,进而读取到错误的数据。After all the segments on the SSD are used up, some segments need to be released. The forward index corresponding to the released segment is invalid. Therefore, during the process of reading data, an invalid forward index may be searched to read the wrong data.
发明内容Summary of the invention
为了解决上述问题,本申请提供存储管理方法及存储设备,以解决读取数据过程中,可能会搜索到无效的正向索引,进而读取到错误的数据的问题。In order to solve the above problem, the present application provides a storage management method and a storage device to solve the problem that an invalid forward index may be searched and data may be read incorrectly during data reading.
为实现上述目的,本发明实施例提供如下技术方案:To achieve the above objective, the embodiment of the present invention provides the following technical solutions:
一方面,本申请的实施例提供一种存储管理方法,该方法应用于存储设备中,所述存储设备包括处理器和固态硬盘(SSD),所述固态硬盘包括多个数据区域,每个数据区域包括一个或多个块(block),由所述处理器执行的该方法中,为对象(例如存储盘、数据区域)赋予初始生命周期号,在生命期结束或一个新的生命期开始时,赋予该对象新的生命周期号。在使用该对象前,需要比较初始的生命周期号与当前的生命周期号是否一致。如果不一致,说明对象无效,不对其继续使用,这样可避免读取到错误的数据。In one aspect, an embodiment of the present application provides a storage management method, where the method is applied to a storage device, where the storage device includes a processor and a solid state drive (SSD), the solid state drive includes a plurality of data areas, each data An area includes one or more blocks, and in the method performed by the processor, an initial lifecycle number is assigned to an object (eg, a storage disk, a data area), at the end of the lifetime or at the beginning of a new lifetime , giving the object a new lifecycle number. Before using this object, you need to compare whether the initial lifecycle number is consistent with the current lifecycle number. If they are inconsistent, the object is invalid and will not be used continuously. This will avoid reading the wrong data.
在一个可能的设计中,上述对象具体为数据区域,例如segment。则上述处理器所执行的步骤包括:接收包括目标数据的逻辑地址的读数据指令;根据该逻辑地址在索引数据中查找,以获取该逻辑地址对应的目标数据区域和其初始生命周期号(索引数据包括该逻辑地址与目标数据区域的初始生命周期号之间的对应关系);获取所述目标数据区域的生命周期号,并在确定所述生命周期号与所述初始生命周期号不一致时,不执行上述读数据指令。此外,在确定上述生命周期号与初始生命周期号相同时,则读取上述目标数据区域中存储的目标数据。可见,在读取过程中,若索引数据记录的目标数据区域的初始生命周期号与目标数据区域当前的生命周期号不同时,会不执行读数据指令。也即,在本发明读取 过程中,会通过生命周期号去识别索引数据是否无效,若无效,则不执行读数据指令,从而可避免读取到错误的数据。In one possible design, the above object is specifically a data area, such as a segment. Then the step performed by the processor includes: receiving a read data instruction including a logical address of the target data; searching in the index data according to the logical address, to obtain a target data area corresponding to the logical address and an initial life cycle number thereof (index The data includes a correspondence between the logical address and an initial life cycle number of the target data area; obtaining a life cycle number of the target data area, and when determining that the life cycle number is inconsistent with the initial life cycle number, The above read data instruction is not executed. Further, when it is determined that the life cycle number is the same as the initial life cycle number, the target data stored in the target data area is read. It can be seen that during the reading process, if the initial life cycle number of the target data area of the index data record is different from the current life cycle number of the target data area, the read data instruction will not be executed. That is, reading in the present invention In the process, the life cycle number is used to identify whether the index data is invalid. If it is invalid, the read data command is not executed, thereby avoiding reading the wrong data.
在一个可能的设计中,在确定上述生命周期号与初始生命周期号不一致时,处理器还可删除上述逻辑地址对应的索引数据。这样可避免读到无效的索引数据,提高读取效率。In a possible design, when it is determined that the life cycle number is inconsistent with the initial life cycle number, the processor may also delete the index data corresponding to the logical address. This avoids reading invalid index data and improves reading efficiency.
在一个可能的设计中,在上述接收读数据指令之前,存储设备还可进行目标数据的写入。其写入过程可包括:处理器接收写数据指令(包括目标数据及其逻辑地址),确定该目标数据对应的目标数据区域及其初始生命周期号,并保存上述逻辑地址与初始生命周期号之间的对应关系至前述索引数据。在一个示例中,可在写入目标数据后,为目标数据区域分配一个初始生命周期号。在另一个示例中,在出厂时,或首次初始化SSD时,为每一数据区域分配一个原始生命周期号(一般为0)。在使用SSD过程中,会在原始生命周期号的基础上,进行单调递增或单调递减。在写入目标数据后,可以使用目标数据区域当时的生命周期号作为初始生命周期号。与现有存储管理方式不同的是,现有存储管理方式建立了正向索引和反向索引。而在本实施例中,存储设备在写入目标数据后,建立了包含目标数据区域的初始生命周期号的索引数据,本实施例中的索引数据类似于现有的正向索引,但与之相比,又增加了逻辑地址与初始生命周期号之间的对应关系。同时,本实施例中,不再维护之前的反向索引,减少了内存消耗并降低了管理复杂度。In one possible design, the storage device can also write the target data before receiving the read data command described above. The writing process may include: the processor receiving the write data instruction (including the target data and its logical address), determining the target data area corresponding to the target data and its initial life cycle number, and saving the logical address and the initial life cycle number. The correspondence between the two is related to the aforementioned index data. In one example, an initial lifecycle number can be assigned to the target data region after the target data is written. In another example, each data region is assigned a raw lifecycle number (typically 0) at the factory, or when the SSD is first initialized. In the process of using SSD, monotonous increment or monotonous decrement is performed based on the original life cycle number. After the target data is written, the current life cycle number of the target data area can be used as the initial life cycle number. Different from the existing storage management method, the existing storage management method establishes a forward index and a reverse index. In this embodiment, after the storage device writes the target data, the index data including the initial life cycle number of the target data region is established, and the index data in this embodiment is similar to the existing forward index, but In contrast, the correspondence between the logical address and the initial life cycle number is increased. In the meantime, in this embodiment, the previous reverse index is no longer maintained, which reduces memory consumption and reduces management complexity.
在一个可能的设计中,在写入过程之后、读取过程之前,存储设备还可能进行数据区域的释放。该释放过程可包括:接收释放目标数据区域的指令,将上述初始生命周期号修改为上述生命周期号。在一个示例中,可将初始生命周期号增加m,得到新的生命周期号。m可为正整数或负整数。与现有释放方式相比,本发明实施例所提供的释放方式只需要修改初始生命周期号即可,避免了复杂的操作,提高了处理效率。In one possible design, the storage device may also release the data area after the write process and before the read process. The releasing process may include receiving an instruction to release the target data area, and modifying the initial life cycle number to the life cycle number. In one example, the initial lifecycle number can be increased by m to get a new lifecycle number. m can be a positive integer or a negative integer. Compared with the existing release mode, the release mode provided by the embodiment of the present invention only needs to modify the initial life cycle number, avoids complicated operations, and improves processing efficiency.
在一个可能的设计中,存储设备还可能进行数据删除。则在一个示例中,删除过程可包括:接收删除数据指令,所述删除数据指令包括所述目标数据的逻辑地址;将所述逻辑地址对应的索引数据设置为无效。在现有的存储方式中,当需要删除LBA a对应的目标数据时,假定LBA a对应的正向索引为a--->(r,x),反向索引为(r,x)--->a,则需要先从正向索引a找到(r,x),再无效掉反向索引(r,x)--->a,最后无效掉正向索引a--->(r,x)。与之相比,在本实施例中,直接将逻辑地址对应的索引数据设置为无效即可,从而可大大减少操作步骤。In one possible design, the storage device may also perform data deletion. In an example, the deleting process may include: receiving a delete data instruction, the delete data instruction including a logical address of the target data; and setting the index data corresponding to the logical address to be invalid. In the existing storage mode, when it is necessary to delete the target data corresponding to LBA a, it is assumed that the forward index corresponding to LBA a is a--->> (r, x), and the reverse index is (r, x)-- ->a, you need to find (r, x) from the forward index a, then invalidate the reverse index (r, x) ---> a, and finally invalidate the forward index a---> (r, x). In contrast, in this embodiment, the index data corresponding to the logical address is directly set to be invalid, so that the operation steps can be greatly reduced.
另一方面,本发明实施例提供了一种存储设备,该存储设备具有实现上述方法实际中存储设备行为的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。On the other hand, an embodiment of the present invention provides a storage device, which has a function of realizing the behavior of the storage device in the foregoing method. The functions may be implemented by hardware or by corresponding software implemented by hardware. The hardware or software includes one or more modules corresponding to the functions described above.
在一个可能的设计中,存储设备的结构包括:处理器和存储器,所述处理器通过运行存储在所述存储器内的软件程序、调用存储在所述存储器内的数据,执行上述存储设备所执行的方法。In one possible design, the structure of the storage device includes: a processor and a memory, the processor executing the execution of the storage device by running a software program stored in the memory, calling data stored in the memory Methods.
再一方面,本发明实施例提供了一种计算机存储介质,用于储存为上述存储设备所用的计算机软件指令,其包含用于执行上述方面所设计的程序。In still another aspect, an embodiment of the present invention provides a computer storage medium for storing computer software instructions for use in the foregoing storage device, including a program designed to perform the above aspects.
在本发明中,在读取过程中,若索引数据记录的目标数据区域的初始生命周期号与目标数据区域当前的生命周期号不同时,会不执行读数据指令。也即,在本发明读取过程中,会通过生命周期号去识别索引数据是否无效,若无效,则不执行读数据指令,从而可避免 读取到错误的数据。In the present invention, in the reading process, if the initial life cycle number of the target data area of the index data record is different from the current life cycle number of the target data area, the read data instruction is not executed. That is, in the reading process of the present invention, the life cycle number is used to identify whether the index data is invalid, and if it is invalid, the data reading instruction is not executed, thereby avoiding Read the wrong data.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings to be used in the embodiments will be briefly described below. Obviously, the drawings in the following description are only some of the present application. For the embodiments, other drawings may be obtained from those skilled in the art without any inventive labor.
图1为正反索引示意图;Figure 1 is a schematic diagram of the forward and reverse indexes;
图2a为本申请实施例提供的一种应用环境示意图;2a is a schematic diagram of an application environment provided by an embodiment of the present application;
图2b为本申请实施例提供的存储设备一种示例性结构图;2b is an exemplary structural diagram of a storage device according to an embodiment of the present application;
图3为本发明实施例提供的存储设备的控制器的通用计算机架构示意图;3 is a schematic diagram of a general computer architecture of a controller of a storage device according to an embodiment of the present invention;
图4、6-9为本申请实施例提供的存储管理方法示例性流程图;4 and 6-9 are exemplary flowcharts of a storage management method provided by an embodiment of the present application;
图5为本申请实施例提供的索引数据示意图;FIG. 5 is a schematic diagram of index data provided by an embodiment of the present application;
图10为本发明实施例提供的存储设备另一种示例性结构示意图。FIG. 10 is a schematic diagram of another exemplary structure of a storage device according to an embodiment of the present invention.
具体实施方式Detailed ways
本申请实施例欲保护存储管理方法及存储设备。上述存储设备具体可为磁盘阵列等。The embodiment of the present application is to protect a storage management method and a storage device. The storage device may be a disk array or the like.
请参见图2a所描绘的存储设备的一种组成图,其包括控制器201和硬盘框202。Please refer to a composition diagram of the storage device depicted in FIG. 2a, which includes a controller 201 and a disk enclosure 202.
控制器201可以是一种计算设备,如服务器、台式计算机等等。在控制器201上安装有操作系统以及其他应用程序。控制器201可以接收来自应用主机的输入输出(I/O)请求,存储I/O请求中携带的数据,并将数据写入硬盘框202中。在一个应用场景下,控制器201可以通过SAN网络与应用主机(图中未示出)连接。控制器201的结构示意图可参见图3。 Controller 201 can be a computing device such as a server, desktop computer, or the like. An operating system and other applications are installed on the controller 201. The controller 201 can receive an input/output (I/O) request from the application host, store the data carried in the I/O request, and write the data into the disk enclosure 202. In an application scenario, the controller 201 can be connected to an application host (not shown) through a SAN network. A schematic diagram of the structure of the controller 201 can be seen in FIG.
硬盘框202则可包括一个或多个硬盘,其中,请参见图2b,至少有一个硬盘是固态硬盘21(Solid State Device,SSD)。当然,SSD也可安装在控制器201的插槽内。The disk enclosure 202 can include one or more hard disks. Referring to FIG. 2b, at least one of the hard disks is a Solid State Device (SSD). Of course, the SSD can also be installed in the slot of the controller 201.
图3是上述控制器201的一种结构示例图,如图3所示,控制器201可包括通过总线相连的处理器1、内存2、通信接口3(可进一步包括前端接口卡和后端接口卡),以及输入设备4和输出设备5。3 is a diagram showing an example of the structure of the controller 201. As shown in FIG. 3, the controller 201 may include a processor 1, a memory 2, and a communication interface 3 connected through a bus (which may further include a front-end interface card and a back-end interface). Card), as well as input device 4 and output device 5.
其中,前端接口卡可用于和应用主机通信,控制器201的处理器1可以通过前端接口卡接收应用主机的各种操作指令。The front end interface card can be used to communicate with the application host, and the processor 1 of the controller 201 can receive various operation instructions of the application host through the front end interface card.
控制器201的处理器1可能是一个中央处理器CPU,或者是特定集成电路ASIC(Application Specific Integrated Circuit),或者是被配置成实施本发明实施例的一个或多个集成电路。在本发明实施例中,控制器201的处理器1可以用于接收来自应用主机的写数据请求或者读数据请求、处理所述写数据请求或者读数据请求、将所述写数据请求或者读数据请求发送给固态硬盘21以及其他操作。The processor 1 of the controller 201 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. In the embodiment of the present invention, the processor 1 of the controller 201 can be configured to receive a write data request or a read data request from the application host, process the write data request or read the data request, request the read data or read the data. The request is sent to the SSD 21 and other operations.
内存2,用于存放程序,另外,本实施例中的内存2还可以集成缓存的功能,例如用于缓存从应用主机接收的数据或从固态硬盘21读取的数据。示例性的,控制器201接收应用主机发送的多个写数据请求时,可以暂时将所述多个写数据请求保存在内存2中,当内存2的容量达到水位线时,将其发送给固态硬盘21进行持久化存储。The memory 2 is used to store the program. In addition, the memory 2 in this embodiment may also integrate a buffer function, for example, for buffering data received from the application host or data read from the solid state hard disk 21. Exemplarily, when receiving the multiple write data requests sent by the application host, the controller 201 may temporarily save the multiple write data requests in the memory 2, and when the capacity of the memory 2 reaches the water level line, send it to the solid state. The hard disk 21 is persistently stored.
内存2可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。可以理解的是,内存2可以为随机存储器 (Random-Access Memory,RAM)、磁碟、硬盘、光盘、固态硬盘(Solid State Disk,SSD)或者非易失性存储器等各种可以存储程序代码的非短暂性的(non-transitory)机器可读介质。需要说明的是,在实施例中内存2和缓存也可以分开设置。 Memory 2 may contain high speed RAM memory and may also include non-volatile memory, such as at least one disk memory. It can be understood that the memory 2 can be a random access memory. (Random-Access Memory, RAM), disk, hard disk, optical disk, solid state disk (SSD) or non-volatile memory, etc. can be stored in non-transitory machines. Read the media. It should be noted that, in the embodiment, the memory 2 and the cache may also be separately set.
后端接口卡可用于和固态硬盘21通信,控制器201的处理器1可以通过后端接口卡将数据发送给固态硬盘21存储。The backend interface card can be used to communicate with the SSD 21, and the processor 1 of the controller 201 can send data to the SSD 21 for storage via the backend interface card.
固态硬盘21进一步可包括SSD控制器和存储介质。其中,SSD控制器用于执行处理器1发送的写数据请求或者读数据请求等操作。The solid state hard disk 21 may further include an SSD controller and a storage medium. The SSD controller is configured to perform operations such as a write data request or a read data request sent by the processor 1.
需要说明的是,控制器201属于系统控制器,不同于SSD自身的控制器。It should be noted that the controller 201 belongs to the system controller and is different from the controller of the SSD itself.
更具体的,SSD控制器中包含闪存翻译层(Flash Translation Layer,FTL),FTL中保存有数据的逻辑地址与物理地址之间的对应关系。因此,FTL用于将写数据请求或者读数据请求中携带的逻辑地址转化为数据保存在SSD的物理地址,数据保存在SSD的物理地址可以是该数据保存在SSD中的实际地址,也可以在所述实际地址的基础上经过虚拟化,只对SSD控制器可见的地址(系统控制器不可见)。More specifically, the SSD controller includes a Flash Translation Layer (FTL), and the correspondence between the logical address and the physical address of the data stored in the FTL. Therefore, the FTL is used to convert the logical address carried in the write data request or the read data request into a physical address in which the data is stored in the SSD, and the physical address in which the data is stored in the SSD may be the actual address in which the data is stored in the SSD, or may be The actual address is virtualized based on the address visible only to the SSD controller (the system controller is not visible).
固态硬盘中的存储介质通常由若干个闪存flash芯片组成。每个闪存芯片包括若干个块(block)。通常情况下block的标准容量可以是2的N次方(M),其中,N为正整数。The storage medium in a solid state drive usually consists of several flash memory chips. Each flash chip includes a number of blocks. In general, the standard capacity of a block may be 2 to the power of N (M), where N is a positive integer.
通常情况下,SSD中的block对系统控制器来说是不可见的。SSD的存储空间对系统控制器呈现的是若干段连续的逻辑空间,在本实施例中,为了描述方便,将一段连续的逻辑空间称为一个段(segment),每个segment对应的逻辑空间的地址称为逻辑地址。在SSD内部,每个segment对应一个或多个block。需要说明的是,SSD控制器并没有感知到segment的存在。Segment是系统控制器感知的一段逻辑空间,对应一段逻辑地址(也称为逻辑地址区间)。例如,一个segment对应的逻辑地址区间是0MB-1023MB;另一个segment对应的逻辑地址区间是1024MB-2047MB;再一个segment对应的逻辑地址区间是2048MB-3071MB,依此类推。Normally, the blocks in the SSD are invisible to the system controller. The SSD storage space presents a number of consecutive logical spaces to the system controller. In this embodiment, for the convenience of description, a continuous logical space is referred to as a segment, and each segment corresponds to a logical space. The address is called a logical address. Inside the SSD, each segment corresponds to one or more blocks. It should be noted that the SSD controller does not sense the existence of the segment. Segment is a piece of logical space perceived by the system controller, corresponding to a logical address (also known as a logical address interval). For example, the logical address range corresponding to one segment is 0MB-1023MB; the logical address interval corresponding to another segment is 1024MB-2047MB; the logical address interval corresponding to one segment is 2048MB-3071MB, and so on.
下面将基于上面所述的本发明涉及的共性方面,对本发明实施例如何存储管理进行进一步详细说明。The storage management of the embodiment of the present invention will be further described in detail below based on the common aspects of the present invention as described above.
图4示出了本发明实施例提供的存储管理方法的一种交互式示例性流程,用以解决读取数据过程中可能会搜索到无效的正向索引,进而读取到错误的数据的问题。FIG. 4 shows an interactive exemplary process of the storage management method provided by the embodiment of the present invention, which solves the problem that an invalid forward index may be searched during the process of reading data, and the wrong data is read. .
图4所示的方法应用在图2a所示的应用场景中,由图3所示的存储设备中的控制器201的处理器1与其他部件交互。The method shown in FIG. 4 is applied in the application scenario shown in FIG. 2a, and the processor 1 of the controller 201 in the storage device shown in FIG. 3 interacts with other components.
该交互流程包括:The interaction process includes:
在401部分:控制器201的处理器1接收(来自应用系统的)读数据指令。In Section 401: Processor 1 of controller 201 receives a read data instruction (from the application system).
上述读数据指令包括目标数据的逻辑地址。The above read data instruction includes a logical address of the target data.
更具体的,处理器1可通过通信接口3的前端接口卡接收上述读数据指令。More specifically, the processor 1 can receive the above read data command through the front end interface card of the communication interface 3.
在一个示例中,该逻辑地址为LBA(Logical Block Address,逻辑区块地址)。如无特别声明,本文后续均将以LBA为例进行描述。In one example, the logical address is an LBA (Logical Block Address). Unless otherwise stated, the LBA will be described as an example.
在402部分:控制器201的处理器1根据上述逻辑地址在(内存2维护的)索引数据中查找,以获取该逻辑地址对应的目标数据区域和该目标数据区域的初始生命周期号。In section 402, the processor 1 of the controller 201 searches in the index data (maintained by the memory 2) according to the above logical address to acquire the target data area corresponding to the logical address and the initial life cycle number of the target data area.
在控制器201的内存2中维护着各逻辑地址LBA对应的索引数据。请参见图5,任一索引 数据包括逻辑地址与数据区域的初始生命周期号之间的对应关系,以及逻辑地址与物理地址之间的对应关系。The index data corresponding to each logical address LBA is maintained in the memory 2 of the controller 201. See Figure 5, any index The data includes a correspondence between a logical address and an initial life cycle number of the data area, and a correspondence between the logical address and the physical address.
索引数据是在向SSD中写入数据后建立的。假定,LBA a对应的数据写入了segment r的block x中,并且,segment r的初始生命周期号为h,则LBA a对应的索引数据可为a--->(r,x,h)或a--->(h,r,x)。The index data is created after the data is written to the SSD. Assume that the data corresponding to LBA a is written in block x of segment r, and the initial lifetime number of segment r is h, then the index data corresponding to LBA a can be a--->(r,x,h) Or a--->(h,r,x).
若读数据指令中包括的是LBA a,则LBA a对应的segment r为目标数据区域,索引数据a--->(r,x,h)或a--->(h,r,x)中记录的h则为目标数据区域的初始生命周期号。If the read data command includes LBA a, the segment r corresponding to LBA a is the target data region, and the index data a--->(r,x,h) or a--->(h,r,x) The h recorded in is the initial life cycle number of the target data area.
本文后续将介绍如何建立索引数据。This article will describe how to build index data later.
在403部分:控制器201的处理器1获取目标数据区域当前的生命周期号;In section 403: the processor 1 of the controller 201 acquires the current life cycle number of the target data area;
除索引数据外,在控制器201的内存2中还维护着数据区域与当前的生命周期号的对应关系。In addition to the index data, the correspondence between the data area and the current life cycle number is maintained in the memory 2 of the controller 201.
在首次初始化SSD过程中,存储设备可将SSD的存储空间划为若干个数据区域(其大小大致是几十MB),并按照SSD的存储地址从低到高的顺序对数据区域加以编号,并维护每个数据区域与生命周期号的对应关系。由于数据区域较大(相对于block),所以维护数据区域与生命周期号的对应关系消耗的内存量很小。During the initial initialization of the SSD, the storage device can divide the storage space of the SSD into a plurality of data areas (the size is approximately several tens of MB), and number the data areas according to the storage address of the SSD from low to high, and Maintain the correspondence between each data area and the life cycle number. Since the data area is large (relative to the block), the amount of memory consumed by maintaining the correspondence between the data area and the life cycle number is small.
在一个示例中,假定共有100个数据区域,数据区域与当前的生命周期号的对应关系可如下表1所示:In one example, assuming a total of 100 data regions, the correspondence between the data region and the current lifecycle number can be as shown in Table 1 below:
数据区域标识Data area identifier 生命周期号 Life cycle number
11 1010
22 2020
……......  
100100 33
表1Table 1
在一个示例中,控制器201的处理器1可查找上述表1,获取目标数据区域当前的生命周期号。In one example, processor 1 of controller 201 can look up Table 1 above to obtain the current lifecycle number of the target data region.
数据区域的生命周期号是会变化的,例如在释放某数据区域后,该数据区域的生命周期号会发生变化,本文后续将对其进行介绍。The lifecycle number of the data area will change. For example, after releasing a data area, the lifecycle number of the data area will change. This article will introduce it later.
在404部分:在确定获取的目标数据区域的生命周期号与初始生命周期号不一致时,控制器201的处理器1不执行上述读数据指令。In section 404: when it is determined that the life cycle number of the acquired target data area does not coincide with the initial life cycle number, the processor 1 of the controller 201 does not execute the above read data instruction.
举例来讲,若初始生命周期号为h,而获取的目标数据区域的当前生命周期号为h+m,则二者不一致,则将不执行读数据指令。For example, if the initial lifetime number is h and the current lifecycle number of the obtained target data area is h+m, if the two are inconsistent, the read data instruction will not be executed.
此外,若获取的目标数据区域当前的生命周期号与初始生命周期号不一致,则可确认该索引数据无效,那么将无法从SSD上读取到数据。此时,可从其他存储介质读取数据。如何从其他存储介质读取数据,可参照现有方式,在此不作赘述。In addition, if the current life cycle number of the acquired target data area does not match the initial life cycle number, it can be confirmed that the index data is invalid, and the data cannot be read from the SSD. At this point, data can be read from other storage media. How to read data from other storage media can be referred to the existing method, and will not be described here.
当然,若获取的目标数据区域的生命周期号与初始生命周期号一致,则执行上述读数据指令。 Of course, if the life cycle number of the acquired target data area is consistent with the initial life cycle number, the above read data instruction is executed.
可见,在本实施例的读取过程中,若索引数据记录的目标数据区域的初始生命周期号与目标数据区域当前的生命周期号不同时,会不执行读数据指令。也即,在本发明读取过程中,会通过生命周期号去识别索引数据是否无效,若无效,则不执行读数据指令,从而可避免读取到错误的数据。It can be seen that, in the reading process of this embodiment, if the initial life cycle number of the target data area of the index data record is different from the current life cycle number of the target data area, the read data instruction is not executed. That is, in the reading process of the present invention, the life cycle number is used to identify whether the index data is invalid. If it is invalid, the read data command is not executed, thereby avoiding reading the erroneous data.
此外,在本发明其他实施例中,仍请参见图4,上述交互过程还可包括:In addition, in other embodiments of the present invention, referring to FIG. 4, the foregoing interaction process may further include:
在405部分:控制器201的处理器1删除上述读数据指令中逻辑地址对应的索引数据。In section 405, the processor 1 of the controller 201 deletes the index data corresponding to the logical address in the read data command.
这样可避免后续处理器1读到无效的索引数据,提高读取效率。This can prevent subsequent processor 1 from reading invalid index data and improve reading efficiency.
图6为本发明实施例提供的存储管理方法的另一种交互式示例性流程。本实施例重点在于介绍上述目标数据的写入过程。FIG. 6 is another interactive exemplary process of a storage management method according to an embodiment of the present invention. The focus of this embodiment is to introduce the writing process of the above target data.
图6所示的方法可应用在图2a所示的应用场景中,主要由图3所示的存储设备中的控制器201的处理器1与其他部件交互完成。The method shown in FIG. 6 can be applied in the application scenario shown in FIG. 2a, and is mainly performed by the processor 1 of the controller 201 in the storage device shown in FIG. 3 interacting with other components.
该交互流程包括:The interaction process includes:
在601部分:控制器201的处理器1接收(来自应用系统的)写数据指令。In section 601: Processor 1 of controller 201 receives a write data instruction (from the application system).
该写数据指令包括了上述目标数据以及逻辑地址。The write data instruction includes the above target data and a logical address.
更具体的,处理器1可通过通信接口3的前端接口卡接收上述写数据指令。More specifically, the processor 1 can receive the above write data command through the front end interface card of the communication interface 3.
在602部分:固态硬盘21从空闲数据区域上顺序为目标数据分配block(一般是几KB到几十KB),将目标数据写入分配的block中。In Section 602: the solid state hard disk 21 sequentially allocates a block (generally several KB to several tens of KB) to the target data from the free data area, and writes the target data into the allocated block.
更具体的,控制器201的处理器1可以通过后端接口卡将数据发送给固态硬盘21存储。固态硬盘21中的SSD控制器则从空闲数据区域上顺序为目标数据分配block(一般是几KB到几十KB),将目标数据写入分配的block中。More specifically, the processor 1 of the controller 201 can transmit data to the SSD 21 for storage via the backend interface card. The SSD controller in the solid state hard disk 21 sequentially allocates a block (generally several KB to several tens of KB) to the target data from the free data area, and writes the target data into the allocated block.
在603部分:控制器201的处理器1确定目标数据对应的目标数据区域及该目标数据区域的初始生命周期号。In section 603: the processor 1 of the controller 201 determines a target data area corresponding to the target data and an initial life cycle number of the target data area.
在写入目标数据后,可以使用目标数据区域当时的生命周期号作为初始生命周期号。After the target data is written, the current life cycle number of the target data area can be used as the initial life cycle number.
举例来讲,假定在T0时刻,将目标数据写入segment r的block x中,则目标数据区域为segment r,可通过查询上述表1,获取segment r当时(T0时刻)的生命周期号h作为初始生命周期号。For example, suppose that at the time T0, the target data is written into the block x of the segment r, and the target data region is segment r, and the life cycle number h of the segment r (time T0) can be obtained by querying the above table 1. Initial life cycle number.
在另一个示例中,可在写入目标数据后,为目标数据区域分配一个初始生命周期号,并存入上述表1。In another example, an initial lifecycle number can be assigned to the target data area after the target data is written and stored in Table 1 above.
在另一个示例中,在出厂时,或首次初始化SSD时,为每一数据区域分配一个原始生命周期号(一般为0)。在使用SSD过程中,会在原始生命周期号的基础上,进行累加或累减(本文后续介绍),将累加或累减的结果存入上述表1。In another example, each data region is assigned a raw lifecycle number (typically 0) at the factory, or when the SSD is first initialized. In the process of using SSD, the accumulation or subtraction is performed on the basis of the original life cycle number (described later in this article), and the accumulated or subtracted results are stored in Table 1 above.
在604部分:控制器201的处理器1保存上述逻辑地址与目标数据区域的初始生命周期号之间的对应关系至上述索引数据。In section 604, the processor 1 of the controller 201 saves the correspondence between the above logical address and the initial life cycle number of the target data area to the above index data.
在604部分中,假定将LBA a对应的目标数据写入segment r的block x中,并且segment r当前的生命周期号为h,则创建出的索引数据为a--->(r,x,h)或a--->(h,r,x)。In Section 604, assuming that the target data corresponding to LBA a is written in block x of segment r, and the current life cycle number of segment r is h, the index data created is a--->(r,x, h) or a--->(h,r,x).
与现有存储管理方式不同的是,现有存储管理方式建立了正向索引和反向索引。而在本实施例中,存储设备在写入目标数据后,建立了包含目标数据区域的初始生命周期号的 索引数据,本实施例中的索引数据类似于现有的正向索引,但与之相比,又增加了逻辑地址与初始生命周期号之间的对应关系。同时,在本实施例中,不再维护反向索引,也减少了内存消耗并降低了管理复杂度。Different from the existing storage management method, the existing storage management method establishes a forward index and a reverse index. In this embodiment, after the storage device writes the target data, the initial life cycle number including the target data region is established. Index data, the index data in this embodiment is similar to the existing forward index, but in addition, the correspondence between the logical address and the initial life cycle number is increased. At the same time, in this embodiment, the reverse index is no longer maintained, and the memory consumption is reduced and the management complexity is reduced.
需要说明的是,在某些现有存储管理方式中,当需要将SSD上的segment释放时需要使用反向索引:假定需要释放segment r,此时需要根据反向索引找到segment r上各block对应的LBA,再根据搜索到的LBA,将segment为r所对应的正向索引都无效掉(删除),最后再将segment r标记为空闲。It should be noted that in some existing storage management modes, when the segment on the SSD needs to be released, an inverted index is required: assuming that segment r needs to be released, it is necessary to find each block corresponding to segment r according to the reverse index. The LBA, according to the searched LBA, invalidates (deletes) the forward index corresponding to segment r, and finally marks segment r as idle.
但是,维护从segment上各block到LBA的反向索引,需要消耗大量内存,此外,空间管理复杂度也较高。However, maintaining the reverse index from each block on the segment to the LBA requires a lot of memory, and the space management complexity is also high.
图7所示的本发明实施例,提供了涉及释放数据区域的交互式示例性流程。The embodiment of the invention illustrated in Figure 7 provides an interactive exemplary process involving the release of data regions.
图7所示的方法应用在图2a所示的应用场景中,由图3所示的存储设备中的控制器201的处理器1与其他部件交互。The method shown in FIG. 7 is applied in the application scenario shown in FIG. 2a, and the processor 1 of the controller 201 in the storage device shown in FIG. 3 interacts with other components.
该交互流程包括:The interaction process includes:
在700部分:控制器201的处理器1接收释放目标数据区域的指令;At 700: processor 1 of controller 201 receives an instruction to release the target data region;
释放目标数据区域的指令是存储设备内部触发的。在实际中,存储设备会检测到数据区域已用完,就会选择将某些已用的segment释放,后续以接受新的数据写入。The instruction to release the target data area is internally triggered by the storage device. In practice, the storage device will detect that the data area has run out, and will choose to release some used segments, and then accept new data writes.
在701部分:控制器201的处理器1修改初始生命周期号。In Section 701: Processor 1 of controller 201 modifies the initial lifecycle number.
在一个示例中,可将初始生命周期号增加m,得到新的生命周期号。m可为正整数或负整数。更具体的,m可取+1。In one example, the initial lifecycle number can be increased by m to get a new lifecycle number. m can be a positive integer or a negative integer. More specifically, m can take +1.
沿用上述表1的例子,假定释放的是数据区域1,则将数据区域1的初始生命周期号10加m,再将(10+m)保存至表1。Following the example of Table 1 above, assuming that the data area 1 is released, the initial life cycle number 10 of the data area 1 is incremented by 10, and (10+m) is stored in Table 1.
前述提及了,在出厂时或首次初始化SSD时,为每一数据区域分配一个原始生命周期号(一般为0)。在使用SSD过程中,会在原始生命周期号的基础上,进行单调递增或单调递减。则在另一示例中,可在原始生命周期号的基础上,每释放一次数据区域,则单调递增m。As mentioned above, each data area is assigned a raw lifecycle number (typically 0) at the factory or when the SSD is first initialized. In the process of using SSD, monotonous increment or monotonous decrement is performed based on the original life cycle number. In another example, the data area may be monotonically incremented by m each time the data area is released on the basis of the original life cycle number.
700部分执行于在保存所述逻辑地址与目标数据区域的初始生命周期号之间的对应关系至所述索引数据之后(也即604部分之后),接收读数据指令之前(也即601部分之前)。The 700 portion is executed after the correspondence between saving the logical address and the initial life cycle number of the target data region to the index data (that is, after the 604 portion), before receiving the read data instruction (that is, before the 601 portion) .
与现有释放方式相比,本发明实施例所提供的释放方式只需要修改初始生命周期号即可,避免了复杂的操作,提高了处理效率。Compared with the existing release mode, the release mode provided by the embodiment of the present invention only needs to modify the initial life cycle number, avoids complicated operations, and improves processing efficiency.
除读/写数据、释放数据区域外,存储设备还可能进行删除目标数据、重写入目标数据等操作。In addition to reading/writing data and releasing data areas, the storage device may perform operations such as deleting target data, rewriting target data, and the like.
基于本发明实施例提供的索引数据,图8示出了涉及删除目标数据的交互式示例性流程。Based on the index data provided by embodiments of the present invention, FIG. 8 illustrates an interactive exemplary process involving deletion of target data.
图8所示的方法应用在图2a所示的应用场景中,由图3所示的存储设备中的控制器201的处理器1与其他部件交互。The method shown in FIG. 8 is applied in the application scenario shown in FIG. 2a, and the processor 1 of the controller 201 in the storage device shown in FIG. 3 interacts with other components.
该交互流程包括: The interaction process includes:
在801部分:控制器201的处理器1接收(来自应用系统的)删除数据指令。In section 801: Processor 1 of controller 201 receives a delete data instruction (from the application system).
该删除数据指令包括上述目标数据的逻辑地址。The delete data instruction includes a logical address of the above target data.
更具体的,处理器1可通过通信接口3的前端接口卡接收上述删除数据指令。More specifically, the processor 1 can receive the above-described delete data command through the front end interface card of the communication interface 3.
在802部分:控制器201的处理器1将上述逻辑地址对应的索引数据设置为无效。At section 802: the processor 1 of the controller 201 sets the index data corresponding to the above logical address to be invalid.
在一个示例中,可删除上述逻辑地址对应的索引数据。In one example, the index data corresponding to the above logical address may be deleted.
需要说明的是,在现有的存储方式中,当需要删除LBA a对应的目标数据时,假定LBA a对应的正向索引为a--->(r,x),反向索引为(r,x)--->a,则需要先从正向索引找到(r,x),再无效掉反向索引(r,x)--->a,最后无效掉正向索引a--->(r,x)。It should be noted that, in the existing storage mode, when the target data corresponding to LBA a needs to be deleted, it is assumed that the forward index corresponding to LBA a is a--->> (r, x), and the reverse index is (r) , x)--->a, you need to find (r,x) from the forward index, then invalidate the reverse index (r,x)--->a, and finally invalidate the forward index a--- >(r,x).
与之相比,在本实施例中,直接将逻辑地址对应的索引数据设置为无效即可,从而可大大减少操作步骤。In contrast, in this embodiment, the index data corresponding to the logical address is directly set to be invalid, so that the operation steps can be greatly reduced.
假定LBA a的数据因为被更新需要再次写入SSD,基于本发明实施例提供的索引数据,图9示出了涉及重复写入目标数据的交互式示例性流程。Assuming that the data of LBA a needs to be written to the SSD again because it is updated, based on the index data provided by the embodiment of the present invention, FIG. 9 shows an interactive exemplary flow involving repeated writing of the target data.
图9所示的方法应用在图2a所示的应用场景中,由图3所示的存储设备中的控制器201的处理器1与其他部件交互。The method shown in FIG. 9 is applied in the application scenario shown in FIG. 2a, and the processor 1 of the controller 201 in the storage device shown in FIG. 3 interacts with other components.
该交互流程包括:The interaction process includes:
在901部分:控制器201的处理器1接收(来自应用系统的)写数据指令。In Section 901: Processor 1 of controller 201 receives a write data instruction (from the application system).
该写数据指令包括了上述目标数据以及逻辑地址。The write data instruction includes the above target data and a logical address.
901部分与601部分相同,在此不作赘述。Section 901 is the same as Section 601 and will not be described here.
在902部分:固态硬盘21中SSD控制器从空闲数据区域上顺序为目标数据分配block(一般是几KB到几十KB),将目标数据写入分配的block中。In Section 902: the SSD controller in the SSD 21 sequentially allocates a block (generally several KB to several tens of KB) for the target data from the free data area, and writes the target data into the allocated block.
假定之前LBA a对应的目标数据写入到segment r上的block x,在重复写入过程中,为目标数据分配的是segment s上的block y,则会将LBA a对应的目标数据写入到segment s上的block y。Assume that the target data corresponding to the previous LBA a is written to the block x on the segment r. In the process of repeated writing, the target data is allocated block y on the segment s, and the target data corresponding to the LBA a is written to Block y on segment s.
需要说明的是,为提升SSD性能和寿命,写入都是顺序进行的。因此,若需要重复写入目标数据,则需要重新分配存储空间。It should be noted that in order to improve the performance and life of the SSD, the writing is performed sequentially. Therefore, if you need to write the target data repeatedly, you need to re-allocate the storage space.
在903部分:存控制器201的处理器1确定目标数据对应的新目标数据区域及该新目标数据区域的初始生命周期号。In section 903, the processor 1 of the memory controller 201 determines a new target data area corresponding to the target data and an initial life cycle number of the new target data area.
沿用前例,假定将LBA a对应的目标数据写入到segment s上的block y,则segment s为新目标数据区域,查找表1,可获取segment s对应的生命周期号作为初始生命周期号,可假定segment s的初始生命周期号为i。Following the previous example, it is assumed that the target data corresponding to LBA a is written to block y on segment s, then segment s is the new target data area, and lookup table 1 can obtain the life cycle number corresponding to segment s as the initial life cycle number. Assume that the initial life cycle number of segment s is i.
在904部分:控制器201的处理器1保存上述逻辑地址与新目标数据区域的初始生命周期号之间的对应关系至上述索引数据。In section 904: the processor 1 of the controller 201 saves the correspondence between the above logical address and the initial life cycle number of the new target data area to the above index data.
仍沿用前例,则将LBA a对应的索引数据由a--->(r,x,h)或a--->(h,r,x),更新为a--->(i,s,y)或a--->(s,y,i)。If the previous example is still used, the index data corresponding to LBA a is updated from a--->(r,x,h) or a--->(h,r,x) to a--->(i,s , y) or a---> (s, y, i).
需要说明的是,在现有的存储方式中,当需要重复写入时,在将目标数据写入分配的block中后,需要先从老的正向索引a找到(r,x),再无效掉反向索引(r,x)--->a。最后,更新正向索引为a--->(s,y),并建立新的反向索引(s,y)--->a。 It should be noted that, in the existing storage mode, when the write is required to be repeated, after the target data is written into the allocated block, it is necessary to find (r, x) from the old forward index a, and then invalidate. Reverse the index (r, x) ---> a. Finally, update the forward index to a--->(s,y) and create a new reverse index (s,y)--->a.
与之相比,本实施例所提供的重复写入方式直接更新逻辑地址对应的索引数据即可,从而可大大减少操作步骤。In contrast, the repeated write mode provided in this embodiment directly updates the index data corresponding to the logical address, thereby greatly reducing the operation steps.
综上,本发明核心思想是:为对象(例如存储盘、数据区域)赋予生命周期号来标志其生命期,在一些情况下,生命期结束或一个新的生命期开始时,赋予其新的生命周期号。所有使用该对象的客体需记录该对象初始的生命周期号,在使用该对象前,需要比较初始的生命周期号与当前的生命周期号是否一致。如果不一致,说明对象无效,不能继续使用。In summary, the core idea of the present invention is to assign a life cycle number to an object (such as a storage disk, a data area) to mark its lifetime, and in some cases, to end its lifetime or to start a new life, to give it a new Life cycle number. All objects using the object need to record the initial life cycle number of the object. Before using the object, it is necessary to compare whether the initial life cycle number is consistent with the current life cycle number. If they are inconsistent, the object is invalid and cannot be used anymore.
除上述所有实施例所提供的技术方案外,本发明的思想还可应用于例如存储盘的存储管理上。若存储盘被释放或损坏,可在存储盘的初始生命周期号上累加m,得到新的生命周期号。访问该存储盘时,可比较其初始生命周期号与当前生命周期号是否一致,如不一致,说明存储盘无效,不可访问。In addition to the technical solutions provided by all of the above embodiments, the idea of the present invention can also be applied to, for example, storage management of a storage disk. If the storage disk is released or damaged, add m to the initial lifecycle number of the storage disk to get a new lifecycle number. When the storage disk is accessed, the initial life cycle number is the same as the current life cycle number. If the value is inconsistent, the storage disk is invalid and cannot be accessed.
上述主要从各个装置之间交互的角度对本发明实施例提供的方案进行了介绍。可以理解的是,各个装置,例如存储设备、存储装置等为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本发明能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。The foregoing provides an introduction to the solution provided by the embodiments of the present invention from the perspective of interaction between the various devices. It can be understood that various devices, such as storage devices, storage devices, etc., in order to implement the above functions, include hardware structures and/or software modules corresponding to the respective functions. Those skilled in the art will readily appreciate that the present invention can be implemented in a combination of hardware or hardware and computer software in combination with the elements and algorithm steps of the various examples described in the embodiments disclosed herein. Whether a function is implemented in hardware or computer software to drive hardware depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
图10示出了上述实施例中所涉及的存储设备的一种可能的结构示意图,包括:FIG. 10 is a schematic diagram of a possible structure of a storage device involved in the foregoing embodiment, including:
接收模块101,用于接收读数据指令(包括目标数据的逻辑地址);The receiving module 101 is configured to receive a read data instruction (including a logical address of the target data);
查找模块102,用于根据上述逻辑地址在索引数据中查找,以获取上述逻辑地址对应的目标数据区域和上述目标数据区域的初始生命周期号。The searching module 102 is configured to search the index data according to the foregoing logical address to obtain the target data area corresponding to the logical address and the initial life cycle number of the target data area.
其中,上述索引数据包括上述逻辑地址与上述目标数据区域的初始生命周期号之间的对应关系;The index data includes a correspondence between the logical address and an initial lifecycle number of the target data area.
获取模块103,用于获取上述目标数据区域的生命周期号;The obtaining module 103 is configured to obtain a life cycle number of the target data area.
读取模块104,用于在确定上述生命周期号与上述初始生命周期号不一致时,不执行上述读数据指令。The reading module 104 is configured to not execute the read data command when determining that the life cycle number does not match the initial life cycle number.
相关细节请参见本文前述记载,在此不作赘述。For details, please refer to the foregoing description in this document, and no further details are given here.
在本发明其他实施例中,仍请参见图10,上述存储设备还可包括写入模块105,用于:In other embodiments of the present invention, still referring to FIG. 10, the foregoing storage device may further include a writing module 105, configured to:
接收写数据指令(可通过接收模块101接收),上述写数据指令包括上述目标数据以及上述目标数据的逻辑地址;其中,上述写数据指令是在上述接收模块101接收读数据指令之前接收到的;Receiving a write data command (receivable by the receiving module 101), wherein the write data command includes the target data and a logical address of the target data; wherein the write data command is received before the receiving module 101 receives the read data command;
确定上述目标数据对应的目标数据区域及上述目标数据区域的初始生命周期号(可通过获取模块103确定目标数据区域及初始生命周期号);Determining a target data area corresponding to the target data and an initial life cycle number of the target data area (the target data area and the initial life cycle number may be determined by the obtaining module 103);
以及,保存上述逻辑地址与上述目标数据区域的初始生命周期号之间的对应关系至上述索引数据。And storing a correspondence between the logical address and the initial life cycle number of the target data area to the index data.
此外,写入模块105还可执行前述的重复写入目标数据的操作。Further, the writing module 105 can also perform the aforementioned operation of repeatedly writing the target data.
在本发明其他实施例中,仍请参见图10,上述存储设备还可包括释放模块106,用于在 接收释放目标数据区域的指令后,将上述初始生命周期号修改为上述生命周期号。In other embodiments of the present invention, still referring to FIG. 10, the foregoing storage device may further include a release module 106 for After receiving the instruction to release the target data area, the initial life cycle number is modified to the above life cycle number.
其中,释放目标数据区域的指令是在写入模块105保存逻辑地址与目标数据区域的初始生命周期号之间的对应关系至索引数据之后,接收模块101接收读数据指令之前接收的。The instruction to release the target data area is received before the receiving module 101 receives the read data command after the write module 105 saves the correspondence between the logical address and the initial life cycle number of the target data area to the index data.
在本发明其他实施例中,仍请参见图10,上述存储设备还可包括删除模块107,用于接收(来自应用系统的)删除数据指令(包括目标数据的逻辑地址),将上述逻辑地址对应的索引数据设置为无效。In other embodiments of the present invention, still referring to FIG. 10, the foregoing storage device may further include a deleting module 107, configured to receive a delete data instruction (including a logical address of the target data) from the application system, and corresponding to the logical address. The index data is set to invalid.
其中,接收模块101可用于支持存储设备与其他装置进行通信,例如,用于支持存储设备与图4、图6、图7、图8、图9中示出的与其他装置进行通信,例如接收指令。The receiving module 101 can be used to support the storage device to communicate with other devices, for example, to support the storage device to communicate with other devices, such as the ones shown in FIG. 4, FIG. 6, FIG. 7, FIG. 8, FIG. instruction.
查找模块102可执行图4所示的402部分,图6所示的603部分(查找初始生命周期号),图7所示的402部分、603部分,或者,可执行图9所示的903部分(查找初始生命周期号)。The lookup module 102 can execute the portion 402 of FIG. 4, the portion 603 shown in FIG. 6 (find the initial life cycle number), the portion 402, the portion 603 shown in FIG. 7, or the portion 903 shown in FIG. (Find the initial lifecycle number).
获取模块103可执行图4或7所示的403部分。The acquisition module 103 can perform the 403 portion shown in FIG. 4 or 7.
读取模块104可执行图4或7所示的404部分和405部分。The reading module 104 can perform the 404 portion and the 405 portion shown in FIG. 4 or 7.
写入模块105可直接执行图6或7所示的601-604部分,或可通过与其他模块交互执行图6或7所示的601-604部分。此外,写入模块可直接或通过与其他模块交互执行图9所示的901-904部分。The write module 105 can directly execute portions 601-604 shown in Figures 6 or 7, or can perform portions 601-604 shown in Figures 6 or 7 by interacting with other modules. Furthermore, the write module can perform the 901-904 portion shown in Figure 9 directly or by interacting with other modules.
释放模块106可直接或通过与其他模块交互执行图7所示的700-701部分。The release module 106 can perform the 700-701 portion shown in Figure 7 directly or by interacting with other modules.
删除模块107可直接或通过与其他模块交互执行图7所示的801-802部分。The deletion module 107 can perform the portions 801-802 shown in Figure 7 directly or by interacting with other modules.
结合本发明公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于RAM存储器、闪存、ROM存储器、EPROM存储器、EEPROM存储器、寄存器、硬盘、移动硬盘、CD-ROM或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于用户设备中。当然,处理器和存储介质也可以作为分立组件存在于用户设备中。The steps of a method or algorithm described in connection with the present disclosure may be implemented in a hardware, or may be implemented by a processor executing software instructions. The software instructions may be comprised of corresponding software modules that may be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable hard disk, CD-ROM, or any other form of storage well known in the art. In the medium. An exemplary storage medium is coupled to the processor to enable the processor to read information from, and write information to, the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an ASIC. Additionally, the ASIC can be located in the user equipment. Of course, the processor and the storage medium may also reside as discrete components in the user equipment.
本领域技术人员应该可以意识到,在上述一个或多个示例中,本发明所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。Those skilled in the art will appreciate that in one or more examples described above, the functions described herein can be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored in a computer readable medium or transmitted as one or more instructions or code on a computer readable medium. Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another. A storage medium may be any available media that can be accessed by a general purpose or special purpose computer.
以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本发明的保护范围之内。 The specific embodiments of the present invention have been described in detail with reference to the preferred embodiments of the present invention. The scope of the protection, any modifications, equivalent substitutions, improvements, etc., which are made on the basis of the technical solutions of the present invention, are included in the scope of the present invention.

Claims (12)

  1. 一种存储管理方法,其特征在于,所述方法应用于存储设备中,所述存储设备包括处理器和固态硬盘,所述固态硬盘包括多个数据区域,每个数据区域包括一个或多个块(block),所述方法由所述处理器执行,包括以下步骤:A storage management method, characterized in that the method is applied to a storage device, the storage device comprising a processor and a solid state hard disk, the solid state hard disk comprising a plurality of data regions, each data region comprising one or more blocks Block, the method being performed by the processor, comprising the steps of:
    接收读数据指令,所述读数据指令包括目标数据的逻辑地址;Receiving a read data instruction, the read data instruction including a logical address of the target data;
    根据所述逻辑地址在索引数据中查找,以获取所述逻辑地址对应的目标数据区域和所述目标数据区域的初始生命周期号,所述索引数据包括所述逻辑地址与所述目标数据区域的初始生命周期号之间的对应关系;Searching, in the index data, according to the logical address, to obtain a target data area corresponding to the logical address and an initial life cycle number of the target data area, where the index data includes the logical address and the target data area The correspondence between the initial life cycle numbers;
    获取所述目标数据区域的生命周期号;Obtaining a life cycle number of the target data area;
    在确定所述生命周期号与所述初始生命周期号不一致时,不执行所述读数据指令。The read data instruction is not executed when it is determined that the life cycle number does not coincide with the initial life cycle number.
  2. 根据权利要求1所述的方法,其特征在于,还包括:The method of claim 1 further comprising:
    在确定所述生命周期号与所述初始生命周期号不一致时,删除所述逻辑地址对应的索引数据。When it is determined that the lifecycle number is inconsistent with the initial lifecycle number, the index data corresponding to the logical address is deleted.
  3. 根据权利要求1或2所述的方法,其特征在于,在所述接收读数据指令之前还包括:The method according to claim 1 or 2, further comprising: before said receiving the read data instruction:
    接收写数据指令,所述写数据指令包括所述目标数据以及所述目标数据的逻辑地址;Receiving a write data instruction, the write data instruction including the target data and a logical address of the target data;
    确定所述目标数据对应的目标数据区域及所述目标数据区域的初始生命周期号;Determining a target data area corresponding to the target data and an initial life cycle number of the target data area;
    保存所述逻辑地址与所述目标数据区域的初始生命周期号之间的对应关系至所述索引数据。Saving a correspondence between the logical address and an initial lifetime number of the target data region to the index data.
  4. 根据权利要求3所述的方法,其特征在于,在所述保存所述逻辑地址与所述目标数据区域的初始生命周期号之间的对应关系至所述索引数据之后,所述接收读数据指令之前还包括:The method according to claim 3, wherein after receiving the correspondence between the logical address and an initial lifetime number of the target data region to the index data, the receiving a read data instruction Previously included:
    接收释放所述目标数据区域的指令;Receiving an instruction to release the target data area;
    将所述初始生命周期号修改为所述生命周期号。Modify the initial lifecycle number to the lifecycle number.
  5. 如权利要求4所述的方法,其特征在于,所述将所述初始生命周期号修改为所述生命周期号包括:The method of claim 4, wherein the modifying the initial lifecycle number to the lifecycle number comprises:
    将所述初始生命周期号增加m,得到所述生命周期号;所述m为正整数或负整数。The initial life cycle number is increased by m to obtain the life cycle number; the m is a positive integer or a negative integer.
  6. 如权利要求1所述的方法,其特征在于,还包括:The method of claim 1 further comprising:
    接收删除数据指令,所述删除数据指令包括所述目标数据的逻辑地址;Receiving a delete data instruction, the delete data instruction including a logical address of the target data;
    将所述逻辑地址对应的索引数据设置为无效。The index data corresponding to the logical address is set to be invalid.
  7. 如权利要求1所述的方法,其特征在于,还包括:The method of claim 1 further comprising:
    在确定所述生命周期号与所述初始生命周期号相同时,读取所述目标数据区域中存储的目标数据。The target data stored in the target data region is read when it is determined that the lifecycle number is the same as the initial lifecycle number.
  8. 一种存储设备,其特征在于,包括固态硬盘,所述固态硬盘包括多个数据区域,每个数据区域包括一个或多个块(block);A storage device, comprising: a solid state drive comprising a plurality of data regions, each data region comprising one or more blocks;
    所述存储设备还包括:The storage device further includes:
    接收模块,用于接收读数据指令,所述读数据指令包括目标数据的逻辑地址;a receiving module, configured to receive a read data instruction, where the read data instruction includes a logical address of the target data;
    查找模块,用于根据所述逻辑地址在索引数据中查找,以获取所述逻辑地址对应的目 标数据区域和所述目标数据区域的初始生命周期号,所述索引数据包括所述逻辑地址与所述目标数据区域的初始生命周期号之间的对应关系;a searching module, configured to search in the index data according to the logical address, to obtain a destination corresponding to the logical address And an initial life cycle number of the target data area, where the index data includes a correspondence between the logical address and an initial life cycle number of the target data area;
    获取模块,用于获取所述目标数据区域的生命周期号;An obtaining module, configured to acquire a lifecycle number of the target data area;
    读取模块,用于在确定所述生命周期号与所述初始生命周期号不一致时,不执行所述读数据指令。And a reading module, configured to not execute the read data instruction when determining that the lifecycle number is inconsistent with the initial lifecycle number.
  9. 如权利要求8所述的设备,其特征在于,所述读取模块还用于:在确定所述生命周期号与所述初始生命周期号不一致时,删除所述逻辑地址对应的索引数据。The device of claim 8, wherein the reading module is further configured to: delete the index data corresponding to the logical address when determining that the lifecycle number is inconsistent with the initial lifecycle number.
  10. 如权利要求8或9所述的设备,其特征在于,还包括写入模块,用于:The device according to claim 8 or 9, further comprising a writing module for:
    接收写数据指令,所述写数据指令包括所述目标数据以及所述目标数据的逻辑地址;确定所述目标数据对应的目标数据区域及所述目标数据区域的初始生命周期号;以及,保存所述逻辑地址与所述目标数据区域的初始生命周期号之间的对应关系至所述索引数据;其中,所述写数据指令是在所述接收模块接收读数据指令之前接收到的。Receiving a write data instruction, the write data instruction including the target data and a logical address of the target data; determining a target data area corresponding to the target data and an initial life cycle number of the target data area; and, a saver Corresponding relationship between the logical address and the initial lifecycle number of the target data region to the index data; wherein the write data instruction is received before the receiving module receives the read data instruction.
  11. 如权利要求10所述的设备,其特征在于,还包括:The device of claim 10, further comprising:
    释放模块,用于在接收释放所述目标数据区域的指令后,将所述初始生命周期号修改为所述生命周期号;其中,所述释放所述目标数据区域的指令是在所述写入模块保存所述逻辑地址与所述目标数据区域的初始生命周期号之间的对应关系至所述索引数据之后,所述接收模块接收读数据指令之前接收的。a release module, configured to modify the initial lifecycle number to the lifecycle number after receiving an instruction to release the target data area; wherein the instruction to release the target data area is in the writing After the module saves the correspondence between the logical address and the initial lifecycle number of the target data area to the index data, the receiving module receives the read data instruction before receiving the data.
  12. 如权利要求10所述的设备,其特征在于,在将所述初始生命周期号修改为所述生命周期号的方面,所述释放模块用于:The device according to claim 10, wherein in the aspect of modifying the initial life cycle number to the life cycle number, the release module is configured to:
    将所述初始生命周期号增加m,得到所述生命周期号;所述m为正整数或负整数。 The initial life cycle number is increased by m to obtain the life cycle number; the m is a positive integer or a negative integer.
PCT/CN2017/081335 2016-10-20 2017-04-21 Storage management method and storage device WO2018072420A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610913693.2 2016-10-20
CN201610913693.2A CN106569742B (en) 2016-10-20 2016-10-20 Memory management method and storage equipment

Publications (1)

Publication Number Publication Date
WO2018072420A1 true WO2018072420A1 (en) 2018-04-26

Family

ID=58534053

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/081335 WO2018072420A1 (en) 2016-10-20 2017-04-21 Storage management method and storage device

Country Status (2)

Country Link
CN (1) CN106569742B (en)
WO (1) WO2018072420A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112000591A (en) * 2020-08-24 2020-11-27 深圳忆联信息系统有限公司 SSD (solid State disk) scanning method and device capable of appointing logical block address, computer equipment and storage medium
CN113127376A (en) * 2019-12-30 2021-07-16 阿里巴巴集团控股有限公司 Control method, device and equipment of solid state drive
CN113688062A (en) * 2020-05-18 2021-11-23 北京市商汤科技开发有限公司 Method for storing data and related product

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106569742B (en) * 2016-10-20 2019-07-23 华为技术有限公司 Memory management method and storage equipment
CN108196980B (en) * 2017-12-28 2022-04-12 深圳市得一微电子有限责任公司 Mistakenly deleted data recovery method, flash memory device and computer readable storage medium
CN110703992A (en) * 2019-09-20 2020-01-17 上海新储集成电路有限公司 Method and system for accelerating reading and writing speed of mechanical hard disk
CN110928495B (en) * 2019-11-12 2023-09-22 杭州宏杉科技股份有限公司 Data processing method and device on multi-control storage system
CN113495671B (en) 2020-04-01 2023-10-17 长鑫存储技术有限公司 Read-write method and memory device
CN113495674B (en) 2020-04-01 2023-10-10 长鑫存储技术有限公司 Read-write method and memory device
CN113495672B (en) 2020-04-01 2023-08-11 长鑫存储技术有限公司 Read-write method and memory device
EP3936996A4 (en) 2020-04-01 2022-07-06 Changxin Memory Technologies, Inc. Read-write method and memory device
CN113495675B (en) 2020-04-01 2023-08-11 长鑫存储技术有限公司 Read-write method and memory device
EP3964941B1 (en) 2020-04-01 2024-02-28 Changxin Memory Technologies, Inc. Read-write method and memory device
CN113495676B (en) * 2020-04-01 2023-09-29 长鑫存储技术有限公司 Read-write method and memory device
EP3985494B1 (en) 2020-04-01 2024-01-17 Changxin Memory Technologies, Inc. Read-write method and memory device
EP3964940A4 (en) 2020-04-01 2022-08-17 Changxin Memory Technologies, Inc. Read/write method and memory apparatus
CN113312443A (en) * 2021-05-06 2021-08-27 天津大学深圳研究院 Novel memory-based in-memory retrieval and table lookup construction method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090327582A1 (en) * 2008-06-30 2009-12-31 Brent Chartrand Banded Indirection for Nonvolatile Memory Devices
CN105845161A (en) * 2015-02-04 2016-08-10 Hgst荷兰公司 Method for reducing adjacent track interference effects in a data storage system
CN106569742A (en) * 2016-10-20 2017-04-19 华为技术有限公司 Storage management method and storage equipment

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9003159B2 (en) * 2009-10-05 2015-04-07 Marvell World Trade Ltd. Data caching in non-volatile memory
CN101930404B (en) * 2010-08-27 2012-11-21 威盛电子股份有限公司 Memory device and operation method thereof
DE112012005617T5 (en) * 2012-01-31 2014-10-09 Hewlett-Packard Development Company, L.P. Storage of data in memory module buffers
JP2014006807A (en) * 2012-06-26 2014-01-16 Fujitsu Ltd Processor, cache memory control apparatus, and cache memory control method
CN103514249B (en) * 2013-06-20 2016-12-28 易乐天 A kind of automatic data reduction and system and storage device
WO2016051512A1 (en) * 2014-09-30 2016-04-07 株式会社日立製作所 Distributed storage system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090327582A1 (en) * 2008-06-30 2009-12-31 Brent Chartrand Banded Indirection for Nonvolatile Memory Devices
CN105845161A (en) * 2015-02-04 2016-08-10 Hgst荷兰公司 Method for reducing adjacent track interference effects in a data storage system
CN106569742A (en) * 2016-10-20 2017-04-19 华为技术有限公司 Storage management method and storage equipment

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113127376A (en) * 2019-12-30 2021-07-16 阿里巴巴集团控股有限公司 Control method, device and equipment of solid state drive
CN113127376B (en) * 2019-12-30 2024-02-27 阿里巴巴集团控股有限公司 Control method, device and equipment for solid state drive
CN113688062A (en) * 2020-05-18 2021-11-23 北京市商汤科技开发有限公司 Method for storing data and related product
CN113688062B (en) * 2020-05-18 2022-08-26 北京市商汤科技开发有限公司 Method for storing data and related product
CN112000591A (en) * 2020-08-24 2020-11-27 深圳忆联信息系统有限公司 SSD (solid State disk) scanning method and device capable of appointing logical block address, computer equipment and storage medium
CN112000591B (en) * 2020-08-24 2023-12-05 深圳忆联信息系统有限公司 SSD scanning method capable of designating logical block address, SSD scanning device, SSD scanning computer equipment and storage medium

Also Published As

Publication number Publication date
CN106569742A (en) 2017-04-19
CN106569742B (en) 2019-07-23

Similar Documents

Publication Publication Date Title
WO2018072420A1 (en) Storage management method and storage device
US11640353B2 (en) Memory system, data storage device, user device and data management method thereof
US11216185B2 (en) Memory system and method of controlling memory system
US10761731B2 (en) Array controller, solid state disk, and method for controlling solid state disk to write data
CN108459826B (en) Method and device for processing IO (input/output) request
KR102149817B1 (en) Memory addressing
KR101301840B1 (en) Method of data processing for non-volatile memory
US10877898B2 (en) Method and system for enhancing flash translation layer mapping flexibility for performance and lifespan improvements
CN111033477A (en) Logical to physical mapping
US11960749B2 (en) Data migration method, host, and solid state disk
US10572171B2 (en) Storage system
US9772790B2 (en) Controller, flash memory apparatus, method for identifying data block stability, and method for storing data in flash memory apparatus
US9122586B2 (en) Physical-to-logical address map to speed up a recycle operation in a solid state drive
CN113220242B (en) Storage management method, apparatus, and computer readable medium
CN105917303B (en) Controller, method for identifying stability of data block and storage system
EP4012547B1 (en) Storage method and apparatus for key value (kv) and storage device
WO2017000821A1 (en) Storage system, storage management device, storage device, hybrid storage device, and storage management method
WO2017054636A1 (en) Method and apparatus for processing virtual machine snapshots
US8856468B2 (en) Memory device capable of improving write processing speed and memory control method
US20160062915A1 (en) Storage control device and storage control method
TWI715116B (en) Data storage device and method of deleting namespaces thereof
CN109002265B (en) Data processing method and related device
US20240143219A1 (en) Software-hardware combination method for internal mapping address query of zoned namespace
KR20200120480A (en) Half-match deduplication
TW201604772A (en) Data storage device and method for operating the same

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

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

Country of ref document: EP

Kind code of ref document: A1