CN116501239A - Method for managing storage device and storage controller - Google Patents

Method for managing storage device and storage controller Download PDF

Info

Publication number
CN116501239A
CN116501239A CN202210457591.XA CN202210457591A CN116501239A CN 116501239 A CN116501239 A CN 116501239A CN 202210457591 A CN202210457591 A CN 202210457591A CN 116501239 A CN116501239 A CN 116501239A
Authority
CN
China
Prior art keywords
storage device
host
mode
logical address
address space
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210457591.XA
Other languages
Chinese (zh)
Inventor
李小凤
王祎磊
何蒙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Starblaze Technology Co ltd
Original Assignee
Chengdu Starblaze Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Starblaze Technology Co ltd filed Critical Chengdu Starblaze Technology Co ltd
Publication of CN116501239A publication Critical patent/CN116501239A/en
Pending legal-status Critical Current

Links

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/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/062Securing storage systems
    • 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/0638Organizing or formatting or addressing of data
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application relates to a method and a storage controller for managing a storage device, wherein the method comprises the steps of responding to a command for triggering the storage device to adjust an operation mode, and setting the operation mode of the storage device, wherein the operation mode comprises a normal mode and a hidden mode; in response to setting an operational mode of the storage device, further setting a value indicative of a storage capacity of the storage device; wherein the value of the storage capacity of the storage device indicated by the hidden mode is different from the normal mode. According to the technical scheme, the space of the hidden part of the host or the space hidden by the host is opened through the adjustment of the working mode, so that the storage device meets the hiding requirement of data.

Description

