A kind of hard disc data conformance test method and device

文档序号:1743476 发布日期:2019-11-26 浏览:23次 中文

阅读说明:本技术 一种硬盘数据一致性测试方法与装置 (A kind of hard disc data conformance test method and device ) 是由 贾祥玉 于 2019-08-01 设计创作,主要内容包括:本发明公开了一种硬盘数据一致性测试方法与装置包括:删除硬盘已有的所有命名空间并重新创建格式类型互不相同的多个命名空间,以及根据逻辑块地址将多个命名空间划分为第一组命名空间和第二组命名空间;在多个命名空间中多次执行全盘写入操作直到硬盘达到稳定状态;通过基于第一参数的第一写入方式向第一组命名空间中写满数据,并通过基于第二参数的第二写入方式向第二组命名空间中写满数据;读取第一组命名空间中的数据并校验数据一致性。本发明能够使用复杂场景以更高的精度来验证硬盘的数据一致性,提升硬盘的校验质量水平。(It include: to delete the existing all NameSpaces of hard disk and re-create the mutually different multiple NameSpaces of Format Type, and multiple NameSpaces are divided by first group of NameSpace and second group of NameSpace according to logical block address the invention discloses a kind of hard disc data conformance test method and device;Overall write operation is performed a plurality of times in multiple NameSpaces until hard disk reaches stable state;Full data are write into first group of NameSpace by the first writing mode based on the first parameter, and full data are write into second group of NameSpace by the second writing mode based on the second parameter;It reads the data in first group of NameSpace and verifies data consistency.The present invention is able to use complex scene and verifies with higher precision the data consistency of hard disk, promotes the verification quality level of hard disk.)

1. a kind of hard disc data conformance test method, which comprises the following steps:

It deletes the existing all NameSpaces of hard disk and re-creates the mutually different multiple NameSpaces of Format Type, Yi Jigen The multiple NameSpace is divided into first group of NameSpace and second group of NameSpace according to logical block address;

Overall write operation is performed a plurality of times in the multiple NameSpace until hard disk reaches stable state;

Full data are write into first group of NameSpace by the first writing mode based on the first parameter, and by based on the Second writing mode of two parameters writes full data into second group of NameSpace;

It reads the data in first group of NameSpace and verifies data consistency.

2. the method according to claim 1, wherein the multiple NameSpace is with all having continuous logical block Location.

3. according to the method described in claim 2, it is characterized in that, first group of NameSpace and second group of name are empty Between be continuously arranged alternately in the logical block address of hard disk so that each of described first group of NameSpace patrolling in hard disk It is only adjacent with second group of NameSpace in volume block address, and each of described second group of NameSpace patrolling in hard disk It collects only adjacent with first group of NameSpace in block address.

4. according to the method described in claim 2, it is characterized in that, reading the data in first group of NameSpace and verification Data consistency includes: to read to be stored in the long with predetermined threshold of logical block address both ends from first group of NameSpace The end-point data of degree, and verify the data consistency of the end-point data.

5. the method according to claim 1, wherein first writing mode and the second writing mode packet It includes following one: being sequentially written in, random writing;And first writing mode is different from second writing mode.

6. according to the method described in claim 5, it is characterized in that, first parameter and second parameter include random raw At at least one of project: block size, queue depth;And any project in first parameter is numerically not It is same as the correspondence project of second parameter.

7. the method according to claim 1, wherein further include: in reading first group of NameSpace Data and after verifying data consistency, also read the data in second group of NameSpace and verify data consistency.

8. method according to any one of claims 1-7, which is characterized in that the hard disk includes as non-volatile The solid state hard disk of built-in storage extension.

9. a kind of hard disc data consistency test device characterized by comprising

Initialization module, for deleting the existing all NameSpaces of hard disk and to re-create Format Type mutually different multiple NameSpace, and the multiple NameSpace is divided by first group of NameSpace and second group of name according to logical block address Space;

Stable module, for overall write operation to be performed a plurality of times in the multiple NameSpace until hard disk reaches stable shape State;

Writing module, for writing full number into first group of NameSpace by the first writing mode based on the first parameter According to, and full data are write into second group of NameSpace by the second writing mode based on the second parameter;

Correction verification module, for reading the data in first group of NameSpace and verifying data consistency.

10. a kind of computer characterized by comprising

Processor;With

Memory, is stored with the program code that processor can be run, and said program code executes such as claim when being run Hard disc data conformance test method described in any one of 1-8.

Technical field

The present invention relates to computer fields, more specifically, particularly relating to a kind of hard disc data conformance test method and dress It sets.

Background technique

With the rapid development of information technology, data are in explosive growth, (Nonvolatile memory reservoir expands NVMe SSD The solid state hard disk of exhibition) have become the Enterprise Data memory carrier of mainstream.Judge whether SSD stablizes one of available important evidence It is data consistency, and the method for usually testing SSD data consistency is only to carry out to single Namespace (NameSpace) Whether simple reading and writing data, the data consistency that this simple test method is not enough to verify SSD reach requirement.

Aiming at the problem that SSD data consistency checking method cannot satisfy the use demand in the prior art, at present there has been no Effective solution scheme.

Summary of the invention

In view of this, the purpose of the embodiment of the present invention is to propose a kind of hard disc data conformance test method and device, It is able to use complex scene and verified with higher precision the data consistency of hard disk, promotes the verification quality level of hard disk.

Based on above-mentioned purpose, the first aspect of the embodiment of the present invention provides a kind of hard disc data conformance test method, Include:

It deletes the existing all NameSpaces of hard disk and re-creates the mutually different multiple NameSpaces of Format Type, with And multiple NameSpaces are divided by first group of NameSpace and second group of NameSpace according to logical block address;

Overall write operation is performed a plurality of times in multiple NameSpaces until hard disk reaches stable state;

Full data are write into first group of NameSpace by the first writing mode based on the first parameter, and by based on the Second writing mode of two parameters writes full data into second group of NameSpace;

It reads the data in first group of NameSpace and verifies data consistency.

In some embodiments, multiple NameSpaces all have continuous logical block address.

In some embodiments, first group of NameSpace and second group of NameSpace connect in the logical block address of hard disk Be arranged alternately continuously so that each of first group of NameSpace in the logical block address of hard disk only with second group of NameSpace It is adjacent, and each of second group of NameSpace is only adjacent with first group of NameSpace in the logical block address of hard disk.

In some embodiments, reading the data in first group of NameSpace and verifying data consistency includes: from the The end-point data with predetermined threshold length for being stored in logical block address both ends is read in one group of NameSpace, and verifies endpoint The data consistency of data.

In some embodiments, the first writing mode and the second writing mode include following one: being sequentially written in, at random Write-in;And the first writing mode is different from the second writing mode.

In some embodiments, the first parameter and the second parameter include at least one of project generated at random: block Size, queue depth;And any project in the first parameter is numerically different from the correspondence project of the second parameter.

In some embodiments, further includes: in the data read in first group of NameSpace and verify data consistency Later, the data in second group of NameSpace are also read and verify data consistency.

In some embodiments, hard disk includes the solid state hard disk as the extension of Nonvolatile memory reservoir.

The second aspect of the embodiment of the present invention provides a kind of hard disc data consistency test device, comprising:

Initialization module, for deleting the existing all NameSpaces of hard disk and to re-create Format Type mutually different Multiple NameSpaces, and multiple NameSpaces are divided by first group of NameSpace and second group of name according to logical block address Space;

Stable module, for overall write operation to be performed a plurality of times in multiple NameSpaces until hard disk reaches stable shape State;

Writing module, for writing full number into first group of NameSpace by the first writing mode based on the first parameter According to, and full data are write into second group of NameSpace by the second writing mode based on the second parameter;

Correction verification module, for reading the data in first group of NameSpace and verifying data consistency.

The third aspect of the embodiment of the present invention provides a kind of computer, comprising:

Processor;With

Memory, is stored with the program code that processor can be run, and program code executes above-mentioned hard disk when being run Data coherence tester method.

The present invention have following advantageous effects: hard disc data conformance test method provided in an embodiment of the present invention with Device, by deleting the existing all NameSpaces of hard disk and re-creating the mutually different multiple NameSpaces of Format Type, And multiple NameSpaces are divided by first group of NameSpace and second group of NameSpace according to logical block address;In multiple lives Overall write operation is performed a plurality of times in the name space until hard disk reaches stable state;Pass through the first write-in side based on the first parameter Formula writes full data into first group of NameSpace, and by the second writing mode based on the second parameter to second group of NameSpace In write full data;It reads the data in first group of NameSpace and verifies the technical solution of data consistency, be able to use complexity Scene verifies the data consistency of hard disk with higher precision, promotes the verification quality level of hard disk.

Detailed description of the invention

In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.

Fig. 1 is the flow diagram of hard disc data conformance test method provided by the invention.

Specific embodiment

To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with specific embodiment, and reference The embodiment of the present invention is further described in attached drawing.

It should be noted that all statements for using " first " and " second " are for differentiation two in the embodiment of the present invention The non-equal entity of a same names or non-equal parameter, it is seen that " first " " second " only for the convenience of statement, does not answer It is interpreted as the restriction to the embodiment of the present invention, subsequent embodiment no longer illustrates this one by one.

Based on above-mentioned purpose, the first aspect of the embodiment of the present invention proposes one kind and is able to use complex scene with more High precision verifies one embodiment of the method for the data consistency of hard disk.Shown in fig. 1 is hard disk provided by the invention The flow diagram of data coherence tester method.

The hard disc data conformance test method, as shown in Figure 1, comprising:

Step S101: the existing all NameSpaces of hard disk are deleted and re-create the mutually different multiple lives of Format Type The name space, and multiple NameSpaces are divided by first group of NameSpace and second group of NameSpace according to logical block address;

Step S103: overall write operation is performed a plurality of times in multiple NameSpaces until hard disk reaches stable state;

Step S105: writing full data into first group of NameSpace by the first writing mode based on the first parameter, and Full data are write into second group of NameSpace by the second writing mode based on the second parameter;

Step S107: the data in first group of NameSpace are read and verify data consistency.

Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, Ke Yitong Computer program is crossed to instruct related hardware and complete, the program can be stored in a computer-readable storage medium, The program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can for magnetic disk, CD, read-only memory (ROM) or random access memory (RAM) etc..The embodiment of the computer program, Ke Yida The effect identical or similar to corresponding aforementioned any means embodiment.

In some embodiments, multiple NameSpaces all have continuous logical block address.

Each NameSpace occupies continuous region on hard disk;Usually logical block address and physical address are phases Corresponding, i.e., physical address is also adjacent in the case that logical block address is adjacent.Therefore each NameSpace is also all only in hard disk One section is occupied, is not in the case where there are also other names space address in a NameSpace section.

In some embodiments, first group of NameSpace and second group of NameSpace connect in the logical block address of hard disk Be arranged alternately continuously so that each of first group of NameSpace in the logical block address of hard disk with and only with second group of life The name space is adjacent, and each of second group of NameSpace in the logical block address of hard disk with and only with first group of name Space is adjacent.

First group of NameSpace and second group of NameSpace are arranged alternately in logical block address (and on physical address), This to generate the edge between first group of NameSpace and second group of NameSpace in hard disk.Multiple edges are conducive to preferably Verify the overall quality of hard disk.

In some embodiments, reading the data in first group of NameSpace and verifying data consistency includes: from the The end-point data with predetermined threshold length for being stored in logical block address both ends is read in one group of NameSpace, and verifies endpoint The data consistency of data.

Number is written to first group of NameSpace and second group of NameSpace respectively using different methods in the embodiment of the present invention According to, and verify the data consistency of end-point data emphatically to determine the data consistency of SSD entirety.In fact, the prior art In occur now and then be written data influence be written into data nearby data the case where, it is especially this when two number formularies are according to standard difference Influence becomes readily apparent from.It is consistent to exclude to be easy to occur this reduction data that the embodiment of the present invention is intended to execution aimed detection Property and storage quality SSD, improve verification quality level.

In some embodiments, the first writing mode and the second writing mode include following one: being sequentially written in, at random Write-in;And the first writing mode is different from the second writing mode.

In some embodiments, the first parameter and the second parameter include at least one of project generated at random: block Size, queue depth;And any project in the first parameter is numerically different from the correspondence project of the second parameter.

In some embodiments, method further include: in the data read in first group of NameSpace and verify data one After cause property, also reads the data in second group of NameSpace and verify data consistency.

In some embodiments, hard disk includes the solid state hard disk as the extension of Nonvolatile memory reservoir.

Disclosed method is also implemented as the computer program executed by CPU, the calculating according to embodiments of the present invention Machine program may be stored in a computer readable storage medium.When the computer program is executed by CPU, executes the present invention and implement The above-mentioned function of being limited in method disclosed in example.Above method step and system unit also can use controller and be used for Storage is so that controller realizes that the computer readable storage medium of the computer program of above-mentioned steps or Elementary Function is realized.

Below according to the specific embodiment specific embodiment that the present invention is further explained, following steps are executed in order:

1. deleting the Namespace of SSD default.

2. continuously 10 Namespace 1-10 of creation, and make Format (format) type of each Namespace It is inconsistent, such as can be chosen in the difference such as 512B Format, 4K Format Format.

3. couple 10 Namespace carry out full capacity sequential write, write 2 times, so that disk is reached Steady State and (stablize shape State).There is SSD under Steady State stable read-write to respond, and be the benchmark of test.

4. couple Namespace 1,3,5,7,9 carries out dishful sequential write, the parameter of sequential write will be set as random Blocksize (block size), random Iodepth (queue depth), and guarantee that the mode of each Namespce write-in data is different It causes.

5. couple Namespace 2,4,6,8,10 carries out dishful random write, the parameter of random write will be set as random Blocksize, random Iodepth and different from the random number of previous step guarantee the mould of each Namespce write-in data Formula is inconsistent.The dishful sequential write and dishful random write of this step and previous step can also exchange, as long as the two is different.

6. the data being written before couple Namespace1,3,5,7,9 are read out verification, test to Namespace2,4, 6, the data on Namespace1,3,5,7,9 whether have been damaged when 8,10 write-in data, has paid close attention to adjacent Namespace's Whether the data on boundary LBA (Logical Block Address, logical block address) receive damage.

7. the data being written before couple Namespace2,4,6,8,10 are read out verification.

From above-described embodiment as can be seen that hard disc data conformance test method provided in an embodiment of the present invention, by deleting Except the existing all NameSpaces of hard disk and the mutually different multiple NameSpaces of Format Type are re-created, and according to logic Multiple NameSpaces are divided into first group of NameSpace and second group of NameSpace by block address;In multiple NameSpaces repeatedly Overall write operation is executed until hard disk reaches stable state;By the first writing mode based on the first parameter to first group of life Full data are write in the name space, and full data are write into second group of NameSpace by the second writing mode based on the second parameter; It reads the data in first group of NameSpace and verifies the technical solution of data consistency, be able to use complex scene with higher Precision verifies the data consistency of hard disk, promotes the verification quality level of hard disk.

It is important to note that each step in each embodiment of above-mentioned hard disc data conformance test method is equal Can intersect, replace, increase, delete, therefore, these reasonable permutation and combination transformation in hard disc data uniformity test Method should also be as belonging to the scope of protection of the present invention, and protection scope of the present invention should not be confined to the embodiment it On.

Based on above-mentioned purpose, the second aspect of the embodiment of the present invention proposes one kind and is able to use complex scene with more High precision verifies one embodiment of the device of the data consistency of hard disk.Hard disc data consistency test device includes:

Initialization module, for deleting the existing all NameSpaces of hard disk and to re-create Format Type mutually different Multiple NameSpaces, and multiple NameSpaces are divided by first group of NameSpace and second group of name according to logical block address Space;

Stable module, for overall write operation to be performed a plurality of times in multiple NameSpaces until hard disk reaches stable shape State;

Writing module, for writing full number into first group of NameSpace by the first writing mode based on the first parameter According to, and full data are write into second group of NameSpace by the second writing mode based on the second parameter;

Correction verification module, for reading the data in first group of NameSpace and verifying data consistency.

Various illustrative logical blocks, module, circuit and algorithm steps in conjunction with described in disclosure herein can be implemented For the combination of electronic hardware, computer software or both.In order to clearly demonstrate this interchangeability of hardware and software, General description has been carried out to it with regard to the function of various exemplary components, square, module, circuit and step.This function is Software is implemented as also to be implemented as hardware depending on concrete application and be applied to the design constraint of whole system.This field Technical staff can realize the function in various ways for every kind of concrete application, but determine should not be by for this realization It is construed to lead to be detached from range disclosed by the embodiments of the present invention.

Based on above-mentioned purpose, the third aspect of the embodiment of the present invention proposes a kind of cloth that can be directed to different hardware Line design automatically generates computer one embodiment of the configuration file of driving level.Computer includes:

Processor;With

Memory, is stored with the program code that processor can be run, and program code executes above-mentioned hard disk when being run Data coherence tester method.

From above-described embodiment as can be seen that hard disc data consistency test device provided in an embodiment of the present invention and calculating Machine, by deleting the existing all NameSpaces of hard disk and re-creating the mutually different multiple NameSpaces of Format Type, with And multiple NameSpaces are divided by first group of NameSpace and second group of NameSpace according to logical block address;In multiple names Overall write operation is performed a plurality of times in space until hard disk reaches stable state;Pass through the first writing mode based on the first parameter Full data are write into first group of NameSpace, and through the second writing mode based on the second parameter into second group of NameSpace Write full data;It reads the data in first group of NameSpace and verifies the technical solution of data consistency, be able to use complicated field Scape verifies the data consistency of hard disk with higher precision, promotes the verification quality level of hard disk.

It is important to note that the embodiment of above-mentioned hard disc data consistency test device and computer is using described The embodiment of hard disc data conformance test method illustrates the course of work of each module, and those skilled in the art can be very It is readily apparent that, it will be in the other embodiments of these module applications to the hard disc data conformance test method.Certainly, by institute The each step stated in hard disc data conformance test method embodiment can be intersected, replaces, increases, be deleted, therefore, These reasonable permutation and combination transformation should also be as belonging to the present invention in the hard disc data consistency test device and computer Protection scope, and protection scope of the present invention should not be confined on the embodiment.

It is exemplary embodiment disclosed by the invention above, it should be noted that in the sheet limited without departing substantially from claim Under the premise of inventive embodiments scope of disclosure, it may be many modifications and modify.According to open embodiment described herein The function of claim to a method, step and/or movement be not required to the execution of any particular order.In addition, although the present invention is implemented Element disclosed in example can be described or be required in the form of individual, but be unless explicitly limited odd number, it is understood that be multiple.

It should be understood that it is used in the present context, unless the context clearly supports exceptions, singular " one It is a " it is intended to also include plural form.It is to be further understood that "and/or" used herein refers to including one or one Any and all possible combinations of a above project listed in association.The embodiments of the present invention disclose embodiment sequence number only Only for description, do not represent the advantages or disadvantages of the embodiments.

Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..

It should be understood by those ordinary skilled in the art that: the discussion of any of the above embodiment is exemplary only, not It is intended to imply that range disclosed by the embodiments of the present invention (including claim) is limited to these examples;In the think of of the embodiment of the present invention Under road, it can also be combined between the technical characteristic in above embodiments or different embodiments, and exist as described above Many other variations of the different aspect of the embodiment of the present invention, for simplicity, they are not provided in details.Therefore, all at this Within the spirit and principle of inventive embodiments, any omission, modification, equivalent replacement, improvement for being made etc. should be included in this hair Within the protection scope of bright embodiment.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:ATE快速获取存储器失效地址的方法

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!