CN112068777B - Management method and system of data storage medium, terminal equipment and storage medium - Google Patents

Management method and system of data storage medium, terminal equipment and storage medium Download PDF

Info

Publication number
CN112068777B
CN112068777B CN202010920097.3A CN202010920097A CN112068777B CN 112068777 B CN112068777 B CN 112068777B CN 202010920097 A CN202010920097 A CN 202010920097A CN 112068777 B CN112068777 B CN 112068777B
Authority
CN
China
Prior art keywords
storage medium
data storage
quasi
physical blocks
binding
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
CN202010920097.3A
Other languages
Chinese (zh)
Other versions
CN112068777A (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.)
SHENZHEN SILICONGO MICROELECTRONICS CO Ltd
Original Assignee
SHENZHEN SILICONGO MICROELECTRONICS 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 SHENZHEN SILICONGO MICROELECTRONICS CO Ltd filed Critical SHENZHEN SILICONGO MICROELECTRONICS CO Ltd
Priority to CN202010920097.3A priority Critical patent/CN112068777B/en
Publication of CN112068777A publication Critical patent/CN112068777A/en
Priority to PCT/CN2021/074793 priority patent/WO2022048109A1/en
Application granted granted Critical
Publication of CN112068777B publication Critical patent/CN112068777B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0607Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device
    • 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/0614Improving the reliability of storage systems
    • G06F3/0616Improving the reliability of storage systems in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]
    • 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
    • G06F3/0623Securing storage systems in relation to content
    • 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/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • 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/0653Monitoring storage devices or 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/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]
    • 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 invention discloses a management method, a system, terminal equipment and a computer storage medium of a data storage medium, wherein the state information of the data storage medium is detected, and the state information comprises the following steps: bad physical block distribution status and physical block availability status; respectively binding physical blocks of each quasi binding group in the data storage medium according to the bad physical block distribution state to build each first logic area; establishing a second logic area in the data storage medium according to the physical block availability status; upon receiving data to be stored, a target logical area is determined from each of the first logical area and the second logical area to store the data to be stored. The invention fully utilizes the good physical blocks in the data storage medium to establish different logic areas, not only ensures the data read-write performance of the data storage medium, but also gives consideration to the whole available capacity of the data storage medium, and achieves good balance between the read-write performance and the whole capacity.

Description

Management method and system of data storage medium, terminal equipment and storage medium
Technical Field
The present invention relates to the field of data storage technologies, and in particular, to a method, a system, a terminal device, and a computer storage medium for managing a data storage medium.
Background
When a data storage medium (such as Nand Flash: a storage product for solid-state storage of data) reads and writes data, in order to give priority to the read-write performance of the data (such as faster solid-state storage of the data or reading out the data), the data storage medium may access the bound physical blocks in parallel at the same time, so that the data storage medium performs the read-write process of the data with the highest performance.
However, due to the fact that physical blocks possibly exist in the data storage medium, the data storage medium cannot be bound for all the physical blocks, and therefore partial physical blocks which are not bound in the data storage medium are not really accessed for data reading and writing.
In contrast, if the data storage medium is to enable most of its physical blocks to be accessed for data reading and writing, the data storage medium cannot ensure the data reading and writing performance, for example, the data storage medium needs to traverse each physical block of itself to query to obtain the currently available physical block and access the physical block separately to complete data storage when performing data storage, so the waiting time of data storage is greatly increased.
In summary, when the conventional data storage medium performs data read/write in parallel based on binding physical blocks based on priority performance, it is easy to cause that some physical blocks of the data storage medium cannot be accessed, so that the overall usage capacity of the data storage medium is greatly reduced, and the data storage medium is difficult to obtain high performance of data read/write on the premise of ensuring the data usage capacity preferentially.
Disclosure of Invention
The invention mainly aims to provide a management method, a device, terminal equipment and a computer storage medium of a data storage medium, and aims to solve the technical problems that in the prior art, the whole available capacity of the data storage medium is difficult to consider in order to consider the data read-write performance of the data storage medium, and the effective balance between the performance and the capacity cannot be realized.
To achieve the above object, the present invention provides a management method of a data storage medium, the management method of the data storage medium comprising:
detecting state information of a data storage medium, wherein the state information includes: bad physical block distribution status and physical block availability status;
respectively binding physical blocks of each quasi binding group in the data storage medium according to the bad physical block distribution state to build each first logic area;
Establishing a second logic area in the data storage medium according to the physical block availability status;
upon receiving data to be stored, a target logical area is determined from each of the first logical area and the second logical area to store the data to be stored.
Further, the bad physical block distribution state includes: no bad physical blocks exist and bad physical blocks exist, the quasi-binding group comprising: a first quasi bound set and a second quasi bound set,
the step of respectively binding the physical blocks of each quasi binding group in the data storage medium according to the bad physical block distribution state to construct each first logic area comprises the following steps:
counting each first quasi binding group without bad physical blocks and each second quasi binding group without bad physical blocks in the data storage medium;
respectively binding physical blocks in each first quasi-binding group to form each first quasi-binding group into a first logic area with a first preset unit number, wherein the first preset unit number is the total number of units of storage units owned by the data storage medium;
detecting the target storage units and the number of bad physical blocks to which the bad physical blocks belong in each second quasi-binding group, and respectively binding the second quasi-binding groups according to the target storage units and the number of the bad physical blocks to construct a first logic area.
Further, the step of binding the second quasi bound group according to the target storage unit and the bad physical block number to construct a first logical area includes:
classifying each second quasi binding group according to the number of bad physical blocks and the target storage unit to obtain each standard binding group;
and binding good physical blocks in each mesh standard binding group respectively to construct each mesh standard binding group into a first logic area with a second preset unit number, wherein the second preset unit number is equal to the unit total number minus the bad physical block number.
Further, the step of binding the second quasi bound group according to the target storage unit and the bad physical block number to construct a first logical area, further includes:
detecting each quasi binding group pair of which the number of bad physical blocks in each second quasi binding group is complementary with that of the target storage unit;
and binding the good physical blocks in each quasi-binding group respectively to construct each quasi-binding group pair into a first logic area with the first preset unit number.
Further, the physical block availability status includes a first availability status and a second availability status,
The step of detecting status information of the data storage medium includes:
scanning all physical blocks in the data storage medium to determine bad physical block distribution status of the data storage medium;
detecting a first erasure life of all the physical blocks in the data storage medium under a preset first mode to determine a first available state;
and detecting a second erasure life of all the physical blocks in a preset second mode to determine a second available state, wherein the first erasure life is shorter than the second erasure life.
Further, the step of establishing a second logical area in the data storage medium according to the physical block availability status includes:
counting all first physical blocks in which the second available state is available and the first available state is unavailable;
and respectively taking each first physical block as an independent storage unit to combine each independent storage unit to establish a second logic area.
Further, the step of determining a target logical area from the first logical area and each of the second logical areas to store the data to be stored includes:
determining the storage occupation capacity of the data to be stored and the available storage capacity of each of the first logic area and the second logic area;
Comparing whether each available storage capacity is larger than or equal to the storage occupation capacity;
if yes, determining the first logic area or the second logic area corresponding to the available storage capacity as the target logic area for storing the data to be stored.
In addition, to achieve the above object, the present invention also provides a management system for a data storage medium, the management system for a data storage medium comprising:
a detection module, configured to detect status information of a data storage medium, where the status information includes: bad physical block distribution status and physical block availability status;
the first building module is used for respectively binding the physical blocks of each quasi-binding group in the data storage medium according to the distribution state of the bad physical blocks so as to build each first logic area;
a second building module for building a second logical area in the data storage medium according to the physical block availability status;
and the storage control module is used for determining a target logic area from each of the first logic area and the second logic area to store the data to be stored when the data to be stored is received.
Each functional module of the management system for data storage media of the present invention realizes the steps of the management method for data storage media as described above at the time of operation.
In addition, to achieve the above object, the present invention also provides a terminal device including: the management method comprises the steps of a memory, a processor and a management program of a data storage medium which is stored in the memory and can run on the processor, wherein the management program of the data storage medium is executed by the processor to realize the management method of the data storage medium.
In addition, in order to achieve the above object, the present invention also provides a computer storage medium having a computer program stored thereon, which when executed by a processor, implements the steps of the data storage medium management method as described above.
The invention provides a management method, a system, terminal equipment and a computer storage medium of a data storage medium, wherein the state information of the data storage medium is detected, and the state information comprises the following steps: bad physical block distribution status and physical block availability status; respectively binding physical blocks of each quasi binding group in the data storage medium according to the bad physical block distribution state to build each first logic area; establishing a second logic area in the data storage medium according to the physical block availability status; upon receiving data to be stored, a target logical area is determined from each of the first logical area and the second logical area to store the data to be stored.
The invention analyzes and detects the state information of the data storage medium at the physical structure level, such as the bad physical block distribution state of the data storage medium and the physical block availability state of the data storage medium, then respectively binds the physical blocks of each quasi-binding group of the data storage medium based on the bad physical block distribution state, thereby respectively constructing each quasi-binding group into a plurality of concurrent first logic areas, and further establishes a second logic area in the data storage medium based on the physical block availability state, thus, after receiving the data to be stored in the data storage medium, determining a target logic area from each constructed first logic area and second logic area to store the data to be stored.
Compared with the prior art that only the quasi-binding group of all good physical blocks in the data storage medium is used as a logic area to read and write data in parallel, and all the good physical blocks are directly used as independent storage units to read and write data aiming at other quasi-binding groups containing bad physical blocks, the invention can more rapidly execute the data reading and writing through a plurality of logic areas established in the data storage medium, and fully utilizes each good physical block in the data storage medium to establish different logic areas, thus not only ensuring the data reading and writing performance of the data storage medium to a great extent, but also fully taking the whole available capacity of the data storage medium into consideration, and achieving the good balance between the data storage medium reading and writing performance and the whole capacity.
Drawings
Fig. 1 is a schematic structural diagram of hardware operation of a terminal device according to an embodiment of the present invention;
FIG. 2 is a flow chart of an embodiment of a method for managing a data storage medium according to the present invention;
FIG. 3 is a detailed flowchart of step S200 in an embodiment of a method for managing a data storage medium according to the present invention;
fig. 4 is a schematic block diagram of a management system for a data storage medium according to the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a hardware running environment related to a terminal device according to an embodiment of the present invention.
It should be noted that fig. 1 may be a schematic structural diagram of a hardware operating environment of a terminal device. The terminal equipment of the embodiment of the invention can be data storage control terminals, PCs, portable computers and other terminal equipment.
As shown in fig. 1, the terminal device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the terminal device structure shown in fig. 1 is not limiting of the terminal device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in FIG. 1, an operating system, network communications modules, user interface modules, and processing programs for distributed tasks may be included in memory 1005, which is a type of computer storage medium. The operating system is a program for managing and controlling hardware and software resources of the sample terminal device, and supports the running of processing programs of distributed tasks and other software or programs.
In the terminal device shown in fig. 1, the user interface 1003 is mainly used for data communication with each terminal; the network interface 1004 is mainly used for connecting a background server and carrying out data communication with the background server; and the processor 1001 may be used to call a management program of a data storage medium stored in the memory 1005 and perform the following operations:
detecting state information of a data storage medium, wherein the state information includes: bad physical block distribution status and physical block availability status;
respectively binding physical blocks of each quasi binding group in the data storage medium according to the bad physical block distribution state to build each first logic area;
Establishing a second logic area in the data storage medium according to the physical block availability status;
upon receiving data to be stored, a target logical area is determined from each of the first logical area and the second logical area to store the data to be stored.
Further, the bad physical block distribution state includes: no bad physical blocks exist and bad physical blocks exist, the quasi-binding group comprising: the processor 1001 may call a hypervisor of a data storage medium stored in the memory 1005, and further perform the following operations:
counting each first quasi binding group without bad physical blocks and each second quasi binding group without bad physical blocks in the data storage medium;
respectively binding physical blocks in each first quasi-binding group to form each first quasi-binding group into a first logic area with a first preset unit number, wherein the first preset unit number is the total number of units of storage units owned by the data storage medium;
detecting the target storage units and the number of bad physical blocks to which the bad physical blocks belong in each second quasi-binding group, and respectively binding the second quasi-binding groups according to the target storage units and the number of the bad physical blocks to construct a first logic area.
Further, the processor 1001 may call a management program of a data storage medium stored in the memory 1005, and further perform the following operations:
classifying each second quasi binding group according to the number of bad physical blocks and the target storage unit to obtain each standard binding group;
and binding good physical blocks in each mesh standard binding group respectively to construct each mesh standard binding group into a first logic area with a second preset unit number, wherein the second preset unit number is equal to the unit total number minus the bad physical block number.
Further, the processor 1001 may call a management program of a data storage medium stored in the memory 1005, and further perform the following operations:
detecting each quasi binding group pair of which the number of bad physical blocks in each second quasi binding group is complementary with that of the target storage unit;
and binding the good physical blocks in each quasi-binding group respectively to construct each quasi-binding group pair into a first logic area with the first preset unit number.
Further, the physical block available states include a first available state and a second available state, and the processor 1001 may call a management program of a data storage medium stored in the memory 1005, and further perform the following operations:
Scanning all physical blocks in the data storage medium to determine bad physical block distribution status of the data storage medium;
detecting a first erasure life of all the physical blocks in the data storage medium under a preset first mode to determine a first available state;
and detecting a second erasure life of all the physical blocks in a preset second mode to determine a second available state, wherein the first erasure life is shorter than the second erasure life.
Further, the processor 1001 may call a management program of a data storage medium stored in the memory 1005, and further perform the following operations:
counting all first physical blocks in which the second available state is available and the first available state is unavailable;
and respectively taking each first physical block as an independent storage unit to combine each independent storage unit to establish a second logic area.
Further, the processor 1001 may call a management program of a data storage medium stored in the memory 1005, and further perform the following operations:
determining the storage occupation capacity of the data to be stored and the available storage capacity of each of the first logic area and the second logic area;
Comparing whether each available storage capacity is larger than or equal to the storage occupation capacity;
if yes, determining the first logic area or the second logic area corresponding to the available storage capacity as the target logic area for storing the data to be stored.
Based on the above-described structure, various embodiments of the management method of the data storage medium of the present invention are presented.
Referring to fig. 2, fig. 2 is a flowchart illustrating a management method of a data storage medium according to a first embodiment of the present invention.
The embodiments of the present invention provide embodiments of a method of managing a data storage medium, it being noted that although a logical order is shown in the flowchart, in some cases the steps shown or described may be performed in a different order than what is shown or described herein.
The management method of the data storage medium according to the embodiment of the present invention is applied to the terminal device for controlling data storage, and the terminal device according to the embodiment of the present invention may be a terminal device such as a data storage medium itself, a data storage control terminal, a PC, a portable computer, etc., which is not particularly limited herein.
The management method of the data storage medium of the present embodiment includes:
step S100, detecting status information of the data storage medium, wherein the status information includes: bad physical block distribution status and physical block availability status;
In this embodiment, the data storage medium may be Nand Flash or other mature data storage medium in the existing market. It should be understood that, based on the continuous progress and development of the scientific and technical level, even though more other storage media (such as magnetic discs and cards) based on the same or similar design principle as the Nand Flash will be developed or already applied in the future, the data storage media may of course be other mature storage media in other embodiments, and the management method of the data storage media according to the embodiment of the present invention is not limited specifically to the kind of the data storage media, based on different design needs of practical application.
The terminal equipment currently used for controlling the data storage traverses all physical blocks in the data storage medium according to a pre-configured detection period or based on a pre-set algorithm operation so as to detect the distribution state of bad physical blocks and the available state of the physical blocks in the data storage medium.
Specifically, for example, the terminal device sets a detection period for performing cyclic detection on the data storage medium-Nand Flash based on a configuration input by a worker through a user graphical interface output by front end visualization in advance, then the terminal device judges whether the next detection period is reached by reading the system time, and when the next detection period is judged to be reached, starts traversing all the physical blocks currently in the data storage medium-Nand Flash, scans and detects the respective good or bad conditions of all the physical blocks one by one, and detects the respective available states of all the physical blocks in the management mode currently aiming at the data storage medium-Nand Flash.
In another possible embodiment, the terminal device may further traverse all physical blocks based on an algorithm operation input by a worker in real time through a user graphical interface output by front-end visualization, and detect respective good or bad conditions of all physical blocks, and in a current management mode for the data storage medium-Nand Flash, respective available states of all physical blocks.
It should be noted that, in this embodiment, the terminal device may adopt different management modes to manage the data storage medium Nand Flash, and the management modes may be specifically various modes that are commonly used in the market at present, such as SLC (Single Level Cel: single layer storage), MLC (Multi-Level Cel: multi-layer storage), TLC (ternary-Level Cell:3bit/Cell-1 memory storage unit may store 3 bits), and the like. In addition, in this embodiment, the algorithm operation that the staff inputs in real time on the user graphical interface may specifically be to click on a pre-configured instruction control on the user graphical interface, or input corresponding instruction content through a pre-configured instruction input dialog box, which should be understood that, based on different design needs of practical application, in other embodiments, the staff may of course execute other algorithm operations to trigger the update instruction, and the management method of the data storage medium in this embodiment of the present invention is not specifically limited to the operation content of the algorithm operation.
Step S200, respectively binding physical blocks of each quasi binding group in the data storage medium according to the bad physical block distribution state to construct each first logic area;
it should be noted that, in this embodiment, the quasi-binding group is a physical group formed by all physical blocks located at the same physical layer in the physical structure of the data storage medium, for example, when the data storage medium-Nand Flash longitudinally divides the overall physical structure by 4 storage units, namely, "plane0", "plane1", "plane2" and "plane3", four physical blocks located at each physical layer in the transverse direction respectively belong to the "plane0", "plane1", "plane2" and "plane3" can be used as one quasi-binding group of the data storage medium-Nand Flash, where one storage unit (i.e. 1 plane) may be formed by 1024 physical blocks in the longitudinal physical structure.
After the terminal equipment traverses all physical blocks of the data storage medium to detect the distribution state of bad physical blocks in the data storage medium, the terminal equipment determines the bad physical blocks in each quasi-binding group of the data storage medium according to the distribution state of the bad physical blocks, binds other good physical blocks except the bad physical blocks in the quasi-binding group, and then combines all quasi-binding groups with the same distribution of the bad physical blocks to establish a plurality of first logic areas coexisting in the data storage medium.
It should be noted that, in this embodiment, since the quasi-binding groups are determined based on the distribution states of the bad physical blocks in the data storage medium, and thus the first logical areas containing different numbers of good physical blocks in the quasi-binding groups are established, the capacity of each of the established first logical areas may be arbitrary. For example, one data storage medium-Nand Flash with a maximum data capacity of 32GB and a completely new data storage medium-Nand Flash, the capacity allocation situation of each first logic area may be specifically 20GB, 8GB, and 2GB (all physical blocks are empty and all available when the data storage medium-Nand Flash is completely new), so that each first logic area can only be built based on the bad physical block distribution state, and the data storage medium-Nand Flash itself needs to leave a sufficient portion of storage space (here, 2 GB) for the storage management algorithm).
Further, in a possible embodiment, the bad physical block distribution state in the step S200 includes: no bad physical blocks exist and bad physical blocks exist, the quasi-binding group comprising: a first quasi bound set and a second quasi bound set. Referring to fig. 3, the step S200 of binding the physical blocks of each quasi-binding group in the data storage medium according to the bad physical block distribution state to construct each first logical area may include:
Step S201, counting each first quasi binding group without bad physical block and each second quasi binding group without bad physical block in the data storage medium;
and the terminal equipment calculates a plurality of first quasi-binding groups without bad physical blocks and a plurality of second quasi-binding groups with bad physical blocks in all quasi-binding groups of the data storage medium based on the detected bad physical block distribution state of the data storage medium.
Specifically, for example, the terminal device detects that the data storage medium-Nand Flash has no bad physical blocks in the 70 th to 600 th quasi-binding groups in the longitudinal direction and no bad physical blocks in the 705 th to 815 th quasi-binding groups by traversing all the empty physical blocks of the data storage medium-Nand Flash with the physical structure divided longitudinally by 4 storage units, and determines that the 70 th to 600 th quasi-binding groups and the 705 th to 815 th quasi-binding groups are the first quasi-binding groups, and in addition, the terminal device determines that all the physical blocks in the 65 th to 69 th quasi-binding groups, the 601 th to 704 th quasi-binding groups and the 816 th to 1024 th quasi-binding groups (the physical blocks in the 1 st to 64 th quasi-binding groups are required for storing management algorithms) of the remaining bad physical blocks in the data storage medium-Nand Flash are all the second quasi-binding groups.
Step S202, respectively binding physical blocks in each first quasi-binding group to form each first quasi-binding group into a first logic area with a first preset unit number, where the first preset unit number is a unit total number of storage units owned by the data storage medium;
it should be noted that, in this embodiment, the first preset unit number is the same as the number of storage units owned by the data storage medium, for example, the data storage medium-Nand Flash with a physical structure is divided longitudinally by 4 storage units, and has 4 storage units, namely, "plane0", "plane1", "plane2" and "plane3", so that the first preset unit number is 4 planes. It should be understood that, based on different design requirements of practical applications, in other possible embodiments, if the data storage medium is divided into other numbers of storage units by using the vertical physical structure, the number of the first preset units is naturally changed to other numbers, and the method for managing the data storage medium according to the embodiment of the present invention does not specifically limit the numerical value of the first preset unit.
After the terminal device determines a plurality of first quasi-binding groups without bad physical blocks and a plurality of second quasi-binding groups with bad physical blocks from the quasi-binding groups of the data storage medium, the terminal device respectively binds all good physical blocks in the plurality of first quasi-binding groups at first, and combines all the first quasi-binding groups to form a first logic area with a first preset unit number in the data storage medium.
Specifically, for example, in the data storage medium-Nand Flash with a physical structure divided longitudinally by 4 storage units, after determining the 70 th to 600 th quasi-binding groups and the 705 th to 815 th quasi-binding groups obtained by detection as the first quasi-binding groups, the terminal device binds good physical blocks belonging to the storage units, "plane0", "plane1", "plane2" and "plane3", in each quasi-binding group in the 70 th to 600 th and 705 th to 815 th quasi-binding groups, respectively, and then combines the 70 th to 600 th and 705 th to 815 th quasi-binding groups into a first logic area of 4 planes.
Step S203, detecting a target storage unit and the number of bad physical blocks to which the bad physical blocks belong in each second quasi-binding group, and binding the second quasi-binding groups according to the target storage unit and the number of bad physical blocks to construct a first logic area.
After the terminal device determines a plurality of first quasi-binding groups without bad physical blocks and a plurality of second quasi-binding groups with bad physical blocks from the quasi-binding groups of the data storage medium, the terminal device further detects the number of the bad physical blocks in the second quasi-binding groups and the target storage units to which the bad physical blocks belong respectively, and then binds good physical blocks in the second quasi-binding groups according to different physical block numbers and different target storage units respectively to combine the second quasi-binding groups into a plurality of first logic areas with other unit numbers.
Further, in a possible embodiment, in the step S203, the step of binding the second quasi bound group according to the target storage unit and the bad physical block number to form a first logical area may include:
step S2031, classifying each second quasi-binding group according to the number of bad physical blocks and the target storage unit to obtain each standard binding group;
and the terminal equipment classifies the second quasi-binding groups in sequence according to different bad physical block numbers and different target storage units so as to obtain target-standard binding groups with different storage unit numbers.
Specifically, for example, after the terminal device traverses all physical blocks with empty data storage media-Nand Flash of a physical structure longitudinally divided by 4 storage units to determine 65 th to 69 th quasi-binding groups, 601 th to 704 th quasi-binding groups and 816 th to 1024 th quasi-binding groups with bad physical blocks as second quasi-binding groups, the terminal device further detects 65 th to 69 th quasi-binding groups, the number of bad physical blocks is 1 and the target storage unit to which the bad physical blocks belong is plane0, and the terminal device uses the 65 th to 69 th quasi-binding groups as first standard binding groups; in addition, the terminal equipment further detects that the number of bad physical blocks is 2 and the target storage units to which the bad physical blocks belong are plane0 and plane1 in 601 to 704 quasi-binding groups, and the terminal equipment takes the 601 to 704 quasi-binding groups as a second standard binding group; in addition, the terminal equipment further detects that the number of bad physical blocks is 3 and the target storage units to which the bad physical blocks belong are plane0, plane1 and plane2 in 816 th to 1020 th quasi-binding groups, and the terminal equipment takes the 816 th to 1020 th quasi-binding groups as a third-order standard binding group; finally, the terminal device further detects that the number of bad physical blocks is 3 and the target storage units to which the bad physical blocks belong are plane1, plane2 and plane3 in 1021 th to 1024 th quasi-binding groups, and the terminal device takes the 1021 th to 1024 th quasi-binding groups as fourth-order standard binding groups.
Step S2032, binding good physical blocks in each of the standard binding groups respectively to construct each of the standard binding groups into a first logical area with a second preset unit number, where the second preset unit number is equal to the unit total number minus the bad physical block number.
It should be noted that, in this embodiment, the number of the second preset units is equal to the number of storage units owned by the data storage medium, for example, the number of bad physical blocks in the standard binding group is to be removed, for example, the data storage medium-Nand Flash with the physical structure is divided longitudinally by 4 storage units, which have 4 storage units, namely, "plane0", "plane1", "plane2" and "plane3", and in the first standard binding group, the number of bad physical blocks is 1, and then the first logic area with the number of the second preset units being 3 planes can be formed by combining all the first standard binding groups. It should be understood that, based on different design requirements of practical applications, in other possible embodiments, if the data storage medium is divided into other numbers of storage units by using the longitudinal physical structure, the number of the second preset units is naturally changed to other numbers, and the method for managing the data storage medium according to the embodiment of the present invention does not specifically limit the numerical value of the second preset unit.
After the terminal equipment divides the second quasi-binding groups into the target standard binding groups of different types, binding is respectively carried out on the good physical blocks in the target standard binding groups of different types so as to construct the target quasi-binding groups into a plurality of first logic areas with the unit numbers of the other target quasi-binding groups.
Specifically, for example, for a first target standard binding group, namely 65 th to 69 th quasi binding groups, the terminal device binds good physical blocks belonging to storage units of plane1, plane2 and plane3 in the 65 th to 69 th quasi binding groups, and further combines the 65 th to 69 th quasi binding groups to form a first logic area of 3 planes; similarly, the terminal device sequentially performs physical block binding for the second mesh standard binding group-601 to 704 quasi-binding groups, the third mesh standard binding group-816 to 1020 quasi-binding groups and the fourth mesh standard binding group-1021 to 1024 quasi-binding groups to form a first logic area (formed by combining the 601 to 704 quasi-binding groups) of 2 planes and a first logic area (formed by combining the 816 to 1024 quasi-binding groups) of 1 planes.
Further, in another possible embodiment, in the step S203, the step of binding the second quasi bound group according to the target storage unit and the bad physical block number to form a first logical area, may further include:
Step S2033, detecting each quasi-binding group pair in which the number of bad physical blocks in each second quasi-binding group and the target storage unit are complementary;
after further detecting and obtaining the number of the bad physical blocks and the target storage units to which the bad physical blocks belong in the second quasi-binding groups, the terminal device preferentially screens out a plurality of quasi-binding group pairs, of which the number of the bad physical blocks and the target storage units to which the bad physical blocks belong are complementary, in the second quasi-binding groups.
In this embodiment, the number of bad physical blocks and the target storage units to which the bad physical blocks belong may be specifically: the result of the superposition of the number of bad physical blocks is the total number of storage units owned by the data storage medium, and the result of the superposition of the target storage units is the storage units owned by the data storage medium.
Specifically, for example, after traversing all physical blocks in which a data storage medium-Nand Flash of a physical structure is divided longitudinally by 4 storage units, and further taking 65 th to 69 th quasi-binding groups as first-order standard binding groups and taking 1021 th to 1024 th quasi-binding groups as fourth-order standard binding groups, the terminal device determines that 4 consecutive quasi-binding groups and 4 consecutive fourth-order standard binding groups in the 5 first-order standard binding groups are 4 quasi-binding pairs after the number of bad physical blocks in the first-order standard binding groups is 1 and the target storage unit to which the bad physical blocks belong is plane0, and the number of bad physical blocks in the fourth-order standard binding groups is 3 and the target storage units to which the bad physical blocks belong is plane1, plane2 and plane 3.
Step S2034, binding the good physical blocks in each quasi-binding team respectively to construct each quasi-binding team pair into the first logic area with the first preset unit number.
The terminal equipment respectively binds good physical blocks in each quasi binding pair aiming at the screened quasi binding pairs so as to construct the quasi binding pairs into first logic areas with a first preset unit number.
Specifically, for example, after the terminal device forms 4 pairs of quasi-binding groups by combining the consecutive 4 quasi-binding groups, 66 th to 69 th quasi-binding groups, with the 1021 th to 1024 fourth quasi-binding groups, the terminal device binds three good physical blocks belonging to the planes 1, 2 and 3 in the 66 th to 69 quasi-binding groups with one good physical block belonging to the plane0 in the 1021 th to 1024 quasi-binding groups, respectively, that is, binds three good physical blocks in the 66 th quasi-binding group with one good physical block in each 1021 th quasi-binding group, and so on, and then the terminal device constructs the 4 pairs of quasi-binding groups as the first logical area of 4 planes.
In this embodiment, after further detecting and obtaining the number of bad physical blocks and the target storage units to which the bad physical blocks belong in the plurality of second quasi-binding groups, the terminal device preferentially screens out a plurality of quasi-binding group pairs in which the number of bad physical blocks and the target storage units to which the bad physical blocks belong in the two second quasi-binding groups are complementary, and binds good physical blocks in each quasi-binding pair respectively for the screened plurality of quasi-binding pairs, so as to construct the plurality of quasi-binding pairs into a first logic area with a first preset unit number. The method realizes the formation of good physical blocks with misaligned binding groups in the data storage medium, and further establishes a logic area with higher read-write performance in the data storage medium, thereby greatly improving the data read-write performance of the data storage medium on the premise of ensuring the available capacity of the data storage medium.
Step S300, a second logic area is established in the data storage medium according to the physical block availability status;
after the terminal device detects the available state of the physical blocks in the data storage medium by traversing all the physical blocks of the data storage medium, the terminal device constructs the physical blocks which are not available in the current management mode but are available in other management modes of the data storage medium into a second logic area in the data storage medium according to the available state of the physical blocks.
Step S400, when data to be stored is received, determining a target logic area from each of the first logic area and the second logic area to store the data to be stored.
After the terminal equipment builds a plurality of first logic areas and second logic areas in the data storage medium, if a data storage task issued by a data owner is detected, and therefore after data to be stored which needs to be stored in a solid state by the data storage medium is received, the terminal equipment determines one or more target logic areas for solid state storage of the data to be stored from the plurality of first logic areas and the second logic areas based on judging the storage occupation capacity of the data to be stored in the data storage medium, and controls the data storage medium to execute a corresponding storage command to store the data to be stored.
Further, in a possible embodiment, in the step S400, the step of determining a target logic area from the first logic area and each of the second logic areas to store the data to be stored may include:
step S401, determining a storage occupation capacity of the data to be stored and an available storage capacity of each of the first logic area and the second logic area;
after detecting a data storage task issued by a data owner, the terminal equipment determines the storage occupation capacity of the data storage medium required to occupy for solid-state storage of the data to be stored based on analyzing the data storage task, and detects the available storage capacities of a plurality of first logic areas and second logic areas established in the data storage medium.
Step S402, comparing whether each available storage capacity is larger than or equal to the storage occupation capacity;
after detecting the storage occupation capacity and the available storage capacities of the first logic areas and the second logic areas, the terminal equipment compares the storage occupation capacity with the available storage capacities in sequence, so that whether the storage occupation capacity is larger than or equal to the current available storage capacity is determined during each comparison.
And step S403, if yes, determining the first logic area or the second logic area corresponding to the available storage capacity as the target logic area for storing the data to be stored.
When the current available storage capacity is greater than or equal to the storage occupied capacity, the terminal equipment immediately determines the first logic area or the second logic area corresponding to the current available storage capacity as a target logic area, and accordingly the data to be stored are stored by controlling the data storage medium to execute the corresponding storage and writing command in the target logic area.
Specifically, for example, when the terminal device compares the storage occupied capacity with the available storage capacity of the first logic area of the 4 planes in the plurality of first logic areas, and detects that the available storage capacity of the first logic area of the 4 planes is greater than or equal to the storage occupied capacity, the terminal device immediately controls the data storage medium-Nand Flash to execute a parallel write command in the first logic area of the 4 planes, so that data to be stored is stored on each physical block bound by the 4 planes in the first logic area of the 4 planes in a parallel write mode.
Or if the terminal equipment detects that the available storage capacity is larger than or equal to the storage occupation capacity when comparing the storage occupation capacity with the available storage capacity of the first logic area of 1plane in the plurality of first logic areas, the terminal equipment then controls the data storage medium-Nand Flash to execute a standard write command in the first logic area of 1plane, so that the data to be stored is stored in each independent physical block in the first logic area of 4 planes in a standard write mode.
In this embodiment, by analyzing and detecting status information of the data storage medium itself at the physical structure level, for example, a bad physical block distribution status of the data storage medium and a physical block availability status of the data storage medium, then binding physical blocks of each quasi-binding group of the data storage medium based on the bad physical block distribution status, respectively, so as to respectively construct each quasi-binding group into a plurality of concurrent first logic areas, and further establish a second logic area in the data storage medium based on the physical block availability status, so that after receiving data to be stored in the data storage medium, a target logic area is determined from each of the constructed first logic area and second logic area to store the data to be stored.
Compared with the prior art that only the quasi-binding group of all good physical blocks in the data storage medium is used as a logic area to read and write data in parallel, and all the good physical blocks are directly used as independent storage units to read and write data aiming at other quasi-binding groups containing bad physical blocks, the invention can more rapidly execute the data reading and writing through a plurality of logic areas established in the data storage medium, and fully utilizes each good physical block in the data storage medium to establish different logic areas, thus not only ensuring the data reading and writing performance of the data storage medium to a great extent, but also fully taking the whole available capacity of the data storage medium into consideration, and achieving the good balance between the data storage medium reading and writing performance and the whole capacity.
Further, based on the first embodiment of the management method for a data storage medium of the present invention, a second embodiment of the management method for a data storage medium of the present invention is provided, in which the physical block availability status includes a first availability status and a second availability status, and the step of detecting status information of the data storage medium in the step S100 may include:
step S101, scanning all physical blocks in the data storage medium to determine bad physical block distribution state of the data storage medium;
when the terminal equipment detects that the system time reaches a time node of a pre-configured detection period or detects that an algorithm operation input by a worker triggers a scanning instruction, the terminal equipment immediately starts to traverse all physical blocks in the data storage medium so as to scan respective conditions of the all physical blocks and record identification information of bad physical blocks, thereby determining the distribution state of the bad physical blocks of the data storage medium.
In this embodiment, the identification information may be specifically a physical block number allocated to each physical block when the data storage medium divides the physical blocks based on its physical structure, and a storage unit to which each physical block belongs in a longitudinal division and a quasi-binding group to which each physical block belongs in a transverse division may be determined based on the physical block number.
Step S102, detecting a first erasure life of all the physical blocks in the data storage medium in a preset first mode to determine a first available state;
step S103, detecting a second erasure life of all the physical blocks in a preset second mode to determine a second available state, where the first erasure life is shorter than the second erasure life.
It should be noted that, in this embodiment, the preset first mode may specifically be TLC, in which, in the management mode of TLC, 1 memory storage unit of each physical block in the data storage medium may store 3 bits, but in the management mode of TLC, only each physical block is allowed to be erased about 500-800 times, i.e. the first erasure life of each physical block in the management mode of TLC is about 500-800 times, if it is detected that the current erasure of the physical block has exceeded the first erasure life, it is determined that the physical block is not available, or the preset first mode may also be MLC, in which, in the management mode of MLC, only each physical block is allowed to be erased about 3000-10000 times, i.e. the first erasure life of each physical block in the management mode of TLC is about 3000-10000 times, and if it is detected that the current erasure of the physical block has exceeded the first erasure life, it is determined that the physical block is not available. In addition, the preset second mode may specifically be SLC, where in the management mode of the SLC, each physical block of the data storage medium is allowed to be erased about 10 ten thousand times, that is, in the management mode of the SLC, the first erasing lifetime of each physical block is about 10 ten thousand times, and if it is detected that the current erasing of the physical block has exceeded the second erasing lifetime, it is determined that the physical block is not available.
It should be understood that, based on different design requirements of practical applications, in other embodiments, only the second erasure life needs to be ensured to be longer than the first erasure life, and of course, other management modes for the data storage medium may be adopted as the preset first mode and the preset second mode, and the management method of the data storage medium according to the embodiment of the present invention is not specifically limited for the preset first mode and the preset second mode.
When traversing all physical blocks in the data storage medium, the terminal device further detects the respective erasing times record of each physical block, and then compares the erasing times record with the first erasing service life of the physical block in a preset first mode respectively, so as to determine whether the first available state of all the physical blocks in the data storage medium is available or unavailable, and also compares the erasing times record with the second erasing service life of the physical block in a preset second mode respectively, so as to determine whether the second available state of all the physical blocks in the data storage medium is available or unavailable.
Further, in a possible embodiment, the step S300 of establishing a second logical area in the data storage medium according to the physical block availability status may include:
Step S301, counting all first physical blocks in which the second available state is available and the first available state is unavailable;
in step S302, each of the first physical blocks is used as an independent storage unit to create a second logic area by combining each of the independent storage units.
After traversing and detecting the first available state and the second available state of each of all physical blocks in the data storage medium, the terminal device further screens out the second physical blocks from all the physical blocks to be available, wherein the first available state is all the first physical blocks which are unavailable, and then the terminal device uses all the first physical blocks as independent storage units respectively to build all the first physical blocks into a second logic area of the data storage medium.
Specifically, for example, when the terminal device traverses all physical blocks in the data storage medium-Nand Flash to obtain respective record of erasing times of 4 physical blocks belonging to the storage unit plane0 in the 61 th to 64 quasi-binding groups, which are sequentially 35052, 30981, 55231 and 86052, respectively, that is, it is determined that a first available state of each of the 4 physical blocks in the TLC management mode is unavailable, and a second available state of each of the 4 physical blocks in the SLC management mode is available, the terminal device then determines the 4 physical blocks as the first physical blocks, and uses the 4 physical blocks as 4 independent storage units to combine the 4 physical blocks to establish a second logic area of the data storage medium-Nand, so when the terminal device controls the data storage medium-Nand to use the second logic area as a target storage area to store data to be stored issued by the data owner, the data storage medium can execute a standard write command in the second logic area, thereby storing the data to be stored in the standard write mode on each of the individual physical blocks.
In this embodiment, when detecting that the system time reaches a time node of a preconfigured detection period or detecting that an algorithm operation input by a staff triggers a scanning instruction, the terminal device immediately starts to traverse all physical blocks in the data storage medium, so as to scan respective conditions of the all physical blocks and record identification information of the bad physical blocks, thereby determining a bad physical block distribution state of the data storage medium, and when traversing all physical blocks in the data storage medium, the terminal device further detects respective erasure count records of all physical blocks, and then compares the erasure count records with first erasure lives of the physical blocks in a preset first mode respectively, thereby determining that the first available states of all physical blocks in the data storage medium are available or unavailable, and similarly compares the erasure count records with second erasure lives of the physical blocks in a preset second mode respectively, thereby determining that the second available states of all physical blocks in the data storage medium are available or unavailable.
Then, after traversing and detecting the respective first available state and second available state of all physical blocks in the data storage medium, the terminal device further screens out each first physical block whose second physical block is available but whose first available state is unavailable from all the physical blocks, and then, the terminal device establishes all the first physical blocks as a second logical area of the data storage medium by using each first physical block as an independent storage unit separately.
The method realizes that the data storage medium is unavailable in a management mode with lower erasing and writing service life, but the physical blocks available in the management mode with higher erasing and writing service life are collected to be built into the independent logic area in the data storage medium, so that the overall available storage capacity in the data storage medium is further improved, and in addition, the logic area is built by combining only part of the physical blocks (unavailable in the management mode with lower erasing and writing service life but available in the management mode with higher erasing and writing service life) as a storage unit, so that the occupation of the number of the physical blocks is further reduced, further more physical blocks can be uniformly bound to read and write data, the overall performance of the read and write data of the data storage medium is ensured, and the balance between the read and write performance and the data storage capacity of the data storage medium is further achieved.
In addition, referring to fig. 4, an embodiment of the present invention further provides a management system for a data storage medium, where the management system for a data storage medium includes:
a detection module, configured to detect status information of a data storage medium, where the status information includes: bad physical block distribution status and physical block availability status;
The first building module is used for respectively binding the physical blocks of each quasi-binding group in the data storage medium according to the distribution state of the bad physical blocks so as to build each first logic area;
a second building module for building a second logical area in the data storage medium according to the physical block availability status;
and the storage control module is used for determining a target logic area from each of the first logic area and the second logic area to store the data to be stored when the data to be stored is received.
Preferably, the bad physical block distribution state includes: no bad physical blocks exist and bad physical blocks exist, the quasi-binding group comprising: a first quasi bound set and a second quasi bound set, the first building block comprising:
a first statistics unit, configured to count each first quasi-binding group in which a bad physical block does not exist in the data storage medium, and each second quasi-binding group in which a bad physical block exists;
the first binding unit is used for respectively binding the physical blocks in each first quasi-binding group to form each first quasi-binding group into a first logic area with a first preset unit number, wherein the first preset unit number is the unit total number of storage units owned by the data storage medium;
The first building unit is used for detecting the target storage units and the number of bad physical blocks of the bad physical blocks in each second quasi-binding group, and respectively binding the second quasi-binding groups according to the target storage units and the number of the bad physical blocks to build a first logic area.
Preferably, the first building unit comprises:
the classification subunit is used for classifying each second quasi binding group according to the number of the bad physical blocks and the target storage unit to obtain each standard binding group;
and the second binding unit is used for binding the good physical blocks in each standard binding group respectively so as to construct each standard binding group into a first logic area with a second preset unit number, wherein the second preset unit number is equal to the unit total number minus the bad physical block number.
Preferably, the first building unit further comprises:
the detection subunit is used for detecting each quasi binding group pair with the number of the bad physical blocks in each second quasi binding group and the target storage unit being complementary;
and the third binding unit is used for binding the good physical blocks in each quasi binding group respectively so as to construct each quasi binding group pair into the first logic areas with the first preset unit number.
Preferably, the physical block available state includes a first available state and a second available state, and the detection module includes:
a scanning unit for scanning all physical blocks in the data storage medium to determine a bad physical block distribution state of the data storage medium;
the first detection unit is used for detecting a first erasure life of all the physical blocks in the data storage medium in a preset first mode to determine a first available state;
and the second detection unit is used for detecting second erasure life of all the physical blocks in a preset second mode to determine a second available state, wherein the first erasure life is shorter than the second erasure life.
Preferably, the second building module comprises:
the second statistics unit is used for counting all the first physical blocks of which the second available state is available and the first available state is unavailable;
and a second building unit for building a second logic area by combining the independent storage units by taking each of the first physical blocks as the independent storage units.
Preferably, the storage control module includes:
a determining unit, configured to determine a storage occupation capacity of the data to be stored, and available storage capacities of the first logical area and the second logical area;
A comparing unit configured to compare whether each of the available storage capacities is greater than or equal to the storage occupation capacity;
a storage unit configured to determine the first logical area or the second logical area corresponding to the available storage capacity as the target logical area for storing the data to be stored
The steps implemented by each functional module of the data storage device of the present invention during operation may refer to each three embodiments of the method of the data storage device of the present invention, which are not described herein again.
In addition, the embodiment of the invention also provides a terminal device, which comprises: the management method includes the steps of a memory, a processor, and a management program of a data storage medium stored on the memory and executable on the processor, which when executed by the processor, implements the management method of the data storage medium as described above.
The steps implemented when the management program of the data storage medium running on the processor is executed may refer to various embodiments of the management method of the data storage medium of the present invention, which are not described herein again.
In addition, the embodiment of the invention also provides a computer storage medium, which is applied to a computer, and the computer storage medium can be a nonvolatile computer readable computer storage medium, and a management program of a data storage medium is stored on the computer storage medium, and when the management program of the data storage medium is executed by a processor, the steps of the management method of the data storage medium are realized.
The steps implemented when the management program of the data storage medium running on the processor is executed may refer to various embodiments of the management method of the data storage medium of the present invention, which are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a computer storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (10)

1. A method of managing a data storage medium, the method comprising:
detecting state information of a data storage medium, wherein the state information includes: bad physical block distribution status and physical block availability status;
determining bad physical blocks in each quasi-binding group in the data storage medium according to the bad physical block distribution state, and binding each physical block except the bad physical blocks in each quasi-binding group to form each first logic area;
establishing a second logic area in the data storage medium according to the physical block availability status;
upon receiving data to be stored, a target logical area is determined from each of the first logical area and the second logical area to store the data to be stored.
2. The method of managing a data storage medium of claim 1, wherein the bad physical block distribution state comprises: no bad physical blocks exist and bad physical blocks exist, the quasi-binding group comprising: a first quasi bound set and a second quasi bound set,
The step of binding each physical block except the bad physical block in each quasi binding group to form each first logic area includes:
counting each first quasi binding group without bad physical blocks and each second quasi binding group without bad physical blocks in the data storage medium;
respectively binding physical blocks in each first quasi-binding group to form each first quasi-binding group into a first logic area with a first preset unit number, wherein the first preset unit number is the total number of units of storage units owned by the data storage medium;
detecting the target storage units and the number of bad physical blocks to which the bad physical blocks belong in each second quasi-binding group, and respectively binding the second quasi-binding groups according to the target storage units and the number of the bad physical blocks to construct a first logic area.
3. The method of managing a data storage medium of claim 2, wherein the step of binding the second quasi bound group to construct a first logical area according to the target storage unit and the bad physical block number, respectively, comprises:
classifying each second quasi binding group according to the number of bad physical blocks and the target storage unit to obtain each standard binding group;
And binding good physical blocks in each mesh standard binding group respectively to construct each mesh standard binding group into a first logic area with a second preset unit number, wherein the second preset unit number is equal to the unit total number minus the bad physical block number.
4. The method of managing a data storage medium of claim 2, wherein the step of binding the second quasi bound group to construct a first logical area according to the target storage unit and the bad physical block number, respectively, further comprises:
detecting each quasi binding group pair of which the number of bad physical blocks in each second quasi binding group is complementary with that of the target storage unit;
and binding the good physical blocks in each quasi-binding group respectively to construct each quasi-binding group pair into a first logic area with the first preset unit number.
5. The method of managing a data storage medium of claim 1, wherein the physical block available states include a first available state and a second available state,
the step of detecting status information of the data storage medium includes:
scanning all physical blocks in the data storage medium to determine bad physical block distribution status of the data storage medium;
Detecting a first erasure life of all the physical blocks in the data storage medium under a preset first mode to determine a first available state;
and detecting a second erasure life of all the physical blocks in a preset second mode to determine a second available state, wherein the first erasure life is shorter than the second erasure life.
6. The method of managing a data storage medium according to claim 5, wherein the step of creating a second logical area in the data storage medium according to the physical block availability status comprises:
counting all first physical blocks in which the second available state is available and the first available state is unavailable;
and respectively taking each first physical block as an independent storage unit to combine each independent storage unit to establish a second logic area.
7. The method of managing a data storage medium according to claim 1, wherein the step of determining a target logical area from among the first logical areas and the second logical areas to store the data to be stored comprises:
determining the storage occupation capacity of the data to be stored and the available storage capacity of each of the first logic area and the second logic area;
Comparing whether each available storage capacity is larger than or equal to the storage occupation capacity;
if yes, determining the first logic area or the second logic area corresponding to the available storage capacity as the target logic area for storing the data to be stored.
8. A management system for a data storage medium, the management system comprising:
a detection module, configured to detect status information of a data storage medium, where the status information includes: bad physical block distribution status and physical block availability status;
the first building module is used for determining bad physical blocks in each quasi-binding group in the data storage medium according to the bad physical block distribution state, and binding all physical blocks except the bad physical blocks in each quasi-binding group to build each first logic area;
a second building module for building a second logical area in the data storage medium according to the physical block availability status;
and the storage control module is used for determining a target logic area from each of the first logic area and the second logic area to store the data to be stored when the data to be stored is received.
9. A terminal device, characterized in that the terminal device comprises: a memory, a processor, and a management program of a data storage medium stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the management method of a data storage medium according to any one of claims 1 to 7.
10. A computer storage medium, characterized in that the computer storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the data storage medium management method according to any of claims 1 to 7.
CN202010920097.3A 2020-09-03 2020-09-03 Management method and system of data storage medium, terminal equipment and storage medium Active CN112068777B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010920097.3A CN112068777B (en) 2020-09-03 2020-09-03 Management method and system of data storage medium, terminal equipment and storage medium
PCT/CN2021/074793 WO2022048109A1 (en) 2020-09-03 2021-02-02 Data storage medium management method, system, terminal device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010920097.3A CN112068777B (en) 2020-09-03 2020-09-03 Management method and system of data storage medium, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112068777A CN112068777A (en) 2020-12-11
CN112068777B true CN112068777B (en) 2023-08-18

Family

ID=73666487

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010920097.3A Active CN112068777B (en) 2020-09-03 2020-09-03 Management method and system of data storage medium, terminal equipment and storage medium

Country Status (2)

Country Link
CN (1) CN112068777B (en)
WO (1) WO2022048109A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112068777B (en) * 2020-09-03 2023-08-18 深圳市硅格半导体有限公司 Management method and system of data storage medium, terminal equipment and storage medium
CN116991306A (en) * 2022-04-25 2023-11-03 深圳市江波龙电子股份有限公司 Processing method of storage device, storage device and computer readable storage device
CN115687171B (en) * 2022-10-26 2023-06-06 深圳三地一芯电子股份有限公司 Flash memory block binding method, device, equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101645042A (en) * 2008-08-04 2010-02-10 深圳市朗科科技股份有限公司 Flash memory management method and flash memory medium
CN101645310A (en) * 2008-08-05 2010-02-10 深圳市朗科科技股份有限公司 Flash memory equipment, method and system for managing flash memory
CN106445408A (en) * 2016-08-31 2017-02-22 深圳芯邦科技股份有限公司 NAND flash memory management method, host, NAND flash memory reading and writing method, and NAND flash memory controller
CN108038065A (en) * 2017-12-22 2018-05-15 湖南国科微电子股份有限公司 A kind of method, apparatus and system of raising Block utilization rates
CN108073363A (en) * 2017-12-28 2018-05-25 深圳市得微电子有限责任公司 Date storage method, storage device and computer readable storage medium
CN109558333A (en) * 2017-09-27 2019-04-02 北京忆恒创源科技有限公司 Solid storage device NameSpace with variable additional storage space (OP)
CN110457233A (en) * 2019-08-10 2019-11-15 深圳市德名利电子有限公司 A kind of flash memory management method and device and equipment based on mixed size unit
CN110750466A (en) * 2019-10-18 2020-02-04 深圳豪杰创新电子有限公司 Method and device for prolonging erasing and writing life of flash memory
CN111104045A (en) * 2018-10-25 2020-05-05 深圳市中兴微电子技术有限公司 Storage control method, device, equipment and computer storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101571833B (en) * 2008-04-29 2012-03-21 深圳市朗科科技股份有限公司 Method and device for protecting storage medium
CN112068777B (en) * 2020-09-03 2023-08-18 深圳市硅格半导体有限公司 Management method and system of data storage medium, terminal equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101645042A (en) * 2008-08-04 2010-02-10 深圳市朗科科技股份有限公司 Flash memory management method and flash memory medium
CN101645310A (en) * 2008-08-05 2010-02-10 深圳市朗科科技股份有限公司 Flash memory equipment, method and system for managing flash memory
CN106445408A (en) * 2016-08-31 2017-02-22 深圳芯邦科技股份有限公司 NAND flash memory management method, host, NAND flash memory reading and writing method, and NAND flash memory controller
CN109558333A (en) * 2017-09-27 2019-04-02 北京忆恒创源科技有限公司 Solid storage device NameSpace with variable additional storage space (OP)
CN108038065A (en) * 2017-12-22 2018-05-15 湖南国科微电子股份有限公司 A kind of method, apparatus and system of raising Block utilization rates
CN108073363A (en) * 2017-12-28 2018-05-25 深圳市得微电子有限责任公司 Date storage method, storage device and computer readable storage medium
CN111104045A (en) * 2018-10-25 2020-05-05 深圳市中兴微电子技术有限公司 Storage control method, device, equipment and computer storage medium
CN110457233A (en) * 2019-08-10 2019-11-15 深圳市德名利电子有限公司 A kind of flash memory management method and device and equipment based on mixed size unit
CN110750466A (en) * 2019-10-18 2020-02-04 深圳豪杰创新电子有限公司 Method and device for prolonging erasing and writing life of flash memory