Method for managing storage device and storage controller
Technical Field
The present application relates generally to the field of storage technology. More particularly, the present application relates to a method for managing a storage device, a storage controller, and a storage device.
Background
FIG. 1A illustrates a block diagram of a solid state storage device. The solid state storage device 102 is coupled to a host for providing storage capability for the host. The host and solid state storage device 102 may be coupled by a variety of means including, but not limited to, connecting the host to the solid state storage device 102 via, for example, SATA (Serial Advanced TechnoLogy Attachment ), SCSI (Small Computer System Interface, small computer system interface), SAS (Serial Attached SCSI ), IDE (Integrated Drive Electronics, integrated drive electronics), USB (Universal Serial Bus ), PCIE (Peripheral Component Interconnect Express, PCIE, peripheral component interconnect Express), NVMe (NVM Express), ethernet, fibre channel, wireless communications network, and the like. The host may be an information processing device capable of communicating with the storage device in the manner described above, such as a personal computer, tablet, server, portable computer, network switch, router, cellular telephone, personal digital assistant, or the like. The storage device 102 (hereinafter, solid-state storage device will be simply referred to as storage device) includes an interface 103, a control section 104, one or more NVM chips 105, and a DRAM (Dynamic Random Access Memory ) 110.
The NVM chip 105 includes common storage media such as NAND flash memory, phase change memory, feRAM (Ferroelectric RAM, ferroelectric memory), MRAM (Magnetic Random Access Memory, magnetoresistive memory), RRAM (Resistive Random Access Memory, resistive memory), and the like.
The interface 103 may be adapted to exchange data with a host by way of, for example, SATA, IDE, USB, PCIE, NVMe, SAS, ethernet, fibre channel, etc.
The control unit 104 is used for controlling data transmission among the interface 103, the NVM chip 105 and the DRAM110, and also for memory management, host logical address to flash physical address mapping, erase balancing, bad block management, etc. The control component 104 can be implemented in a variety of ways, such as software, hardware, firmware, or a combination thereof, for example, the control component 104 can be in the form of an FPGA (Field-programmable gate array, field programmable gate array), an ASIC (Application Specific Integrated Circuit, application-specific integrated circuit), or a combination thereof. The control component 104 may also include a processor or controller in which software is executed to manipulate the hardware of the control component 104 to process IO (Input/Output) commands. Control unit 104 may also be coupled to DRAM110 and may access data of DRAM 110. FTL tables and/or cached data of IO commands may be stored in the DRAM.
The control section 104 includes a flash interface controller (or referred to as a media interface controller, a flash channel controller) coupled to the NVM chip 105, which issues commands to the NVM chip 105 in a manner conforming to an interface protocol of the NVM chip 105 to operate the NVM chip 105, and receives a command execution result output from the NVM chip 105. Known NVM chip interface protocols include "Toggle", "ONFI", and the like.
FTL (Flash Translation Layer ) is utilized in the storage device 102 to maintain mapping information from logical addresses (LBAs) to physical addresses. The logical addresses constitute the memory address space of the solid state memory device as perceived by upper level software such as the operating system. The physical address is an address for accessing a physical storage unit of the solid state storage device. Address mapping may also be implemented in the related art using an intermediate address modality. For example, logical addresses are mapped to intermediate addresses, which in turn are further mapped to physical addresses. The table structure storing mapping information from logical addresses to physical addresses is called FTL table. FTL tables are important metadata in a storage device. The entries of the FTL table record address mapping relationships in units of data pages in the storage device.
FTLs of some storage devices are provided by a host to which the storage device is coupled, FTL tables are stored by a memory of the host, and FTLs are provided by a CPU executing software of the host. Still other storage management devices disposed between a host and a storage device provide FTLs. In these cases, the read/write command received by the storage device indicates a physical address.
Commands provided by the host to the storage device may access logical addresses corresponding to one or more entries of the FTL table. And the control component may change the form of the command received from the interface 103 (e.g., split the command according to the logical address space size corresponding to the FTL entry) and process the command to change the form. For clarity purposes, herein, access to a single FTL entry by a read/write command received by a storage device is described as an example.
FIG. 1B shows a schematic diagram of a prior art logical address space. In the prior art, a logical address space is a storage address space provided by a storage device, and a host can access the storage device using elements (logical addresses) in the logical address space. In general, the logical address (Logical Block Addressing, LBA) space that can be accessed by the host is the same size as the LBA space that can be provided by the storage device. For a logical address space, the storage device manages the mapping between logical and physical addresses through FTL tables.
FIG. 1C illustrates a schematic diagram of a host accessing a storage device. In fig. 1C, the host sends an IO command (read/write command) to the storage device, the IO command indicating a logical address (LBA address) to be accessed, the storage device converts the LBA address into a physical block address (Physical Block Address, PBA) based on the FTL table managed in the control section, and then the control section accesses the NVM chip according to the PBA address.
With the increasing data storage technologies, various data are stored in a storage device, such as user data, an operating system, application data, or data required for restoring factory settings of a host, and some data are not desired to be seen by a user (such as data required for restoring factory settings of a host) in order to improve the security of the data, and the data may be stored in a hidden manner in the storage device, where the hidden manner refers to that the data cannot be accessed by the user or the application on the host side.
Disclosure of Invention
The prior art generally refers to hiding the stored data from an application program of the host, but is visible to an operating system of the host, and if the operating system is invaded or misoperated, the hidden stored data may be tampered or deleted. In order to improve security of the hidden stored data, it is desirable that the hidden stored data is hidden to both the host application and the operating system, and the host cannot normally access and modify the hidden stored data through the application or the operating system, and only when the hidden stored data needs to be used, the host can access the hidden stored data, for example, when the host needs to restore factory settings, the host can access the data required for restoring factory settings of the hidden stored host in the storage device, so as to execute the factory settings.
In order to realize the function of hiding the stored data to the host application program and the operating system, the logical address space provided by the storage device is generally partitioned, and the data to be hidden and stored is stored in the hidden space, wherein the hidden space refers to that the logical address space provided by the storage device is not provided for the host under normal conditions, and the application program or the operating system of the host cannot access the data to be hidden and stored in the hidden space. However, in some cases, for example, it is required to restore factory settings, the host needs to access the data stored in the hidden space in a hidden manner, and the hidden space needs to be accessible to the host, that is, the hidden space is displayed to the host. Therefore, how to hide or display the host according to the actual requirement becomes an important link for managing the data stored in the hidden memory.
According to the scheme provided by the embodiment of the application, the storage device can respond to the received corresponding command to adjust the working mode to be the common mode or the hiding mode and set the value of the storage capacity under different working modes, so that the space of the hidden part of the host or the space hidden by the host is realized through the adjustment of the working mode, and the storage device meets the hiding requirement of data.
Further, in the scheme provided by the embodiment of the application, the command for adjusting the working mode may be a user-defined mode switching command, or may also be a Set Feature command defined by an NVMe protocol, and the working mode switching is realized through the characteristics of different commands, so that the use requirement of a user can be met to the greatest extent, and meanwhile, the interactive suitability between the storage device and the host is ensured.
Further, two sets of concepts are introduced into the scheme provided by the embodiment of the application, namely, a logical address space and a logical address space visible to a host, and a host logical address space and a device logical address space (see below for explanation of specific concepts), and the values of the storage capacities of the storage devices under different demands can be set by combining the logical address space and the logical address space visible to the host, or the values of the storage capacities of the storage devices under different demands can be set by combining the logical address space of the host and the logical address space of the device, so that the storage devices can be further improved while meeting the hidden demands on data in a diversified implementation manner.
According to a first aspect of the present application, there is provided a method for managing a storage device according to the first aspect of the present application, including setting an operation mode of the storage device in response to receiving a command triggering the storage device to adjust the operation mode, wherein the operation mode includes a normal mode and a hidden mode; in response to setting an operational mode of the storage device, further setting a value indicative of a storage capacity of the storage device; wherein the value of the storage capacity of the storage device indicated by the hidden mode is different from the normal mode.
According to a method for managing a storage device of a first aspect of the present application, there is provided a second method for managing a storage device according to the first aspect of the present application, setting a value for indicating a storage capacity of the storage device comprising: in response to setting the storage device to a normal mode, setting a storage capacity of the storage device in the normal mode to a first capacity value; or in response to setting the storage device to a hidden mode, setting a storage capacity of the storage device in the hidden mode to a second capacity value, wherein the first capacity value is different from the second capacity value.
According to the first or second method for managing a storage device of the first aspect of the present application, there is provided a third method for managing a storage device according to the first aspect of the present application, the command for adjusting the operation mode is a mode switching command or a Set Feature command defined by NVMe protocol.
According to a third method for managing a storage device of the first aspect of the present application, there is provided a fourth method for managing a storage device according to the first aspect of the present application, wherein setting the storage device to a normal mode or a hidden mode includes: responding to the command as a mode switching command, and switching the working mode of the storage device from the common mode to the hidden mode if the current working mode of the storage device is the common mode; and if the current working mode of the storage equipment is the hiding mode, switching the working mode of the storage equipment from the hiding mode to the common mode.
According to a fourth method for managing a storage device of the first aspect of the present application, there is provided a fifth method for managing a storage device according to the first aspect of the present application, wherein a storage capacity of the storage device is set to the first capacity value or the second capacity value according to a value of a parameter of a mode switch command indicated by the mode switch command.
According to a third method for managing a storage device of the first aspect of the present application, there is provided the sixth method for managing a storage device according to the first aspect of the present application, in response to the Set Feature command defined by the NVMe protocol, setting an operation mode of the storage device and a value indicating a storage capacity of the storage device according to one or more sections of logical address intervals indicated by the Set Feature command.
According to one of the second to sixth methods for managing a storage device of the first aspect of the present application, there is provided a seventh method for managing a storage device according to the first aspect of the present application, wherein a logical address space is a storage address space provided by a storage device, a host accessing the storage device using a logical address that is an element of the logical address space, characterized in that setting a value for indicating a storage capacity of the storage device comprises: and setting the first capacity value or the second capacity value according to a logical address space visible to a host in response to setting the working mode of the storage device, wherein the logical address space visible to the host is a storage address space reported to the host by the storage device and accessed by the host according to a block device.
According to one of the second to sixth methods for managing a storage device according to the first aspect of the present application, there is provided the eighth method for managing a storage device according to the first aspect of the present application, wherein a device logical address space is a storage address space provided by a storage device, a host accesses the storage device using an element of a host logical address space, for processing an IO command provided by the host, the storage device converting an element of the host logical address space in the IO command into an element of the device logical address space, characterized by setting a value indicating a storage capacity of the storage device, further comprising: and setting the first capacity value or the second capacity value based on a host logical address space in response to setting an operating mode of the storage device, wherein the host logical address space is a storage address space that the storage device reports to a host and is accessed by the host in terms of block devices.
According to one of the eighth methods for managing a storage device according to the first aspect of the present application, there is provided the ninth method for managing a storage device according to the first aspect of the present application, setting the first capacity value or the second capacity value based on a host logical address space, including: setting the second capacity value based on a first host logical address space in response to setting an operational mode of the storage device to a hidden mode; or in response to setting the operating mode of the storage device to a normal mode, setting a first capacity value based on a second host logical address space, wherein the second host logical address space comprises the first host logical address space and a newly added host logical address space, and in the hidden mode, the newly added host logical address space is invisible to a host.
According to one of the methods for managing a storage device according to the ninth aspect of the present application, there is provided the method for managing a storage device according to the tenth aspect of the present application, wherein the newly added host logical address space is located after the first host logical address space in the second host logical address space.
According to a ninth or tenth method for managing storage devices of the first aspect of the present application, there is provided a method for managing storage devices according to the eleventh aspect of the present application, wherein the newly added host logical address space is mapped to any position in the device logical address space that is not visible to the host.
According to a seventh or eighth method for managing a storage device of the first aspect of the present application, there is provided a twelfth method for managing a storage device according to the first aspect of the present application, in response to one or more sections of logical address intervals indicated by the Set Feature command, setting a storage capacity of the storage device to a first capacity value or a second capacity value according to the one or more sections of logical address intervals.
According to a twelfth method for managing a storage device of the first aspect of the present application, there is provided a method for managing a storage device according to the thirteenth method for managing a storage device of the first aspect of the present application, setting a storage capacity of the storage device to a first capacity value or a second capacity value according to the one or more logical address intervals includes: setting a working mode of the storage device to be a normal mode in response to the one or more sections of logical address intervals indicated by the Set Feature command being described as a logical address space visible to a host, and setting a storage capacity of the storage device to be a first capacity value according to the one or more sections of logical address intervals; or in response to the one or more sections of logical address intervals indicated by the Set Feature command being described as a logical address space hidden from a host, setting the working mode of the storage device as a hidden mode, and setting the storage capacity of the storage device to a second capacity value according to the one or more sections of logical address intervals.
According to a twelfth method for managing a storage device of the first aspect of the present application, there is provided a method for managing a storage device according to the fourteenth aspect of the present application, setting a value for indicating a storage capacity of the storage device includes: setting the working mode of the storage device to be a common mode in response to the description of one or more sections of logical address intervals indicated by the Set Feature command as a host logical address space, and setting the storage capacity of the storage device to be a first capacity value according to the one or more sections of logical address intervals; or responding that one or more sections of logical address intervals indicated by the Set Feature command are parts in the equipment logical address space, wherein the parts of the equipment logical address space do not have a corresponding host logical address space, and setting the second capacity value according to the host logical address space.
According to one of the methods for managing a storage device according to the seventh aspect of the present application, there is provided the method for managing a storage device according to the fifteenth aspect of the present application, setting an operation mode of the storage device to a hidden mode in response to the command being a mode switch command, setting the second capacity value according to a logical address space visible to the host; or in response to the command being a mode switching command, setting the working mode of the storage device to a common mode, and setting the first capacity value according to a logical address space visible to the host.
According to a fifteenth aspect of the present application, there is provided a method for managing a storage device according to the sixteenth aspect of the present application, further comprising: and setting a relation between the host logic address space and the equipment logic address space, wherein the equipment logic address space refers to a logic address space managed by a storage medium management unit of the storage equipment.
According to an eighth method for managing a storage device of the first aspect of the present application, there is provided the seventeenth method for managing a storage device according to the first aspect of the present application, setting an operation mode of the storage device to a hidden mode in response to the command being a mode switch command, and setting the second capacity value according to a host logical address space; or in response to the command being a mode switching command, setting the working mode of the storage device to a common mode, and setting the first capacity value according to the host logic address space.
According to one of the fifteenth to seventeenth methods for managing a storage device of the first aspect of the present application, there is provided the eighteenth method for managing a storage device according to the first aspect of the present application, further comprising: responding to the command as a mode switching command, and setting the working mode as a hidden mode, wherein the size of the host logic address space is smaller than that of the equipment logic address space; or in response to the command being a mode switch command and the operating mode being set to a normal mode, the size of the host logical address space being equal to the size of the device logical address space.
According to one of the fifteenth to seventeenth methods for managing a storage device of the first aspect of the present application, there is provided the nineteenth method for managing a storage device according to the first aspect of the present application, further comprising: responding to the command as a Set Feature command, and setting the working mode as a hidden mode, wherein the size of the host logic address space is equal to the size of a logic address space except one or more sections of logic address intervals indicated by the Set Feature command in the equipment logic address space; and responding to the command as a Set Feature command, setting the working mode into a normal mode, wherein the size of the host logic address space is equal to the size of one or more sections of logic address intervals indicated by the Set Feature command.
According to one of a fifteenth method for managing a storage device to a seventeenth method for managing a storage device of the first aspect of the present application, there is provided the twentieth method for managing a storage device of the first aspect of the present application, in response to the command being a Set Feature command, and the operation mode being Set to a normal mode, a size of one or more sections of logical address intervals indicated by the Set Feature command being smaller than or equal to the device logical address space.
A twelfth method for managing a storage device according to the first aspect of the present application or a fourteenth method for managing a storage device provides the twenty-first method for managing a storage device according to the first aspect of the present application, further comprising: responding to the command as a mode switching command, and setting the working mode as a hidden mode, wherein the size of a logic address space visible by the host is smaller than that of the logic address space; or in response to the command being a mode switch command and the operating mode being set to a normal mode, the size of the logical address space visible to the host is equal to the size of the logical address space.
A twelfth method for managing a storage device according to the first aspect of the present application or a fourteenth method for managing a storage device provides the twenty-second method for managing a storage device according to the first aspect of the present application, further comprising: responding to the command as a Set Feature command, and setting the working mode as a hidden mode, wherein the size of a logic address space visible by the host is equal to the size of a logic address space except one or more sections of logic address intervals indicated by the Set Feature command in the logic address space; and responding to the command being a Set Feature command, and setting the working mode to be a common mode, wherein the size of a logic address space visible to the host is equal to the size of one or more sections of logic address intervals indicated by the Set Feature command.
According to a twelfth method for managing a storage device or a fourteenth method for managing a storage device of the first aspect of the present application, there is provided a twenty-third method for managing a storage device according to the first aspect of the present application, in response to the command being a Set Feature command, and the operation mode being Set to a normal mode, a size of one or more sections of logical address sections indicated by the Set Feature command being smaller than or equal to the logical address space.
According to one of the second to twenty-third methods for managing a storage device of the first aspect of the present application, there is provided a twenty-fourth method for managing a storage device according to the first aspect of the present application, the method further comprising: responding to the received idenfity command, and if the current working mode of the storage equipment is a common mode, feeding back the first capacity value to a host; and if the current working mode of the storage equipment is a hidden mode, feeding back the second capacity value to a host.
A seventh method for managing a storage device or an eighth method for managing a storage device according to the first aspect of the present application provides a twenty-fifth method for managing a storage device according to the first aspect of the present application, the method further comprising: in response to receiving an IO command, acquiring a logical address accessed by the IO command; and responding to that the logic address accessed by the IO command exceeds the logic address space visible to the host or that the logic address accessed by the IO command exceeds the host logic address space, and returning error reporting information.
A seventh method for managing a storage device or an eighth method for managing a storage device according to the first aspect of the present application provides a twenty-sixth method for managing a storage device according to the first aspect of the present application, the method further comprising: and in response to executing the garbage collection operation, executing the garbage collection operation on the logical address space corresponding to the storage device or the physical address space indicated by the device logical address space.
According to one of the first to twenty-seventh methods for managing storage devices of the first aspect of the present application, there is provided a twenty-seventh method for managing storage devices according to the first aspect of the present application, the method further comprising: and setting a factory working mode of the storage device to be the hiding mode.
According to a twenty-seventh method for managing a storage device of the first aspect of the present application, there is provided a twenty-eighth method for managing a storage device according to the first aspect of the present application, the setting a factory operation mode of the storage device to the hidden mode includes: and setting a logic address space visible to the host and a logic address space hidden by the host, wherein the logic address space hidden by the host is a storage address space which is not reported to the host by the storage device in a hidden mode and is invisible or inaccessible to the host.
According to a twenty-eighth method for managing storage devices of the first aspect of the present application, there is provided a twenty-ninth method for managing storage devices of the first aspect of the present application, the host-hidden logical address space being located after the host-visible logical address space.
According to one of the first to twenty-ninth methods for managing storage devices of the first aspect of the present application, there is provided the thirty-first method for managing storage devices according to the first aspect of the present application, the method further comprising: and switching the working mode of the storage equipment to a hidden mode or keeping the working mode before power-down in response to the power-down and power-up of the storage equipment.
According to a thirty-first method for managing a storage device of the first aspect of the present application, there is provided a thirty-first method for managing a storage device according to the first aspect of the present application, wherein switching an operation mode of the storage device to a hidden mode or maintaining the operation mode before power-down comprises: setting the working mode of the storage device to be the working mode after the power-on again indicated by the mode switching command; or setting the working mode of the storage device to be a working mode recorded in a controller or a nonvolatile memory in the storage device after the power-on again; or setting the working mode of the storage device to be the working mode obtained when the storage device is started; or setting the working mode of the storage device as a hidden mode by a Set Feature command before power-down in response to the storage device being Set as the hidden mode Set before power-down.
According to a second aspect of the present application, there is provided a storage controller according to the second aspect of the present application, for implementing one of the first to thirty-first methods for managing storage devices of the first aspect of the present application.
According to a third aspect of the present application there is provided a storage device according to the third aspect of the present application comprising a storage medium and a storage controller as described in the second aspect of the present application.
Drawings
For a clearer description of embodiments of the present application or of the solutions of the prior art, reference will be made below to the accompanying drawings, which are used in the description of embodiments or of the prior art, it being obvious that the drawings in the description below are only some embodiments described in the present application, from which other drawings can also be obtained for a person skilled in the art;
FIG. 1A illustrates a block diagram of a solid state storage device;
FIG. 1B illustrates a prior art mapping diagram of a logical address space;
FIG. 1C illustrates a schematic diagram of a host accessing a storage device;
FIG. 2A illustrates a flow chart of a method for managing storage devices provided by embodiments of the present application;
FIG. 2B illustrates storage capacity values set by a storage device according to an embodiment of the present application in different modes of operation;
FIG. 3A is a schematic diagram of a LBA space presented to a host by a hidden-mode storage device according to an embodiment of the present application;
FIG. 3B illustrates a mapping diagram between another hidden-mode host LBA space and device LBA space provided by an embodiment of the present application;
FIG. 3C is a diagram illustrating a mapping between a normal mode host LBA space and a device LBA space according to one embodiment of the present application;
FIG. 4A is a diagram illustrating mapping between a host LBA space and a device LBA space in yet another hidden mode provided by an embodiment of the present application;
FIG. 4B is a diagram illustrating a mapping between a host LBA space and a device LBA space in another general mode provided by embodiments of the present application; and
FIG. 4C illustrates a mapping diagram between host LBA space and device LBA space in yet another general mode provided by further embodiments of the present application.
Detailed Description
The following description of the embodiments of the present application, taken in conjunction with the accompanying drawings, clearly and completely describes the technical solutions of the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
According to embodiments of the present application, the storage device may have a plurality of operation modes, including at least a hidden mode and a normal mode. In the hidden mode, the storage device provides a portion, but not all, of its logical address space to the host, so that the host is aware of only a portion of the storage device's logical address space. And, if the host attempts to access a logical address space that is present in the storage device but not provided to the host, the storage device will reject such access requests by the host and report errors.
The normal mode is an operation mode opposite to the hidden mode, and the normal mode refers to an operation mode in which the hidden logical address space is visible to the host. Alternatively, in normal mode, the storage device provides the host with a logical address space that is the same as or smaller than the logical address space maintained inside the storage device. It will be appreciated that in some embodiments, other ranges of logical address space are maintained within the storage device that are not visible to the host, whether in normal or hidden mode.
The following embodiments are briefly described with respect to the relevant operation of a storage device or host in a hidden mode and normal mode scenario.
Fig. 2A illustrates a flow chart of a method 200 for managing a storage device according to an embodiment of the present application. As shown in fig. 2, at step S201, an operating mode of a storage device may be set in response to receiving a command triggering the storage device to adjust the operating mode. As one implementation, the aforementioned commands may be sent by the host to the storage device. Specifically, commands may be sent to the storage device through the host when the user finds that the hidden data is needed to perform some particular task or operation (e.g., the user finds that the host's operating system is malicious (e.g., virus)), or when the hidden data is not needed. After receiving the command, the storage device can adjust its working mode to a normal mode or a hidden mode according to the command.
At step S202, a value indicating the storage capacity of the storage device may also be set in response to setting the operation mode of the storage device. As an embodiment, the value of the storage capacity of the storage device in the hidden mode is different from the value of the storage capacity of the storage device in the normal mode. In general, the value of the storage capacity in the hidden mode is smaller than that in the normal mode. Therefore, the storage device can enable the storage capacity which can be accessed by the host in different working modes to be different through the setting of the working modes and the storage capacity, particularly in a hiding mode, the storage capacity value which can be informed to the host by the storage device is a part of the storage capacity value instead of the whole storage capacity value, so that part of the storage address space of the storage device is hidden to the host, further, the part of the data in the storage address space hidden to the host can not be accessed and modified by the host through an application program or an operating system and the like, and the host can only access the hidden data when the hidden data is needed.
Fig. 2B illustrates storage capacity values set by the storage device according to the embodiments of the present application in different operation modes.
As an example, the actual total storage capacity value of the storage device is 356GB, that is, the size of the logical address space managed by the storage device through the FTL table is 356GB, where in the hidden mode, the size of the storage address space that the storage device can hide to the host is 100GB. Referring to fig. 2B, if the storage device is set to the normal mode, the storage capacity of the storage device in the normal mode may be set to the capacity value a; if the storage device is set to the hidden mode, the storage capacity of the storage device in the hidden mode may be set to the capacity value B. The size of the capacity value a is 356GB, and the size of the capacity value B is 256GB, that is, the storage capacity of the storage device in the normal mode is generally larger than that in the hidden mode.
For simplicity and convenience, the storage capacity values set by the storage device in the normal mode are hereinafter all identified as capacity value a, and the storage capacity values set by the storage device in the hidden mode are hereinafter all identified as capacity value B.
According to the embodiment of the application, the command for adjusting the working mode received by the storage device may be various, for example, the command for adjusting the working mode received by the storage device may be a custom mode switching command or a Set Feature command defined by NVMe protocol.
In one embodiment, if the command for adjusting the operation mode is a mode switch command. Specifically, when the storage device receives the mode switching command, if the current working mode is the normal mode, the working mode of the storage device is switched from the normal mode to the hidden mode. And if the current working mode of the storage device is the hidden mode, switching the working mode of the storage device from the hidden mode to the normal mode. Meanwhile, the storage capacity of the storage device may be set to the capacity value a or the capacity value B according to the value of the parameter of the mode switching command indicated by the mode switching command.
The mode switching command is a custom command and is not a command defined by a protocol, but the format of the mode switching command conforms to the protocol (such as NVMe protocol). By way of example, the mode switch command includes a "command code" having a specified value with an optional "command parameter" command code to indicate that the current command is a mode switch command. The host specifies the content or parameter value of the mode switch command. By way of example, the mode switch command provided by the host to the storage device includes only a command code (without specifying a command parameter). The storage device recognizes that the received command is a mode switch command based on the command code, and changes the mode of the current storage device, for example, if the storage device is currently in a hidden mode, to a normal mode in response to receiving the mode switch command; and/or if the storage device is currently in the normal mode, changing to the hidden mode in response to receiving the mode switch command. In yet another example, a mode switch command provided by a host to a storage device includes a command code and a command parameter. The storage device recognizes that the received command is a mode switching command according to the command code, and further determines a mode to be entered by the storage device according to the command parameter. The switch from the hidden mode to the normal mode is indicated when the command parameter is, for example, 0, and the switch from the normal mode to the hidden mode is indicated when the command parameter is, for example, 1.
The content of the host defines the mode switching command to instruct the storage device to execute the working mode switching operation after receiving the mode switching command, or configures parameters of the mode switching command, for example, the host instructs the storage device to execute the working mode switching operation after receiving the mode switching command by setting a value of a command parameter in the mode switching command.
When the host defines the content of the mode switching command, the storage device switches the current working mode according to the mode switching command, and as an example, in response to receiving the mode switching command in the normal mode, the storage device switches from the normal mode to the hidden mode; or in response to receiving the mode switch command in the hidden mode, the storage device switches from the hidden mode to the normal mode. When the host configures the command parameter of the mode switching command, the storage device switches the operation mode according to the value of the command parameter, for example, the command parameter of the host configures the mode switching command to be configured according to the operation mode of the current storage device, for example, the operation mode of the current storage device is a hidden mode, and in order to control the storage device to switch to the normal mode, the command parameter is configured to be 0, and the storage device switches the operation mode to the normal mode according to the value of the command parameter; the current working mode of the storage device is a normal mode, and in order to control the storage device to switch to a hidden mode, the command parameter is configured to be 1, and the storage device switches the working mode to the hidden mode according to the command parameter value.
By way of example, the specific format of the host-defined mode switch command may also include a command code and two or more command parameters to implement further functions.
In one embodiment, the mode switch command instructs the storage device to: set to hidden mode, set to normal mode, and set to hidden LBA space size. Wherein the function set to the hidden mode and the function set to the normal mode are suitable for use during operation of the storage device, and the function set to the size of the hidden LBA space is suitable for use when the storage device is manufactured to provide the storage device with a specified size of the hidden space to a user. When the mode switch command indicates that the hidden LBA space size is set, the value of the hidden LBA space size is also described by a further command parameter.
Further, a command parameter of the mode switch command is used to indicate the data length to be transmitted by the current command, so as to meet the requirements of the host and the storage device. The host and/or storage device determines whether processing of the current command is complete by identifying the data length to be transmitted by the current command indicated in the command parameters. Since the mode switch command does not require data transfer between the host and the storage device, the command parameter is set to 0 in the mode switch command.
Similarly, a further command parameter of the mode switch command is used to indicate the length of metadata to be transmitted by the current command, which command parameter is also set to 0 in the mode switch command in accordance with embodiments of the present application.
When the mode switch command indicates that the hidden LBA space size function is set, it is also indicated by one or more command parameters, for example, whether the hidden LBA space is initialized, whether the hidden LBA space requires 4KB alignment, etc.
As another embodiment, the foregoing command may be a Set Feature command defined by NVMe protocol. The Set Feature command of the NVMe protocol can Set a variety of different "features" by a command parameter. For a specific storage device, some "features" are not supported, so that when it receives a Set Feature command for such features (functions), it is not necessary to perform processing, so that a Set Feature command indicating such features (functions) can be utilized as a mode switching command, so that it is not necessary to add a new command.
By way of example, the "LBA Range Type" is one of the features that a Set feature command may indicate, and some current storage devices do not support. Thus, a Set Feature command with an "LBA Range Type" command parameter is used as a mode switch command according to an embodiment of the present application. For this purpose, in the Set Feature command, one or more command parameters are carried in addition to the "LBA Range Type" command parameter, so that the mode switch command instructs the storage device to: set to hidden mode, set to normal mode, and set to hidden LBA space size. And when the mode switch command indicates that the hidden LBA space size function is set, also indicates, for example, by one or more command parameters, whether the hidden LBA space is to be initialized, whether the hidden LBA space requires 4KB alignment, and so forth. Specifically, the "Data Structure Entry" field of the Set Feature command with the "LBA Range Type" command parameter is utilized to describe one or more parameters for the mode switch command.
As another example, the Set Feature command indicates two logical address intervals LBA0 through LAB100 and LBA200 through LBA 300. According to the embodiment of the application, on the basis that the function of the Set Feature command for indicating one or more sections of logical address intervals is defined by using the existing NVMe protocol, one or more sections of logical address intervals indicated by the Set Feature command are Set as logical address intervals accessible to a host or as logical address intervals inaccessible to the host, so that part of logical address spaces in the storage device are hidden or displayed for the host. Further, the operation mode of the storage device and the value indicating the storage capacity of the storage device may be Set according to one or more sections of the logical address section indicated by the Set Feature command. By way of example, the one or more logical address intervals may be Set by a user via a Set Feature command. It can be appreciated that, in some embodiments, the user may also directly Set the Set Feature command defined by the NVMe protocol, so that the Set Feature command instructs the storage device to perform mode switching, that is, after the storage device receives the Set Feature command, the storage device enters the hidden mode or exits the hidden mode according to the switching mode indicated by the Set Feature command.
For ease of understanding, the solution provided in the embodiments of the present application introduces two sets of concepts, namely, a logical address space and a logical address space visible to the host, and a host logical address space and a device logical address space. Wherein the logical address space (LBA space) is a storage address space provided by the storage device, and the host accesses the storage device using the logical address as an element of the logical address space. Since the storage device can switch between normal mode and hidden mode, in hidden mode the storage device hides portions of the logical address space from the host. For ease of understanding and description, the embodiments of the present application introduce a set of concepts of a logical address space visible to a host (LBA space visible to the host) and a hidden logical address space (hidden LBA space) on the basis of the logical address space, where the logical address space visible to the host is a storage address space in the logical address space that is reported to the host by a storage device and is accessed by the host according to a block device, and the hidden LBA space is a storage address space in the logical address space that is not reported to the host by the storage device in the hidden mode and is not accessible by the host according to the block device.
The device logical address space is a storage address space provided by the storage device, the host accesses the storage device by using elements of the host logical address space, and the storage device converts the elements of the host logical address space in the IO command into the elements of the device logical address space for processing the IO command provided by the host. And the host logical address space is the memory address space that the memory device reports to the host and that is accessed by the host in terms of block devices. Thus, the aforementioned hidden space may be understood as the aforementioned hidden logical address space or a device logical address space having no mapping relationship of a portion with the host logical address space.
The process of setting the storage capacity of the storage device is further described below with reference to fig. 3A to 3C.
FIG. 3A illustrates a schematic diagram of LBA space presented to a host by a hidden-mode storage device provided by an embodiment of the present application. As shown in fig. 3A, as one implementation, the storage capacity of the storage device in either the hidden mode or the normal mode may be set according to a logical address space visible to the host. By way of example, in fig. 3A, the LBA space includes a host-visible LBA space and a hidden LBA space, where the host-visible LBA space is part or all of the storage address space of the LBA space.
By way of example, the logical address space visible to the host provided by embodiments of the present application is a dynamically variable memory address space. When the storage device is in normal mode, the hidden LBA space is visible or accessible to applications and/or operating systems in the host, and the host visible logical address space is the full logical address space, which is the same size as the logical address space. When the storage device is in the hidden mode, the hidden LBA space is a "LBA space" that is invisible or inaccessible to applications and/or operating systems in the host, and the logical address space visible to the host is a portion of the logical address space that is smaller in size than the logical address space.
The storage device can be triggered to switch the working mode according to a mode switching command or a Set Feature command. As an implementation, in response to a command triggering the storage device to adjust the operation mode being a mode switch command, the operation mode of the storage device may be set to a hidden mode and the capacity value B may be set according to a logical address space visible to the host, or the operation mode of the storage device may be set to a normal mode and the capacity value a may be set according to a logical address space visible to the host. If the storage device is in the hidden mode, the size of the logical address space visible to the host is smaller than the size of the logical address space. If the storage device is in normal mode, the size of the logical address space visible to the host is equal to the size of the logical address space.
As another embodiment, in response to a command triggering the storage device to adjust the operation mode being a Set Feature command, the operation mode of the storage device and a value indicating the storage capacity of the storage device may be Set according to one or more sections of logical address intervals indicated by the Set Feature command. As an example, the storage capacity of the storage device may be Set to the capacity value a or the capacity B according to one or more sections of logical address sections described in the Set Feature command.
As an implementation manner, if one or more sections of the logical address section indicated by the Set Feature command is described as a logical address space visible to the host, the operation mode of the storage device is Set to a normal mode, and the storage capacity of the storage device is Set to the capacity value a according to the one or more sections of the logical address section. If one or more sections of the logical address intervals indicated by the Set Feature command are described as a logical address space hidden from the host, the working mode of the storage device may be Set to be a hidden mode, and the storage capacity of the storage device may be Set to be a capacity value B according to the one or more sections of the logical address intervals.
It will be appreciated that in some embodiments, when a multi-segment logical address region is described as a logical address space that is hidden from the host, all or a portion of the multi-segment logical address may be re-described as a logical address space that is visible to the host after the storage device is switched to normal mode. It should be noted that, since the capacity value of the storage device is obtained by the host in different operation modes of the storage device, for example, the capacity value of the storage device obtained by the host is 100GB, the host may consider that the storage space accessible by the host is 0-100GB, and the host may access the storage space of 0-100 GB. When a host writes data in 0-100GB of storage space, the host will record the logical address in the file system to which the data was written. When the working mode of the storage device is switched from the hidden mode to the normal mode, the capacity value provided by the storage device to the host is changed, if the logical address of any data stored in the original hidden mode is changed, the host accesses the data according to the logical address of the data recorded by the file system, and at the moment, the data cannot be found according to the logical address of the data recorded by the file system. Therefore, in order to ensure that when the capacity value provided by the storage device to the host changes, the host still can find the corresponding data according to the logical address of the data recorded by the file system, it is necessary to ensure that the logical address of any data stored in the original hidden mode cannot change. In order to ensure that the logical address of any data stored in the original hidden mode cannot be changed, a logical address space hidden by the host needs to be set to be located behind a logical address space visible by the host.
By way of example, the following relationship may exist between one or more segments of logical address interval size and logical address space size indicated by the Set Feature command: the size of one or more sections of logical address intervals indicated by the Set Feature command is smaller than or equal to the logical address space. As another example, in response to the operating mode of the storage device being Set to the hidden mode, the size of the logical address space visible to the host is equal to the size of a logical address space in the logical address space other than the one or more sections of logical address intervals indicated by the Set Feature command; in response to the operating mode of the storage device being Set to the normal mode, the size of the logical address space visible to the host is equal to the size of one or more segments of logical address intervals indicated by the Set Feature command.
FIG. 3B illustrates a mapping diagram between a hidden-mode host LBA space and a device LBA space provided by an embodiment of the present application. Wherein the host logical address space is a storage address space known to and accessible by the host and the device logical address space is a storage address space maintained and managed by the storage device. In order to realize that the host accesses the storage device through the elements of the host logical address space, a certain mapping relationship exists between the host logical address space and the device logical address space, and the mapping relationship is not always unchanged, but dynamically changed according to different working modes of the storage device. Wherein in fig. 3B, the device LBA space may include A1, A2, and A3, where there is a mapping relationship between the host logical address space 1 and A2, and A1 and A3 do not have corresponding host logical address spaces.
As shown in fig. 3B, when the storage device is in the hidden mode, a relationship between the host logical address space and the device logical address space may be set, where a mapping relationship is stored between the host logical address space and a portion of the device logical address space (e.g., a mapping relationship exists between the host logical address space 1 and A2), and a portion of the device logical address space does not have a corresponding host logical address space (e.g., A1 and A3 do not have a corresponding host logical address). Since the host accesses the storage device through the host logical address in the host logical address space, the portion of the device logical address space (A1 and A3) that does not have a corresponding host logical address is inaccessible to the host. For example, the host operating system, the application program or the disk manager cannot access the part of the device logic address space, so that the storage device can hide part of the storage address space from the host, and the storage device is in a hidden mode.
By way of example, in response to setting the operating mode of the storage device, the capacity value a or the capacity value B may be set based on the host logical address space. Further, in response to setting the operating mode of the storage device to a hidden mode, a capacity value B may be set based on the host logical address space a; or in response to setting the operating mode of the storage device to normal mode, the capacity value a may be set based on the host logical address space B. The host logic address space B comprises a host logic address space A and an added host logic address space, and the added host logic address space is invisible to a host in a hidden mode. It will be appreciated that host logical address space a and host logical address space B herein are storage address spaces known to and accessible by the host in either hidden mode or normal mode, respectively.
By way of example, the operating mode of the storage device may be Set by a mode switch command or a Set Feature command. As one implementation, the capacity value a or the capacity value B may be set based on the host logical address space in response to a command triggering the storage device to adjust the operating mode being a mode switch command. Wherein the size of the host logical address space in hidden mode is smaller than the size of the device logical address space. While the size of the host logical address space in normal mode is equal to the size of the device logical address space.
As another embodiment, in response to a command triggering the storage device to adjust the operation mode being a Set Feature command, if one or more sections of the logical address intervals indicated by the Set Feature command are described as the host logical address space, the operation mode of the storage device may be Set to a normal mode, and the storage capacity of the storage device in the normal mode may be Set to a capacity value a according to the one or more sections of the logical address intervals. If one or more sections of the logical address intervals indicated by the Set Feature command are part of the device logical address space and the part of the device logical address space does not have a corresponding host logical address space, the storage capacity of the storage device in the hidden mode can be Set as the capacity value B according to the host logical address space. For example, in response to a command triggering a storage device to adjust an operating mode being a Set Feature command, and the operating mode being Set to a normal mode, the size of one or more segments of logical address intervals indicated by the Set Feature command is less than or equal to the device logical address space. As another example, in response to the operating mode being Set to the hidden mode, the size of the host logical address space is equal to the size of a logical address space of the device logical address space other than the one or more sections of logical address intervals indicated by the Set Feature command; in response to the operating mode being Set to the normal mode, the size of the host logical address space is equal to the size of one or more segments of logical address intervals indicated by the Set Feature command.
FIG. 3C illustrates a mapping diagram between normal mode host LBA space and device LBA space provided by embodiments of the present application.
In the normal mode in fig. 3C (specifically, the storage device may be Set to the normal mode by a mode switch command or a Set Feature command), as can be seen from fig. 3B, in the hidden mode, the device LBA spaces A1 and A3 cannot be accessed by the host because they do not have corresponding host logical address spaces. As can be seen from the above, compared with the hidden mode, the host may access not only all the device LBA spaces in the hidden mode but also some or all of the device LBA spaces that cannot be accessed in the hidden mode, i.e., in the normal mode, the host may access not only the LBA space A2 but also some or all of the device LBA space A1 and/or the device LBA space A3. The following description will take an example in which the host can access all of the device LBA space A1 and the device LBA space A3 in the normal mode.
In order to enable access to device LBA space A1 and device LBA space A3, in FIG. 3C, in normal mode, the host LBA space includes host LBA space 1 and host LBA space 2. Wherein, there is a mapping relationship between host LBA space 2 and device LBA spaces A1 and A3. It will be appreciated that in hidden mode, the partial device LBA spaces A1, A3 do not have corresponding host LBA spaces (as shown in FIG. 3B). In the normal mode, the partial device LBA spaces A1 and A3 have a mapping relationship with the host LBA space 2. At this time, the host LBA space 2 may be understood as a host LBA space newly added by converting the hidden mode into the normal mode, and the host realizes access to the device LBA space A1 and the device LBA space A3 through the newly added host LBA space 2. For example, when the newly added host logical address space 2 is located behind the host logical address space 1, so as to ensure that the capacity value provided by the storage device to the host changes, the host can still find the corresponding data according to the logical address of the data recorded by the existing file system.
Also by way of example, the newly added host logical address space 2 in normal mode is mapped to any location in the device logical address space (e.g., A1, A3) that is not visible to the host. Thus, after the storage device is switched from the hidden mode to the normal mode, in the normal mode, each address of the host LBA space in the original hidden mode is unchanged, and the added new host LBA space can be mapped to any position of the device LBA space, so that the position limitation of the hidden space in the device LBA space is cancelled. For example, the address range of the host LBA space in the original hidden mode is 0-256GB, and after the hidden mode is switched to the normal mode, the address range of the host LBA space is still 0-256GB. In addition, before and after the mode switching, the device LBA space managed by the storage device is unchanged, so that the change of the host LBA space is isolated from the processing of the control part of the storage device, and the extra complexity is avoided.
The process of setting the device LBA space by the Set Feature command is further described below with reference to fig. 4A to 4C.
FIG. 4A illustrates a mapping diagram between a host LBA space and a device LBA space in yet another hidden mode provided by an embodiment of the present application.
As one implementation, the host may describe that some or all of the device LBA space may be accessed by the host through one or more segments of the logical address intervals indicated by the Set Feature command. As an example, as shown in fig. 4A, the device LBA space includes three parts, that is, the device LBA space S1, the device LBA space S2, and the device LBA space S3, respectively, and in the hidden mode, the host indicates that the device LBA space S1 can be accessed by it through the Set Feature command. In order to enable the device LBA space S1 to be accessed by the host, a mapping relationship between the device LBA space S1 and the host LBA space 1 is set in the storage device, and the host accesses the device LBA space S1 through the host LBA space 1. In addition, the capacity value of the storage device may also be Set according to the segment of the logical address section indicated by the Set Feature command. In FIG. 4A, since device LBA spaces S2 and S3 do not have corresponding host LBA spaces, neither the host operating system, the application, nor the disk manager, etc., has access to device LBA spaces S2 and S3.
FIG. 4B is a diagram illustrating a mapping between a host LBA space and a device LBA space in another general mode provided by embodiments of the present application.
By way of example, as shown in FIG. 4B, in normal mode, the host indicates that device LBA spaces S1 and S2 can be accessed by the host via a Set Feature command, and in FIG. 4B, the host can access device LBA space S2, as compared to hidden mode shown in FIG. 4A. Further, in order to enable the host to access the device LBA space S2, in addition to setting a mapping relationship between the device LBA space S1 and the host LBA space 1 in the storage device, a mapping relationship between the device LBA space S2 and the host LBA space 2 is also set, and the host may access the device LBA space S2 through the newly added host LBA space 2. In addition, since the Set Feature command does not indicate that the device LBA space S3 is accessible to the host, the host LBA space corresponding to the device LBA space S3 is not Set in the storage device, and the host operating system, the application program, the disk manager, or the like cannot access S3.
FIG. 4C illustrates a mapping diagram between host LBA space and device LBA space in yet another general mode provided by further embodiments of the present application.
As yet another implementation, when a Set Feature command is utilized to regulate a storage device to switch from a hidden mode to a normal mode, all or a portion of the device LBA space may be Set for host access. By way of example, as shown in FIG. 4C, the device LBA space provided by the storage device includes four portions, S1, S2, S3, and S4, respectively. When the host instructs the storage device to switch to the normal mode through the Set Feature command, the host can access the device LBA spaces S2 and S4 through the Set Feature command, as compared with the hidden mode shown in fig. 4A, in fig. 4C, the host can access the device LBA spaces S1, S2, and S4. In order to enable the host to access the device LBA spaces S2 and S4, in addition to setting a mapping relationship between the device LBA space S1 and the host LBA space 1 in the storage device, a mapping relationship between the device LBA spaces S2 and S4 and the host LBA space 2 is also set, and the host may access the device LBA spaces S2 and S4 through the newly added host LBA space 2. At this time, the capacity value of the storage device may be Set according to S1, S2, and S4 indicated by the Set Feature command. In addition, since the Set Feature command does not indicate that the device LBA space S3 is accessible to the host, S3 does not have a corresponding host LBA space, and the host operating system, application program, disk manager, or the like cannot access S3. Thus, even in the normal mode, a part of the hidden space can be reserved from being accessed by the host. In the scheme provided by the embodiment of the application, when the host indicates that the working mode of the storage device is switched to the normal mode through the Set Feature command, the Set Feature command may indicate that a part of device LBA space which cannot be accessed by the host in the hidden mode is open to the host, and the storage device may still have a part of device LBA space which cannot be accessed in the normal mode.
By way of example, further, the host may send a protocol-defined Identify command to the storage device, which may feed back the capacity value a or the capacity value B to the host after receiving the Identify command. As an implementation manner, if the current working mode of the storage device is a normal mode, feeding back the capacity value a to the host; and if the current working mode of the storage equipment is a hidden mode, feeding back the capacity value B to the host. By way of example, the storage device alters the LBA space size it provides to the host by altering the value of a parameter nsze that indicates the altered host LBA space size.
The Identify command may indicate a variety of command parameters. As an example, in the case where the storage device does not support "NameSpace", the storage capacity of the storage device is acquired with an Identify command indicating the "NameSpace" parameter, or further information related to the hidden LBA space is further acquired. Therefore, the processing of the Identify command with other command parameters by the storage device is not changed, so that the storage device meets the requirement of being compatible with the NVMe protocol. When the storage device according to the embodiment of the present application processes the Identify command indicating the "NameSpace" parameter, information hiding the logical address space is added to the result of the Identify command. Alternatively, since the storage device does not support "NameSpace", the NSID of "NameSpace" is set to, for example, NS0 in the Identify command indicating the "NameSpace" parameter.
Also by way of example, in the case where a Set Feature command indicating "LBA Range Type" is used as the mode switch command, a Get Feature command indicating "LBA Range Type" may be used accordingly to acquire the current operation mode (in normal mode or hidden mode) of the storage device, and optionally the size of the hidden LBA space. A Set Feature command indicating "LBA Range Type" is also registered to be associated with the mode switch command.
According to the embodiment of the application, the mode switching command is indicated by a custom command or by an existing command in a standard, so that a new function or a function different from the standard is provided for the command. While the storage devices to which the hosts are coupled may come from different vendors or different batches, and may or may not support mode switch commands. Support needs to be provided to assist the host in identifying whether the storage device supports mode switch commands. Also as an example, the command sent to the storage device by the corresponding host, for example, an NVMe command or a custom command, may reflect the effect generated by each command through the Log page. "Log Page" is a data structure defined by NVMe protocol, which reflects the effect generated after each command is processed by the storage device, so that the difference of the effect of processing the command between the storage devices is reflected by the data corresponding to each command in "Log Page". For example, one storage device may change the storage capacity size after processing a Set Feature command indicating "LBA Range Type" while another storage device may not; for another example, one storage device may change the storage capacity after processing the custom mode switch command, while another storage device does not support the custom mode switch command. Thus, the effect that a command will produce can be obtained through the Log page to identify whether one or more storage devices connected to the host support hiding from part of the logical address space. Specifically, the host sets an identifier for the mode switching command in the Log Page to indicate an effect generated by the mode switching command, and returns a relevant identifier when a Get Log Page command (a Log Page of a corresponding mode switching command is acquired) in the NVMe protocol is received. For example, in the data of the Log Page corresponding to the mode switch command, the CSUPP/LBCC/NCC/NIC/CCC/CSE field specified by the NVMe protocol is set to 1.
In an alternative embodiment, in the process of sending an IO command to the storage device in the hidden mode, if the address of the storage space after accessing the designated location in the IO command exceeds the storage address space range of the storage device, the storage device driver of the host refuses to send the IO command to the storage device, so as to avoid error occurrence, avoid meaningless command sending and processing, and effectively save system resources. Alternatively or in addition, if for some reason (e.g., a virus infection) the host issues an IO command to access the hidden LBA space to the storage device in hidden mode, the storage device also refuses to process such IO command and reports an error to the host, e.g., an access logical address out of range error.
Still optionally, the storage device refuses to process the erase command and/or the format command to the hidden LBA space to protect the data of the hidden LBA space. For example, in hidden mode, the storage device refuses to process erase commands and/or format commands to the hidden LBA space; in the normal mode, the storage device may execute the erase command and/or the format command to the hidden LBA space after verifying the authority of the host, and delete the data of the hidden LBA space in response. In yet another example, after the storage device is manufactured and the required data is written to the hidden LBA space, the erase command and/or format command from the host to the hidden LBA space is never accepted to ensure that the data of the hidden LBA space is continuously available. It will be appreciated that, for wear leveling, data reliability, etc., the control unit may implement garbage collection on the physical address corresponding to the hidden LBA space within the storage device, but ensure that the data of the hidden LBA space is valid.
As an example, further, the factory working mode of the storage device may also be set to the hidden mode. As one implementation, the storage device may be placed in a hidden mode during the storage device manufacturing phase and delivered to a customer who installs the storage device on a host. Optionally, in the hidden mode, a logical address space visible to the host and a hidden logical address space are also provided. Further, as an example, data, antivirus programs, etc. required for the host to restore factory settings may also be stored in the hidden logical address space.
Further, for example, if the storage device is powered up after being powered down, the working mode of the storage device may be switched to the hidden mode or kept in the working mode before being powered down. As an embodiment, the operation mode of the storage device may be set to the operation mode after the power-up again indicated by the mode switching command. For example, the operation mode after the next power-up may be indicated by a mode switching command. When the storage device is powered up again, the operating mode of the storage device may be set directly according to the hidden mode or the normal mode indicated by the mode switch naming.
As another embodiment, the mode of operation after powering up again may also be recorded in a controller (controller) or a non-volatile memory (NVM). After the storage device has been last time again, the operating mode of the storage device is set according to the recorded hidden mode or normal mode.
As a further embodiment, it is also possible to directly acquire the operation mode to be used when the storage device is started up, and set the operation mode of the storage device according to the acquired hidden mode or normal mode.
Still alternatively, the operating mode (hidden mode or normal mode) of the storage device is not changed by powering down/up the storage device. Or adopting a processing mode of hiding mode priority, and after restarting the storage device in the hiding mode, still being in the hiding mode; after the storage device in the normal mode is restarted, the storage device enters a hidden mode so as to improve the safety of hiding the LBA space. After the storage device is powered down/powered up or restarted, the information related to the hidden LBA space size, log Page and the like is kept unchanged.
The present application also provides a memory controller for implementing the related scheme of fig. 2A. In addition, the application also provides a storage device which comprises the storage controller.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the application. It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the spirit or scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.

Claims (10)

1. A method for managing a storage device, comprising:
setting the working mode of the storage device in response to receiving a command for triggering the storage device to adjust the working mode, wherein the working mode comprises a common mode and a hidden mode;
in response to setting an operational mode of the storage device, further setting a value indicative of a storage capacity of the storage device; wherein the value of the storage capacity of the storage device indicated by the hidden mode is different from the normal mode.
2. The method of claim 1, wherein setting a value for indicating a storage capacity of the storage device comprises:
in response to setting the storage device to a normal mode, setting a storage capacity of the storage device in the normal mode to a first capacity value; or (b)
In response to setting the storage device to a hidden mode, a storage capacity of the storage device in the hidden mode is set to a second capacity value, wherein the first capacity value is different from the second capacity value.
3. The method of claim 1, wherein setting the storage device to a normal mode or a hidden mode comprises:
responding to the command as a mode switching command, and switching the working mode of the storage device from the common mode to the hidden mode if the current working mode of the storage device is the common mode;
and if the current working mode of the storage equipment is the hiding mode, switching the working mode of the storage equipment from the hiding mode to the common mode.
4. The method of claim 1, wherein the step of determining the position of the substrate comprises,
and setting the working mode of the storage device and a value indicating the storage capacity of the storage device according to one or more sections of logical address intervals indicated by the Set Feature command in response to the Set Feature command defined by the NVMe protocol.
5. The method of any of claims 1 to 4, wherein a logical address space is a storage address space provided by a storage device, a host accessing the storage device using a logical address that is an element of the logical address space, wherein setting a value for indicating a storage capacity of the storage device comprises:
and setting the first capacity value or the second capacity value according to a logical address space visible to a host in response to setting the working mode of the storage device, wherein the logical address space visible to the host is a storage address space reported to the host by the storage device and accessed by the host according to a block device.
6. The method of any of claims 1 to 4, wherein the device logical address space is a storage address space provided by a storage device to which a host accesses using elements of the host logical address space for processing IO commands provided by the host, the storage device converting elements of the host logical address space in the IO commands to elements of the device logical address space, wherein setting the value for indicating the storage capacity of the storage device further comprises:
And setting the first capacity value or the second capacity value based on a host logical address space in response to setting an operating mode of the storage device, wherein the host logical address space is a storage address space that the storage device reports to a host and is accessed by the host in terms of block devices.
7. The method of claim 6, wherein setting the first capacity value or the second capacity value based on a host logical address space comprises:
setting the second capacity value based on a first host logical address space in response to setting an operational mode of the storage device to a hidden mode; or (b)
In response to setting an operational mode of the storage device to a normal mode, a first capacity value is set based on a second host logical address space, wherein the second host logical address space includes the first host logical address space and a newly added host logical address space, and in the hidden mode, the newly added host logical address space is invisible to a host.
8. The method of claim 7, wherein the newly added host logical address space is located after the first host logical address space in the second host logical address space.
9. The method according to claim 5 or 6, characterized in that the method further comprises:
in response to receiving an IO command, acquiring a logical address accessed by the IO command; and
and responding to that the logic address accessed by the IO command exceeds the logic address space visible to the host or the host logic address accessed by the IO command exceeds the host logic address space, and returning error reporting information.
10. A storage controller for implementing the method for managing storage devices of any one of claims 1 to 9.
CN202210457591.XA 2022-01-18 2022-04-27 Method for managing storage device and storage controller Pending CN116501239A (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN2022100565444 2022-01-18
CN202210056544 2022-01-18
CN202210333838 2022-03-30
CN2022103338387 2022-03-30

Publications (1)

Publication Number Publication Date
CN116501239A true CN116501239A (en) 2023-07-28

Family

ID=87323615

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210457591.XA Pending CN116501239A (en) 2022-01-18 2022-04-27 Method for managing storage device and storage controller

Country Status (1)

Country Link
CN (1) CN116501239A (en)

Similar Documents

Publication Publication Date Title
JP6484763B2 (en) Data processing method and apparatus, and flash device
CN106909313B (en) Memory system and control method
US8412909B2 (en) Defining and changing spare space and user space in a storage apparatus
US8903956B2 (en) On-demand virtual storage capacity
US11467739B2 (en) Storage device and operation method thereof
TW201142591A (en) Semiconductor memory device
US20230342032A1 (en) Dynamic processing of storage command based on internal operations of storage system
US11775183B2 (en) Storage device and operation method thereof
WO2024098635A1 (en) Raid management method and system, and electronic device and non-volatile readable storage medium
CN112286838A (en) Storage device configurable mapping granularity system
US20240053917A1 (en) Storage device, operation method of storage device, and storage system using the same
WO2024078012A1 (en) Solid-state drive configuration method, garbage collection method and related device
KR102425470B1 (en) Data storage device and operating method thereof
CN116501239A (en) Method for managing storage device and storage controller
US11256435B2 (en) Method and apparatus for performing data-accessing management in a storage server
CN116501663A (en) Method for accessing hidden space and related product
KR20210142863A (en) Apparatus and method for increasing operation efficiency in a memory system
CN117311591A (en) Method for accessing storage device and related product
CN116466871A (en) Method for accessing storage device and related product
JP7490714B2 (en) MEMORY SYSTEM AND CONTROL METHOD - Patent application
CN110659216A (en) NID allocation method and storage device thereof
US11740838B2 (en) Array-based copy utilizing one or more unique data blocks
US20230315316A1 (en) Reading a master boot record for a namespace after reformatting the namespace
CN117311594A (en) Method for managing NVM chip and related product
TWI741357B (en) Computing systems for memory operation and methods for operating the same

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination