Data management method and device, storage medium and electronic device

文档序号:1888628 发布日期:2021-11-26 浏览:2次 中文

阅读说明:本技术 数据的管理方法及装置、存储介质、电子装置 (Data management method and device, storage medium and electronic device ) 是由 贲伟建 刘征宇 杨超 于 2021-08-24 设计创作,主要内容包括:本发明提供了一种数据的管理方法及装置、存储介质、电子装置,上述方法包括:确定存储装置中每一个物理块的状态信息;在物理块不满足目标写入模式的情况下,将不满足目标写入模式的目标物理块的状态信息保存在第一列表中,其中,目标写入模式用于指示物理块支持多倍数据的迁移存储;获取存储装置的迁移列表,根据迁移列表确定出目标物理块在对应的迁移节点上绑定的虚拟物理块,并将虚拟物理块的信息保存在第二列表中,其中,迁移节点用指示目标物理块和虚拟物理块的对应关系;根据迁移列表、第一列表、第二列表对存储装置进行数据的写入管理,解决了现有技术中无法在保证存储装置可靠性的同时降低成本等问题。(The invention provides a data management method and device, a storage medium and an electronic device, wherein the method comprises the following steps: determining state information of each physical block in the storage device; under the condition that the physical block does not meet the target writing mode, storing the state information of the target physical block which does not meet the target writing mode in a first list, wherein the target writing mode is used for indicating that the physical block supports migration storage of multiple data; acquiring a migration list of a storage device, determining a virtual physical block bound by a target physical block on a corresponding migration node according to the migration list, and storing information of the virtual physical block in a second list, wherein the migration node indicates a corresponding relationship between the target physical block and the virtual physical block; data writing management is carried out on the storage device according to the migration list, the first list and the second list, and the problems that the reliability of the storage device cannot be guaranteed and the cost cannot be reduced in the prior art are solved.)

1. A method for managing data, comprising:

determining state information of each physical block in the storage device;

if the physical block does not satisfy the target writing mode, saving the state information of the target physical block which does not satisfy the target writing mode in a first list, wherein the target writing mode is used for indicating that the physical block supports migration storage of multiple data;

acquiring a migration list of the storage device, determining a virtual physical block bound on a corresponding migration node by the target physical block according to the migration list, and storing information of the virtual physical block in a second list, wherein the migration node indicates a corresponding relationship between the target physical block and the virtual physical block;

and performing data write management on the storage device according to the migration list, the first list and the second list.

2. The method of claim 1, wherein determining the state information for each physical block in the storage device comprises:

acquiring the erasing times of each physical block in the storage device and the writing time for executing each erasing;

comparing the erasing times and the writing time with the preset time of the target writing mode corresponding to the physical block and the preset times of the target writing mode to determine whether the physical block meets the target writing mode;

and determining the state information of the physical block according to the comparison result, the erasing times and the writing time.

3. The method of claim 2, wherein comparing the erase-write times and the write time with a predetermined time of a target write pattern corresponding to the physical block and a predetermined number of times of the target write pattern to determine whether the physical block satisfies the target write pattern comprises:

determining that the physical block does not support the target writing mode under the condition that the erasing times are greater than the preset times and the writing time is less than the preset time;

determining that the physical block supports the target writing mode under the condition that the erasing times are greater than the preset times and the writing time is not less than the preset time;

and determining that the physical block supports the target writing mode under the condition that the erasing times are less than the preset times.

4. The method of claim 1, wherein before saving the status information of the target physical block that does not satisfy the target write mode in the first list in a case where the physical block does not satisfy the target write mode, the method further comprises:

determining a migration node corresponding to the physical block from a migration list under the condition that the physical block meets a target writing mode, and migrating data on a virtual physical block bound with the physical block on the migration node into the physical block, wherein the migration node comprises a physical block with a data storage mode of a 3-order unit and 3 virtual physical blocks with a data storage mode of a single-layer unit;

and clearing occupation information corresponding to the virtual physical block under the condition that the data migration is completed, wherein the occupation information comprises: occupancy flag bit information.

5. The method of claim 1, wherein after saving the status information of the target physical block that does not satisfy the target write mode in the first list if the physical block does not satisfy the target write mode, the method further comprises:

changing the data storage mode of the target physical block stored in the first list;

converting the data storage mode of the target physical block from a 3-level cell to a single-layer cell.

6. The method according to claim 1, wherein after obtaining the migration list of the storage device, determining the virtual physical block to which the target physical block is bound on the corresponding migration node according to the migration list, and storing information of the virtual physical block in a second list, the method further comprises:

removing the migration node from the migration list, and determining whether the current migration node is the last node of the migration list;

under the condition that the migration node is the last node of the migration list, finishing executing the migration of the data corresponding to the migration node in the migration list;

and under the condition that the migration node is not the last node of the migration list, continuously and circularly executing the migration of the data corresponding to the migration node in the migration list.

7. The method according to claim 1, wherein performing write management of data to the storage device according to the migration list, the first list, and the second list comprises:

receiving a write-in command for analysis, and applying a physical block with a data storage mode of a 3-order unit as a storage block;

calling a target physical block which is converted into a single-layer unit from the first list to be used as a target virtual physical block to be bound with the storage block under the condition that the first list is not empty and an unused target physical block exists;

applying an original physical block of a single-layer unit from a physical block pool as a target virtual physical block to be bound with the storage block under the condition that the first list is empty;

and after the target virtual physical block configuration of the target quantity corresponding to the storage block is determined to be completed, generating a new migration node according to the storage block and the target virtual physical block, and adding the new migration node into a migration list.

8. An apparatus for managing data, comprising:

a first determination module configured to perform determining status information of each physical block in the storage device;

a first saving module configured to perform saving state information of a target physical block which does not satisfy a target write mode in a first list if the physical block does not satisfy the target write mode, wherein the target write mode is used for indicating that the physical block supports migration storage of multiple data;

a second saving module, configured to perform obtaining of a migration list of the storage apparatus, determine, according to the migration list, a virtual physical block to which the target physical block is bound on a corresponding migration node, and save information of the virtual physical block in a second list, where the migration node indicates a correspondence between the target physical block and the virtual physical block;

a management module configured to perform write management of data to the storage apparatus according to the migration list, the first list, and the second list.

9. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to carry out the method of any one of claims 1 to 7 when executed.

10. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 7.

Technical Field

The invention relates to the technical field of solid state disks, in particular to a data management method and device, a storage medium and an electronic device.

Background

The rapid development of the technology of electronic products in these years makes the consumer experience demand for electronic products higher and higher, and the demand for higher-speed and convenient storage products is greater and greater. Since the rewritable non-volatile memory (rewritable non-volatile memory) has the characteristics of non-volatility, power saving, small volume, no mechanical structure, high read-write speed and the like, the rewritable non-volatile memory is most suitable for portable electronic products such as notebook computers. A solid state disk is a storage device using a flash memory as a storage medium. Therefore, the flash memory industry has become a very popular part of the electronics industry in recent years.

The storage modes of the particles on the market at present are mainly two modes: the SLC mode and the TLC mode, wherein the SLC storage mode has the characteristics of fast information storage, high erasing times and good reliability, but the unit capacity cost of the SLC storage mode particles is increased due to the fact that one Cell stores 1bit information; the TLC mode can store 3-bit information through one Cell to reduce the cost of unit capacity, but compared with the SLC mode, the TLC mode has the characteristics of slow information storage speed, low erasing times and poor reliability.

In order to meet the market demand that the solid state disk can show good reliability in a high-strength erasing and writing use environment, the mainstream solution in the market at present adopts a method of storing data information in an SLC mode, so that although the market demand is solved, the cost of the solid state disk is several times that of a TLC mode hard disk under the same capacity; however, reliability of the solid-state hard disk in the TLC mode in the high-strength erasing and writing use environment cannot be guaranteed, and therefore, how to find a solution which is a compromise and meets market expectations in the TLC mode and the SLC mode is a research direction of current solid-state storage development.

In the related art, an effective technical solution has not been proposed yet to solve the problems that the reliability of the storage device cannot be ensured and the cost cannot be reduced.

Disclosure of Invention

Embodiments of the present invention provide a data management method and apparatus, a storage medium, and an electronic apparatus, so as to at least solve the problem that the reliability of a storage apparatus cannot be guaranteed and the cost cannot be reduced in the related art.

According to an embodiment of the present invention, there is provided a data management method including: determining state information of each physical block in the storage device; under the condition that the physical block does not meet the target writing mode, storing the state information of the target physical block which does not meet the target writing mode in a first list, wherein the target writing mode is used for indicating that the physical block supports migration storage of multiple data; acquiring a migration list of a storage device, determining a virtual physical block bound by a target physical block on a corresponding migration node according to the migration list, and storing information of the virtual physical block in a second list, wherein the migration node indicates a corresponding relationship between the target physical block and the virtual physical block; and performing data write management on the storage device according to the migration list, the first list and the second list.

In one exemplary embodiment, determining the status information of each physical block in the storage device comprises: acquiring the erasing times of each physical block in the storage device and the writing time for executing each erasing; comparing the erasing times, the writing time and the preset time of the target writing mode corresponding to the physical block with the preset times of the target writing mode to determine whether the physical block meets the target writing mode; and determining the state information of the physical block according to the comparison result, the erasing times and the writing time.

In an exemplary embodiment, comparing the number of times of erasing and the preset time of the target writing mode and the preset number of times of the target writing mode, where the writing time corresponds to the physical block, to determine whether the physical block satisfies the target writing mode includes: determining that the physical block does not support the target writing mode under the condition that the erasing times are greater than the preset times and the writing time is less than the preset time; determining that the physical block supports a target writing mode under the condition that the erasing times are greater than the preset times and the writing time is not less than the preset time; and under the condition that the erasing times are less than the preset times, determining that the physical block supports the target writing mode.

In an exemplary embodiment, before saving the state information of the target physical block which does not satisfy the target write mode in the first list in a case where the physical block does not satisfy the target write mode, the method further includes: determining a migration node corresponding to the physical block from the migration list under the condition that the physical block meets a target writing mode, and migrating data on a virtual physical block bound with the physical block on the migration node into the physical block, wherein the migration node is composed of the physical block of which the data storage mode is a 3-order unit and the virtual physical blocks of which the 3 data storage modes are single-layer units; and clearing occupation information corresponding to the virtual physical block under the condition that the data migration is completed, wherein the occupation information comprises: occupancy flag bit information.

In an exemplary embodiment, in a case where the physical block does not satisfy the target write mode, after saving the state information of the target physical block that does not satisfy the target write mode in the first list, the method further includes: changing the data storage mode of the target physical block stored in the first list; and converting the data storage mode of the target physical block from a 3-order unit into a single-layer unit.

In an exemplary embodiment, after obtaining a migration list of the storage device, determining a virtual physical block bound by a target physical block on a corresponding migration node according to the migration list, and storing information of the virtual physical block in a second list, the method further includes: removing the migration node from the migration list, and determining whether the current migration node is the last node of the migration list; under the condition that the migration node is the last node of the migration list, finishing executing the migration of the data corresponding to the migration node in the migration list; and in the case that the migration node is not the last node of the migration list, continuously and circularly executing the migration of the data corresponding to the migration node in the migration list.

In an exemplary embodiment, the data write management of the storage device according to the migration list, the first list and the second list includes: receiving a write-in command for analysis, and applying a physical block with a data storage mode of a 3-order unit as a storage block; calling the target physical block which is converted into the single-layer unit from the first list as a target virtual physical block to be bound with the storage block under the condition that the first list is not empty and the unused target physical block exists; applying an original physical block of a single-layer unit from the physical block pool as a target virtual physical block to be bound with the storage block under the condition that the first list is empty; and after the configuration of the target virtual physical blocks of the target quantity corresponding to the storage blocks is determined to be completed, generating new migration nodes according to the storage blocks and the target virtual physical blocks, and adding the new migration nodes into a migration list.

According to another embodiment of the present invention, there is provided a data management apparatus including: a first determination module configured to perform determining status information of each physical block in the storage device; a first saving module configured to perform saving state information of a target physical block which does not satisfy a target write mode in a first list if the physical block does not satisfy the target write mode, wherein the target write mode is used for indicating that the physical block supports migration storage of multiple data; a second saving module, configured to perform obtaining of a migration list of the storage apparatus, determine, according to the migration list, a virtual physical block to which the target physical block is bound on a corresponding migration node, and save information of the virtual physical block in a second list, where the migration node indicates a correspondence between the target physical block and the virtual physical block; a management module configured to perform write management of data to the storage apparatus according to the migration list, the first list, and the second list.

In an exemplary embodiment, the determining module is further configured to obtain the number of times of erasing and writing each physical block in the storage device and a write time for performing each erasing and writing; comparing the erasing times, the writing time and the preset time of the target writing mode corresponding to the physical block with the preset times of the target writing mode to determine whether the physical block meets the target writing mode; and determining the state information of the physical block according to the comparison result, the erasing times and the writing time.

In an exemplary embodiment, the determining module is further configured to determine that the physical block does not support the target writing mode when the number of times of erasing is greater than a preset number of times and the writing time is less than a preset time; determining that the physical block supports a target writing mode under the condition that the erasing times are greater than the preset times and the writing time is not less than the preset time; and under the condition that the erasing times are less than the preset times, determining that the physical block supports the target writing mode.

In an exemplary embodiment, the apparatus further includes: the migration module is used for determining a migration node corresponding to the physical block from the migration list under the condition that the physical block meets the target writing mode, and migrating data on a virtual physical block bound with the physical block on the migration node into the physical block, wherein the migration node is composed of the physical block of which the data storage mode is a 3-order unit and the virtual physical blocks of which the 3 data storage modes are single-layer units; and clearing occupation information corresponding to the virtual physical block under the condition that the data migration is completed, wherein the occupation information comprises: occupancy flag bit information.

In an exemplary embodiment, the first saving module further includes: a conversion unit configured to change a data storage mode of the target physical block stored in the first list; and converting the data storage mode of the target physical block from a 3-order unit into a single-layer unit.

In an exemplary embodiment, the apparatus further includes: the second determining module is used for removing the migration node from the migration list and determining whether the current migration node is the last node of the migration list; under the condition that the migration node is the last node of the migration list, finishing executing the migration of the data corresponding to the migration node in the migration list; and in the case that the migration node is not the last node of the migration list, continuously and circularly executing the migration of the data corresponding to the migration node in the migration list.

In an exemplary embodiment, the management module is further configured to receive a write command for parsing, and apply for a physical block with a data storage mode of a 3-level unit as a storage block; calling the target physical block which is converted into the single-layer unit from the first list as a target virtual physical block to be bound with the storage block under the condition that the first list is not empty and the unused target physical block exists; applying an original physical block of a single-layer unit from the physical block pool as a target virtual physical block to be bound with the storage block under the condition that the first list is empty; and after the configuration of the target virtual physical blocks of the target quantity corresponding to the storage blocks is determined to be completed, generating new migration nodes according to the storage blocks and the target virtual physical blocks, and adding the new migration nodes into a migration list.

According to a further embodiment of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.

According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.

By the invention, the state information of each physical block in the storage device is determined; under the condition that the physical block does not meet the target writing mode, storing the state information of the target physical block which does not meet the target writing mode in a first list, wherein the target writing mode is used for indicating that the physical block supports migration storage of multiple data; acquiring a migration list of a storage device, determining a virtual physical block bound by a target physical block on a corresponding migration node according to the migration list, and storing information of the virtual physical block in a second list, wherein the migration node indicates a corresponding relationship between the target physical block and the virtual physical block; the method comprises the steps of carrying out data writing management on a storage device according to a migration list, a first list and a second list, namely, completing dynamic switching of writing modes by detecting the state of a physical block in real time, increasing the states of the physical block for maintaining the first list and the second list, optimizing writing processes, improving writing efficiency and reducing writing amplification, so that the problems that the reliability of the storage device cannot be guaranteed, cost cannot be reduced and the like in the prior art can be solved, further, data writing of data reliability under high reading and writing frequency can be realized on the premise of guaranteeing stable writing speed, and the probability of introducing error bit overturning after data are moved due to the fact that the physical block of an unreliable TLC mode exists in the physical block is reduced.

Drawings

The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:

fig. 1 is a block diagram of a hardware configuration of a computer terminal of a data management method according to an embodiment of the present invention;

FIG. 2 is a flow chart of a method of managing data according to an embodiment of the present invention;

FIG. 3 is a flow diagram illustrating a new Migration determination, in accordance with an alternative embodiment of the present invention;

FIG. 4 is a schematic diagram of a write flow according to an alternative embodiment of the present invention;

FIG. 5 is a process flow diagram of a Migration method for Migration in high wear situations, in accordance with an alternative embodiment of the present invention;

FIG. 6 is a flow chart of a data block application method for a new Migration procedure in accordance with an alternative embodiment of the present invention;

fig. 7 is a block diagram of a structure of a data management apparatus according to an embodiment of the present invention.

Detailed Description

The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.

It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.

The method provided by the embodiment of the application can be executed in a computer terminal or a similar operation device of an equipment terminal. Taking the example of the data management method running on the computer terminal as an example, fig. 1 is a hardware structure block diagram of the computer terminal of the data management method according to the embodiment of the present invention. As shown in fig. 1, the computer terminal may include one or more (only one shown in fig. 1) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and in an exemplary embodiment, may also include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the computer terminal. For example, the computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration with equivalent functionality to that shown in FIG. 1 or with more functionality than that shown in FIG. 1.

The memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the data management method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the above-mentioned method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to a computer terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.

The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.

In the present embodiment, a data management method is provided, and fig. 2 is a flowchart of a data management method according to an embodiment of the present invention, where the flowchart includes the following steps:

step S202, determining the state information of each physical block in the storage device;

for example, the status information may be the number of times of erasing and writing of the physical block and the determination result of whether the TLC mode is satisfied;

step S204, under the condition that the physical block does not meet the target writing mode, storing the state information of the target physical block which does not meet the target writing mode in a first list, wherein the target writing mode is used for indicating that the physical block supports migration storage of multiple data;

as an optional embodiment, the first list is used to store unreliable block information, where the unreliable block information is information corresponding to a physical block that does not satisfy the TLC mode; that is, due to the decrease of the reliability of the current physical block, data writing in the TLC mode cannot be realized, and if the physical block is continuously used to store data, the number of false flips of the data may become large and even greater than the maximum correction capability may occur, thereby reducing the performance of the solid state disk.

Step S206, obtaining a migration list of the storage device, determining a virtual physical block bound on a corresponding migration node by the target physical block according to the migration list, and storing information of the virtual physical block in a second list, wherein the migration node indicates a corresponding relationship between the target physical block and the virtual physical block;

as an optional implementation manner, the write mode of the unreliable block binding recorded in the second list is information of a Pseudo SLC virtual physical block of an SLC, it should be noted that three Pseudo SLC virtual physical blocks are correspondingly bound with one TLC physical block to form one migration node in a migration list in the storage device, and the migration list records correspondence information that data in the physical block in the SLC mode needs to be moved to a physical block in the TLC mode.

And step S208, performing data write management on the storage device according to the migration list, the first list and the second list.

Through the steps, determining the state information of each physical block in the storage device; under the condition that the physical block does not meet the target writing mode, storing the state information of the target physical block which does not meet the target writing mode in a first list, wherein the target writing mode is used for indicating that the physical block supports migration storage of multiple data; acquiring a migration list of a storage device, determining a virtual physical block bound by a target physical block on a corresponding migration node according to the migration list, and storing information of the virtual physical block in a second list, wherein the migration node indicates a corresponding relationship between the target physical block and the virtual physical block; the method comprises the steps of carrying out data writing management on a storage device according to a migration list, a first list and a second list, namely, completing dynamic switching of writing modes by detecting the state of a physical block in real time, increasing the states of the physical block for maintaining the first list and the second list, optimizing writing processes, improving writing efficiency and reducing writing amplification, so that the problems that the reliability of the storage device cannot be guaranteed, cost cannot be reduced and the like in the prior art can be solved, further, data writing of data reliability under high reading and writing frequency can be realized on the premise of guaranteeing stable writing speed, and the probability of introducing error bit overturning after data are moved due to the fact that the physical block of an unreliable TLC mode exists in the physical block is reduced.

There are various implementations of the step S202, and in an alternative embodiment, the implementation may be implemented by the following scheme: acquiring the erasing times of each physical block in the storage device and the writing time for executing each erasing; comparing the erasing times, the writing time and the preset time of the target writing mode corresponding to the physical block with the preset times of the target writing mode to determine whether the physical block meets the target writing mode; and determining the state information of the physical block according to the comparison result, the erasing times and the writing time.

Optionally, comparing the erasing times and the writing time with the preset time of the target writing mode and the preset times of the target writing mode corresponding to the physical block to determine whether the physical block meets the target writing mode, including: determining that the physical block does not support the target writing mode under the condition that the erasing times are greater than the preset times and the writing time is less than the preset time; determining that the physical block supports a target writing mode under the condition that the erasing times are greater than the preset times and the writing time is not less than the preset time; and under the condition that the erasing times are less than the preset times, determining that the physical block supports the target writing mode.

That is to say, by acquiring the number of times of erasing and writing in the physical block and comparing the number of times of erasing and writing in the physical block with the preset number of times and the preset time of the physical block in the preset standard TLC mode, it is determined whether the current physical block still conforms to the use of the physical block as the TLC mode. For example, a healthy physical block has a writing time of 1.3Ms in the first time of using the TLC mode, but the writing time of the physical block is reduced to 0.9Ms with the change of time and the increase of the erasing times, but the time of 0.9Ms is not enough to support the data to be completely written on the physical block by using the TLC mode, so that the data has a writing error when the data is written by using the TLC mode.

In an exemplary embodiment, before saving the state information of the target physical block which does not satisfy the target write mode in the first list in a case where the physical block does not satisfy the target write mode, the method further includes: determining a migration node corresponding to the physical block from the migration list under the condition that the physical block meets a target writing mode, and migrating data on a virtual physical block bound with the physical block on the migration node into the physical block, wherein the migration node is composed of the physical block of which the data storage mode is a 3-order unit and the virtual physical blocks of which the 3 data storage modes are single-layer units; and clearing occupation information corresponding to the virtual physical block under the condition that the data migration is completed, wherein the occupation information comprises: occupancy flag bit information.

It can be understood that the migration list is an information table for recording data migration needs to be performed, the migration list has a plurality of migration nodes at the same time, the migration nodes store a corresponding relationship between one physical block meeting a target write-in mode and 3 virtual physical blocks correspondingly bound to the physical block, and then when it is determined that the physical block meets the target write-in mode (i.e., a TLC mode), data in the 3 virtual physical blocks are migrated to the corresponding physical block according to the relationship of the migration nodes, and occupation information corresponding to the virtual physical blocks is cleared away, so that the data migration is realized on the premise of ensuring data correctness.

In an exemplary embodiment, in a case where the physical block does not satisfy the target write mode, after saving the state information of the target physical block that does not satisfy the target write mode in the first list, the method further includes: changing the data storage mode of the target physical block stored in the first list; and converting the data storage mode of the target physical block from a 3-order unit into a single-layer unit.

In short, when the physical block does not satisfy the target write mode, it is stated that the subsequent physical block cannot achieve data writing in the target write mode, and in order to ensure the stability of the continuously written data, the usage mode of the unreliable target physical block stored in the first list is changed, and the target physical block is correspondingly converted from the TLC mode to the SLC mode, thereby achieving flexible usage of the physical block.

In an exemplary embodiment, after obtaining a migration list of the storage device, determining a virtual physical block bound by a target physical block on a corresponding migration node according to the migration list, and storing information of the virtual physical block in a second list, the method further includes: removing the migration node from the migration list, and determining whether the current migration node is the last node of the migration list; under the condition that the migration node is the last node of the migration list, finishing executing the migration of the data corresponding to the migration node in the migration list; and in the case that the migration node is not the last node of the migration list, continuously and circularly executing the migration of the data corresponding to the migration node in the migration list.

When data migration on the node corresponding to the migration list is executed, in order to ensure that the node can be quickly known after the migration is completed, each node in the migration process is confirmed whether to be the last migration node, before the migration node in the migration list does not reach the last node, the migration of data corresponding to the migration node in the migration list is continuously and circularly executed, and under the condition that the current node is determined to be the last node, the data migration corresponding to the migration list is ended.

In an exemplary embodiment, the data write management of the storage device according to the migration list, the first list and the second list includes: receiving a write-in command for analysis, and applying a physical block with a data storage mode of a 3-order unit as a storage block; calling the target physical block which is converted into the single-layer unit from the first list as a target virtual physical block to be bound with the storage block under the condition that the first list is not empty and the unused target physical block exists; applying an original physical block of a single-layer unit from the physical block pool as a target virtual physical block to be bound with the storage block under the condition that the first list is empty; and after the configuration of the target virtual physical blocks of the target quantity corresponding to the storage blocks is determined to be completed, generating new migration nodes according to the storage blocks and the target virtual physical blocks, and adding the new migration nodes into a migration list.

In order to better realize data writing, when data writing is carried out, an external terminal sends a write command to a storage device, wherein the write command is used for indicating data information of data to be written, a storage block is applied in the storage device according to the data information, as shown in fig. 4, a target physical block which is not used and has completed TLC mode to SLC mode in a T2S table is used as a Pseudo virtual block of a physical block of a current TLC mode, on the premise that no target physical block can be used in a T2S table, a Pseudo virtual block bound with a physical block of the current TLC mode is selected from a plurality of original physical blocks in a physical block pool, a new migration node is generated and added to a migration list, and the migration list is changed according to the written data.

In order to better understand the process of the above data management method, the following describes a flow of the above data management method with reference to an alternative embodiment.

As an optional embodiment, a data writing method, a data writing device, and a DRAM-Less solid state disk are provided, where the data writing method includes: configuring at least one Single Level Cell (SLC) physical block for the packet, and establishing a binding relationship between each SLC physical block and one non-SLC physical block in the packet; when the memory of the SLC physical block is full, determining the proportion of valid data pages in the SLC physical block; if the proportion of the valid data page is smaller than a preset proportion threshold, moving the valid data in the SLC physical block to a non-SLC physical block bound with the valid data page based on a dynamic moving strategy; and if the proportion of the effective data pages is not less than a preset proportion threshold, copying all data in the SLC physical block to a non-SLC physical block bound with the SLC physical block based on a static copy strategy. Through the mode, the embodiment of the invention can reduce the waste of the flash memory bandwidth in the random write scene and improve the random write performance of the DRAM-Less solid state disk.

However, the above method involves the following risks: 1) as the use of the solid state disk will lead to the increase of PE (i.e. erasing and writing), the non-SLC physical block thereof may be unstable, resulting in the increase of the error rate of the written data, and the method is not suitable for the application of mining such a high-frequency read-write scene; 2) the data is firstly stored in an SLC physical block, the SLCs and corresponding TLCs (Triple Level cells, three-order cells, TLC for short) are recorded by using table entries, and after the data reaches a waterline, Migration of the data from the SLC to the TLC is triggered to be completed, so that write amplification is increased, the abrasion of particles is accelerated, and the reliability of the solid state disk in a high-erasing PE mode is reduced;

therefore, in another alternative embodiment of the present invention based on the above drawbacks, a data writing method suitable for high frequency reading and writing is mainly provided, in which the determination of the current physical block mode is completed by counting the erasing times of the physical block and the writing time in the TLC mode and performing comparative analysis. Due to the writing time t of the particlesrWill be different with the change of PE, according to the rule, the storage particle is sentWrite time for write-from-scratch errors is set to tnThe value is obtained by the particle analysis team through analysis experiments and is determined according to the PE times and t of the test blocknThe method for judging the physical block mode is implemented together with the following steps:

reading the PE times of a current physical block, and judging whether the PE times is greater than a threshold value; if yes, executing the step two; if not, executing the fourth step;

step two, acquiring data writing time of the target physical block in a TLC mode, and judging whether the data writing time is smaller than a threshold value; if yes, executing a third step, otherwise, executing a fourth step;

step three, the current physical block is not suitable for being used as a TLC mode;

step four, the current physical block is suitable for being used as a TLC mode and can be continuously operated;

as an optional implementation manner, after obtaining the state of the target physical block, if the target physical block does not satisfy the TLC mode, it is necessary to store information of the target physical block into a T2S table (equivalent to a first List in the embodiment of the present invention), and store information of Pseudo SLC blocks (equivalent to virtual physical blocks in the embodiment of the present invention) bound to the current TLC block in a Migration table (equivalent to a Migration List in the embodiment of the present invention) into a Trans List table (equivalent to a second List in the embodiment of the present invention), where the Migration table records information that SLC block data needs to be migrated to the TLC block, the T2S table is used to store unreliable block information, and the Trans List records information of Pseudo SLC blocks of the unreliable block; in order to solve the problem, an optional embodiment of the present invention further provides a new Migration method to complete data writing, so as to ensure data correctness in a high PE usage environment while ensuring writing speed. Meanwhile, a writing method adapted to the current Migration scheme is proposed, as shown in fig. 3, a flow diagram of new Migration determination is shown, and as shown in fig. 4, a writing flow diagram is shown.

Optionally, in order to solve the problems of how to reduce the compression on the actual storage capacity, ensure stable data performance, and improve the service life of the product under the premise of ensuring the correctness of data in a high-frequency read-write environment, a processing flow chart of the Migration method applicable to a high-wear condition is provided, as shown in fig. 5, which includes the following steps:

step 1, starting to execute Migration, and executing step 2;

step 2, judging whether the Pseudo SLC block data recorded by a TransList is valid or not in a table look-up mode, recovering invalid blocks, and clearing occupation information of the recovered blocks, wherein the TransList is used for recording the Pseudo SLC block information corresponding to the unreliable blocks, and executing step 3;

step 3, acquiring a node to be processed from a Migration List (i.e. a MigList) table, wherein the MigList is an information table maintained by an FTL (Flash translation layer, FTL for short) algorithm layer and used for recording data movement, and the node comprises a TLC block and 3 SLC blocks, and executing step 4;

step 4, judging whether the current TLC block is reliable or not; if yes, executing step 5, otherwise, executing step 8;

step 5, moving the Pseudo SLC block data in the current node (equivalent to the migration node in the embodiment of the invention) to the corresponding TLC block, and executing step 6;

step 6, clearing information such as an occupied zone bit of a Pseudo SLC block in the current node, and executing step 7;

step 7, removing the current node from the MigList table, and executing step 11;

step 8, converting the TLC block of the current node into an SLC module and then Erase, and executing step 9;

step 9, adding the converted block into a T2S table, and clearing the occupation information of the block, wherein the T2S table is used for recording the memory block converted into the SLC mode by TLC due to unreliable judgment; and executing step 10;

step 10, adding the Pseudo SLC block corresponding to the unreliable block into a Trans List, wherein the Trans List is used for recording the Pseudo SLC block information corresponding to the unreliable block, and executing step 7;

step 11, judging whether the current node is the last node of the MigList table, if not, step 12 is not known, otherwise, step 13 is executed;

step 12, adding 1 to the node offset value, and executing step 3;

step 13, ending the Migration;

optionally, an optional embodiment of the present invention further provides a data block application method applicable to a new Migration procedure, as shown in fig. 6, in which the method adds degraded storage block resources to scheduling, so that on the premise of ensuring stable data, consumption of performance and capacity is minimized. The method comprises the following specific steps:

step 601, starting to receive a command and executing step 602;

step 602, acquiring and analyzing a written command, applying for a TLC block, and executing step 603;

step 603, judging that the T2S table is not empty and an unused storage block exists; if yes, go to step 604, otherwise go to step 605;

step 604, acquiring an unused storage block in the T2S table as a Pseudo block of the current TLC block, and executing step 606;

step 605, applying for an SLC block from the physical block pool and adding the SLC block into a Pseudo block of the current TLC storage block; and go to step 606;

step 606, judging whether the Pseudo block of the current TLC block is filled up or not, if not, executing step 603, otherwise, executing step 607;

step 607, judging whether the Migration needs to be executed, if so, executing step 602, otherwise, executing step 608;

step 608, execute the Migration procedure.

In summary, the optional embodiments of the present invention provide a novel data writing method capable of ensuring data reliability under high PE while ensuring stable writing speed, so as to solve the problem of performance and reliability degradation of a flash memory medium due to consumption of a service life. The optional embodiment of the invention innovatively provides that the dynamic switching of the writing mode is completed by detecting the state of the physical block in real time, and compared with the method for directly writing the SLC block data into the TLC block in the embodiment, the method reduces the probability of introducing error bit inversion after data is moved due to unreliable TLC block. In addition, the Migration method of the existing embodiment is to move data to all nodes in the Migration table, and introduce write amplification while reducing the reliability of the data, and the optional embodiment of the present invention maintains the state of the physical block by adding the T2S table and the Trans List table, optimizes the write flow, improves the write efficiency, and achieves the purpose of reducing the write amplification.

Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.

In this embodiment, a data management apparatus is further provided, and the apparatus is used to implement the foregoing embodiments and preferred embodiments, and details of which have been already described are omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.

Fig. 7 is a block diagram of a structure of an apparatus for managing data according to an embodiment of the present invention, as shown in fig. 7, the apparatus including:

(1) a first determination module 72 configured to perform determining status information of each physical block in the storage device;

(2) a first saving module 74 configured to perform saving, in a first list, status information of a target physical block that does not satisfy a target write mode in a case where the physical block does not satisfy the target write mode, wherein the target write mode is used to indicate that the physical block supports migration storage of multiple data;

(3) a second saving module 76, configured to perform obtaining a migration list of the storage apparatus, determine, according to the migration list, a virtual physical block to which the target physical block is bound on a corresponding migration node, and save information of the virtual physical block in a second list, where the migration node indicates a correspondence between the target physical block and the virtual physical block;

(4) a management module 78 configured to perform write management of data to the storage device according to the migration list, the first list, and the second list.

Determining, by the device, status information for each physical block in the storage device; under the condition that the physical block does not meet the target writing mode, storing the state information of the target physical block which does not meet the target writing mode in a first list, wherein the target writing mode is used for indicating that the physical block supports migration storage of multiple data; acquiring a migration list of a storage device, determining a virtual physical block bound by a target physical block on a corresponding migration node according to the migration list, and storing information of the virtual physical block in a second list, wherein the migration node indicates a corresponding relationship between the target physical block and the virtual physical block; the method comprises the steps of carrying out data writing management on a storage device according to a migration list, a first list and a second list, namely, completing dynamic switching of writing modes by detecting the state of a physical block in real time, increasing the states of the physical block for maintaining the first list and the second list, optimizing writing processes, improving writing efficiency and reducing writing amplification, so that the problems that the reliability of the storage device cannot be guaranteed, cost cannot be reduced and the like in the prior art can be solved, further, data writing of data reliability under high reading and writing frequency can be realized on the premise of guaranteeing stable writing speed, and the probability of introducing error bit overturning after data are moved due to the fact that the physical block of an unreliable TLC mode exists in the physical block is reduced.

In an exemplary embodiment, the determining module is further configured to obtain the number of times of erasing and writing each physical block in the storage device and a write time for performing each erasing and writing; comparing the erasing times, the writing time and the preset time of the target writing mode corresponding to the physical block with the preset times of the target writing mode to determine whether the physical block meets the target writing mode; and determining the state information of the physical block according to the comparison result, the erasing times and the writing time.

In an exemplary embodiment, the determining module is further configured to determine that the physical block does not support the target writing mode when the number of times of erasing is greater than a preset number of times and the writing time is less than a preset time; determining that the physical block supports a target writing mode under the condition that the erasing times are greater than the preset times and the writing time is not less than the preset time; and under the condition that the erasing times are less than the preset times, determining that the physical block supports the target writing mode.

That is to say, by acquiring the number of times of erasing and writing of the physical block and comparing the number of times of erasing and writing time with the preset number of times and the preset time of the physical block in the preset standard TLC mode, it is determined whether the current physical block still conforms to the use of the physical block as the TLC mode. For example, a healthy physical block has a writing time of 1.3Ms in the first time of using the TLC mode, but the writing time of the physical block is reduced to 0.9Ms with the change of time and the increase of the erasing times, but the time of 0.9Ms is not enough to support the data to be completely written on the physical block by using the TLC mode, so that the data has a writing error when the data is written by using the TLC mode.

In an exemplary embodiment, the apparatus further includes: the migration module is used for determining a migration node corresponding to the physical block from the migration list under the condition that the physical block meets the target writing mode, and migrating data on a virtual physical block bound with the physical block on the migration node into the physical block, wherein the migration node is composed of the physical block of which the data storage mode is a 3-order unit and the virtual physical blocks of which the 3 data storage modes are single-layer units; and clearing occupation information corresponding to the virtual physical block under the condition that the data migration is completed, wherein the occupation information comprises: occupancy flag bit information.

It can be understood that the migration list is an information table for recording data migration needs to be performed, the migration list has a plurality of migration nodes at the same time, the migration nodes store a corresponding relationship between one physical block meeting a target write-in mode and 3 virtual physical blocks correspondingly bound to the physical block, and then when it is determined that the physical block meets the target write-in mode (i.e., a TLC mode), data in the 3 virtual physical blocks are migrated to the corresponding physical block according to the relationship of the migration nodes, and occupation information corresponding to the virtual physical blocks is cleared away, so that the data migration is realized on the premise of ensuring data correctness.

In an exemplary embodiment, the first saving module further includes: a conversion unit configured to change a data storage mode of the target physical block stored in the first list; and converting the data storage mode of the target physical block from a 3-order unit into a single-layer unit.

In short, when the physical block does not satisfy the target write mode, it is stated that the subsequent physical block cannot achieve data writing in the target write mode, and in order to ensure the stability of the continuously written data, the usage mode of the unreliable target physical block stored in the first list is changed, and the target physical block is correspondingly converted from the TLC mode to the SLC mode, thereby achieving flexible usage of the physical block.

In an exemplary embodiment, the apparatus further includes: the second determining module is used for removing the migration node from the migration list and determining whether the current migration node is the last node of the migration list; under the condition that the migration node is the last node of the migration list, finishing executing the migration of the data corresponding to the migration node in the migration list; and in the case that the migration node is not the last node of the migration list, continuously and circularly executing the migration of the data corresponding to the migration node in the migration list.

When data migration on the node corresponding to the migration list is executed, in order to ensure that the node can be quickly known after the migration is completed, each node in the migration process is confirmed whether to be the last migration node, before the migration node in the migration list does not reach the last node, the migration of data corresponding to the migration node in the migration list is continuously and circularly executed, and under the condition that the current node is determined to be the last node, the data migration corresponding to the migration list is ended.

In an exemplary embodiment, the management module is further configured to receive a write command for parsing, and apply for a physical block with a data storage mode of a 3-level unit as a storage block; calling the target physical block which is converted into the single-layer unit from the first list as a target virtual physical block to be bound with the storage block under the condition that the first list is not empty and the unused target physical block exists; applying an original physical block of a single-layer unit from the physical block pool as a target virtual physical block to be bound with the storage block under the condition that the first list is empty; and after the configuration of the target virtual physical blocks of the target quantity corresponding to the storage blocks is determined to be completed, generating new migration nodes according to the storage blocks and the target virtual physical blocks, and adding the new migration nodes into a migration list.

In order to better realize data writing, when data writing is carried out, an external terminal sends a write command to a storage device, wherein the write command is used for indicating data information of data to be written, a storage block is applied in the storage device according to the data information, as shown in fig. 4, a target physical block which is not used and has completed TLC mode to SLC mode in a T2S table is used as a Pseudo virtual block of a physical block of a current TLC mode, on the premise that no target physical block can be used in a T2S table, a Pseudo virtual block bound with a physical block of the current TLC mode is selected from a plurality of original physical blocks in a physical block pool, a new migration node is generated and added to a migration list, and the migration list is changed according to the written data.

It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.

Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.

In an exemplary embodiment, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:

s1, determining the state information of each physical block in the storage device;

s2, if the physical block does not satisfy the target writing mode, saving the state information of the target physical block which does not satisfy the target writing mode in a first list, wherein the target writing mode is used for indicating that the physical block supports migration storage of multiple data;

s3, obtaining a migration list of the storage device, determining a virtual physical block bound on a corresponding migration node by the target physical block according to the migration list, and storing the information of the virtual physical block in a second list, wherein the migration node indicates the corresponding relationship between the target physical block and the virtual physical block;

and S4, performing data write management on the storage device according to the migration list, the first list and the second list.

In an exemplary embodiment, in the present embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable storage device, a magnetic disk, or an optical disk.

Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.

In an exemplary embodiment, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.

In an exemplary embodiment, in the present embodiment, the processor may be configured to execute the following steps by a computer program:

s1, determining the state information of each physical block in the storage device;

s2, if the physical block does not satisfy the target writing mode, saving the state information of the target physical block which does not satisfy the target writing mode in a first list, wherein the target writing mode is used for indicating that the physical block supports migration storage of multiple data;

s3, obtaining a migration list of the storage device, determining a virtual physical block bound on a corresponding migration node by the target physical block according to the migration list, and storing the information of the virtual physical block in a second list, wherein the migration node indicates the corresponding relationship between the target physical block and the virtual physical block;

and S4, performing data write management on the storage device according to the migration list, the first list and the second list.

In an exemplary embodiment, for specific examples in this embodiment, reference may be made to the examples described in the above embodiments and optional implementation manners, and details of this embodiment are not described herein again.

It will be apparent to those skilled in the art that the various modules or steps of the invention described above may be implemented using a general purpose computing device, which may be centralized on a single computing device or distributed across a network of computing devices, and in one exemplary embodiment may be implemented using program code executable by a computing device, such that the steps shown and described may be executed by a computing device stored in a memory device and, in some cases, executed in a sequence different from that shown and described herein, or separately fabricated into individual integrated circuit modules, or multiple ones of them fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.

The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

22页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种硬盘管理方法及装置、硬盘设备、存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类