Storage device and low-level formatting method thereof

文档序号:1186377 发布日期:2020-09-22 浏览:25次 中文

阅读说明:本技术 存储装置及其低级格式化方法 (Storage device and low-level formatting method thereof ) 是由 周宇峰 陈双喜 于 2020-06-12 设计创作,主要内容包括:本发明涉及一种存储装置及其低级格式化方法,所述方法包括搜寻所述存储装置的多个存储区块中,是否已存在一RDT测试结果或一固件储存信息,所述RDT测试结果及所述固件储存信息皆包含一擦写次数纪录及一写入兆字节纪录;若不存在有所述RDT测试结果或所述固件储存信息,则判断所述擦写次数纪录及所述写入兆字节纪录中,是否有记载一擦写次数及一写入兆字节;若不存在所述RDT测试结果及所述固件储存信息,则将所述擦写次数及所述写入兆字节的值设为0;若有记载所述擦写次数及所述写入兆字节,则将所记载的擦写次数及写入兆字节的值写入所述存储区块;以及若未记载所述擦写次数及所述写入兆字节,则将所述擦写次数及所述写入兆字节的值设为0。(The invention relates to a storage device and a low-level formatting method thereof, wherein the method comprises the steps of searching a plurality of storage blocks of the storage device to determine whether an RDT (remote data transfer) test result or firmware storage information exists, wherein the RDT test result and the firmware storage information both comprise an erasing time record and a writing megabyte record; if the RDT test result or the firmware storage information does not exist, judging whether an erasing time and a writing megabyte are recorded in the erasing time record and the writing megabyte record; if the RDT test result and the firmware storage information do not exist, setting the values of the erasing times and the writing megabytes to be 0; if the erasing times and the writing megabytes are recorded, writing the recorded erasing times and the written megabytes into the storage block; and if the erasing times and the writing megabytes are not recorded, setting the values of the erasing times and the writing megabytes to 0.)

1. A method for low-level formatting of a memory device, said memory device having a plurality of memory blocks, comprising:

searching whether a reliability and life cycle test result or firmware storage information exists in the plurality of memory blocks of the memory device, wherein the reliability and life cycle test result and the firmware storage information comprise an erasing time record and a writing megabyte record of the memory device;

if the reliability and life cycle test result or the firmware storage information exists in the plurality of memory blocks of the memory device, judging whether an erasing frequency and a writing megabyte of the memory device are recorded in the erasing frequency record and the writing megabyte record;

if the reliability and life cycle test result and the firmware storage information do not exist in the plurality of memory blocks of the memory device, writing the erasing times and the default values of the writing megabytes of the memory device into the memory blocks of the memory device;

if the erasing times and the writing megabytes of the storage device are recorded in the erasing times record and the writing megabyte record, writing the recorded erasing times and the written megabyte values into the storage block of the storage device; and

if the erasing times and the writing megabytes of the storage device are not recorded in the erasing times record and the writing megabyte record, writing default values of the erasing times and the writing megabytes of the storage device into the storage block of the storage device.

2. The method of claim 1, further comprising validating the erase count record and the write megabyte record.

3. The low-level formatting method of a storage device according to claim 1, further comprising:

reading the storage block of the storage device;

acquiring the erasing times record and the writing megabyte record from the storage block of the storage device; and

and integrating the obtained erasing times record and the write-in megabyte record into the reliability and life cycle test result.

4. The method of claim 1, wherein said erase count records and said write megabyte records of said memory device at different time points are stored in said plurality of blocks of said memory device, said method further comprising:

reading the storage block of the storage device;

acquiring the erasing times record and the writing megabyte record of the latest time point of the storage device; and

writing the obtained erase times record and the write megabyte record back to a predetermined memory block of the plurality of memory blocks of the memory device to generate the firmware storage information.

5. The low-level formatting method of a storage device according to claim 1, wherein said storage device is a flash memory storage device.

6. The method of claim 3, wherein during the obtaining and writing of the erasure count record and the written megabyte record, the method further comprises:

testing the plurality of memory blocks of the memory device; and

