CN117632003A - Data processing method, device, electronic equipment and computer readable storage medium - Google Patents
Data processing method, device, electronic equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN117632003A CN117632003A CN202311508639.6A CN202311508639A CN117632003A CN 117632003 A CN117632003 A CN 117632003A CN 202311508639 A CN202311508639 A CN 202311508639A CN 117632003 A CN117632003 A CN 117632003A
- Authority
- CN
- China
- Prior art keywords
- data
- storage unit
- physical storage
- target
- area
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 14
- 238000013507 mapping Methods 0.000 claims abstract description 52
- 230000002159 abnormal effect Effects 0.000 claims description 68
- 230000015654 memory Effects 0.000 claims description 47
- 238000000034 method Methods 0.000 claims description 41
- 239000007787 solid Substances 0.000 claims description 22
- 230000005856 abnormality Effects 0.000 claims description 18
- 238000012545 processing Methods 0.000 claims description 14
- 230000004044 response Effects 0.000 claims description 14
- 238000004590 computer program Methods 0.000 claims description 9
- 238000005299 abrasion Methods 0.000 claims description 6
- 239000000523 sample Substances 0.000 claims 1
- 238000004064 recycling Methods 0.000 abstract description 5
- 230000000875 corresponding effect Effects 0.000 description 46
- 238000010586 diagram Methods 0.000 description 15
- 230000008569 process Effects 0.000 description 11
- 238000013500 data storage Methods 0.000 description 10
- 238000004891 communication Methods 0.000 description 7
- 238000007726 management method Methods 0.000 description 6
- 230000003321 amplification Effects 0.000 description 4
- 230000003993 interaction Effects 0.000 description 4
- 239000010410 layer Substances 0.000 description 4
- 238000003199 nucleic acid amplification method Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 3
- 230000002596 correlated effect Effects 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000002035 prolonged effect Effects 0.000 description 2
- 238000011084 recovery Methods 0.000 description 2
- 238000000638 solvent extraction Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000014759 maintenance of location Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000010416 shoe-polishing Methods 0.000 description 1
- 239000002356 single layer Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0608—Saving storage space on storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0646—Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
- G06F3/0652—Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0679—Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy 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)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the application provides a data processing method, a device, an electronic device and a computer readable storage medium, wherein target data are respectively stored in different areas of an SSD according to the size of the data, and because a physical storage unit and a logic storage unit of a host device form a linear corresponding relation in a first mapping relation, when the data are stored, the data can be stored in the corresponding physical storage unit directly based on the first mapping relation, the operation of refreshing the mapping table is not needed, no other data except the target data exist in the logic storage unit, only the physical storage unit for storing the target data is determined through the logic storage unit, when the target data are deleted, the data to be deleted are directly selected, then overwriting is performed, and garbage recycling operation is not needed.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data processing method, a data processing device, an electronic device, and a computer readable storage medium.
Background
In most of traditional SSD products based on NAND at present, a host device cannot directly cover invalid data by using a newly written solid state disk because a flash memory does not support coverage in the process of reading and writing, so that the storage space capable of being used for storing data in the solid state disk gradually decreases along with the increase of the invalid data. In order to avoid the occupation of excessive storage space by invalid data, the solid state disk can be subjected to garbage recycling treatment. When garbage collection is performed, it is necessary to transfer the valid data into a specific area, delete the data entirely, and then rewrite the valid data transferred into the specific area into the SSD, and reserve a space for the specific area (referred to as OP area in this application) required for garbage collection in the conventional SSD. In addition, the host device needs to determine the physical address corresponding to the logical address according to the mapping table in the read-write process, so that space is reserved for the mapping table, and the reserved space reduces the actual use space of the SSD.
In addition, in the prior art, the process of determining the physical address corresponding to the logical address based on the mapping table is complex, the time consumption is more, and the read-write efficiency of the host equipment is reduced.
Disclosure of Invention
An embodiment of the application aims to provide a data processing method, a data processing device, electronic equipment and a computer readable storage medium, so as to increase the capacity of an actual use area of an SSD. The specific technical scheme is as follows:
in a first aspect of the present application, a data processing method is provided, applied to a solid state disk SSD, where the SSD includes: a data area adopting a block mapping storage mode corresponding to a logic address and a database area adopting a virtual single-layer unit pSLC storage mode are adopted, wherein the data area and the database area are used for storing different data, the data area is used for storing service data, and the database area is used for storing metadata; the method comprises the following steps:
a target logic storage unit for receiving target data transmitted by a host device and the target data;
if the data volume of the target data is greater than the preset capacity threshold of the database area, or the logic address of the target data is greater than the logic address of the database area, determining a target physical storage unit corresponding to the target logic storage unit in the data area according to a first mapping relation, wherein the physical storage unit and the logic storage unit of host equipment in the first mapping relation form a linear corresponding relation;
Storing the target data to the target physical storage unit;
in the case that the data erasure requirement exists, responding to an erasure instruction aiming at a target logic storage unit, and determining a physical storage unit corresponding to the target logic storage unit in the data area according to the first mapping relation;
and deleting the target data stored in the determined physical storage unit.
In a second aspect of the present application, a data storage device is provided, applied to a solid state disk SSD, the SSD including: a data area adopting a block mapping storage mode corresponding to a logic address and a database area adopting a virtual single-layer unit pSLC storage mode are adopted, wherein the data area and the database area are used for storing different data, the data area is used for storing service data, and the database area is used for storing metadata; the device comprises:
the receiving module is used for receiving target data transmitted by the host equipment and a target logic storage unit of the target data;
a first determining module, configured to determine, in the data area, a target physical storage unit corresponding to the target logical storage unit according to a first mapping relationship if the data size of the target data is greater than a preset capacity threshold of the database area, or if the logical address of the target data is greater than the logical address of the database area, where the physical storage unit and the logical storage unit of the host device in the first mapping relationship form a linear corresponding relationship;
The first storage module is used for storing the target data to the target physical storage unit;
the second determining module is used for responding to an erasing instruction aiming at a target logic storage unit under the condition that the data erasing requirement exists, and determining a physical storage unit corresponding to the target logic storage unit in the data area according to the first mapping relation;
and the deleting module is used for deleting the target data stored in the determined physical storage unit.
In a third aspect of the present application, there is provided an electronic device, comprising:
a memory for storing a computer program;
a processor configured to implement the method according to any one of the first aspect when executing a program stored in the memory.
In a fourth aspect of the present application, there is provided a computer readable storage medium having a computer program stored therein, which when executed by a processor, implements the method of any of the first aspects.
The beneficial effects of the embodiment of the application are that:
the data processing method, the electronic device and the computer readable storage medium provided by the embodiment of the application judge whether target data transmitted by the host device is written into the data area or the database area through the logic address or the data volume. In this embodiment, the target data are stored in different areas of the SSD according to the size of the data volume, where the data area stores data with a logical address greater than that of the database area, and the data is usually service data, for example, video data, and the database area stores data with a logical address less than that of the database area, and the data is usually metadata, so that the metadata and the video data are separately stored, which not only improves the stability of the metadata, but also improves the read-write performance of the metadata. Because the physical storage units and the logical storage units of the host equipment in the first mapping relation form a linear corresponding relation, when data are stored, the data can be directly stored in the corresponding physical storage units based on the first mapping relation, and the operation of refreshing the mapping table is not needed. In addition, when the host device determines that the target data is invalid data, it can determine a physical storage unit corresponding to a logical storage unit of the target data based on the first mapping relation, and then delete the target data stored in the physical storage unit directly. Because the garbage collection is not needed, the writing delay of the host equipment can be reduced, the writing amplification is reduced, and the service life of the SSD is prolonged.
Of course, not all of the above-described advantages need be achieved simultaneously in practicing any one of the products or methods of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following description will briefly introduce the drawings that are required to be used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other embodiments may also be obtained according to these drawings to those skilled in the art.
Fig. 1-1 is a schematic diagram of internal physical block division of a conventional SSD according to an embodiment of the disclosure;
FIGS. 1-2 are schematic diagrams illustrating a conventional SSD management distribution according to embodiments of the present application;
fig. 2-1 is a schematic diagram of internal physical block division of an SSD according to an embodiment of the disclosure;
fig. 2-2 is a schematic diagram of SSD management according to an embodiment of the present application;
fig. 2-3 are schematic flow diagrams of a data processing method according to an embodiment of the present application;
fig. 2-4 are schematic diagrams of a target data transmission processing mechanism according to an embodiment of the present application;
FIGS. 2-5 are schematic diagrams illustrating interaction between a host device and an SSD according to embodiments of the present application;
fig. 3 is a schematic diagram of a host device according to an embodiment of the present application to allocate each data stream to die;
FIG. 4 is a schematic diagram of a data storage device according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. Based on the embodiments herein, a person of ordinary skill in the art would be able to obtain all other embodiments based on the disclosure herein, which are within the scope of the disclosure herein.
Conventional SSD internal physical block partitioning is shown in FIG. 1-1, and includes: sys reserved, user area, OP area, wherein the User area accounts for 93.2% and the OP area accounts for 6.8%. As shown in fig. 1-2, a conventional SSD management distribution diagram includes: the system comprises a Sys area, a Table mapping Table, a User data area and an OP area, wherein the User data area comprises a plurality of BU (a storage unit name) units, and each BU unit consists of a plurality of Dies.
For more clear explanation of the data storage method provided by the embodiment of the present invention, an exemplary illustration of one possible application scenario of the data storage method provided by the embodiment of the present invention will be described below, it will be understood that the following example is only one possible application scenario of the data processing method provided by the embodiment of the present invention, and in other possible embodiments, the data processing method provided by the embodiment of the present invention may also be applied to other possible application scenarios, which are not limited in any way by the following examples.
SSD (Solid State Drive): the solid state disk is made of solid state electronic memory processing unit array, and is composed of control unit and memory unit (FLASH processing unit, DRAM processing unit). Flash Memory (Flash Memory) is adopted as a storage device, and one type of Flash Memory commonly used in solid state disks is NAND Flash (a type of Flash Memory). The solid state disk is identical to the common hard disk in the aspects of interface specification, interface definition, interface function and interface using method, and is identical to the common hard disk in the aspects of product appearance and product size. The method is widely applied to the fields of vehicle-mounted, industrial control, video monitoring, network terminals, electric power, medical treatment, aviation, navigation equipment and the like.
NAND Flash: a non-volatile Flash memory, NAND Flash, has the following characteristics: each bit can only change from 1 to 0 when writing, and from 0 to 1 when erasing. Data is read and written in units of pages, and data is erased in units of blocks, wherein the data of an effective page inside the block needs to be moved before the data is erased, and the maximum erasing times exist in each block in the NAND Flash. The NAND Flash includes CEs (chip select pins), each CE has one or more stripes packaged therein as physical storage units, each stripe includes a plurality of physical storage blocks (blocks), and the stripe has the same meaning as the LUN (Logicl Unit Number, logical unit number).
SLC (Single Level Cell): the single-layer unit, one memory cell can store 1bit of data, the flash memory of the memory cell type is most accurate when reading and writing data, and has the advantage of longest data read-write life.
MLC (Multi Level Cell): multi-layered cells, one memory cell capable of storing 2 bits of data, flash memory of this memory cell type expands the capacity of an SSD but is less robust and reliable than SLC flash memory.
TLC (Triple Level Cell): three layers of cells, one memory cell can store 3 bits of data, the cost of the flash memory of the memory cell type is lower, but compared with SLC and MLC memory cells, the shoe polishing life of the TLC memory cells is much shorter, and the reading and writing speeds are slowest.
QLC (Quad level cells): the four-layer unit, a storage unit can store 4bit data, the cost of the flash memory of the storage unit type is lower, the flash memory is realized by means of fewer drivers when being stored, and the flash memory has the characteristics of larger capacity, high storage density and the like. QLC cells have reduced performance and write life compared to SLC, MLC cells, but are comparable to TLC cells.
pSLC (Pseudo SLC) the virtual SLC is configured into SLC mode by special flash memory management optimization algorithm, so that the SLC can read and write in SLC NAND working mode, thereby achieving high performance, high reliability and high durability similar to SLC.
The flash memory comprises:
page (page): 4K;
block (block): a block is formed by 64 or 128 pages;
face (plane): a plurality of blocks form a plane;
stripe (Die): a Die is composed of one or more planes;
flash memory chip: forming a flash memory chip from a plurality of strips;
SSD: an SSD is composed of a plurality of flash memory chips.
Op: the space inside the SSD for data transition supply is reserved by each manufacturer for GC (Garbage Collection ) and is invisible to the user. As the user's demand changes, the data originally stored in the solid state disk may become invalid data. Because the flash memory does not support coverage and cannot directly cover invalid data by using the newly written solid state disk, the storage space capable of being used for storing data in the solid state disk is gradually reduced along with the increase of the invalid data. In order to avoid the occupation of excessive storage space by invalid data, the solid state disk can be subjected to garbage recycling treatment. For example, assuming that in a block (composed of 64 pages), 32 pages are valid data and 32 pages are marked with "deleted" invalid data, before the block is rewritten, the whole block data needs to be erased, and then the other half of valid data needs to be moved to an empty block, which is called GC garbage collection technology. The Op area as described in fig. 1-1 is the space reserved by the GC, and this part of the space often occupies at least 6.8% of the capacity of the entire SSD.
Write amplification: in the garbage recycling process, the effective data is written once originally, and is rewritten in the moving process, and the process is write amplification.
In the prior art, storage media of a solid state disk are divided into two types, one type adopts a FLASH memory (FLASH processing unit) as the storage medium, and the other type adopts a DRAM as the storage medium. The NAND-Flash memory is one of Flash memories, and the NAND structure can provide extremely high cell density, can achieve high storage density, and also has a large writing and erasing speed. In most conventional SSD solution products based on NAND at present, in order to improve the durability of the solid state disk and prolong the service life of the hard disk, it is necessary to recycle garbage of the solid state disk, which requires at least 6.8% of space reserved for garbage recycling. But this results in a reduction in the space actually used by the user.
Based on this, the embodiment of the application provides a data processing method, and for convenience of description, in the embodiment of the application, a video monitoring application scenario is described as an example. The data processing method provided by the embodiment of the application can be applied to an SSD, and the SSD comprises: a database area and a data area. As shown in fig. 2-1, an internal physical block partitioning schematic diagram of an SSD according to an embodiment of the present application is provided, where the SSD is partitioned into: SYS system reserved area, database area, data area. Fig. 2-2 are schematic diagrams of SSD management according to an embodiment of the present application, including: sys block (Sys area), conVention SLC Zone (database area in this application), sequential-Write-Required Zone (data area in this application); the storage mode in the database area is the same as the traditional SSD storage mode, and comprises a plurality of zones (a storage unit); the data area is stored in a block mapping mode, wherein blkA … … blkN is a plurality of mapping relations, each die comprises a plurality of planes, and each plane is provided with a corresponding zone. The SSD includes: the method comprises the steps of adopting a data area of a block mapping storage mode corresponding to a logic address and a database area of a virtual single-layer unit pSLC storage mode, wherein the data area and the database area are used for storing different data, the data area is used for storing service data, and the database area is used for storing metadata.
Fig. 2-3 are schematic flow diagrams of a data processing method according to an embodiment of the present application, where the method includes:
s201, target data and a target logic storage unit of the target data transmitted by the host device are received.
S202, if the data volume of the target data is larger than a preset capacity threshold of the database area, or the logic address of the target data is larger than the logic address of the database area, determining a target physical storage unit corresponding to the target logic storage unit in the data area according to a first mapping relation, wherein the physical storage unit and the logic storage unit of the host equipment in the first mapping relation form a linear corresponding relation.
S203, storing the target data into a target physical storage unit.
S204, in the case that the data erasure requirement exists, responding to an erasure instruction aiming at the target logic storage unit, and determining a physical storage unit corresponding to the target logic storage unit in the data area according to the first mapping relation.
S205, deleting the target data stored in the determined physical storage unit.
In this embodiment, the target data are stored in different areas of the SSD according to the size of the data volume, where the data area stores data with a logical address greater than that of the database area, and the data is usually service data, for example, video data, and the database area stores data with a logical address less than that of the database area, and the data is usually metadata, so that the metadata and the video data are separately stored, which not only improves the stability of the metadata, but also improves the read-write performance of the metadata. Because the physical storage units and the logical storage units of the host equipment in the first mapping relation form a linear corresponding relation, when data are stored, the data can be directly stored in the corresponding physical storage units based on the first mapping relation, and the operation of refreshing the mapping table is not needed. In addition, when the host device determines that the target data is invalid data, it can determine a physical storage unit corresponding to a logical storage unit of the target data based on the first mapping relation, and then delete the target data stored in the physical storage unit directly. Because the garbage collection is not needed, the writing delay of the host equipment can be reduced, the writing amplification is reduced, and the service life of the SSD is prolonged.
The following describes the above-mentioned S201 to S205 in detail:
as shown in fig. 2-4, for the target data transmission processing mechanism, the Host device, that is, the Host device, transmits the target data to the front end of the SSD, and after protocol analysis, the data reaches the layer ftl of the SSD, and the layer ftl determines whether to store the target data in the data area or the data base area according to the preset processing mechanism. And storing database data into a database area and storing video data into a data area, wherein the database area is stored by adopting 4K mapping of the traditional pSLC, and the data area is stored by adopting block mapping.
In the embodiment of the application, the SSD data storage area is entirely divided into two parts: the database area is used as a normal traditional SSD and is used for storing data in a pSLC mode. And the data area adopts a block mapping relation to store data. The manner in which the data is stored in the database area and the data area will be described in detail later, and will not be described in detail.
In the embodiment of the present application, the capacity size of the database area is predetermined. The minimum capacity of the database required by the host device determines the capacity of the database area. The minimum capacity of the database required by the host device is the amount of capacity required to store important data in the database of the host device. For example, the important data may be a file index, a file number, etc., and this part of the data may be restored after other data stored in the data area is lost, for example, after the video data is lost. This portion of the data is integral to the host device database and is referred to as database data. Therefore, it is preferentially stored in the database area stored by the pSLC system. The high performance, high reliability and high durability of the pSLC can lead the data of the part to be difficult to lose and have better stability. Assuming that the total capacity of the database of the host device is 512G, the capacity required to store important data is 6G, i.e., the capacity of the required pSLC is at least 6G; assuming that the total capacity of the database of the host device is 1024G, the capacity required to store important data is 10G, i.e., the capacity of the required pSLC is at least 10G; assuming that the total capacity of the database of the host device is 2048G, the capacity required to store important data is 20G, i.e., the capacity of the required pSLC is at least 20G; the size of the database total capacity of the host device versus the capacity of the required pSLC is determined by one skilled in the art based on the size of the SSD data area.
When the capacity of the host device database is fixed, the larger the pSLC capacity, the smaller the host device can be used to store other data. Therefore, in order to make the host device as large as possible to store other data, the pSLC capacity should be as close as possible to the database minimum capacity. For example, assuming that the capacity required for the host device to store important data is 6G, the minimum capacity of the required pSLC is 6G; when the capacity of the database area is set in the SSD, the minimum capacity should be 6G, for example, 6G, or may be 6.1G,8G, or the like, which may be specifically set according to the actual application scenario. For convenience of description, in this embodiment, the description is given by taking the database area capacity of the SSD as 6G as an example.
In S201, the target logical storage unit of the target data is a storage unit corresponding to the logical address of the target data. The logical address is a virtual address and the logical memory unit is a virtual memory unit. The target logical storage unit of the target data is determined in advance after the host device receives the target data, the corresponding target physical storage unit is determined after the target logical storage unit is determined, the corresponding relation between the logical storage unit and the physical storage unit is stored in the first mapping relation, and the subsequent SSD only needs to determine the target physical storage unit corresponding to the target logical storage unit based on the first mapping relation.
In S202, the logical address of the database area is determined according to the host device database size. The size of the database area capacity in the required SSD can be determined by the size of the database of the host device, and the preset capacity threshold is determined based on the size of the database area capacity.
And if the data volume of the target data is larger than the preset capacity threshold value of the database area, indicating that the data volume of the target data is larger than the capacity of the database area.
The logical address of the database area is the logical address corresponding to the last logical storage unit of the database area.
If the logical address of the target data is greater than the logical address of the database area, it means that the data size of the target data is greater than the capacity of the database area.
Whether the data volume of the target data exceeds the capacity of the database area can be determined by comparing the size between the logical address of the target data and the logical address of the database area, or by comparing the data volume of the target data with the capacity of the database area.
In S203, each logical address corresponds to a physical address, and the storage unit corresponding to the physical address is a physical storage unit. I.e., each target logical storage unit corresponds to only one target physical storage unit. The physical storage units are not virtual.
In S204, S205, for the target data, the case where there is a need for data erasure includes: when the host device determines that the target data is invalid, the target data needs to be erased; when the host device calculates that the storage capacity of the SSD is insufficient, it is necessary to erase the target data. Any situation where there is a need for data erasure may be applied to embodiments of the present application.
Under the condition that the data erasure requirement exists, the host device sends an erasure instruction aiming at a target logic storage unit corresponding to target data to the SSD or sends an erasure instruction aiming at a target logic storage unit corresponding to data with longer storage time to the SSD, after the SSD receives the erasure instruction, the SSD determines a physical storage unit corresponding to the target logic storage unit according to a first mapping relation, and then deletes the target data stored in the determined physical storage unit. Compared with the prior art, the method and the device have the advantages that the management is carried out according to the whole area, and the one-to-one correspondence relation does not exist, so that the scheme of integral deletion is only adopted.
The manner of determining the data with longer storage time by the host device may be that the host device stores time information of the data stored in each logic storage unit, and then determines whether the stored data is old or not according to the time information; the data stored in the logical storage unit with the storage time greater than the preset time threshold can also be directly determined as old data. Any manner of determining data stored for a longer period of time may be used in embodiments of the present application.
In one possible embodiment, the step S202 may specifically be:
s2021, calculating the difference value between the logical address of the target logical storage unit and the logical address of the database area.
S2022, calculating the ratio of the difference value to the capacity of the physical storage unit of the data area, and using the ratio as an id identification of the physical storage unit.
In the above steps, the logical address corresponding to the capacity of the database area is the logical address corresponding to the last physical storage unit of the database area; the capacity of the database area is calculated based on the minimum capacity of the database required by the host device.
The logical address of the target logical storage unit and the logical address of the data area are linearly related to the physical storage unit id identification. Wherein, the logical address of the target logical storage unit=the initial logical address+the address offset 1, and the logical address of the physical storage unit of the data area=the initial logical address+the address offset 2, and since the initial logical addresses are the same, the difference between the logical address of the target logical storage unit and the logical address of the physical storage unit of the data area can be represented by the address offset 1-the address offset 2, that is, the difference between the logical address of the target logical storage unit and the logical address of the physical storage unit of the data area can be represented by the address offset.
The logical address of the target logical storage unit is positively correlated with the physical storage unit id identification and the logical address of the database area is negatively correlated with the physical storage unit identification.
Specifically, the physical storage unit identity may be determined by the following formula:
wherein zone represents a physical storage unit, zone id is a target physical storage unit identifier, Q is a logical address of a target logical storage unit, Z is a logical address of a database area, and Q is a physical storage unit capacity.
Illustratively, assuming that the physical storage unit is identified as N, it is the (n+1) th physical storage unit.
S2023, taking the physical storage unit corresponding to the id identifier as a target physical storage unit.
In this step, the id identifier is the number of the physical storage unit in the data area, and the physical unit can be uniquely determined in the data area through the id identifier.
In this embodiment, the interval of the physical storage unit corresponding to the target data is determined by calculating the difference between the address offset of the target logical storage unit of the target data and the logical address of the database area, and then dividing the interval by the capacity of the physical storage unit, thereby determining the corresponding target physical storage unit. The target physical storage unit can be determined only through linear calculation, the logical storage units are not needed to sequentially determine the physical storage units, and the data size of the identification is much smaller than that of the logical storage units, so that the efficiency of determining the target physical storage unit is improved.
In one possible embodiment, to improve the maximum performance of the device and improve the stability and durability of the SSD, the SSD exposes certain operation interfaces to the host device, so as to implement interaction between the host device and the SSD, as shown in fig. 2-5, which are schematic diagrams of interaction between the host device and the SSD. The method further comprises the following steps:
s206, responding to an acquisition instruction of the state information of the data area sent by the host equipment, and sending the state information of the data area to the host equipment, so that the host equipment determines an abnormal physical storage unit with potential abnormality according to the state information.
In this step, the potential exception is an impending exception, if the physical storage unit of the potential exception is not handled in time, the physical storage unit may be abnormal, and in order to avoid the occurrence of the exception, the potential exception may be handled when the physical storage unit is abnormal (for example, the data is determined to be unstable or the data is impending to be abnormal according to the state information of the data area).
The host device autonomously acquires the state information of the physical storage unit of the data area, and when the host device needs to acquire the state information of the physical storage unit of the data area, the host device sends an acquisition instruction to the SSD, and after receiving the acquisition instruction, the SSD sends the state information of the data area to the host device. So that the host device can discover the potentially abnormal physical storage units in time according to the state information. The host device can automatically obtain the state information of the material storage units in the data area at regular time so as to monitor the SSD in real time, and once the physical storage units in the SSD are potentially abnormal, the SSD can be processed in time.
S207, receiving a read instruction sent by the host device aiming at the abnormal physical storage unit and a write instruction sent by the host device aiming at the non-abnormal physical storage unit; wherein the read instructions are sent in a high-to-low order based on a preset priority of the anomaly type of the potential anomaly; the preset priority is preset based on the abnormality type.
In this step, the anomaly type includes, but is not limited to, medium anomaly, read interference, wear leveling, data retention, etc., and the preset priority is preset by those skilled in the art according to the actual application scenario. For example, in one application scenario, the preset priority of the anomaly type related to the particulate media of the NAND is high, and the preset priority of the anomaly type of the disturbance class is low. In another application scenario, the preset priority of the anomaly type related to the media anomaly is high, the preset priority of the anomaly type related to the wear condition is low, and so on. The reason for the abnormal state information is the normal phenomenon of the read-write operation of the solid state disk. The order of sending the read instructions is related to the priority of the type of exception of the potential exception, and the higher the priority, the earlier the read instructions are sent to the exception physical memory location of the potential exception. Thus, since the order in which the SSD receives the read instructions is received in the host device transmission order, the order in which the SSD subsequently executes the read instructions is also the order in which the SSD sequentially executes. The host device is sent in a pre-set priority order so that the SSD also receives and executes the read instructions in this order.
For example, the host device may acquire the state information of each physical storage unit zone of the data area every 1 hour, when it is determined that zone1 and zone3 are abnormal physical storage units with potential abnormalities, and the priority of the abnormality type of zone1 is higher than that of the abnormality type of zone3, a read command is sent to the SSD for zone1, then a write command is sent to the SSD for zone2 in a non-abnormal area, so that data in zone1 is written to zone2, a read command is sent to the SSD for zone3 after a read command is sent to the SSD for zone1, then a write command is sent to the SSD for zone4 in a non-abnormal area, so that data in zone3 is written to zone4, and then the SSD sends new state information to the host device.
S208, responding to the read instruction and the write instruction, storing the data stored in the abnormal physical storage unit into the non-abnormal physical storage unit according to the read instruction and the write instruction, and deleting the data stored in the abnormal physical storage unit.
In this step, after receiving a read instruction of an exception process and a write instruction of a non-exception area sent by a host device in response to status information for the exception area, the SSD reads data stored in a physical storage unit of the exception area, writes the data into the physical storage unit of the non-exception area indicated by the write instruction, and deletes all data in the physical storage unit corresponding to the exception area. Taking zone1 as an example, after receiving the read-write command 1, the SSD writes the data in zone1 into a new zone2 and deletes the data in zone 1.
S209, in response to a completion instruction of the host device for storing the data stored in the abnormal physical storage unit to the non-abnormal physical storage unit, updating the state information of the abnormal physical storage unit.
In this step, after the data stored in the abnormal physical storage unit has been completely restored to the non-abnormal physical storage unit, the host device sends a completion instruction to the SSD to inform the SSD that the abnormality of the abnormal physical storage unit has been completed, and the SSD may update the state information of the abnormal physical storage unit to update the abnormality of the type of abnormality, in which the abnormality is about to occur, to a normal state. Specifically, the state information includes an exception state flag for characterizing each exception type of each physical storage unit, wherein the exception state flag includes a first value and a second value, the first value being used to characterize the potential exception of the exception type; the second value is used to characterize the potential anomaly for which the anomaly type does not exist.
In one possible embodiment, the state information of the abnormal physical storage unit may be updated by changing the value, and the above S209 may specifically be:
s2091, in response to the host device changing the abnormal state flag in the state information of the abnormal physical storage unit from the first value to the second value for a completion instruction to store the data stored in the abnormal physical storage unit to the non-abnormal physical storage unit.
Each physical memory cell has a 32bit exception status flag, wherein each exception type exception status flag is recorded with 1 bit. The state information includes abnormal state indicia for characterizing various types of the various physical memory cells.
If the abnormal state of a certain abnormal type of the physical storage unit is marked as the first value, the potential abnormality of the abnormal type exists in the physical storage unit, namely the abnormality of the abnormal type is about to occur.
If the exception of a certain exception type of the physical storage unit is marked as the second value, the fact that the physical storage unit does not have the potential exception of the exception type is indicated, namely the exception of the exception type does not occur.
In this step, updating the state information of the abnormal material storage unit only needs to change the abnormal state flag in the bit corresponding to the abnormal type of the potential abnormality from the first data to the second value.
For example, assuming that the first value is 0 and the second value is 1, if the bit of the exception type 1 of the exception physical storage unit 1 is 0, it indicates that the exception physical storage unit has a potential exception of the exception type 1, the host device sends a read command to the exception physical storage unit, reads out the data of the exception physical storage unit 1, and then stores the data in the non-exception physical storage unit 2 again, and changes the bit of the exception type 1 in the state information of the exception physical storage unit from 0 to 1, so as to characterize that the exception of the exception physical storage unit has been processed, and the exception physical storage unit has recovered to be normal.
In the embodiment of the application, the abnormal region is processed through interaction between the host device and the SSD, and the host device controls the SSD to execute the abnormal processing operation, so that the host device can autonomously control the SSD operation, and the performance of the SSD is improved. And when the host device finds that the physical storage unit of the SSD has potential abnormality, the abnormality is processed, so that the abnormality is not perceived to the user, and the user experience can be improved.
To further enhance the performance of the SSD, the destination data includes a plurality of data streams, the SSD has a plurality of stripes, each of which includes a plurality of plane planes. Different data streams are distributed to different planes in different die, and the sum of code rates of the data streams distributed to the planes in the same die is smaller than the upper limit of a preset code rate; the target logical storage unit is determined in the plane allocated for each data stream; if the sum of the code rates of the data streams allocated to each plane in the same die is larger than the upper limit of the preset code rate, transferring at least one data stream allocated to the plane in the die to a plane with a low code rate, wherein the low code rate is the die that the sum of the code rates of all the data streams allocated to each plane is smaller than the lower limit of the preset code rate. And the target logic storage unit is a logic storage unit with abrasion less than a preset abrasion threshold value in the plane allocated to the data stream.
That is, the host device determines the target logical storage unit by:
a) Allocating different planes in different die for different data streams, wherein the sum of code rates of the data streams allocated for the planes in the same die is smaller than a preset code rate upper limit;
b) For each data stream, determining a target logical storage unit of the data stream in the plane allocated to the data stream.
As shown in fig. 3, the data received by the same channel is the same data stream. The target data comprises a plurality of data streams, that is to say the target data is data received by a plurality of channels. die is a storage unit of the SSD. Each die includes a plurality of planes, each plane having a plurality of physical memory locations therein. The host equipment sends and receives target data through the data interface, the channels are data interfaces for sending and receiving data by the host equipment, and each channel sends and receives one path of target data. The data sent and received by each channel is correspondingly stored on one strip of the SSD. Each stripe is made up of the same number of physical storage units.
After receiving the target data, the host device allocates die for the data stream according to the data stream of the target data.
If the number of the data streams is less than or equal to the number of die, if the number of the data streams and the number of die in the SSD are all n, the SSD adopts a mode of writing multiple die in parallel to achieve maximum performance, and each data stream is correspondingly allocated in one die of the SSD.
If the number of data streams is greater than the number of die, such as n+3 data streams and n die, the host device will preferentially allocate n paths of data streams to n die of the SSD in parallel. The remaining 3 data streams, the host device calculates the code rate per data stream, and the write rate per die. The host device allocates the data stream with the large code rate to die with the small writing rate of the SSD. In fig. 3, the data stream with the number of n+2 is allocated to die0, the data stream with the number of n+1 is allocated to die1, and the data stream with the number of n+3 is allocated to die2. In this way, maximum performance is achieved when the host device allocates die of the SSD for each data stream to store the target data.
In one possible embodiment, a target logical storage unit with wear less than a preset wear threshold is determined in die assigned data stream.
In this step, the wear of the logical storage units is positively correlated with the performance, so in order to maximize the subsequent storage performance, the target logical storage unit needs to be selected from the logical storage units whose models are smaller than the preset wear threshold.
In this embodiment, by allocating different planes in different die for different data flows and determining the target logical storage unit of the target data in the planes, since the data flows of the target data are allocated to different planes in different die in parallel, when the target logical storage units are stored subsequently, the writing efficiency is further improved, and the maximum performance of the device is improved.
In order to further improve the performance of the device, the allocation method further includes:
c) And if the sum of the code rates of the data streams allocated to the planes in the same die is larger than the upper limit of the preset code rate, transferring at least one data stream allocated to the planes in the die to a low code rate die for storage.
In this step, the code rate is the total amount of data transmitted in unit time of each channel. And the sum of the code rates of all data streams allocated for each plane is smaller than the die of the preset code rate lower limit.
If the sum of the code rates of the data streams distributed by the planes in the die is larger than the upper limit of the preset code rate, the die is in a busy state, and no capacity can store data, namely the data cannot be stored on the physical storage units of the planes in the die. If the sum of the code rates of the data streams allocated to the planes in the die is smaller than the lower limit of the preset code rate, the die is not in the busy state, and enough capacity is available for storing data, so that the data streams can be allocated to the planes in the die preferentially.
In one embodiment, the sum of the code rates of the data streams allocated to the planes in the die of all the die in the SSD may be arranged in order from small to large, and when one die is in busy state, at least one data stream on the die is transferred to the plane in the die with the smallest code rate selected according to the arrangement order.
In the process of storing data, if a certain die is in busy state, if the data stream is continuously allocated to the die, the working performance of the SSD is affected, in this embodiment, the data stream originally allocated to the die is transferred to other die which is not in busy state for storage, i.e. a die with better performance is selected for storage, and then the performance of the SSD can be improved. In one possible embodiment, the SSD further includes: the system reservation area, the database area includes effective physical storage unit and invalid physical storage unit, the effective physical storage unit stores effective data, the invalid physical storage unit stores invalid data; the method further comprises the steps of:
s210, storing the effective data into a system reservation area.
S211, deleting all data stored in the effective physical storage unit and the ineffective physical storage unit.
S212, transferring the effective data stored in the system reservation area to a database area.
In this embodiment, the region in the database area where garbage collection is performed is placed in the SYS reserved area, and since the database area stores database data with a relatively small data amount, the update frequency is not high. Therefore, the space occupied by garbage collection aiming at the data of the part is small, and the space can be completely born in the SYS reserved space, so that the garbage collection operation of the data in the database area is realized, and the stability of the database is improved.
The embodiment of the application provides a data storage device, which is applied to a solid state disk SSD, wherein the SSD comprises: a data area adopting a block mapping storage mode corresponding to a logic address and a database area adopting a virtual single-layer unit pSLC storage mode are adopted, wherein the data area and the database area are used for storing different data, the data area is used for storing service data, and the database area is used for storing metadata; as shown in fig. 4, the apparatus includes:
a receiving module 401, configured to receive target data transmitted by a host device and a target logic storage unit of the target data;
a first determining module 402, configured to determine, in the data area, a target physical storage unit corresponding to the target logical storage unit according to a first mapping relationship if the data amount of the target data is greater than a preset capacity threshold of the database area, or if the logical address of the target data is greater than the logical address of the database area, where the physical storage unit and the logical storage unit of the host device in the first mapping relationship are in a linear corresponding relationship;
a first storage module 403, configured to store the target data to the target physical storage unit;
A second determining module 404, configured to determine, in response to an erase instruction for a target logical storage unit, a physical storage unit corresponding to the target logical storage unit in the data area according to the first mapping relationship, in a case where there is a need for data erasure;
and the deleting module 405 is configured to delete the target data stored in the determined physical storage unit.
In one possible embodiment, the apparatus further comprises: an exception handling module 406, configured to send, in response to an acquisition instruction for status information of the data area sent by the host device, status information of the data area to the host device, so that the host device determines an exception physical storage unit with a potential exception according to the status information;
receiving a read instruction sent by the host device aiming at an abnormal physical storage unit and a write instruction sent by the host device aiming at a non-abnormal physical storage unit; wherein the read instruction is sent in order from high to low based on a preset priority of the anomaly type of the potential anomaly; the preset priority is preset based on the abnormality type;
in response to the read instruction and the write instruction, storing the data stored in the abnormal physical storage unit into a non-abnormal physical storage unit according to the read instruction and the write instruction, and deleting the data stored in the abnormal physical storage unit;
Updating state information of the abnormal physical storage unit in response to a completion instruction of the host device for storing data stored in the abnormal physical storage unit to a non-abnormal physical storage unit;
in one possible embodiment, the state information includes an exception state flag for characterizing each exception type of each physical storage unit, wherein the exception state flag includes a first value and a second value, the first value being used to characterize the existence of a potential exception of that exception type; the second value is used to characterize the absence of a potential anomaly of the anomaly type;
the updating, in response to a completion instruction of the host device for storing data stored in the abnormal physical storage unit to a non-abnormal physical storage unit, state information of the abnormal physical storage unit includes:
in response to a completion instruction of the host device for storing data stored in the abnormal physical storage unit to a non-abnormal physical storage unit, changing an abnormal state flag in state information of the abnormal physical storage unit from a first value to a second value.
In one possible embodiment, the determining, according to the first mapping relationship, a target physical storage unit corresponding to the target logical storage unit in the data area includes:
Calculating the difference value between the logical address of the target logical storage unit and the logical address of the database area;
calculating the ratio of the difference value to the capacity of a physical storage unit of the data area as an id identification of the physical storage unit;
taking a physical storage unit corresponding to the id identifier as the target physical storage unit;
the target data comprises a plurality of data streams, and the SSD has a plurality of stripes; the die comprises a plurality of plane;
different data streams are distributed to different planes in different die, and the sum of code rates of the data streams distributed to the planes in the same die is smaller than the upper limit of a preset code rate; the target logical storage unit is determined in the plane allocated for each of the data streams;
if the sum of the code rates of the data streams allocated to the planes in the same die is larger than the upper limit of the preset code rate, transferring at least one data stream allocated to the planes in the die to a plane with a low code rate, wherein the low code rate die is a die with the sum of the code rates of all the data streams allocated to the planes smaller than the lower limit of the preset code rate. And the target logic storage unit is a logic storage unit with abrasion less than a preset abrasion threshold value in the plane allocated to the data stream. The SSD further includes: the device comprises a system reservation area, a recovery module and a data storage area, wherein the database area comprises an effective physical storage unit and an ineffective physical storage unit, the effective physical storage unit stores effective data, the ineffective physical storage unit stores ineffective data, and the recovery module is used for storing the effective data into the system reservation area;
Deleting all data stored in the effective physical storage unit and the ineffective physical storage unit;
and transferring the valid data stored in the system reserved area to the database area.
The embodiment of the application also provides an electronic device, as shown in fig. 5, including:
a memory 501 for storing a computer program;
the processor 502 is configured to execute the program stored in the memory 501, and implement the following steps:
a target logic storage unit for receiving target data transmitted by a host device and the target data;
if the data volume of the target data is greater than the preset capacity threshold of the database area, or the logic address of the target data is greater than the logic address of the database area, determining a target physical storage unit corresponding to the target logic storage unit in the data area according to a first mapping relation, wherein the physical storage unit and the logic storage unit of host equipment in the first mapping relation form a linear corresponding relation;
storing the target data to the target physical storage unit;
in the case that the data erasure requirement exists, responding to an erasure instruction aiming at a target logic storage unit, and determining a physical storage unit corresponding to the target logic storage unit in the data area according to the first mapping relation;
And deleting the target data stored in the determined physical storage unit.
And the electronic device may further comprise a communication bus and/or a communication interface, through which the processor 502, the communication interface, and the memory 501 communicate with each other.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment provided herein, there is also provided a computer readable storage medium having stored therein a computer program which when executed by a processor implements the steps of any of the data storage methods described above.
In yet another embodiment provided herein, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the data storage methods of the above embodiments.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., a floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a Solid State Disk (SSD), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus 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 apparatus. 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 apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the present application. Any modifications, equivalent substitutions, improvements, etc. that are within the spirit and principles of the present application are intended to be included within the scope of the present application.
Claims (10)
1. The data processing method is characterized by being applied to a solid state disk SSD, wherein the SSD comprises: a data area adopting a block mapping storage mode corresponding to a logic address and a database area adopting a virtual single-layer unit pSLC storage mode are adopted, wherein the data area and the database area are used for storing different data, the data area is used for storing service data, and the database area is used for storing metadata; the method comprises the following steps:
a target logic storage unit for receiving target data transmitted by a host device and the target data;
if the data volume of the target data is greater than the preset capacity threshold of the database area, or the logic address of the target data is greater than the logic address of the database area, determining a target physical storage unit corresponding to the target logic storage unit in the data area according to a first mapping relation, wherein the physical storage unit and the logic storage unit of host equipment in the first mapping relation form a linear corresponding relation;
storing the target data to the target physical storage unit;
in the case that the data erasure requirement exists, responding to an erasure instruction aiming at a target logic storage unit, and determining a physical storage unit corresponding to the target logic storage unit in the data area according to the first mapping relation;
And deleting the target data stored in the determined physical storage unit.
2. The method according to claim 1, wherein the method further comprises:
transmitting state information of the data area to the host equipment in response to an acquisition instruction of the state information of the data area transmitted by the host equipment, so that the host equipment determines an abnormal physical storage unit with potential abnormality according to the state information;
receiving a read instruction sent by the host device aiming at an abnormal physical storage unit and a write instruction sent by the host device aiming at a non-abnormal physical storage unit; wherein the read instruction is sent in order from high to low based on a preset priority of the anomaly type of the potential anomaly; the preset priority is preset based on the abnormality type;
in response to the read instruction and the write instruction, storing the data stored in the abnormal physical storage unit into a non-abnormal physical storage unit according to the read instruction and the write instruction, and deleting the data stored in the abnormal physical storage unit;
in response to a completion instruction of the host device for storing data stored in the abnormal physical storage unit to a non-abnormal physical storage unit, status information of the abnormal physical storage unit is updated.
3. The method of claim 2, wherein the status information includes an exception status flag for characterizing each exception type of each physical storage unit, wherein the exception status flag includes a first value and a second value, the first value being used to characterize the existence of a potential exception of the exception type; the second value is used to characterize the absence of a potential anomaly of the anomaly type;
the updating, in response to a completion instruction of the host device for storing data stored in the abnormal physical storage unit to a non-abnormal physical storage unit, state information of the abnormal physical storage unit includes:
in response to a completion instruction of the host device for storing data stored in the abnormal physical storage unit to a non-abnormal physical storage unit, changing an abnormal state flag in state information of the abnormal physical storage unit from a first value to a second value.
4. The method of claim 1, wherein determining a target physical storage unit corresponding to the target logical storage unit in the data area according to the first mapping relationship comprises:
calculating the difference value between the logical address of the target logical storage unit and the logical address of the database area;
Calculating the ratio of the difference value to the capacity of a physical storage unit of the data area as an id identification of the physical storage unit;
and taking the physical storage unit corresponding to the id identifier as the target physical storage unit.
5. The method of claim 1, wherein the target data comprises a plurality of data streams, the SSD having a plurality of stripes die; the die comprises a plurality of plane;
different data streams are distributed to different planes in different die, and the sum of code rates of the data streams distributed to the planes in the same die is smaller than the upper limit of a preset code rate; the target logical storage unit is determined in the plane allocated for each data stream; if the sum of the code rates of the data streams allocated to the planes in the same die is larger than the upper limit of the preset code rate, transferring at least one data stream allocated to the planes in the die to a plane with a low code rate, wherein the low code rate die is a die with the sum of the code rates of all the data streams allocated to the planes smaller than the lower limit of the preset code rate.
6. The method of claim 5, wherein the step of determining the position of the probe is performed,
and the target logic storage unit is a logic storage unit with abrasion less than a preset abrasion threshold value in the plane allocated to the data stream.
7. The method of claim 1, wherein the SSD further comprises: a system reservation zone, the database zone comprising an active physical storage unit storing active data and an inactive physical storage unit storing inactive data, the method further comprising:
storing the valid data to the system reserved area;
deleting all data stored in the effective physical storage unit and the ineffective physical storage unit;
and transferring the valid data stored in the system reserved area to the database area.
8. A data processing apparatus, for use in a solid state disk, SSD, the SSD comprising: a data area adopting a block mapping storage mode corresponding to a logic address and a database area adopting a virtual single-layer unit pSLC storage mode are adopted, wherein the data area and the database area are used for storing different data, the data area is used for storing service data, and the database area is used for storing metadata; the device comprises:
the receiving module is used for receiving target data transmitted by the host equipment and a target logic storage unit of the target data;
A first determining module, configured to determine, in the data area, a target physical storage unit corresponding to the target logical storage unit according to a first mapping relationship if the data size of the target data is greater than a preset capacity threshold of the database area, or if the logical address of the target data is greater than the logical address of the database area, where the physical storage unit and the logical storage unit of the host device in the first mapping relationship form a linear corresponding relationship;
the first storage module is used for storing the target data to the target physical storage unit;
the second determining module is used for responding to an erasing instruction aiming at a target logic storage unit under the condition that the data erasing requirement exists, and determining a physical storage unit corresponding to the target logic storage unit in the data area according to the first mapping relation;
and the deleting module is used for deleting the target data stored in the determined physical storage unit.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the method of any of claims 1-7 when executing a program stored on a memory.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the method of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311508639.6A CN117632003A (en) | 2023-11-13 | 2023-11-13 | Data processing method, device, electronic equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311508639.6A CN117632003A (en) | 2023-11-13 | 2023-11-13 | Data processing method, device, electronic equipment and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117632003A true CN117632003A (en) | 2024-03-01 |
Family
ID=90031317
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311508639.6A Pending CN117632003A (en) | 2023-11-13 | 2023-11-13 | Data processing method, device, electronic equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117632003A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118132012A (en) * | 2024-05-07 | 2024-06-04 | 杭州海康威视数字技术股份有限公司 | Data writing method, data reading method, system and electronic equipment |
-
2023
- 2023-11-13 CN CN202311508639.6A patent/CN117632003A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118132012A (en) * | 2024-05-07 | 2024-06-04 | 杭州海康威视数字技术股份有限公司 | Data writing method, data reading method, system and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20230152969A1 (en) | Memory system and method of controlling memory system | |
KR102291507B1 (en) | Operating method of memory controller | |
US9298534B2 (en) | Memory system and constructing method of logical block | |
US8832371B2 (en) | Storage system with multiple flash memory packages and data control method therefor | |
JP3942807B2 (en) | Semiconductor memory device with block alignment function | |
KR101521958B1 (en) | Hybrid density Memory storage device | |
CN113196226A (en) | Partitioned namespace in solid state drives | |
KR20210125774A (en) | Data Storage Apparatus and Operation Method Thereof | |
US10289317B2 (en) | Memory apparatus and methods thereof for write amplification aware wear leveling | |
US20140129758A1 (en) | Wear leveling in flash memory devices with trim commands | |
US10496297B2 (en) | Data categorization based on invalidation velocities | |
CN109697027B (en) | Data storage device including shared memory region and dedicated memory region | |
US8738876B2 (en) | Method for performing block management, and associated memory device and controller thereof | |
US10990325B2 (en) | Write control method, associated data storage device and controller thereof | |
US10126970B2 (en) | Paired metablocks in non-volatile storage device | |
KR20200068941A (en) | Apparatus and method for controlling data stored in memory system | |
KR20130079007A (en) | Method for managing data in storage device | |
US11513949B2 (en) | Storage device, and control method and recording medium thereof | |
CN105573666A (en) | Disk array device, disk control device, solid state drive, disk control method, and recording medium | |
CN111538680A (en) | Selecting mass storage device streams for garbage collection based on logical saturation | |
CN110908596A (en) | Data storage device, method of operating the same, and storage system including the same | |
CN112068782B (en) | Memory management method, memory storage device and memory control circuit unit | |
CN117632003A (en) | Data processing method, device, electronic equipment and computer readable storage medium | |
TW202314519A (en) | Data storage device for refreshing data and operating method thereof | |
CN111324287A (en) | Memory 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 |