SSD wear leveling mechanism test method, system, medium and terminal

文档序号:1615530 发布日期:2020-01-10 浏览:17次 中文

阅读说明:本技术 一种ssd磨损均衡机制测试方法、系统、介质和终端 (SSD wear leveling mechanism test method, system, medium and terminal ) 是由 冯超 于 2019-09-09 设计创作,主要内容包括:一种固态硬盘SSD磨损均衡机制测试方法、系统、存储介质和终端,其中,所述方法包括:对SSD中指定逻辑区块寻址LBA区域随机写入数据;当向所述指定LBA区域发送的数据量满足预设条件时,对比所述SSD中指定LBA区域块和SSD中非指定LBA区域块的擦写次数,根据对比结果获得磨损均衡机制的测试结果。本申请能够实现快速测试SSD磨损均衡机制的目的。(A method, a system, a storage medium and a terminal for testing a Solid State Disk (SSD) wear leveling mechanism are provided, wherein the method comprises the following steps: randomly writing data to the designated logical block addressing LBA region in the SSD; and when the data volume sent to the appointed LBA region meets a preset condition, comparing the erasing times of the appointed LBA region block in the SSD and the non-appointed LBA region block in the SSD, and obtaining a test result of the wear leveling mechanism according to the comparison result. The method and the device can achieve the purpose of rapidly testing the SSD wear leveling mechanism.)

1. A method for testing a wear leveling mechanism of a Solid State Disk (SSD) is characterized by comprising the following steps:

randomly writing data to the designated logical block addressing LBA region in the SSD;

and when the data volume sent to the appointed LBA region meets a preset condition, comparing the erasing times of the appointed LBA region block in the SSD and the non-appointed LBA region block in the SSD, and obtaining a test result of the wear leveling mechanism according to the comparison result.

2. The method for testing the wear leveling mechanism of the SSD of claim 1, wherein the obtaining the test result of the wear leveling mechanism according to the comparison result comprises:

the erasing times of the appointed LBA region block in the SSD and the erasing times of the non-appointed LBA region block in the SSD are uniformly distributed, so that the wear leveling mechanism of the SSD meets the requirement.

3. The method for testing the wear leveling mechanism of the SSD of claim 1, wherein the obtaining the test result of the wear leveling mechanism according to the comparison result comprises:

the erasing times of the designated LBA region block in the SSD are larger than the erasing times of the non-designated LBA region block in the SSD, and the erasing times of the designated LBA region block in the SSD and the erasing times of the non-designated LBA region block are distributed unevenly, so that the wear leveling mechanism of the SSD does not meet the requirement.

4. The method for testing the wear leveling mechanism of the SSD of claim 1, wherein the obtaining the test result of the wear leveling mechanism according to the comparison result comprises:

if the block of the unspecified LBA region in the SSD is not erased, there is no wear leveling mechanism in the SSD.

5. The method for testing the wear leveling mechanism of the SSD according to claim 2,

the erasing times of the appointed LBA area block in the SSD and the times of the non-appointed LBA area block in the SSD are uniformly distributed, and the erasing times comprise the following steps:

the variance of the erasing times of each block of the designated LBA region in the SSD and the variance of the erasing times of each block of the non-designated LBA region in the SSD fall into a first preset range, and the difference between the maximum value and the minimum value of the erasing times of all the blocks in the SSD falls into a second preset range.

6. The method for testing the wear leveling mechanism of the SSD according to any one of claims 1 to 5,

the size of the designated LBA region in the SSD is 5% of the total SSD region size.

7. A test system for a wear leveling mechanism of a Solid State Disk (SSD) is characterized by comprising:

the data writing module is used for randomly writing data into the designated logic block addressing LBA area in the SSD;

and the comparison module is used for comparing the erasing times of the designated LBA region block in the SSD and the non-designated LBA region block in the SSD when the data volume sent to the designated LBA region meets the preset condition, and obtaining the test result of the wear leveling mechanism according to the comparison result.

8. The system for testing the wear leveling mechanism of a Solid State Disk (SSD) according to claim 7,

the comparison module is used for obtaining a test result of the wear leveling mechanism according to the comparison result, and comprises:

the erasing times of the appointed LBA region block in the SSD and the erasing times of the non-appointed LBA region block in the SSD are uniformly distributed, so that the wear leveling mechanism of the SSD meets the requirement.

9. A computer-readable and writable storage medium, characterized in that the medium stores computer-executable instructions which, when executed by a processor, implement the steps of the wear leveling mechanism testing method of a solid state disk, SSD, according to any of claims 1 to 6.

10. A terminal, comprising:

a memory for storing computer executable instructions;

a processor for executing the computer executable instructions to implement the steps of the wear leveling mechanism testing method of the solid state disk SSD according to any of claims 1 to 6.

Technical Field

The present disclosure relates to a Solid State Drive (SSD) performance testing technology, and in particular, to a method, a system, a storage medium, and a terminal for testing an SSD wear leveling mechanism.

Background

With the development of technologies such as internet, cloud computing, internet of things and the like, the solid state disk SSD is widely used as a new generation of storage. In the development and test process of the Solid State Disk (SSD), the service life of the SSD is of great concern, and the service life of a FLASH memory FLASH used in the SSD is divided according to a sector. When the erasing times (0 changes to 1 or 1 changes to 0 and is calculated once) of the same bit position reach a certain number (the theoretical value is 10 ten thousand times), the bit position cannot be written into (1 changes to 0), and the whole sector is influenced by one bit. After wear leveling is introduced into the SSD, a sector can be erased (the erasure is calculated once for each bit position), and then the position of each written content is changed, so that the FLASH service life can be prolonged by calculating once for each bit position until the whole sector is fully written (because different bit positions are operated each time). Assuming a 4K FLASH sector, 100 storage units can be divided, and after a wear leveling mechanism is introduced, 100 times of storing one data and only 2 times of erasing and writing of each storage unit are performed, while no wear mechanism is used, 1 storage unit can be erased and written 200 times, the service life of the storage unit is prolonged by 100 times, which also means that the service life of a sector is prolonged by 100 times. Therefore, the service life of the SSD is directly influenced by the quality of the wear leveling function introduced into the SSD, but with the increase of the SSD capacity, the test of the wear leveling mechanism needs to be verified after a large amount of data is written, and the test time is greatly prolonged.

Disclosure of Invention

The application provides a method, a system, a storage medium and a terminal for testing a Solid State Disk (SSD) wear leveling mechanism, which can achieve the purpose of rapidly testing the SSD wear leveling mechanism.

The application provides a wear leveling mechanism test method of a Solid State Disk (SSD), which comprises the following steps:

randomly writing data to the designated logical block addressing LBA region in the SSD;

and when the data volume sent to the appointed LBA region meets a preset condition, comparing the erasing times of the appointed LBA region block in the SSD and the non-appointed LBA region block in the SSD, and obtaining a test result of the wear leveling mechanism according to the comparison result.

In an exemplary embodiment, the obtaining a test result of the wear leveling mechanism according to the comparison result includes:

the erasing times of the appointed LBA region block in the SSD and the erasing times of the non-appointed LBA region block in the SSD are uniformly distributed, so that the wear leveling mechanism of the SSD meets the requirement.

In an exemplary embodiment, the obtaining a test result of the wear leveling mechanism according to the comparison result includes:

the erasing times of the designated LBA region block in the SSD are larger than the erasing times of the non-designated LBA region block in the SSD, and the erasing times of the designated LBA region block in the SSD and the erasing times of the non-designated LBA region block are distributed unevenly, so that the wear leveling mechanism of the SSD does not meet the requirement.

In an exemplary embodiment, the obtaining a test result of the wear leveling mechanism according to the comparison result includes:

if the block of the unspecified LBA region in the SSD is not erased, there is no wear leveling mechanism in the SSD.

In an exemplary embodiment, the erasing times of the designated LBA region block in the SSD and the unspecified LBA region block in the SSD are both uniformly distributed, including:

the variance of the erasing times of each block of the designated LBA region in the SSD and the variance of the erasing times of each block of the non-designated LBA region in the SSD fall into a first preset range, and the difference between the maximum value and the minimum value of the erasing times of all the blocks in the SSD falls into a second preset range.

In an exemplary embodiment, the size of the designated LBA region in the SSD is 5% of the SSD total region size.

The embodiment of the present application further provides a system for testing a wear leveling mechanism of a solid state disk SSD, including:

the data writing module is used for randomly writing data into the designated logic block addressing LBA area in the SSD;

and the comparison module is used for comparing the erasing times of the designated LBA region block in the SSD and the non-designated LBA region block in the SSD when the data volume sent to the designated LBA region meets the preset condition, and obtaining the test result of the wear leveling mechanism according to the comparison result.

In an exemplary embodiment, the comparison module, configured to obtain a test result of the wear leveling mechanism according to the comparison result, includes:

the erasing times of the appointed LBA region block in the SSD and the erasing times of the non-appointed LBA region block in the SSD are uniformly distributed, so that the wear leveling mechanism of the SSD meets the requirement.

The embodiment of the present application further provides a computer readable and writable storage medium, where the medium stores computer executable instructions, and the computer executable instructions, when executed by a processor, implement the steps of the wear leveling mechanism testing method for the SSD, according to the foregoing embodiment.

An embodiment of the present application further provides a terminal, including:

a memory for storing computer executable instructions;

the processor is used for executing the computer executable instructions to implement the steps of the wear leveling mechanism testing method for the solid state disk SSD according to the foregoing embodiment.

Compared with the related art, the method comprises the following steps: randomly writing data to the designated logical block addressing LBA region in the SSD; and when the data volume sent to the appointed LBA region meets a preset condition, comparing the erasing times of the appointed LBA region block in the SSD and the non-appointed LBA region block in the SSD, and obtaining a test result of the wear leveling mechanism according to the comparison result. The method and the device can achieve the purpose of rapidly testing the SSD wear leveling mechanism.

Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. Other advantages of the application may be realized and attained by the instrumentalities and combinations particularly pointed out in the specification, claims, and drawings.

Drawings

The accompanying drawings are included to provide an understanding of the present disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the examples serve to explain the principles of the disclosure and not to limit the disclosure.

Fig. 1 is a flowchart of a method for testing an SSD wear leveling mechanism according to an embodiment of the present application;

fig. 2 is a block diagram of a system for testing a SSD wear leveling mechanism according to an embodiment of the present application.

Detailed Description

The present application describes embodiments, but the description is illustrative rather than limiting and it will be apparent to those of ordinary skill in the art that many more embodiments and implementations are possible within the scope of the embodiments described herein. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are possible. Any feature or element of any embodiment may be used in combination with or instead of any other feature or element in any other embodiment, unless expressly limited otherwise.

The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in this application may also be combined with any conventional features or elements to form a unique inventive concept as defined by the claims. Any feature or element of any embodiment may also be combined with features or elements from other inventive aspects to form yet another unique inventive aspect, as defined by the claims. Thus, it should be understood that any of the features shown and/or discussed in this application may be implemented alone or in any suitable combination. Accordingly, the embodiments are not limited except as by the appended claims and their equivalents. Furthermore, various modifications and changes may be made within the scope of the appended claims.

Further, in describing representative embodiments, the specification may have presented the method and/or process as a particular sequence of steps. However, to the extent that the method or process does not rely on the particular order of steps set forth herein, the method or process should not be limited to the particular sequence of steps described. Other orders of steps are possible as will be understood by those of ordinary skill in the art. Therefore, the particular order of the steps set forth in the specification should not be construed as limitations on the claims. Further, the claims directed to the method and/or process should not be limited to the performance of their steps in the order written, and one skilled in the art can readily appreciate that the sequences may be varied and still remain within the spirit and scope of the embodiments of the present application.

The embodiment of the application provides a method for testing a Solid State Disk (SSD) wear leveling mechanism, as shown in FIG. 1, the method comprises the following steps:

step S101, randomly writing data into the designated logic block addressing LBA area in the SSD;

in an exemplary embodiment, data may be randomly written to a designated LBA region in an SSD in an empty disk state, or data may be randomly written to the designated LBA region in the SSD in which data is written sequentially after data is sequentially written to the entire disk of the SSD first;

in the embodiment of the invention, the function of writing data into the SSD can be realized by using a disk IO test tool;

step S102, when the data amount sent to the designated LBA region satisfies a preset condition (for example, the preset condition is 1/M times of the SSD data capacity, M is an integer greater than or equal to 1, and M may be determined by a technician experience), comparing the erasing times of the designated LBA region block in the SSD and the unspecified LBA region block in the SSD, and obtaining a test result of the wear leveling mechanism according to the comparison result.

In an exemplary embodiment, the erase times of the designated LBA region block in the SSD and the non-designated LBA region block in the SSD are both uniformly distributed, and the wear leveling mechanism of the SSD meets the requirement.

The erasing times of the appointed LBA area block in the SSD and the times of the non-appointed LBA area block in the SSD are uniformly distributed, and the erasing times comprise the following steps:

the variance of the erasing times of each block of the designated LBA region in the SSD and the variance of the erasing times of each block of the non-designated LBA region in the SSD fall into a first preset range, the difference value between the maximum value and the minimum value of the erasing times of all the regions in the SSD falls into a second preset range, and the first preset range and the second preset range can be modified.

In an exemplary embodiment, the obtaining a test result of the wear leveling mechanism according to the comparison result includes:

the erasing times of the designated LBA region block in the SSD are larger than the erasing times of the non-designated LBA region block in the SSD, and the erasing times of the designated LBA region block in the SSD and the erasing times of the non-designated LBA region block are distributed unevenly, so that the wear leveling mechanism of the SSD does not meet the requirement.

The uneven distribution of the erasing times of the appointed LBA region block and the erasing times of the non-appointed LBA region block in the SSD comprises:

the variance of the erasing times of each block of the designated LBA region in the SSD and the variance of the erasing times of each block of the unspecified LBA region in the SSD do not fall within the first preset range, or the difference between the maximum value and the minimum value of the erasing times of all the area blocks in the SSD does not fall within the second preset range.

In an exemplary embodiment, the obtaining a test result of the wear leveling mechanism according to the comparison result includes:

if the block of the unspecified LBA region in the SSD is not erased, there is no wear leveling mechanism in the SSD.

The designated LBA region in the SSD may be randomly selected, and the smaller the ratio of the size of the designated LBA region to the size of the entire region is, the faster the data amount written in the designated LBA region meets the requirement, and the shorter the test time is, in an exemplary embodiment, the size of the designated LBA region may be 5% of the total size of the SSD.

The SSD may be a Non-Volatile memory host controller interface specification (NVME) SSD.

According to the embodiment of the application, the designated LBA region block and the non-designated LBA region block are set, data are randomly written into the designated LBA region block, and the SSD model with the unbalanced data distribution is constructed firstly. If the SSD meets the requirement by using a wear leveling mechanism, when the SSD writes data into the designated LBA region, the data is copied to the non-designated LBA region before the data of the designated LBA region is erased, and the erasing times of the designated LBA region block and the erasing times of the non-designated LBA region block are distributed uniformly, so that whether the erasing times of the final LBA region block and the erasing times of the non-designated LBA region block are distributed uniformly is verified, and whether the wear leveling mechanism meets the requirement is verified. In the prior art, data is randomly written into the whole SSD, and a large amount of data is usually written to construct an SSD model with unbalanced data distribution because of the uniform data distribution and the sporadic data. Compared with the prior art, the data volume written into the SSD during the wear leveling mechanism test is reduced, the purpose of rapidly testing the wear leveling mechanism of the SSD is achieved, the test working time is shortened, and the research and development test efficiency is improved.

An embodiment of the present application further provides a system for testing a wear leveling mechanism of a solid state disk SSD, as shown in fig. 2, the system includes:

a data writing module 201, configured to randomly write data to the designated logical block addressing LBA region in the SSD;

in an exemplary embodiment, the data writing module 201 may randomly write data to the designated LBA region in the SSD in an empty disk state, or may randomly write data to the designated LBA region in the SSD in which data is written sequentially after data is written sequentially to the entire disk of the SSD;

the data writing module 201 can implement the writing operation on the SSD data by using a disk IO test tool;

a comparing module 202, configured to, when the amount of data sent to the designated LBA region meets a preset condition (the preset condition is, for example, 1/M times of the data capacity of the SSD, where M is an integer greater than or equal to 1, and M may be determined by a technician's experience), compare the erasing times of the designated LBA region block in the SSD and the unspecified LBA region block in the SSD, and obtain a test result of the wear leveling mechanism according to the comparison result.

In an exemplary embodiment, the comparison module 202 is configured to obtain a test result of the wear leveling mechanism according to the comparison result, and includes:

the erasing times of the appointed LBA region block in the SSD and the erasing times of the non-appointed LBA region block in the SSD are uniformly distributed, so that the wear leveling mechanism of the SSD meets the requirement.

The erasing times of the appointed LBA area block in the SSD and the times of the non-appointed LBA area block in the SSD are uniformly distributed, and the erasing times comprise the following steps:

the variance of the erasing times of each block of the designated LBA region in the SSD and the variance of the erasing times of each block of the non-designated LBA region in the SSD fall into a first preset range, the difference value between the maximum value and the minimum value of the erasing times of all the regions in the SSD falls into a second preset range, and the first preset range and the second preset range can be modified.

In an exemplary embodiment, the comparing module 202, configured to obtain the test result of the wear leveling mechanism according to the comparison result, includes:

the erasing times of the designated LBA region block in the SSD are larger than the erasing times of the non-designated LBA region block in the SSD, and the erasing times of the designated LBA region block in the SSD and the erasing times of the non-designated LBA region block are distributed unevenly, so that the wear leveling mechanism of the SSD does not meet the requirement.

The uneven distribution of the erasing times of the appointed LBA region block and the erasing times of the non-appointed LBA region block in the SSD comprises:

the variance of the erasing times of each block of the designated LBA region in the SSD and the variance of the erasing times of each block of the unspecified LBA region in the SSD do not fall within the first preset range, or the difference between the maximum value and the minimum value of the erasing times of all the area blocks in the SSD does not fall within the second preset range.

In an exemplary embodiment, the comparing module 202, configured to obtain the test result of the wear leveling mechanism according to the comparison result, includes:

if the block of the unspecified LBA region in the SSD is not erased, there is no wear leveling mechanism in the SSD.

The designated LBA region in the SSD may be randomly selected, and the smaller the ratio of the size of the designated LBA region to the size of the entire region is, the faster the data amount written in the designated LBA region meets the requirement, and the shorter the test time is, in an exemplary embodiment, the size of the designated LBA region may be 5% of the total size of the SSD.

The SSD may be a Non-Volatile memory host controller interface specification (NVME) SSD.

Compared with the related technology, the embodiment of the invention reduces the data volume written into the SSD during the wear leveling mechanism test, realizes the purpose of rapidly testing the wear leveling mechanism of the SSD, reduces the test working time and improves the research and development test efficiency.

The embodiment of the invention also provides a computer readable and writable storage medium, which stores computer executable instructions, and when the computer executable instructions are executed by a processor, the steps of the wear leveling mechanism testing method for the SSD of the solid state disk according to the foregoing embodiment are implemented.

An embodiment of the present invention further provides a terminal, including:

a memory for storing computer executable instructions;

the processor is used for executing the computer executable instructions to implement the steps of the wear leveling mechanism testing method for the solid state disk SSD according to the foregoing embodiment.

It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:DDR修复方法、装置、终端和存储介质

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!