and writing the test results of the plurality of memory blocks into the reliability and life cycle test results.

7. The method as claimed in claim 6, wherein the test results of the plurality of blocks, the records of erase times and the records of write megabytes are integrated into the reliability and life cycle test results.

8. A memory device comprising a processor and a plurality of memory blocks, wherein the processor performs a low level formatting method comprising:

searching whether a reliability and life cycle test result or firmware storage information exists in the plurality of memory blocks of the memory device, wherein the reliability and life cycle test result and the firmware storage information comprise an erasing time record and a writing megabyte record of the memory device;

if the reliability and life cycle test result or the firmware storage information exists in the plurality of memory blocks of the memory device, judging whether an erasing frequency and a writing megabyte of the memory device are recorded in the erasing frequency record and the writing megabyte record;

if the reliability and life cycle test result and the firmware storage information do not exist in the plurality of memory blocks of the memory device, writing the erasing times and the default values of the writing megabytes of the memory device into the memory blocks of the memory device;

if the erasing times and the writing megabytes of the storage device are recorded in the erasing times record and the writing megabyte record, writing the recorded erasing times and the written megabyte values into the storage block of the storage device; and

if the erasing times and the writing megabytes of the storage device are not recorded in the erasing times record and the writing megabyte record, writing default values of the erasing times and the writing megabytes of the storage device into the storage block of the storage device.

9. The storage device of claim 8 wherein said low level formatting further comprises validating said record of erase times and said record of write megabytes.

10. The memory device as recited in claim 8, wherein the test results of the plurality of blocks, the erase count record, and the write megabyte record are integrated into the reliability and life cycle test results.

Technical Field

The present invention relates to a memory device and a low-level formatting method thereof, and more particularly, to a flash memory device and a low-level formatting method thereof.

Background

A Solid State Drive (SSD) is commonly called a Solid State Disk, and the Solid State Disk is a hard Disk made of an array of Solid State electronic memory chips. The P/E (Program-Erase) Cycle of an SSD refers to the number of times the storage medium NAND in the SSD is erased, while TBW (Terabyte Write) refers to the number of megabytes that are available to be written in total over the life Cycle of the SSD. Both of the parameters are indicators of SSD lifetime.

Fig. 1 is a schematic diagram of a conventional SSD System Firmware (SSD) 11 reading a configuration file (config) from the storage block 131. First, before the SSD performs low-level formatting, the low-level formatting firmware 12 writes a configuration file therein into a memory block 131 of the NAND 13, and then the system firmware 11 reads the configuration file from the memory block 131, wherein the configuration file includes a plurality of parameter information, such as low-level formatting mode. From these parameters, it can be decided to start the RDT Firmware (Reliability and Duration Test Firmware)14 (see fig. 2) or System Firmware (wheel System Firmware)11 for low-level formatting.

Fig. 2 is a diagram of low-level formatting of RDT firmware 14. Referring to fig. 2 and 4, the system firmware (wheel system firmware)11 reads the configuration file from the memory block 131 and obtains the information of the low-level formatted RDT firmware 14 (step S41), so that the RDT firmware 14 starts to detect each memory block 131 in the NAND 13 one by one (step S42), and writes the test result back to a memory block 131 of the NAND 13 (step S43).

FIG. 3 shows a schematic diagram of low level formatting development System Firmware (wheel System Firmware) 11. In this mode, as shown in fig. 5, the System Firmware (wheel System Firmware)11 still reads the configuration file from the storage block 131 and obtains information of the low-level formatted System Firmware 11 (step S51). Next, system firmware 11 performs a master read operation (step S52a), a master write operation (step S52b), a garbage collection operation (step S52c), and so on. In this mode, the information read by the system firmware 11 will reside in the SRAM, and the system firmware 11 can modify (update) its content at any time and write the P/E Cycle, TBW information into the NAND backup at intervals.

