CN111240601B - Method, device, equipment and storage medium for determining superblock of partitioned space - Google Patents

Method, device, equipment and storage medium for determining superblock of partitioned space Download PDF

Info

Publication number
CN111240601B
CN111240601B CN202010059008.0A CN202010059008A CN111240601B CN 111240601 B CN111240601 B CN 111240601B CN 202010059008 A CN202010059008 A CN 202010059008A CN 111240601 B CN111240601 B CN 111240601B
Authority
CN
China
Prior art keywords
partition
logic
host
logical
request
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.)
Active
Application number
CN202010059008.0A
Other languages
Chinese (zh)
Other versions
CN111240601A (en
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010059008.0A priority Critical patent/CN111240601B/en
Publication of CN111240601A publication Critical patent/CN111240601A/en
Application granted granted Critical
Publication of CN111240601B publication Critical patent/CN111240601B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • 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
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • 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/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method for determining a superblock of a partitioned space, which comprises the following steps: determining a first logic partition corresponding to the write request from a host partition space of the host according to the logic address carried in the write request; and if the mapping information corresponding to the first logical partition does not exist, allocating a corresponding super block for the first logical partition, and storing the mapping relation between the first logical partition and the super block so as to respond to the write request according to the allocated super block. Therefore, according to the scheme, the corresponding super block does not need to be allocated to each logic partition of the host partition space in advance, and the corresponding super block only needs to be allocated to the logic partition corresponding to the write request after the write request is received, so that all the host partition spaces can be ensured to have the corresponding super blocks, and the super blocks are not wasted under the condition that the host partition spaces are not fully written. The invention also discloses a device, equipment and a storage medium for determining the superblock of the partitioned space, and the technical effects can be realized.

Description

Partitioned space super block determining method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data storage technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for determining a superblock of a partitioned space.
Background
SSD (Solid State Drive) internal firmware organizes and uses super blocks (superblocks, a unit of data blocks within an SSD disk that organizes data) according to the relevant properties of nand. ZNS (zoned namespace) is a new characteristic of NVMe protocol based on a logical zone (logical partition) sized management space, a unit space under ZNS is a logical zone, generally, a super block sized space is defined as a logical zone, and a zone size corresponding to a HOST space HOST zone is defined as n logical zones, that is: the HOST zone consists of n different logical zones. Before writing a certain logic zone, a mapping relation between the logic zone and a super block needs to be established in advance, and selecting the super block is a policy mechanism in the firmware. When the host zone is equal to one logic zone, the management is relatively simple, and the one-to-one correspondence relationship among the host zone, the logic zone and the super block is established; however, when the host zone is n logical zones, if the logical zone and the super block are not used due to the one-to-one correspondence relationship established in advance, the super block is wasted.
Disclosure of Invention
The invention aims to provide a method, a device and equipment for determining superblocks of partition spaces and a computer readable storage medium, so as to ensure that all host partition spaces have corresponding superblocks and avoid wasting the superblocks under the condition that the host partition spaces are not fully written.
In order to achieve the above object, the present invention provides a method for determining a superblock in a partitioned space, including:
if a write request of a host is detected, determining a first logic partition corresponding to the write request from a host partition space of the host according to a logic address carried in the write request;
judging whether mapping information corresponding to the first logic partition exists or not;
and if not, allocating a corresponding super block for the first logic partition, and storing the mapping relation between the first logic partition and the super block so as to respond to the write request according to the allocated super block.
Optionally, the scheme further includes:
receiving a read request sent by a host;
determining a second logic partition corresponding to the read request from the host partition space according to a logic address carried by the read request;
searching partition information corresponding to the second logic partition; the partition information comprises a mapping relation between a second logical partition and a super block, the data of the super block is written into a logical address, and the storage state of the second logical partition;
judging whether the read request is a valid request or not by using the partition information;
and if so, responding to the read request.
Optionally, the determining, by using the partition information, whether the read request is a valid request includes:
judging whether the storage state of the second logic partition is an Empty state or not;
if so, judging the read request to be an invalid request; if not, judging whether the logical address carried by the read request is not greater than the written logical address of the data;
if the data is not larger than the written logic address, judging the read request to be a valid request; and if the data is larger than the written logic address, judging the read request to be an invalid request.
Optionally, the determining, according to the logical address carried in the write request, the first logical partition corresponding to the write request from the host partition space of the host includes:
determining a logical address range for each logical partition in the host partition space;
and detecting a first logic address range in which the logic address of the write request falls, and taking a logic partition corresponding to the first logic address range as a first logic partition.
Correspondingly, the determining, according to the logical address carried by the read request, a second logical partition corresponding to the read request from the host partition space includes:
determining a logical address range for each logical partition in the host partition space;
and detecting a second logic address range in which the logic address of the read request falls, and taking a logic partition corresponding to the second logic address range as a second logic partition.
Optionally, the present solution further includes:
if the storage state of the host partition space is detected to be a Full state, judging whether the logic partitions in the host partition space are all allocated with corresponding super blocks;
if not, setting the logic partition of the distributed super block into a Full state, and setting the logic partition of the unallocated super block into an Empty state;
if yes, all the logical partitions are set to the Full state.
To achieve the above object, the present invention further provides a partition-space super-block determining apparatus, including:
the first determining module is used for determining a first logic partition corresponding to a write request from a host partition space of a host according to a logic address carried in the write request when the write request of the host is detected;
the first judging module is used for judging whether mapping information corresponding to the first logic partition exists or not;
and the allocation module is used for allocating a corresponding super block to the first logic partition when mapping information corresponding to the first logic partition does not exist, and storing the mapping relation between the first logic partition and the super block so as to respond to the write request according to the allocated super block.
Optionally, the scheme further includes:
the receiving module is used for receiving a reading request sent by a host;
a second determining module, configured to determine, according to a logical address carried by the read request, a second logical partition corresponding to the read request from the host partition space;
the searching module is used for searching partition information corresponding to the second logic partition; the partition information comprises a mapping relation between a second logical partition and a super block, the data of the super block is written into a logical address, and the storage state of the second logical partition;
the second judgment module is used for judging whether the read request is an effective request or not by utilizing the partition information;
and the execution module is used for responding to the read request when the read request is judged to be an effective request by utilizing the partition information.
Optionally, the present solution further includes:
a third determining module, configured to determine whether all logical partitions in the host partition space have been allocated with corresponding super blocks when it is detected that the storage state of the host partition space is a Full state;
the first setting module is used for setting the logic partition which is allocated with the super block into a Full state and setting the logic partition which is not allocated with the super block into an Empty state when the logic partitions in the host partition space are all allocated with the corresponding super blocks;
and the second setting module is used for setting all the logical partitions to Full states when the logical partitions in the host partition space are not distributed with the corresponding super blocks.
To achieve the above object, the present invention further provides a superblock determination device for partitioned spaces, including:
a memory for storing a computer program;
a processor for implementing the steps of the partition space superblock determination method as described above when executing said computer program.
To achieve the above object, the present invention further provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the partition space superblock determination method as described above.
According to the above scheme, the method for determining a superblock of a partitioned space provided by the embodiment of the present invention includes: if a write request of a host is detected, determining a first logic partition corresponding to the write request from a host partition space of the host according to a logic address carried in the write request; judging whether mapping information corresponding to the first logic partition exists or not; and if not, allocating a corresponding super block for the first logic partition, and storing the mapping relation between the first logic partition and the super block so as to respond to the write request according to the allocated super block.
It can be seen that, in the present solution, it is not necessary to allocate a corresponding super block to each logical partition of the host partition space in advance, and it is only necessary to allocate a corresponding super block to the logical partition corresponding to the write request after receiving the write request, so that it can be ensured that all host partition spaces have corresponding super blocks, and the super blocks are not wasted under the condition that the host partition spaces are not fully written.
The invention also discloses a device and equipment for determining the superblock of the partitioned space and a computer readable storage medium, and the technical effects can be realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for determining a superblock of a partitioned space according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a host partition space and a logical partition according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a partition-space super block determining apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a superblock determination device for partition space according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
The embodiment of the invention discloses a method, a device and equipment for determining super blocks of partition spaces and a computer readable storage medium, which are used for ensuring that all host partition spaces have corresponding super blocks and avoiding wasting the super blocks under the condition that the host partition spaces are not fully written.
Referring to fig. 1, a schematic flow chart of a method for determining a superblock of a partitioned space according to an embodiment of the present invention; specifically, the method may comprise:
s101, if a write request of a host is detected, determining a first logic partition corresponding to the write request from a host partition space of the host according to a logic address carried in the write request;
it is understood that a host partition space (host zone) corresponding to a host may correspond to n logical partitions (logical zones), each logical zone corresponding to a unique super block; after a user sets the size of a Host partition space Host zone, the number of logical zones can be determined according to the size of the Host zone, the larger the Host zone is, the more correspondingly allocated logical zones are, in the existing scheme, each logical zone has a corresponding super block, if a one-to-one correspondence relationship between a logical zone and a super block is established in advance and is not used, super block resources are wasted, and after a Host partition space is allocated to the user, if the Host partition space is not written by the user, the Host partition space is closed, and the corresponding super block is allocated to the remaining space, the super block is wasted.
Therefore, in the present application, only the starting logical zone and the number of logical zones of each host zone are recorded inside the hard disk, and when the host does not perform a write action, the logical zones and the super block do not establish a relationship, that is: the host partition space may correspond to n logical zones as well, but for a logical zone, when there is no actual write, the corresponding super block is not allocated, so that there is no actual super block reduction, thereby avoiding the waste of the super block.
It should be noted that, after receiving the write request, the present solution determines, according to the logical address carried in the write request, the first logical partition corresponding to the write request, and the process specifically includes: determining a logical address range of each logical partition in a host partition space; and detecting a first logical address range in which the logical address of the write request falls, and taking a logical partition corresponding to the first logical address range as a first logical partition.
Referring to fig. 2, a schematic diagram of a host partition space and a logical partition provided by the present application is shown; as can be seen from this figure, there are n host partition spaces, and each host partition space in turn corresponds to two logical zones, for example: the two logical partitions corresponding to host partition space host zone0 are: logical zone0 and logical zone1, the two logical partitions corresponding to the host partition space host zone1 are: a logical zone2 and a logical zone 3. If a write request sent by a host is received, the write request carries a logical address, and according to the logical address and the logical address range of each logical partition, which logical partition the logical address falls into can be determined, so that the logical partition corresponding to the write request is determined.
For example: assuming that each Logical zone is 50 in size and a host zone is composed of two Logical zones in size, the Lba (Logical Block Address: a unit space of host organization write data, in this patent, the Lba size is 4 k) range represented by the host zone0 is 0 to 99, the Lba range of the host zone1 is 100 to 199, and the Logical zones in each host zone bisect the Lba, that is: the lba range of the host zone0 is 0-99, the logical address range of the logical zone0 is 0-49, the logical address range of the logical zone1 is 50-99, the lba range of the host zone1 is 100-199, the logical address range of the logical zone2 is 100-149, and the logical address range of the logical zone3 is 150-199. If the logical address lba in the issued write request is 103, it can be seen from the above logical address ranges that the logical address in the write request falls into the logical address range of the logical zone2, that is to say, the first logical partition corresponding to the write request is: logical zone2 of host zone 1.
S102, judging whether mapping information corresponding to the first logic partition exists or not; if yes, executing S103; if not, executing S104;
s103, determining a corresponding super block according to the mapping information of the first logic partition, and responding to the write request;
it should be noted that, since there may be a super block allocated before the first logical partition, in order to avoid duplicate allocation to the same logical zone, in this solution, after determining the first logical partition corresponding to the write request from the host partition space of the host, the method may further include: judging whether mapping information corresponding to the first logic partition exists or not; if not, continuing to execute step S104, if yes, directly reading the mapping information corresponding to the first logical partition, determining a super block having a mapping relationship with the first logical partition, and applying for a physical address and then initiating a write.
S104, distributing a corresponding super block for the first logic partition, and storing the mapping relation between the first logic partition and the super block so as to respond to the write request according to the distributed super block.
It can be understood that, after a host issues a write action to any logical address (e.g. lba 0: (lba0+100)), a logical zone corresponding to a host zone of the host needs to be calculated, and when writing for the first time, a super block is selected to the current logical zone according to a policy, and the mapping relationship zone info information is written into a DDR, and the corresponding super block is queried for the next I/O; moreover, because the ZNS protocol only supports sequential writing, if the logical zone _0 is not written, the logical zone _1 is not switched to the logical zone _1, and the logical zone _1 does not need to establish a corresponding relationship with the super block in advance, so that the super block resource is not wasted at this time.
It should be noted that, in this embodiment, if it is detected that the storage state of the host partition space is a Full state, when the storage state of the logical partition is set, the following specific setting may be performed: judging whether the logical partitions in the partition space of the host computer are all distributed with corresponding super blocks or not; if not, setting the logic partition of the distributed super block into a Full state, and setting the logic partition of the unallocated super block into an Empty state; if yes, the logical partitions are all set to the Full state. That is, if the current HOST zone is set to full state at this time, only the superblock is allocated to the logical zone0 at this time, and the superblock is not allocated to the logical zone1, at this time, it is only necessary to set zone _0 to full, and it is not necessary to care about zone _1, because zone _1 is not used yet, and is currently in empty state.
In summary, according to the method for adjusting the size of the host zone provided by the invention, the corresponding super block is allocated to the logic zone only when the write operation is performed on the logic zone, so that the waste of the use of the super block in the firmware can be reduced, enough super blocks are provided for background data moving, garbage recycling and the like, and the algorithm processing efficiency is improved.
Based on the foregoing embodiment, in this embodiment, if a read request sent by a host is received, the method further includes the following steps:
the method comprises the following steps: determining a second logic partition corresponding to the read request from the host partition space according to the logic address carried by the read request;
in this scheme, the manner of determining the second logical partition according to the logical address carried by the read request is the same as the manner of determining the first logical partition according to the logical address carried by the write request, that is: determining a logical address range of each logical partition in a host partition space; and detecting a second logic address range in which the logic address of the read request falls, and taking the logic partition corresponding to the second logic address range as a second logic partition.
Step two: searching partition information corresponding to the second logic partition; the partition information comprises a mapping relation between a second logical partition and a super block, the data of the super block is written into a logical address, and the storage state of the second logical partition;
step three: judging whether the read request is a valid request or not by using the partition information; and if so, responding to the read request.
The process of judging whether the read request is an effective request by utilizing the partition information specifically comprises the following steps: judging whether the storage state of the second logic partition is an Empty state or not; if so, judging the read request to be an invalid request; if not, judging whether the logical address carried by the read request is not greater than the written logical address of the data; if the data is not larger than the written logic address, the read request is judged to be a valid request; if the data is larger than the written logic address, the read request is judged to be an invalid request.
It should be noted that each logical partition in the present solution has corresponding partition information, where the partition information includes a mapping relationship between the logical partition and the super block, a written logical address (which may be represented by write point) of data in the super block, and a storage state (Full state or Empty state) of the logical partition; when a read request occurs, a logical zone corresponding to the HOST zone is obtained through calculation according to a logical address lba of a read request, partition information of the logical zone is directly read, whether the lba to be read is an effective address is checked, and specifically: the written logic address of the data in the partition information reflects which lba the current zone has been written to, the position can be represented by write point, if lba ≦ to-be-read ≦ write point is to be read, and if the state of the current logic zone recorded in the partition information is empty, the partition information is directly determined as an invalid read request, after the logic address in the read request is determined not to be an effective address, the read result needs to be directly returned to the host as empty, and when the logic address in the read request is determined to be an effective address, the physical address is calculated according to lba to be read and the read request is responded.
In conclusion, according to the scheme, the corresponding super block does not need to be allocated to each logic partition of the host partition space in advance, and the corresponding super block only needs to be allocated to the logic partition corresponding to the write request after the write request is received, so that all the host partition spaces can be guaranteed to have the corresponding super block, the super blocks can not be wasted under the condition that the host partition spaces are not fully written, in addition, a set of firmware read-write processing flow can be reused, and the algorithm difficulty is simplified.
In the following, the determining apparatus provided by the embodiment of the present invention is introduced, and the determining apparatus described below and the determining method described above may be referred to each other.
Referring to fig. 3, a schematic structural diagram of a partition-space super block determining apparatus according to an embodiment of the present invention is provided; the device includes:
a first determining module 100, configured to determine, when a write request of a host is detected, a first logical partition corresponding to the write request from a host partition space of the host according to a logical address carried in the write request;
a first determining module 200, configured to determine whether mapping information corresponding to the first logical partition exists;
the allocating module 300 is configured to, when mapping information corresponding to the first logical partition does not exist, allocate a corresponding super block to the first logical partition, and store a mapping relationship between the first logical partition and the super block, so as to respond to the write request according to the allocated super block.
Wherein, this scheme still includes:
the receiving module is used for receiving a reading request sent by a host;
a second determining module, configured to determine, according to a logical address carried by the read request, a second logical partition corresponding to the read request from the host partition space;
the searching module is used for searching partition information corresponding to the second logic partition; the partition information comprises a mapping relation between a second logical partition and a super block, the data of the super block is written into a logical address, and the storage state of the second logical partition;
the second judgment module is used for judging whether the read request is an effective request or not by utilizing the partition information;
and the execution module is used for responding to the read request when the read request is judged to be an effective request by utilizing the partition information.
Wherein, this scheme still includes:
a third determining module, configured to determine whether all logical partitions in the host partition space have been allocated with corresponding super blocks when it is detected that the storage state of the host partition space is a Full state;
the first setting module is used for setting the logic partition which is allocated with the super block into a Full state and setting the logic partition which is not allocated with the super block into an Empty state when the logic partitions in the host partition space are all allocated with the corresponding super blocks;
and the second setting module is used for setting all the logical partitions to Full states when the logical partitions in the host partition space are not distributed with the corresponding super blocks.
Wherein, the second judging module includes:
the first judging unit is used for judging whether the storage state of the second logic partition is an Empty state;
a first determining unit, configured to determine that the read request is an invalid request when the storage state of the second logical partition is an Empty state;
a second determining unit, configured to determine, when the storage state of the second logical partition is not an Empty state, whether a logical address carried in the read request is not greater than a logical address into which the data has been written;
the second judging unit is used for judging the read request to be an effective request when the logical address carried by the read request is not larger than the written logical address of the data;
and the third judging unit is used for judging the read request to be an invalid request when the logic address carried by the read request is larger than the written logic address of the data.
The first determining module is specifically configured to: determining a logical address range for each logical partition in the host partition space; and detecting a first logic address range in which the logic address of the write request falls, and taking a logic partition corresponding to the first logic address range as a first logic partition.
Correspondingly, the second determining module is specifically configured to: determining a logical address range for each logical partition in the host partition space; and detecting a second logic address range in which the logic address of the read request falls, and taking a logic partition corresponding to the second logic address range as a second logic partition.
Referring to fig. 4, the embodiment of the present invention further discloses a schematic structural diagram of a superblock determination device for partitioned space; the equipment specifically comprises:
a memory 11 for storing a computer program;
a processor 12 for implementing the steps of the method for determining superblocks of a partitioned space as described in any of the above method embodiments when said computer program is executed.
In this embodiment, the device may be a PC (Personal Computer), or may also be a terminal device such as a smart phone, a tablet Computer, a palmtop Computer, and a portable Computer.
The device may include a memory 11, a processor 12, and a bus 13.
The memory 11 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may in some embodiments be an internal storage unit of the device, for example a hard disk of the device. The memory 11 may also be an external storage device of the device in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc. provided on the device. Further, the memory 11 may also include both an internal storage unit of the device and an external storage device. The memory 11 can be used not only for storing application software installed in the device and various types of data such as program codes for executing the determination method, etc., but also for temporarily storing data that has been output or is to be output.
The processor 12 may be, in some embodiments, a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data Processing chip for executing program codes stored in the memory 11 or Processing data, such as program codes for executing certain methods.
The bus 13 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 4, but that does not indicate only one bus or one type of bus.
Further, the device may further include a network interface 14, and the network interface 14 may optionally include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are generally used to establish a communication connection between the device and other electronic devices.
Optionally, the device may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the device and for displaying a visualized user interface.
Fig. 4 shows only the device with the components 11-14, and it will be understood by those skilled in the art that the structure shown in fig. 4 does not constitute a limitation of the device, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
The embodiment of the present invention further discloses a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps of the partition space superblock determination method according to any of the above method embodiments are implemented.
Wherein the storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A method for determining superblocks of partitioned spaces, comprising:
if a write request of a host is detected, determining a first logic partition corresponding to the write request from a host partition space of the host according to a logic address carried in the write request;
judging whether mapping information corresponding to the first logic partition exists or not;
if not, distributing a corresponding super block for the first logic partition, and storing the mapping relation between the first logic partition and the super block so as to respond to the write request according to the distributed super block;
if the storage state of the host partition space is detected to be a Full state, judging whether the logical partitions in the host partition space are all allocated with corresponding super blocks;
if not, setting the logic partition of the distributed super block into a Full state, and setting the logic partition of the unallocated super block into an Empty state;
if yes, all the logical partitions are set to the Full state.
2. The superblock determination method of claim 1, further comprising:
receiving a read request sent by a host;
determining a second logic partition corresponding to the read request from the host partition space according to a logic address carried by the read request;
searching partition information corresponding to the second logic partition; the partition information comprises a mapping relation between a second logic partition and a super block, the data of the super block is written into a logic address, and the storage state of the second logic partition;
judging whether the read request is a valid request or not by using the partition information;
and if so, responding to the read request.
3. The method of claim 2, wherein the determining whether the read request is a valid request using the partition information comprises:
judging whether the storage state of the second logic partition is an Empty state or not;
if so, judging the read request to be an invalid request; if not, judging whether the logic address carried by the read request is not larger than the written logic address of the data;
if the data is not larger than the written logic address, judging the read request to be a valid request; and if the data is larger than the written logic address, judging the read request to be an invalid request.
4. The method according to claim 2, wherein the determining, according to the logical address carried in the write request, the first logical partition corresponding to the write request from the host partition space of the host includes:
determining a logical address range for each logical partition in the host partition space;
detecting a first logic address range in which a logic address of the write request falls, and taking a logic partition corresponding to the first logic address range as a first logic partition;
correspondingly, the determining, according to the logical address carried by the read request, a second logical partition corresponding to the read request from the host partition space includes:
determining a logical address range for each logical partition in the host partition space;
and detecting a second logic address range in which the logic address of the read request falls, and taking a logic partition corresponding to the second logic address range as a second logic partition.
5. An apparatus for determining superblocks of partitioned spaces, comprising:
the first determining module is used for determining a first logic partition corresponding to a write request from a host partition space of a host according to a logic address carried in the write request when the write request of the host is detected;
the first judging module is used for judging whether mapping information corresponding to the first logic partition exists or not;
the allocation module is used for allocating a corresponding super block to the first logical partition when mapping information corresponding to the first logical partition does not exist, and storing the mapping relation between the first logical partition and the super block so as to respond to the write request according to the allocated super block;
a third determining module, configured to determine whether all logical partitions in the host partition space have been allocated with corresponding superblocks when it is detected that the storage state of the host partition space is a Full state;
the first setting module is used for setting the logic partition which is allocated with the super block into a Full state and setting the logic partition which is not allocated with the super block into an Empty state when the logic partitions in the host partition space are all allocated with the corresponding super blocks;
and the second setting module is used for setting all the logical partitions into Full states when the corresponding super blocks are not distributed to the logical partitions in the host partition space.
6. The superblock determination device as defined in claim 5, further comprising:
the receiving module is used for receiving a reading request sent by a host;
a second determining module, configured to determine, according to a logical address carried by the read request, a second logical partition corresponding to the read request from the host partition space;
the searching module is used for searching partition information corresponding to the second logic partition; the partition information comprises a mapping relation between a second logical partition and a super block, the data of the super block is written into a logical address, and the storage state of the second logical partition;
the second judgment module is used for judging whether the read request is an effective request or not by utilizing the partition information;
and the execution module is used for responding to the read request when the read request is judged to be an effective request by utilizing the partition information.
7. A partitioned space superblock determination device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method of superblock determination of partitioned spaces as claimed in any of claims 1 to 4 when said computer program is executed.
8. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method for superblock determination of partitioned spaces as claimed in any of claims 1 to 4.
CN202010059008.0A 2020-01-19 2020-01-19 Method, device, equipment and storage medium for determining superblock of partitioned space Active CN111240601B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010059008.0A CN111240601B (en) 2020-01-19 2020-01-19 Method, device, equipment and storage medium for determining superblock of partitioned space

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010059008.0A CN111240601B (en) 2020-01-19 2020-01-19 Method, device, equipment and storage medium for determining superblock of partitioned space

Publications (2)

Publication Number Publication Date
CN111240601A CN111240601A (en) 2020-06-05
CN111240601B true CN111240601B (en) 2022-07-22

Family

ID=70864080

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010059008.0A Active CN111240601B (en) 2020-01-19 2020-01-19 Method, device, equipment and storage medium for determining superblock of partitioned space

Country Status (1)

Country Link
CN (1) CN111240601B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112559193A (en) * 2020-12-31 2021-03-26 山东华芯半导体有限公司 Region information table management method based on host memory space
US11537305B1 (en) 2021-06-03 2022-12-27 Western Digital Technologies, Inc. Dissimilar write prioritization in ZNS devices
US11537303B1 (en) 2021-06-03 2022-12-27 Western Digital Technologies, Inc. Dissimilar write prioritization in ZNS devices
US11853203B1 (en) 2022-06-23 2023-12-26 Western Digital Technologies, Inc. Systems and methods with variable size super blocks in zoned namespace devices

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107632944A (en) * 2017-09-22 2018-01-26 郑州云海信息技术有限公司 A kind of method and device for reading data
CN110389907A (en) * 2018-04-18 2019-10-29 爱思开海力士有限公司 Electronic device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107632944A (en) * 2017-09-22 2018-01-26 郑州云海信息技术有限公司 A kind of method and device for reading data
CN110389907A (en) * 2018-04-18 2019-10-29 爱思开海力士有限公司 Electronic device

Also Published As

Publication number Publication date
CN111240601A (en) 2020-06-05

Similar Documents

Publication Publication Date Title
CN111240601B (en) Method, device, equipment and storage medium for determining superblock of partitioned space
JP2021108199A (en) Range of expansion usage for memory apparatus
CN110390979B (en) Memory controller and memory system having the same
US20080195833A1 (en) Systems, methods and computer program products for operating a data processing system in which a file system's unit of memory allocation is coordinated with a storage system's read/write operation unit
CN107908571B (en) Data writing method, flash memory device and storage equipment
US9569381B2 (en) Scheduler for memory
TWI710905B (en) Data storage device and method for loading logical-to-physical mapping table
CN114840450B (en) Storage space arrangement method and electronic equipment
WO2022151985A1 (en) Virtual memory-based data storage method and apparatus, device, and storage medium
KR102330394B1 (en) Method for operating controller and method for operating device including the same
US11226738B2 (en) Electronic device and data compression method thereof
US11216383B2 (en) Storage device providing a virtual memory region, electronic system including the same, and method of operating the same
US11144380B2 (en) Memory controller and storage device including the same
CN102543184B (en) Memorizer memory devices, its Memory Controller and method for writing data
CN115934002A (en) Solid state disk access method, solid state disk, storage system and cloud server
WO2016023276A1 (en) Data processing method and device for storage card
CN107203332B (en) Data storage device, flash memory controller and operation method thereof
CN111881065B (en) Physical address processing method, device, equipment and medium for data deduplication operation
CN115543859A (en) Wear leveling optimization method, device, equipment and medium for multi-partition SSD
CN115469796A (en) Data storage method, device, equipment and storage medium
TWI486966B (en) Flash memory storage device, controller thereof, and programming management method thereof
CN113448487A (en) Computer readable storage medium, method and device for writing flash memory management table
CN111158582A (en) Storage device and electronic device
US10923178B1 (en) Data storage with improved write performance for preferred user data
CN113625953B (en) Data processing method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant