Method, system, equipment and storage medium for detecting data integrity of solid state disk

文档序号:1143087 发布日期:2020-09-11 浏览:19次 中文

阅读说明:本技术 固态硬盘的数据完整性检测方法、系统、设备及存储介质 (Method, system, equipment and storage medium for detecting data integrity of solid state disk ) 是由 王辉 李振华 于 2020-05-22 设计创作,主要内容包括:本发明公开一种固态硬盘的数据完整性检测方法,该数据完整性检测方法包括上位机写入数据到待测固态硬盘中,并将写入到待测固态硬盘中的数据记录在预设位置;在检测到待测固态硬盘异常断电时,停止写入数据,并对最后写入待测固态硬盘中的数据增加停止字符;在检测到待测固态硬盘重新上电时,读取待测固态硬盘内的数据,并根据所述停止字符查询待测固态硬盘断电前已写入的数据;将查询到的数据与记录在预设位置的数据进行比对,根据比对结果判断待测固态硬盘在断电前所写入的数据是否完整。本发明有利于检测待测固态硬盘在异常断电状态下写入数据的完整性和准确性。此外,本发明还公开一种固态硬盘的数据完整性检测系统、设备及存储介质。(The invention discloses a data integrity detection method of a solid state disk, which comprises the steps that an upper computer writes data into a solid state disk to be detected, and records the data written into the solid state disk to be detected at a preset position; when the abnormal power failure of the solid state disk to be tested is detected, stopping writing data, and adding stop characters to the data written into the solid state disk to be tested finally; when detecting that the solid state disk to be tested is electrified again, reading data in the solid state disk to be tested, and inquiring the data written in the solid state disk to be tested before the power failure according to the stop character; and comparing the inquired data with the data recorded at the preset position, and judging whether the data written in the solid state disk to be tested before the power failure is complete or not according to the comparison result. The method is beneficial to detecting the integrity and the accuracy of the data written in the solid state disk to be detected in the abnormal power-off state. In addition, the invention also discloses a system, equipment and a storage medium for detecting the data integrity of the solid state disk.)

1. A method for detecting data integrity of a solid state disk is characterized by comprising the following steps:

the upper computer writes data into the solid state disk to be tested and records the data written into the solid state disk to be tested at a preset position;

when the abnormal power failure of the solid state disk to be tested is detected, stopping writing data, and adding stop characters to the data written into the solid state disk to be tested finally;

when detecting that the solid state disk to be tested is electrified again, reading data in the solid state disk to be tested, and inquiring the data written in the solid state disk to be tested before the power failure according to the stop character;

and comparing the inquired data with the data recorded at the preset position, and judging whether the data written in the solid state disk to be tested before the power failure is complete or not according to the comparison result.

2. The data integrity detection method according to claim 1, wherein the reading data in the solid state disk to be detected and querying the data written in the solid state disk to be detected before the power failure according to the stop character comprises:

acquiring time node information corresponding to stop characters;

and inquiring data written in a preset time period before the time node according to the time node information.

3. The data integrity detection method according to claim 1, wherein the reading data in the solid state disk to be detected and querying the data written in the solid state disk to be detected before the power failure according to the stop character comprises:

acquiring position information of a stop character;

and inquiring data with preset size written in the solid state disk to be tested before the stop character according to the position information of the stop character.

4. The data integrity detection method according to claim 1, wherein after the step of determining whether the data written in the solid state disk to be detected before the power failure is complete according to the comparison result, the method further comprises:

if the written data is complete, carrying out repeated detection on the solid state disk to be detected for a preset number of times;

and if the written data is incomplete, terminating the detection of the solid state disk to be detected.

5. The data integrity detection method according to claim 4, wherein the step of writing data into the solid state disk to be detected by the upper computer and recording the data written into the solid state disk to be detected at a preset position by the upper computer further comprises:

constructing a database;

the database includes a plurality of write data groups arranged in sequence and stop characters corresponding to the write data groups one to one.

6. The data integrity checking method of claim 5, wherein the step of constructing a database further comprises, before:

acquiring the testing times of the solid state disk to be tested;

and writing the corresponding data in the written data group into the solid state disk to be tested according to the test times.

7. The data integrity detection method according to claim 6, wherein before the step of stopping writing data and adding stop characters to the data written into the solid state disk to be detected finally when detecting that the solid state disk to be detected is abnormally powered off, the method further comprises:

acquiring writing time for writing the data in the written data group into the solid state disk to be tested;

and the solid state disk to be tested is forced to be powered off within the writing time.

8. A data integrity detection system of a solid state disk is characterized by comprising:

the recording module is used for recording data written into the solid state disk to be tested;

the marking module is used for writing stop characters into the solid state disk to be tested after the information that the solid state disk to be tested is forcibly powered off is received;

the query module is used for reading data stored in the solid state disk to be tested after the solid state disk to be tested is powered on and querying data written in the solid state disk to be tested before the solid state disk to be tested is powered off according to stop characters;

and the judging module is used for judging whether the data before the stop character in the data inquired by the inquiring module is consistent with the data recorded by the recording module.

9. The utility model provides a data integrity check out test set of solid state hard drives which characterized in that includes:

a memory for storing a computer program;

a processor for implementing the steps of the data integrity detection method as claimed in any one of claims 1 to 7 when executing the computer program.

10. A storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the data integrity detection method according to any one of claims 1 to 7.

Technical Field

The invention relates to the technical field of solid state disks, in particular to a method, a system, equipment and a storage medium for detecting data integrity of a solid state disk.

Background

A Solid State Drive (SSD), commonly called Solid State Disk, is a hard Disk made of an array of Solid State electronic memory chips, and is composed of a control unit and a memory unit (FLASH chip, DRAM chip).

The solid state disk generally performs corresponding performance detection before leaving a factory, and the existing method for detecting the solid state disk generally loads an operating system to the solid state disk, and then judges the performance of the solid state disk according to whether the operating system can be restarted and whether a file is damaged or not after forced power failure and restart. However, this test method cannot detect the integrity and accuracy of the data written in the solid state disk after abnormal power failure.

Disclosure of Invention

The invention provides a data integrity detection method of a solid state disk, which aims to solve the technical problem that the existing test mode can not detect the integrity and accuracy of data written in the solid state disk after abnormal power failure.

The invention provides a data integrity detection method of a solid state disk, which comprises the following steps:

the upper computer writes data into the solid state disk to be tested and records the data written into the solid state disk to be tested at a preset position;

when the abnormal power failure of the solid state disk to be tested is detected, stopping writing data, and adding stop characters to the data written into the solid state disk to be tested finally;

when detecting that the solid state disk to be tested is electrified again, reading data in the solid state disk to be tested, and inquiring the data written in the solid state disk to be tested before the power failure according to the stop character;

and comparing the inquired data with the data recorded at the preset position, and judging whether the data written in the solid state disk to be tested before the power failure is complete or not according to the comparison result.

Preferably, the reading data in the solid state disk to be tested and querying the data written in the solid state disk to be tested before the power failure according to the stop character includes:

acquiring time node information corresponding to stop characters;

and inquiring data written in a preset time period before the time node according to the time node information.

Preferably, the reading data in the solid state disk to be tested and querying the data written in the solid state disk to be tested before the power failure according to the stop character includes:

acquiring position information of a stop character;

and inquiring data with preset size written in the solid state disk to be tested before the stop character according to the position information of the stop character.

Preferably, after the step of determining whether the data written in the solid state disk to be tested before the power failure is complete according to the comparison result, the method further includes:

if the written data is complete, carrying out repeated detection on the solid state disk to be detected for a preset number of times;

and if the written data is incomplete, terminating the detection of the solid state disk to be detected.

Preferably, the step of writing data into the solid state disk to be tested by the upper computer and recording the data written into the solid state disk to be tested at a preset position by the upper computer further includes:

constructing a database;

the database includes a plurality of write data groups arranged in sequence and stop characters corresponding to the write data groups one to one.

Preferably, the step of constructing a database further comprises:

acquiring the testing times of the solid state disk to be tested;

and writing the corresponding data in the written data group into the solid state disk to be tested according to the test times.

Preferably, before the step of stopping writing data and adding a stop character to the data written into the solid state disk to be tested finally when detecting that the solid state disk to be tested is abnormally powered off, the method further includes:

acquiring writing time for writing the data in the written data group into the solid state disk to be tested;

and the solid state disk to be tested is forced to be powered off within the writing time.

The invention further provides a data integrity detection system of the solid state disk, which comprises:

the recording module is used for recording data written into the solid state disk to be tested;

the marking module is used for writing stop characters into the solid state disk to be tested after the information that the solid state disk to be tested is forcibly powered off is received;

the reading module is used for reading data stored in the solid state disk to be tested after the solid state disk to be tested is powered on;

the query module is used for acquiring the position of the stop character in the data read from the solid state disk to be tested;

and the judging module is used for judging whether the data before the stop character in the data inquired by the inquiring module is consistent with the data recorded by the recording module.

The invention also provides a data integrity detection device of the solid state disk, which comprises:

a memory for storing a computer program;

a processor, configured to implement at least the following steps of the method for detecting data integrity of a solid state disk when executing the computer program:

the upper computer writes data into the solid state disk to be tested and records the data written into the solid state disk to be tested at a preset position;

when the abnormal power failure of the solid state disk to be tested is detected, stopping writing data, and adding stop characters to the data written into the solid state disk to be tested finally;

when detecting that the solid state disk to be tested is electrified again, reading data in the solid state disk to be tested, and inquiring the data written in the solid state disk to be tested before the power failure according to the stop character;

and comparing the inquired data with the data recorded at the preset position, and judging whether the data written in the solid state disk to be tested before the power failure is complete or not according to the comparison result.

The present invention also provides a storage medium, in which a computer program is stored, and when executed by a processor, the computer program at least implements the following steps of the method for detecting data integrity of a solid state disk:

the upper computer writes data into the solid state disk to be tested and records the data written into the solid state disk to be tested at a preset position;

when the abnormal power failure of the solid state disk to be tested is detected, stopping writing data, and adding stop characters to the data written into the solid state disk to be tested finally;

when detecting that the solid state disk to be tested is electrified again, reading data in the solid state disk to be tested, and inquiring the data written in the solid state disk to be tested before the power failure according to the stop character;

and comparing the inquired data with the data recorded at the preset position, and judging whether the data written in the solid state disk to be tested before the power failure is complete or not according to the comparison result.

According to the data integrity detection method for the solid state disk, provided by the embodiment of the invention, the data written into the solid state disk to be detected is recorded, and the stop character is written into the solid state disk to be detected after the abnormal power failure information of the solid state disk to be detected is detected, so that the data written by the solid state disk to be detected in the power failure state and the recorded data are conveniently compared by the stop character, and the integrity and the accuracy of the data written by the solid state disk to be detected in the abnormal power failure state are favorably detected.

Drawings

Fig. 1 is a schematic flowchart of an embodiment of a method for detecting data integrity of a solid state disk according to the present invention;

fig. 2 is a schematic structural diagram of an embodiment of a system for detecting data integrity of a solid state disk according to the present invention.

Detailed Description

Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be illustrative of the present invention and should not be construed as limiting the present invention, and all other embodiments that can be obtained by one skilled in the art based on the embodiments of the present invention without inventive efforts shall fall within the scope of protection of the present invention.

The invention provides a data integrity detection method of a solid state disk, as shown in fig. 1, the data integrity detection method comprises the following steps:

and S10, writing data into the solid state disk to be tested by the upper computer, and recording the data written into the solid state disk to be tested at a preset position.

In this step, the data may be written in by electrically connecting the solid state disk to be tested with the test equipment (i.e., the upper computer), so as to facilitate data transmission. The test equipment is preferably a computer, a corresponding test fixture can be arranged at the moment, namely the test fixture is provided with a plurality of test cavities for loading the solid state disk to be tested, the test cavities are internally provided with connectors which can be electrically connected with the solid state disk to be tested, and the solid state disk to be tested can be installed in the test cavities in a manner of being directly inserted into the test cavities. Meanwhile, the data written into the solid state disk to be tested can be preset specific data, can also be data stored in the test equipment by random calling, certainly can also be manually input data, and can also record data information written into the solid state disk to be tested and record the data information at a specific position in the process of writing the data into the solid state disk to be tested.

And S20, stopping writing data when the abnormal power failure of the solid state disk to be tested is detected, and adding stop characters to the data written into the solid state disk to be tested finally.

In this step, the power-off mode may be manual power-off or automatic power-off. The stop character may be a specific stop character, or may be data written to the end of the solid state disk to be tested as the stop character. Because there is a process in the power failure, a small amount of content can be written into the solid state disk to be tested after the power failure information is received.

And S30, when detecting that the solid state disk to be tested is electrified again, reading the data in the solid state disk to be tested, and inquiring the data written in the solid state disk to be tested before the power failure according to the stop character.

In this step, the solid state disk to be tested is powered on again, and the power-on operation may be automatic power-on or hand-to-east power-on, so that the data in the solid state disk to be tested can be conveniently read in a manner that the test equipment directly reads the data. Meanwhile, after data is read, the position of the stop character corresponding to the current test needs to be inquired, so that data written into the solid state disk to be tested before the current power failure is obtained. The position mode of the stop character in the data obtained by the query can be obtained by referring to the existing identification searching mode, such as the existing web crawler mode.

And S40, comparing the inquired data with the data recorded at the preset position, and judging whether the data written in the solid state disk to be tested before the power failure is complete according to the comparison result.

In this step, after the data before the stop character is queried, the recorded write data are compared, and the specific comparison mode may be to compare all the data, or to compare a part of the data (i.e. data close to the stop symbol) in the data, so as to determine whether the two are the same, if not, it indicates that the solid state disk to be tested has a defect, and if so, it indicates that the solid state disk to be tested is a non-conforming product, and if so, it indicates that the solid state disk to be tested is a conforming product.

In this embodiment, the data written into the solid state disk to be tested is recorded, and the stop character is written into the solid state disk to be tested after the abnormal power failure information of the solid state disk to be tested is detected, so that the data written into the solid state disk to be tested in the power failure state and the recorded data are conveniently compared by the stop character, and the integrity and the accuracy of the data written into the solid state disk to be tested in the abnormal power failure state are favorably detected.

In a preferred embodiment, reading data in the solid state disk to be tested, and querying the data written before the power failure of the solid state disk to be tested according to the stop character includes:

acquiring time node information corresponding to stop characters;

and inquiring data written in a preset time period before the time node according to the time node information.

In this step, by obtaining the time node information of the stop character written in the solid state disk to be tested, the data written in the preset time before the stop symbol can be conveniently obtained. At this time, the time when the upper computer receives the power-off signal is the last time for recording data, so that the recorded data in the preset time before the time node is compared with the data written in the preset time.

In a preferred embodiment, reading data in the solid state disk to be tested, and querying the data written before the power failure of the solid state disk to be tested according to the stop character includes:

acquiring position information of a stop character;

and inquiring data with preset size written in the solid state disk to be tested before the stop character according to the position information of the stop character.

In this step, by obtaining the position of the stop character in the query data, it is convenient to obtain the data with the preset size written in the solid state disk to be tested before the stop symbol. At this time, the data with the preset size at the end of the recorded data is compared with the data with the preset size.

In a preferred embodiment, after the step of determining whether the data written in the solid state disk to be tested before the power failure is complete according to the comparison result, the method further includes:

if the written data is complete, carrying out repeated detection on the solid state disk to be detected for a preset number of times;

and if the written data is incomplete, terminating the detection of the solid state disk to be detected.

In this step, after the data comparison work is completed and the judgment result is output, the subsequent corresponding steps can be executed according to the judgment result, if the judgment result of the solid state disk to be tested is normal, the repeated detection of the preset times is continuously carried out on the solid state disk to be tested, namely, the cycle test of the preset times is carried out on the normal solid state disk to be tested, and the specific test times can be carried out according to the actual conditions; if the judgment result of the solid state disk to be tested is abnormal, the test operation is terminated, namely the solid state disk to be tested is a unqualified product

In a preferred embodiment, before the step of writing data into the solid state disk to be tested by the upper computer and recording the data written into the solid state disk to be tested at the preset position, the method further includes:

constructing a database;

the database includes a plurality of write data groups arranged in sequence and stop characters corresponding to the write data groups one to one.

In this step, in order to facilitate management of the written data, a database is first constructed, and at this time, the database may be directly set in the test equipment or may be stored in a readable medium such as a usb disk. The database comprises a plurality of write-in data groups which are arranged in sequence and stop characters which are in one-to-one correspondence with the write-in data groups, so that the write-in of the write-in data and the write-in of the stop characters are managed conveniently and respectively. The data written into each data group is different, and each stop character is different.

In a preferred embodiment, the step of constructing the database further comprises:

acquiring the test times of the solid state disk to be tested;

and writing the data in the corresponding written data group into the solid state disk to be tested according to the test times.

In this step, the test times of the solid state disk to be tested are firstly obtained, so that the write-in data sets of the serial number are confirmed and called according to the test times, and each write-in data set is correspondingly provided with a group of stop characters, namely, when the writing of the corresponding write-in data set into the solid state disk to be tested is finished, a group of corresponding stop characters is correspondingly written into the solid state disk to be tested, so that the corresponding write-in data string and stop characters can be conveniently and accurately searched when the solid state disk to be tested is subjected to the cycle test.

In a preferred embodiment, when detecting that the solid state disk to be tested is abnormally powered off, the step of stopping writing data and adding a stop character to the data written into the solid state disk to be tested at last further includes:

acquiring writing time for writing the data written into the data group into the solid state disk to be tested;

and the solid state disk to be tested is forced to be powered off within the writing time.

In this step, by obtaining the write-in time of each group of write-in data written in the solid state disk to be tested, the solid state disk to be tested can be forcibly powered off at any time node within the write-in time. The power-off time can be randomly selected, for example, a random model is set to randomly select a time node of each power-off, so that the comprehensiveness of detecting the solid state disk to be detected is increased.

In a preferred embodiment, before the step of writing data into the solid state disk to be tested by the upper computer and recording the data written into the solid state disk to be tested at the preset position, the method further includes:

and deleting the data stored in the solid state disk to be tested.

In this step, after the data comparison step is completed, the data stored in the solid state disk to be tested is deleted, so that the size of the read data is favorably reduced, and the workload of comparing the read data with the write data is reduced. At this time, the manner of acquiring detection at this time may be by acquiring the number of the write data group.

For the above method for detecting data integrity of a solid state disk, the present invention further provides a system for detecting data integrity of a solid state disk, as shown in fig. 2, the system for detecting data integrity includes:

the recording module is used for recording data written into the solid state disk to be tested;

the marking module is used for writing stop characters into the solid state disk to be tested after the information that the solid state disk to be tested is forcibly powered off is received;

the query module is used for reading data stored in the solid state disk to be tested after the solid state disk to be tested is powered on and querying the data written in the solid state disk to be tested before the solid state disk to be tested is powered off according to the stop characters;

and the judging module is used for judging whether the data before the stop character in the data inquired by the inquiring module is consistent with the data recorded by the recording module.

In a preferred embodiment, the query module comprises:

a first time obtaining unit, configured to obtain time node information corresponding to a stop character;

and the first data extraction unit is used for inquiring data written in a preset time period before the time node according to the time node information.

In a preferred embodiment, the query module comprises:

a position acquisition unit that acquires position information of a stop character;

and the second data extraction unit is used for inquiring data with preset size written into the solid state disk to be tested before the stop character according to the position information of the stop character.

In a preferred embodiment, the data integrity detection system further comprises:

the control module is used for executing corresponding operation according to the received judgment result, if the written data is complete, the solid state disk to be detected is repeatedly detected for a preset number of times, namely the control module is used for sequentially controlling the recording module, the marking module, the query module and the judgment module to circularly operate; if the written data is incomplete, the detection of the solid state disk to be detected is stopped, and at the moment, the control module can send corresponding warning information, such as a corresponding signal sent by a loudspeaker or a warning lamp on the test equipment.

In a preferred embodiment, the data integrity detection system further comprises:

and the storage module is used for storing the data written into the solid state disk to be tested and the stop character.

In a preferred embodiment, the data integrity detection system further comprises:

the test frequency detection module is used for acquiring the test frequency of the solid state disk to be tested;

and the logic module is used for writing the data in the corresponding written data group into the solid state disk to be tested according to the test times.

In a preferred embodiment, the data integrity detection system further comprises:

the second time acquisition module is used for acquiring the time for writing the data written into the data group into the solid state disk to be tested;

and the power-off module is used for forcibly powering off the solid state disk to be tested at random within the writing time.

In a preferred embodiment, the data integrity detection system further comprises:

and the deleting module is used for deleting the data in the solid state disk to be detected before writing the data into the solid state disk to be detected.

Based on the aforementioned data integrity detection system of the solid state disk, the present invention further provides a data integrity detection device of the solid state disk, where the data integrity detection device includes:

a memory for storing a computer program;

the processor is used for at least realizing the following steps of the data integrity detection method of the solid state disk when executing the computer program:

the upper computer writes data into the solid state disk to be tested and records the data written into the solid state disk to be tested at a preset position;

when the abnormal power failure of the solid state disk to be tested is detected, stopping writing data, and adding stop characters to the data written into the solid state disk to be tested finally;

when detecting that the solid state disk to be tested is electrified again, reading data in the solid state disk to be tested, and inquiring the data written in the solid state disk to be tested before the power failure according to the stop character;

and comparing the inquired data with the data recorded at the preset position, and judging whether the data written in the solid state disk to be tested before the power failure is complete or not according to the comparison result.

Based on the aforementioned data integrity detection method for a solid state disk, the present invention further provides a storage medium, where a computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps of the data integrity detection method for a solid state disk in the foregoing embodiments are implemented, where the steps of the data integrity detection method at least include:

the upper computer writes data into the solid state disk to be tested and records the data written into the solid state disk to be tested at a preset position;

when the abnormal power failure of the solid state disk to be tested is detected, stopping writing data, and adding stop characters to the data written into the solid state disk to be tested finally;

when detecting that the solid state disk to be tested is electrified again, reading data in the solid state disk to be tested, and inquiring the data written in the solid state disk to be tested before the power failure according to the stop character;

and comparing the inquired data with the data recorded at the preset position, and judging whether the data written in the solid state disk to be tested before the power failure is complete or not according to the comparison result.

In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of modules is merely a division of logical functions, and an actual implementation may have another division, for example, a plurality of modules or components may be combined or integrated into another apparatus, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.

Modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.

In addition, functional modules in the embodiments of the present invention may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.

The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

The above is only a part or preferred embodiment of the present invention, and neither the text nor the drawings should limit the scope of the present invention, and all equivalent structural changes made by the present specification and the contents of the drawings or the related technical fields directly/indirectly using the present specification and the drawings are included in the scope of the present invention.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种计算机内存的存储检测装置

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!