Fig. 6 shows a flow chart of the conventional low-level formatting, which includes determining whether the low-level formatting is the RDT firmware 14 (i.e., performing the mode of fig. 2) or the system firmware 11 (i.e., performing the mode of fig. 3) (step S61), checking the NAND-corrupted block (step S62), selecting the pulse phase for the calibration data (step S63), updating the related parameters (the corrupted block and the selected pulse phase) to the firmware, and writing the updated firmware into the NAND (step S64), and so on.

Before shipment of the SSD, the mode of opening the RDT Firmware in the low-level format of fig. 2 is performed, and then the mode of opening the System Firmware (wheel System Firmware) of fig. 3 is performed. However, in the detection process of the RDT firmware of fig. 2, the detection of the block requires the read and write operations, and thus the originally written data (such as the erase line shown in fig. 2) is destroyed, so the P/E Cycle and TBW information will disappear. In this way, the SSD of Return Merchantability Assessment (RMA) cannot inherit the previous P/E Cycle and TBW information of the SSD after low-level formatting.

Furthermore, if the SSD is used for a long time and low-level formatting is performed again due to some factors, the P/E Cycle and TBW of the SSD have accumulated a considerable value, and the information is deleted after low-level formatting (during the detection process of the RDT firmware in fig. 2), so that the user knows that the life Cycle of the SSD is not a real life Cycle, and the data is not backed up before the end of the real life Cycle of the SSD, resulting in irretrievable data loss.

Disclosure of Invention

Therefore, how to inherit the previous information of the P/E Cycle and the TBW of the SSD after the low-level formatting is performed is a problem to be solved, so that the user can know the real P/E Cycle and TBW of the SSD and avoid the loss of data.

The invention relates to a low-level formatting method for a storage device, the storage device comprising a plurality of region units, the low-level formatting method comprising: searching whether a reliability and life cycle test result or firmware storage information exists in the plurality of memory blocks of the memory device, wherein the reliability and life cycle test result and the firmware storage information comprise an erasing time record and a writing megabyte record of the memory device; if the reliability and life cycle test result or the firmware storage information exists in the plurality of memory blocks of the memory device, judging whether an erasing frequency and a writing megabyte of the memory device are recorded in the erasing frequency record and the writing megabyte record; if the reliability and life cycle test result and the firmware storage information do not exist in the plurality of memory blocks of the memory device, setting the values of the erasing times and the writing megabytes of the memory device to be 0 (default values), and writing the values into the memory blocks of the memory device; if the erasing times and the writing megabytes of the storage device are recorded in the erasing times record and the writing megabyte record, writing the recorded erasing times and the written megabyte values into the storage block of the storage device; and if the erasing times and the writing megabytes of the storage device are not recorded in the erasing times record and the writing megabyte record, setting the values of the erasing times and the writing megabytes of the storage device to be 0 (default value), and writing the values into the storage block of the storage device.

The invention also relates to a storage device, which comprises a processor and a plurality of storage blocks, wherein the processor executes the low-level formatting method.

The low-level formatting method of the storage device further comprises: and confirming the validity of the erasing times record and the writing megabyte record.

The low-level formatting method of the storage device further comprises: reading the storage block of the storage device; acquiring the erasing times record and the writing megabyte record from the storage block of the storage device; and integrating the obtained erasing times record and the writing megabyte record into the reliability and life cycle test result.

Wherein the erase/write times record and the write megabyte record of the memory device at different time points are stored in the plurality of memory blocks of the memory device, the method further comprising: reading the storage block of the storage device; acquiring the erasing times record and the writing megabyte record of the latest time point of the storage device; and writing the acquired erase count record and the acquired write megabyte record back to a predetermined memory block of the plurality of memory blocks of the memory device to generate the firmware storage information.

Wherein the storage device is a flash memory storage device.

In the process of obtaining and writing the erasing times record and the writing megabyte record, the test results of the plurality of memory blocks, the erasing times record and the writing megabyte record are integrated into the reliability and life cycle test result.

In the process of obtaining and writing the record of the number of times of erasing and the record of the number of megabytes of writing at the latest time point of the storage device, the method for low-level formatting of the storage device further comprises: executing a read operation; performing a write operation; and performing a garbage collection operation.

Other advantages of the present invention will be explained in more detail in conjunction with the following description and the accompanying drawings.

Drawings

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

Fig. 1 is a schematic diagram illustrating a system firmware reading configuration file of a conventional SSD.

Fig. 2 is a diagram illustrating a conventional SSD low-level format of the RDT firmware.

FIG. 3 is a diagram of a low level formatting of open system firmware for a conventional SSD.

FIG. 4 is a flow chart illustrating the operation of the conventional low-level formatting of the SSD for developing RDT firmware.

FIG. 5 is a flow chart illustrating the operation of the low-level formatting system firmware of the conventional SSD.

FIG. 6 is a flow chart illustrating the operation of a conventional SSD in a low-level format.

Fig. 7 is a flowchart illustrating a method for low-level formatting of a storage device according to an embodiment of the present invention.

FIG. 8 is a flowchart illustrating a system firmware generating the firmware storage information according to an embodiment of the present invention in a low-level formatting method of a memory device.

FIG. 9 is a combination diagram of the system firmware flow and the prior art flow in the low-level formatting method of the storage device according to the embodiment of the present invention.

FIG. 10 is a flowchart illustrating the RDT firmware generating the RDT test result in the low-level formatting method of the storage device according to an embodiment of the present invention.

Fig. 11 is a combined diagram of the flow of the RDT firmware and the existing flow in the low-level formatting method of the storage device according to the embodiment of the present invention.

Detailed Description

Embodiments of the present invention will be described below with reference to the accompanying drawings. In the drawings, the same reference numerals indicate the same or similar components or process flows.

It will be understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, values, method steps, operations, components, and/or components, but do not preclude the presence or addition of further features, values, method steps, operations, components, and/or groups thereof.

The use of words such as "first," "second," "third," etc. in this disclosure is intended to modify a component in a claim and is not intended to imply a priority order, precedence relationship, or order between components or steps in a method.

It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may be present. In contrast, when an element is described as being "directly connected" or "directly coupled" to another element, there are no intervening elements present. Other words used to describe relationships between components may be similarly interpreted, such as "between" and "directly between," or "adjacent" and "directly adjacent," etc.

FIG. 7 is a flowchart illustrating a method for low-level formatting a storage device according to an embodiment of the present invention, wherein the method can maintain P/ECycle and TBW information. FIG. 7 is a flow diagram for low level formatting of RDT firmware or System firmware (SystemFirmware) according to an embodiment of the present invention. Is modified over the existing flow of fig. 6. Step S71 of the embodiment of the present invention is the same as step S61 of fig. 6, and is all to determine whether the low-level formatting is RDT firmware or system firmware. Next, in step S72, the NAND block of the SSD is searched for whether there is a RDT test result (pre-RDT result) or a firmware storage information (pre-WSsblock), wherein the RDT test result and the firmware storage information may include an erase count (P/E Cycle) record and a write megabyte (TBW) record of the storage device. The RDT test result is a record generated after the SSD completes the RDT test. If the RDT test result exists, the SSD is just finished, and the RDT test is finished but not used. If the firmware storage information exists, the SSD has the use record, and the firmware storage information refers to the information stored in the SSD after the SSD is used by a user and returned or sent for repair by the user due to quality problems or other factors. In other words, for an SSD in use, the System Firmware (wheel System Firmware) writes the latest number of erasures and megabyte values written to the SSD to the memory block at intervals to assemble the Firmware storage information. By updating the parameter values at regular time, the latest parameter values of the SSD can be obtained from the storage block which records the latest erasing and writing times and the write-in megabyte parameters after the SSD is powered off and powered back again, so that the latest parameter information of the SSD can be inherited.

If the RDT test result and the firmware storage information cannot be found in step S72, it indicates that the SSD may have just finished playing the firmware, and the RDT is not performed or used. At this time, the flow proceeds to step S76, and the default values (default value is 0) of the P/E Cycle and TBW of the SSD are written into the memory block of the memory device, and the flow ends. It should be noted that, after the flow of fig. 7 is finished, the following conventional low-level formatting steps in fig. 6 are performed, including checking the NAND-damaged blocks (step S62), calibrating the data selecting pulse phase (step S63), updating the related parameters (damaged blocks, selecting pulse phase) to the firmware, writing the updated firmware into the NAND (written updated firmware to NAND) (step S64), and so on. Since the subsequent low-level formatting step is not a focus of the present invention, the description is omitted.

In step S72, if the RDT test result or the firmware storage information exists in the NAND block, the process proceeds to step S73 to confirm the validity of the record of erase/write times and the record of write megabytes. The validity here refers to whether the record of the number of times of erasing and the record of writing megabytes can be recognized by the system firmware; if not, the version of the system firmware is too old, and needs to be updated to a version capable of supporting the erasure count record and the write megabyte record. Then, the process proceeds to step S74, where it is determined whether there is an erase count (P/E Cycle) and a write megabyte (TBW) recorded in the erase count record and the write megabyte record. If so, the flow proceeds to step S75, where the values of the P/E Cycle and TBW described therein are written into the memory blocks of the memory device; if not, it represents that there is no usage record in the SSD, so the process proceeds to step S76, where the default values (default value is 0) of the P/E Cycle and TBW of the storage device are written into the storage block of the storage device. By the low-level formatting method provided by the embodiment of the invention, the SSD can keep the latest P/E Cycle and TBW information no matter the SSD is subjected to RDT tests or low-level formatting for several times after being used. Therefore, the user can know the real life cycle of the SSD, and can backup data and replace the storage device early before the life of the SSD expires, so that irreparable data loss is avoided.

The flow chart of FIG. 7 of the present invention is executed to ensure that the P/E Cycle and TBW messages are not lost during the low level formatting or RDT testing process. However, before executing the flow of fig. 7, the system firmware (wheel system firmware) and the RDT firmware can respectively execute the flow charts of the methods thereof to respectively generate the firmware storage information and the RDT test result, as described in detail below.

FIG. 8 is a flow chart of generating the Firmware storage information by the System Firmware (wheel System Firmware) in the low-level formatting method of the storage device according to the embodiment of the present invention. As mentioned above, when the SSD is used, the system firmware writes information such as P/E Cycle, TBW, etc. into different blocks of the NAND for backup at intervals. Therefore, before performing the low-level formatting according to the embodiment of the present invention, the system firmware first reads the storage block of the SSD (step S81). Then, the system firmware obtains the record of the erasing times (P/E Cycle) and the record of the writing megabyte (TBW) at the latest time point of the SSD from the storage block (step S82). Finally, the system firmware writes the obtained erase count (P/E Cycle) record and the write megabyte (TBW) record back to a predetermined block of the plurality of blocks to generate the firmware storage information (step S83). According to the method flow of fig. 8, if low-level formatting is needed later, the Firmware storage information can be generated by the System Firmware under the condition of low-level formatting System Firmware (low System Firmware) for reading and using by the subsequent low-level formatting flow (fig. 7). In addition, the flow chart of fig. 8 of the present invention is modified from the conventional flow chart of fig. 5, and is specifically shown in fig. 9. That is, the steps S82 and S83 are performed in parallel to the conventional steps of "master read operation", "master write operation", and "garbage collection operation". Accordingly, the system firmware (wheel system firmware) can synchronously perform the steps S82 and S83 while performing the conventional steps to simultaneously generate the firmware storage information, and then perform the low-level formatting of the SSD according to the firmware storage information by the low-level formatting program of fig. 7. Therefore, the process of generating the firmware storage information in the embodiment of the invention does not affect the execution of the existing steps at all, and therefore, the cost is not increased. It should be noted that the low-level formatting process of fig. 7 only inherits the P/recycle and TBW information, and after the process of fig. 7 is completed, the following conventional formatting processes, i.e., "check NAND-damaged block", "calibration data selecting pulse phase", and "write updated firmware into NAND" of fig. 6, are performed, so that the low-level formatting process of the entire SSD is completed.

FIG. 10 is a flowchart illustrating the RDT firmware generating the RDT test result in the low-level formatting method of the storage device according to an embodiment of the present invention. First, the RDT firmware reads the storage block of the storage device (step S101). Then, the RDT firmware obtains the erase count record and the write megabyte record from the memory block (step S102). Finally, the RDT firmware integrates the acquired erase count record and the write megabyte record into the RDT test result (step S103). Similarly, the flow chart of fig. 10 of the present invention is modified from the conventional flow chart of fig. 4, and is specifically shown in fig. 11. That is, the steps S102 and S103 are performed in parallel to the conventional steps of "testing NAND quality" and "writing NAND test quality into the reliability and life cycle test results". Accordingly, the RDT firmware can perform the existing steps and simultaneously perform steps S102 and S103 to simultaneously integrate the P/E Cycle, the TBW information, and the NAND test quality into the RDT test result. If the low-level formatting is needed later, the low-level formatting program shown in fig. 7 is performed to perform the low-level formatting of the SSD according to the RDT test result. Therefore, the process of integrating the P/E Cycle and TBW information in the embodiment of the invention does not influence the flow generated by the existing RDT test result, thereby not increasing any cost. It should be noted that the low-level formatting process of fig. 7 only inherits the P/E Cycle and TBW information, and after the process of fig. 7 is completed, the conventional formatting process, i.e., "check the NAND damaged block", "calibrate data selecting pulse phase", and "write updated firmware into NAND" of fig. 6, is performed, so that the low-level formatting process of the entire SSD is completed.

In summary, the low-level formatting method according to the embodiment of the present invention only adds some steps (S82 and S83) to the existing firmware flow of the system of fig. 5, so as to generate the firmware storage information synchronously with the existing steps, and then the low-level formatted firmware performs low-level formatting further according to the firmware storage information, so as to implement inheritance of important information parameters during low-level formatting in a manner that does not increase cost at all. Similarly, the low-level formatting method of the present invention only adds some steps (S102 and S103) to the existing RDT firmware flow of fig. 4, so as to generate the RDT test result synchronously with the existing steps, and then the low-level formatting firmware performs low-level formatting further according to the RDT test result, so as to implement inheritance of important information parameters during low-level formatting in a manner without increasing cost at all.

Therefore, the low-level formatting method of the embodiment of the invention can truly reflect the information of P/E Cycle, TBW and the like of the SSD in the whole life process of the SSD, not only can avoid irrevocable data loss caused by misjudging the service life of the SSD by a user be avoided, but also can be suitable for a disk returned by the user (RMA), so that the real use condition of the SSD can be inquired when the returned disk is maintained, and the low-level formatting method can be used as a basis for providing product retention.

In addition, the invention also discloses a storage device, which comprises a processor and a plurality of storage blocks, wherein the processor executes the low-level formatting method.

All or a portion of the steps of the methods described herein may be implemented in a computer program, such as the operating system of a computer, a driver for specific hardware in a computer, or a software program. In addition, other types of programs, as shown above, may also be implemented. Those skilled in the art can write the method of the embodiment of the present invention as a computer program, and will not be described again for the sake of brevity. The computer program implemented according to the embodiments of the present invention may be stored on a suitable computer readable medium, such as a DVD, CD-ROM, USB, hard disk, or may be located on a network server accessible via a network (e.g., the internet, or other suitable carrier).

Although the above-described elements are included in the drawings of the present application, it is not excluded that more additional elements may be used to achieve better technical results without departing from the spirit of the invention. Further, although the flowcharts of the present application are executed in the order specified, a person skilled in the art can modify the order of the steps without departing from the spirit of the invention to achieve the same effect, and therefore, the present invention is not limited to the order described above. In addition, one skilled in the art may integrate several steps into one step, or perform more steps in sequence or in parallel besides the steps, and the present invention is not limited thereby.

While the invention has been described using the above embodiments, it should be noted that these descriptions are not intended to limit the invention. Rather, this invention encompasses modifications and similar arrangements as would be apparent to one skilled in the art. The scope of the claims is, therefore, to be construed in the broadest manner to include all such obvious modifications and similar arrangements.

20页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:半导体存储装置及其控制方法

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!