Also Published As

Publication number Publication date
WO2022048109A1 (en) 2022-03-10
CN112068777A (en) 2020-12-11

Similar Documents

Publication Publication Date Title
CN112068777B (en) Management method and system of data storage medium, terminal equipment and storage medium
US20220057940A1 (en) Method and Apparatus for SSD Storage Access
US11106393B2 (en) Latency-based scheduling of command processing in data storage devices
US8583854B2 (en) Nonvolatile storage device with NCQ supported and writing method for a nonvolatile storage device
JP3942807B2 (en) Semiconductor memory device with block alignment function
CN111506269B (en) Disk storage space allocation method, device, equipment and storage medium
AU2003286967B2 (en) Dual journaling store method and storage medium thereof
US9501392B1 (en) Management of a non-volatile memory module
US20100125715A1 (en) Storage System and Operation Method Thereof
CN103597444A (en) Managing data placement on flash-based storage by use
JP2013509658A (en) Allocation of storage memory based on future usage estimates
US11734103B2 (en) Behavior-driven die management on solid-state drives
CN114610497A (en) Container scheduling method, cluster system, device, electronic equipment and storage medium
KR20210083448A (en) Storage device using unsupervised learning scheme and memory management method thereof
US20140297983A1 (en) Method of arranging data, information processing apparatus, and recording medium
CN112463058B (en) Fragmented data sorting method and device and storage node
US20100023677A1 (en) Solid state storage system that evenly allocates data writing/erasing operations among blocks and method of controlling the same
CN104969167A (en) Control device and control method
CN116457885A (en) Data processing method, device and system
CN117215485A (en) ZNS SSD management method, data writing method, storage device and controller
US11256621B2 (en) Dual controller cache optimization in a deterministic data storage system
CN115543859A (en) Wear leveling optimization method, device, equipment and medium for multi-partition SSD
CN114327246B (en) Method for storing data in storage medium, storage medium and computer device
CN114840448A (en) Method for accelerating garbage recovery of 3D flash memory by utilizing inter-channel parallel
CN112352216B (en) Data storage method and data storage device

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