CN116841463A - Data verification method, device and equipment of storage equipment and storage medium - Google Patents

Data verification method, device and equipment of storage equipment and storage medium Download PDF

Info

Publication number
CN116841463A
CN116841463A CN202310771154.XA CN202310771154A CN116841463A CN 116841463 A CN116841463 A CN 116841463A CN 202310771154 A CN202310771154 A CN 202310771154A CN 116841463 A CN116841463 A CN 116841463A
Authority
CN
China
Prior art keywords
data
block address
storage device
mode
read
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310771154.XA
Other languages
Chinese (zh)
Inventor
王小兵
李元杰
吕镱
刘欢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Alibaba Feitian Information Technology Co ltd
Original Assignee
Hangzhou Alibaba Feitian Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Alibaba Feitian Information Technology Co ltd filed Critical Hangzhou Alibaba Feitian Information Technology Co ltd
Priority to CN202310771154.XA priority Critical patent/CN116841463A/en
Publication of CN116841463A publication Critical patent/CN116841463A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The embodiment of the application provides a data verification method, a device, equipment and a storage medium of storage equipment, wherein the method comprises the following steps: responding to a read command of the storage device, and acquiring a data block corresponding to the target logical block address; if the data block verification fails, a mode tracking sequence aiming at the target logic block address is obtained; and tracing the data of the data block according to the pattern tracing sequence. Under the condition that verification of the read data block of the storage device fails, the original set data mode and the historical operation data mode aiming at the target logical block address, which are maintained by the mode tracking sequence, are based, so that the data of the storage device is verified, and meanwhile, the historical data tracking of the logical block address level is realized, and the problem positioning speed is effectively improved based on tracing of the historical data under the condition that the verification of the data block fails.

Description

Data verification method, device and equipment of storage equipment and storage medium
Technical Field
The present application relates to the field of testing technologies, and in particular, to a data verification method of a storage device, a data verification apparatus of a storage device, a corresponding storage device, and a corresponding computer readable storage medium.
Background
In the development stage of the solid state disk, firmware testing is usually performed on the solid state disk, including hard disk transmission rate detection, health state detection, temperature detection, disk surface scanning, data verification, and the like. The data verification is mainly represented by testing the error correction capability of the solid state disk when the data is read and written, so as to verify the data with changed errors.
In the related technology of data verification, a third party tool is generally used for performing related test on the solid state disk, which is mainly represented by verifying data in a checksum mode, but cannot realize the positioning of error data.
Disclosure of Invention
In view of the foregoing, embodiments of the present application are directed to providing a data verification method of a storage device, a data verification apparatus of a storage device, a corresponding storage device, and a corresponding computer-readable storage medium, which overcome or at least partially solve the foregoing problems.
The embodiment of the application discloses a data verification method of storage equipment, which comprises the following steps:
responding to a read command of the storage equipment, and acquiring a data block corresponding to a target logical block address;
if the data block verification fails, a mode tracking sequence aiming at the target logic block address is obtained; the mode tracking sequence is a sequence of data modes of recording operated data when the data block corresponding to the target logical block address is subjected to read operation and/or write operation, and is used for maintaining an original set data mode and a historical operation data mode of the target logical block address;
And carrying out data tracing on the data block according to the mode tracing sequence.
Optionally, the read command includes a read operation command, a target logical space of the read operation, and a target logical block address of the read operation;
the responding to the read command of the storage device, obtaining the data block corresponding to the target logical block address, including:
responding to a read operation command of the storage device, and reading a data block corresponding to a target logic block address in the target logic space;
further comprises:
acquiring a check value of a read operation and a check value of the data block;
if the check value of the read operation is consistent with the check value of the data block, judging that the data block passes the check; and/or if the check value of the read operation is inconsistent with the check value of the data block, judging that the data block fails to check.
Optionally, the historical operation data patterns in the pattern tracking sequence are obtained based on historical read operation and/or historical write operation records of the target logical block address, the number of the historical operation data patterns is a plurality, and the data tracing is used for indicating tracking of data origin of the data block and reproduction of data history states;
The step of performing data tracing on the data block according to the pattern tracing sequence includes:
and presenting the historical read-write state of the historical read operation and/or the historical write operation of the data block based on a plurality of historical operation data modes and original setting data modes recorded by the mode tracking sequence.
Optionally, before the responding to the read command of the storage device, the method further comprises:
creating a preset data pattern library;
recording the data pattern type of each logical block address in the storage device through the data pattern library; wherein the data pattern type is used for indicating an index value in a preset data pattern base.
Optionally, the recording, by the data pattern database, the data pattern type of each logical block address in the storage device includes:
responding to a write command to the storage device; the write command comprises a write operation instruction and a write operation logic block address interval, wherein the original set data modes of the corresponding logic block address intervals in the same write command are the same;
calculating an index value of the original set data mode in the preset data mode base based on a starting logic block address, a preset count value and a preset random number of the logic block address interval;
And according to the index value, the original set data mode of the logical block address interval and the allocated memory space are associated and recorded in the preset data mode library.
Optionally, the method further comprises:
generating logic block data of each logic block address in the logic block address interval based on an original set data mode of the logic block address interval and the allocated memory space;
and writing the logic block data into the storage device in response to the write operation command.
Optionally, after writing the logical block data to the storage device, the method further includes:
acquiring index values of all logical block addresses in the logical block address interval;
and generating and/or updating a mode tracking sequence of each logic block address in the logic block address interval according to each logic block address in the logic block address interval and the index value corresponding to each logic block address in the logic block address interval.
Optionally, the generating the logic block data of each logic block address in the logic block address interval based on the original set data mode of the logic block address interval and the allocated memory space includes:
acquiring a logic space identifier based on the memory space and generating data based on an original set data mode;
Calculating a check value based on the logical block address of the logical block address interval, the logical space identifier and the data generated based on the original set data mode;
and splicing the logic block address based on the logic block address interval, the logic space identifier, the data generated based on the original set data mode and the check value to obtain the logic block data of the data block where the current logic block address is located.
Optionally, the method further comprises:
when the read-write test of the storage device is detected, restoring the preset data pattern library to the storage device, and multiplexing the data pattern types of all the logic block addresses recorded by the preset data pattern library; wherein the read-write test of the storage device is embodied based on a read command and a write command to the storage device.
The embodiment of the application also discloses a data verification method of the storage device, wherein the storage device is connected with the test host, and the method comprises the following steps:
receiving a read command sent by the test host, wherein the read command is generated based on the response of the test host to the read operation of the storage device by a user;
responding to a read command of the storage equipment, and acquiring a data block corresponding to a target logical block address;
If the data block verification fails, a mode tracking sequence aiming at the target logic block address is obtained; the mode tracking sequence is used for maintaining an original set data mode and a historical operation data mode of the target logic block address;
and carrying out data tracing on the data block according to the mode tracing sequence.
The embodiment of the application also discloses a data verification device of the storage equipment, which is positioned in the storage equipment and comprises:
the read command response module is used for responding to the read command of the storage device and acquiring a data block corresponding to the target logical block address;
the tracking sequence acquisition module is used for acquiring a mode tracking sequence aiming at the target logical block address when the data block verification fails; the mode tracking sequence is a sequence of data modes of recording operated data when the data block corresponding to the target logical block address is subjected to read operation and/or write operation, and is used for maintaining an original set data mode and a historical operation data mode of the target logical block address;
and the data tracing module is used for tracing the data of the data block according to the mode tracing sequence.
Optionally, the read command includes a read operation command, a target logical space of the read operation, and a target logical block address of the read operation; the read command response module includes:
the database reading sub-module is used for responding to the reading operation command of the storage device and reading the data block corresponding to the target logic block address in the target logic space;
the read command response module further includes:
the data verification sub-module is used for obtaining a verification value of the read operation and a verification value of the data block; when the check value of the read operation is consistent with the check value of the data block, judging that the data block passes the check; and/or when the check value of the read operation is inconsistent with the check value of the data block, judging that the data block fails to check.
Optionally, the historical operation data patterns in the pattern tracking sequence are obtained based on historical read operation and/or historical write operation records of the target logical block address, the number of the historical operation data patterns is a plurality, and the data tracing is used for indicating tracking of data origin of the data block and reproduction of data history states;
the data tracing module comprises:
and the historical operation data mode presenting sub-module is used for presenting the historical reading and writing states of the historical reading operation and/or the historical writing operation of the data block based on the plurality of historical operation data modes and the original setting data modes recorded by the mode tracking sequence.
Optionally, before the responding to the read command of the storage device, the apparatus further includes:
the data pattern type recording module is used for creating a preset data pattern library; recording the data pattern type of each logical block address in the storage device through the data pattern library; wherein the data pattern type is used for indicating an index value in a preset data pattern base.
Optionally, the data pattern type recording module includes:
a write command response sub-module for responding to a write command of the storage device; the write command comprises a write operation instruction and a write operation logic block address interval, wherein the original set data modes of the corresponding logic block address intervals in the same write command are the same; calculating an index value of the original set data mode in the preset data mode base based on a starting logic block address, a preset count value and a preset random number of the logic block address interval; and according to the index value, the original set data mode of the logical block address interval and the allocated memory space are associated and recorded in the preset data mode library.
Optionally, the data pattern type recording module further includes:
The logic block data writing sub-module is used for generating logic block data of each logic block address in the logic block address interval based on an original set data mode of the logic block address interval and the allocated memory space; and writing the logic block data into the storage device in response to the write operation command.
Optionally, after writing the logical block data to the storage device, the data pattern type recording module further includes:
a mode tracking sequence updating sub-module, configured to obtain index values of each logical block address in the logical block address interval; and generating and/or updating a mode tracking sequence of each logic block address in the logic block address interval according to each logic block address in the logic block address interval and the index value corresponding to each logic block address in the logic block address interval.
Optionally, the logic block data writing submodule includes:
the logic block data generation unit is used for acquiring a logic space identifier based on the memory space and generating data based on an original set data mode; calculating a check value based on the logical block address of the logical block address interval, the logical space identifier and the data generated based on the original set data mode; and splicing the logic block address based on the logic block address interval, the logic space identifier, the data generated based on the original set data mode and the check value to obtain the logic block data of the data block where the current logic block address is located.
Optionally, the apparatus further comprises:
the data pattern library multiplexing module is used for recovering the preset data pattern library into the storage device when the read-write test of the storage device is detected, so as to realize multiplexing of the data pattern types of all the logic block addresses recorded by the preset data pattern library; wherein the read-write test of the storage device is embodied based on a read command and a write command to the storage device.
The embodiment of the application also discloses a data verification device of the storage equipment, which is positioned in the storage equipment, the storage equipment is connected with the test host, and the device comprises:
the read command receiving module is used for receiving a read command sent by the test host, and the read command is generated based on the response of the test host to the read operation of the storage device by a user;
the read command response module is used for responding to the read command of the storage device and acquiring a data block corresponding to the target logical block address;
the tracking sequence acquisition module is used for acquiring a mode tracking sequence aiming at the target logical block address when the data block verification fails; the mode tracking sequence is a sequence of data modes of recording operated data when the data block corresponding to the target logical block address is subjected to read operation and/or write operation, and is used for maintaining an original set data mode and a historical operation data mode of the target logical block address;
And the data tracing module is used for tracing the data of the data block according to the mode tracing sequence.
The embodiment of the application also discloses a storage device which comprises a control unit, a storage unit, a cache unit and a computer program executed on the basis of the control unit, wherein the computer program realizes the data verification method of any storage device when being executed by the control unit.
The embodiment of the application also discloses a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the data verification method of any storage device when being executed by a processor.
The embodiment of the application has the following advantages:
in the embodiment of the application, under the condition that the verification of the data block of the read storage device fails, the mode tracking sequence of the read target logic block address corresponding to the read command can be obtained, and the historical data tracking of the logic block address level is realized while the verification of the data of the storage device is realized based on the original set data mode and the historical operation data mode of the target logic block address maintained by the mode tracking sequence, so that the problem positioning speed is effectively improved based on the tracing of the historical data under the condition that the verification of the data block fails.
Drawings
FIG. 1 is a schematic diagram of a related art implementation of data verification based on an OKG tool;
FIG. 2 is a flow chart of steps of an embodiment of a method for verifying data of a storage device according to the present application;
FIG. 3 is a flow chart of steps of another embodiment of a data verification method for a storage device of the present application;
FIG. 4 is a schematic diagram of creating a preset data pattern library according to an embodiment of the present application;
FIG. 5 is a schematic diagram illustrating generation of logical block data according to an embodiment of the present application;
fig. 6 is a schematic diagram of an application scenario of data verification of a storage device according to an embodiment of the present application;
FIG. 7 is a block diagram illustrating an embodiment of a data verification apparatus for a memory device of the present application;
FIG. 8 is a block diagram illustrating an embodiment of a data verification apparatus for a memory device according to the present application.
Detailed Description
In order that the above-recited objects, features and advantages of the present application will become more readily apparent, a more particular description of the application will be rendered by reference to the appended drawings and appended detailed description.
To facilitate an understanding of the application by those skilled in the art, the following description of terms or nouns used in connection with the various embodiments of the application described below are provided:
SSD: solid State Disk/Drive, solid State Disk.
DMC: data error alignment.
SSD firmware: refers to embedded software running on an SSD.
LB: logical Block is a unit of data Block for Host IO operation.
Host IO operation: input (Input), output (Output) operations of the host.
LBA: logical BlockAddress, LB address, i.e. Logical block address, refers to the address of a certain data block or the data block to which a certain address points, and a user may access the SSD through the LBA.
FIO: the Flexible I/O tester is an open source tool for SSD performance testing.
OKG: oakgite, is a SSD test tool.
Checksum: a checksum, which may also be referred to as a redundancy check, may be allowed to exist for ensuring the integrity of the data.
MetaData: metadata, data describing data, refers to descriptive information about data and information resources, and may generally be attribute fields.
SD: secure Digital Card, secure digital card.
CF: compact Flash, a standard Flash memory card, is a data storage device for portable electronic devices.
MMC: multiMedia Card, a multimedia Card, is a flash memory Card.
NSID: namespace Identifier, logical space identification.
NVMe protocol: NVM Express is a protocol designed specifically for Solid State Drives (SSD) for optimizing read-write speed and performance of SSD memory.
The data verification of the storage device is mainly represented by testing the error correction capability of the solid state disk when data reading and writing are performed so as to verify the data with changed errors.
In the related art of data verification, a third party tool, such as FIO, OKG, and the like, is generally used to perform related tests on a solid state disk, and these tools generally implement verification of data by adopting a verification and Checksum mode.
Specifically, as shown in fig. 1, the data verification of the ozg tool is mainly performed by inserting certain MetaData into the LBA data block and using the inserted MetaData. The method specifically includes that when a read operation is initiated on the LBA, the OKG tool will recalculate the corresponding Checksum value of the data (except the last 8 bytes) of the current LBA, namely, calculates the corresponding Checksum value of the data pattern data (i.e. Data Pattern Data) including the counting label (i.e. CountTag), the data pattern index (i.e. DataPattern Index), the Magic Number (i.e. Magic Number), the complementary part (i.e. One's Complement ofLBA) of the logic block, the logic block address (i.e. LBA) and the like, and checks the Checksum value recorded in the current LBA data to judge the correctness of the data; the field value of the last 8 bytes may refer to the Checksum (i.e. Block Checksum) of the data Block, that is, the Checksum value recorded in the current LBA data. However, in the data verification method based on the recalculated checksum and the checksum originally recorded therein, for the LBA to which the data is not written, the OKG tool cannot directly perform the data verification because the recorded checksum does not exist; in addition, the data verification implemented by the OKG tool is based on independent data streams, and cannot support data verification across data streams.
For the data verification realized by the FIO tool, the basic principle is similar to that of the data verification realized by the OKG tool, and the data verification is realized by adopting a mode of verification and Checksum. Specifically, adding a corresponding Checksum value to a header parameter of a data block may be shown, where definition of the header parameter by a FIO tool is different from definition of the header parameter by an ozg tool, and the specific definition of the header parameter in the FIO tool may be shown as follows:
a header structure associated with the check data block. * /
structverify_header{
uint16_tmagic; wherein 1 byte is used to define a magic number, and the set magic number is used to store a random number, preventing data corruption;
uint16_tverify_type; the/×2 bytes are used to define the parameter type;
uint 32_tlen; the/×4 bytes are used to define the length;
uint64_trand_seed; the/×8 bytes are used to define a random seed, making the random data predictable;
uint64_toffset; the/. Times.8 bytes are used to define the offset;
uint32_ttime_sec; the/. Times.4 bytes are used to define a time value;
uint32_ttime_nsec; the/. Times.4 bytes are used to define a time value;
uint16_tthread; the/×2 bytes are used to define threads;
uint16_tnumber; the/x 2 bytes are used to define the data digit type;
uint 32_tcrc32; the/×4 bytes are used to define verification data crc;
};
from the above, it may appear as a specific header of a checksum, containing verification data. Suppose for a block LBA0, after the first data write to the logical block address with the FIO tool, e.g., it appears as "0000000acca0011100000000000000000000000
00000100000000000000000000000001e7c 064c
00000200001000033ee 63d23412 cdab 3412cdab
00000303412cdab 3412cdab 3412cdab 3412cdab
0000040……”
After writing the logical address for the second time, it is expressed as "0000000acca 0011100000000000000000000000", for example
0000010000000000000000000000000c29a 063e
00000200001000065339b893412cdab 3412cdab
00000303412cdab 3412cdab 3412cdab 3412cdab
0000040……”
After two data writes, the data correctness can be accurately distinguished by the crc, but the FIO tool itself cannot provide a historical sequence of operational data patterns for the specified LBAs; furthermore, FIO tools cannot support complex IO workload scenarios, such as the compounding of different IOs under multiple processes, which are difficult to meet test requirements. Furthermore, FIO is difficult to support for testing of some special scenarios, such as constructing LBAs within the same FIO task to flexibly specify the data operated on, constructing scenarios where IOs are concurrent with other special commands, etc.
According to the embodiment of the application, under the condition that the verification of the data block of the read storage device fails, the mode tracking sequence of the read target logic block address corresponding to the read command can be obtained, and the historical data tracking of the logic block address level is realized while the verification of the data of the storage device is realized based on the original set data mode and the historical operation data mode of the target logic block address maintained by the mode tracking sequence, so that the problem positioning speed is effectively improved based on the tracing of the historical data under the condition that the verification of the data block fails. Further, when the read-write test of the storage device is detected, the data pattern library for recording the data pattern types of each logical block address can be recovered in the storage device, so that the data of the written logical block address are multiplexed in different test examples, the test progress of the storage device is integrally improved, and the data quick verification during the read-write test of the storage device is realized based on the realized cross-script and cross-test data multiplexing.
Referring to fig. 2, a flowchart illustrating steps of an embodiment of a data verification method for a storage device according to the present application may specifically include the following steps:
step 201, responding to a read command of a storage device, and acquiring a data block corresponding to a target logic block address;
the read-write test of the storage device, i.e. the detection of the IO test scenario, may be based on the read command and the write command to the storage device. Typically, it is shown that upon receipt of a read command to a storage device, data stored on a previously written data block in the storage device may be read based on the data by a response to the read command in order to effect verification of the data.
The storage device may refer to a device such as a usb disk, a memory card (e.g. SD, CF, MMC, etc.), an SSD hard disk, a common hard disk, etc., and in the embodiment of the present application, taking an SSD as an example, reading data stored by a data block is generally represented by accessing the SSD through an address of a certain data block or a data block pointed to by a certain address, i.e. a Logical Block Address (LBA). At this time, the data block of the target logical block address required to be read by the read command can be acquired, so that the data stored in the data block can be read for data verification.
Step 202, if the data block check fails, a mode tracking sequence aiming at the target logic block address is obtained;
the data stored in the data block is verified in a data verification manner, which is usually implemented by using checksum or verification data or verification value, and can be usually determined based on a result of judging whether the checksum or the verification data or the verification value is consistent or not.
Specifically, the received read command may include a read operation command, a target logic space of the read operation, and a target logic block address of the read operation, where a check value of the read operation and a check value stored in the read data block may be obtained, and in one case, if the check value of the read operation is consistent with the check value of the data block, it is determined that the data block passes the check; in another case, if the check value of the read operation and the check value of the data block are not identical, it is determined that the data block check fails.
Under the condition that the verification of the data block fails, the historical data of the logical block address can be tracked, so that the problem positioning speed can be effectively improved based on the tracing of the historical data.
In one embodiment of the present application, under the condition that the verification of the data block fails, a pattern tracking sequence of the target logical block address may be acquired, where the acquired pattern tracking sequence is a sequence of data patterns of the data recorded during the read operation and/or the write operation on the data block corresponding to the target logical block address, and may be mainly used to maintain the original set data pattern and the historical operation data pattern of the target logical block address, so that the verification of the data of the storage device may be implemented at this time, and at the same time, the historical data tracking of the logical block address level may be implemented based on the pattern tracking sequence.
The data pattern may be defined as a data pattern for writing or reading data from a logical block address when performing a read/write test. The setting of the data pattern may be represented by a binary digital code or by other means, the setting of a specific data pattern may be defined according to a specific test, it may be set manually or automatically according to a certain rule or strategy, and it may be varied in parameters with the data pattern written when used for the test.
Illustratively, the data patterns may include, for example, conventional all 0, all 1 data patterns, or incremental, decremental data patterns, or some special data patterns or some randomly generated data patterns, as the embodiments of the present application are not limited in this regard. For the special data mode, for example, a data mode supporting the Format and Trim operation may be used, because the Format and Trim commands change the data of the specified LBA to all 0 s or all 1 s, unlike the general IO operation, for the data of the Format and Trim, auxiliary information (such as crc, LBA values, etc.) is not generally inserted into the logical block address data to increase the data verification speed, so some special data modes supporting the Format and Trim operation may be set, and for the specific setting or definition of the special data modes, the embodiment of the present application is not limited thereto.
In the embodiment of the present application, the original set data pattern may refer to a data pattern of initial setting of a logical block address; the history operation data pattern may refer to a corresponding data pattern when a read operation and/or a write operation is performed on the logical block address at a history time after the data pattern of the logical block address is initially set.
And 203, performing data tracing on the data block according to the pattern tracing sequence.
Data tracing refers to tracking the origin of data and reproducing the historical state of the data.
The original set data pattern maintained by the pattern tracking sequence is expressed as the original set data pattern for a certain logical block address; the historical operation data mode maintained by the mode tracking sequence is obtained based on the record of the historical read operation and/or the historical write operation (namely, the historical IO operation) of the logic block address, namely, the mode tracking sequence can be represented as the data mode of corresponding read data when a certain read operation is performed in the history or the data mode of corresponding write data when a certain write operation is performed in the history for the current target logic block address. That is, the pattern trace sequence pattern trace may record the original set data pattern and the history operation data pattern of the history read operation and/or the history write operation at the logical block address level, wherein the original set data pattern may be defined according to a specific test, and for different logical block addresses in the storage device, different data patterns may be set as far as possible to cover the possibly related data patterns as far as possible; the history data pattern is recorded during history writing or reading, and the number of the history data patterns may be plural.
And tracing the data of the data block with the current verification failure, wherein under the condition that the mode tracing sequence can maintain the original set data mode and the original set data mode, the historical read-write state of the historical read operation and/or the historical write operation of the data block can be presented directly based on a plurality of historical operation data modes and the original set data modes recorded by the mode tracing sequence, so that the problem locating speed is effectively improved based on the presented historical read-write state.
In practical application, the historical read-write state may refer to a corresponding state of a read operation or a write operation and a data mode of corresponding data in a mode tracking sequence, when the verification of a data block fails, a source causing data errors can be positioned through the data mode corresponding to different operations recorded in the sequence presented by the data mode tracking sequence, namely, a logical block address for data error comparison and an auxiliary positioning error data source can be captured, and when the verification of the data of the storage device is realized, the historical data tracking of the logical block address level is realized, so that the problem positioning speed is effectively improved based on the tracing of the historical data when the verification of the data block fails.
In a preferred embodiment of the present application, since the pattern trace sequence is a record based on a logical block address level, it can be based on a logical block address section in a single command when responding to the single command, and the data trace of the data block of each logical block address in the one-time hit section when responding to the command and the data check fails, that is, the target logical block address may also be each logical block address in the logical block address section carried by the read command.
In the embodiment of the application, under the condition that the verification of the data block of the read storage device fails, the mode tracking sequence of the read target logic block address corresponding to the read command can be obtained, and the historical data tracking of the logic block address level is realized while the verification of the data of the storage device is realized based on the original set data mode and the historical operation data mode of the target logic block address maintained by the mode tracking sequence, so that the problem positioning speed is effectively improved based on the tracing of the historical data under the condition that the verification of the data block fails.
Referring to fig. 3, a flowchart illustrating steps of another embodiment of a data verification method for a storage device according to the present application may specifically include the following steps:
Step 301, creating a preset data pattern library, and recording the data pattern types of each logical block address in the storage device through the data pattern library;
the storage device may refer to a device such as a usb disk, a memory card (e.g., SD, CF, MMC, etc.), an SSD hard disk, a common hard disk, etc., and data verification on the storage device is generally represented by a read-write test (i.e., IO test) scenario of the storage device, and when a read command to the storage device is received, it is generally represented by reading data stored on a data block written in the storage device before through a response to the read command, so as to implement verification on the data.
Taking an SSD as an example in the embodiment of the application, DMC is a relatively common problem of firmware test and is relatively difficult to locate in the SSD research and development stage, in order to improve the reproduction probability, the method can be implemented based on a preset data pattern library for recording the data pattern types of each logical block address in the storage device when the storage device is written, so that when different test cases are tested, cross-script and cross-test data multiplexing can be implemented based on the preset data pattern library, thereby integrally improving the test progress of the storage device.
Specifically, for the IO test scenario of the SSD, in order to effectively identify the DMC, the read-write test is generally not applicable to the same data mode, and then the read-write test may be performed by using a random data mode, so as to ensure the non-repeatability of the data mode of the read-write test as much as possible. Further, in order to implement randomization of the data patterns without losing IO performance as much as possible, the randomization may be implemented by pre-generating a data pattern library so as to maintain the data patterns possibly involved.
The data pattern may refer to a definition of a data pattern for data written or read from a certain logical block address at the time of a read-write test. The setting of the data pattern may be represented by a binary digital code or by other means, the setting of a specific data pattern may be defined according to a specific test, it may be set manually or automatically according to a certain rule or strategy, and it may be varied in parameters with the data pattern written when used for the test.
Illustratively, the data patterns may include, for example, conventional all 0, all 1 data patterns, or incremental, decremental data patterns, or some special data patterns or some randomly generated data patterns, as the embodiments of the present application are not limited in this regard. For the special data mode, for example, a data mode supporting the Format and Trim operation may be used, because the Format and Trim commands change the data of the specified LBA to all 0 s or all 1 s, unlike the general IO operation, for the data of the Format and Trim, auxiliary information (such as crc, LBA values, etc.) is not generally inserted into the logical block address data to increase the data verification speed, so some special data modes supporting the Format and Trim operation may be set, and for the specific setting or definition of the special data modes, the embodiment of the present application is not limited thereto.
Specifically, as shown in fig. 4, for each of the different data patterns, for example, pattern 1 (i.e., pattern 1), pattern 2 (i.e., pattern 2), pattern3 (i.e., pattern 3), pattern n (i.e., pattern n), etc., the created preset data Pattern library may be calculated according to a memory occupying one Byte, for example, a mode of allocating Byte1 for Pattern 1 and allocating Byte2 for Pattern 2, and then 1024 data patterns may be supported if 1KB of memory is allocated in advance for the created preset data Pattern library. In order to reduce the cost in the IO process, a corresponding data Buffer (Buffer) may be pre-allocated to the 1024 data modes, where the data Buffer is allocated in the host memory, which refers to reserving a storage space with a specified size in the memory for temporarily storing input/output (I/O) data, and may be mainly used for driving to quickly splice with the allocated memory according to the corresponding data modes to obtain data with a specific logical block address, where the memory is 4MB according to the calculation of each LBA4KB, which is insufficient to affect IO cost and thus affect IO performance.
For the created pre-set data pattern library there is a need to cover as much as possible the data patterns that may be involved, whereas for the recording of a specific data pattern in the data pattern library it may be implemented based on a write command to the storage device. The method is characterized in that the method can respond to the write command of the storage device, the responded write command can comprise a write operation command and a write operation logical block address interval, the original set data modes of the corresponding logical block address interval in the same write command are the same, and when the same write command is generated, the record of different data modes in a preset data mode library can be realized based on the setting of the original set data modes in different write commands, so that the logical address interval and the corresponding data mode type in each write command are maintained in a command unit.
The data pattern type may be used to indicate an index value in a preset data pattern library. Specifically, when a write command is responded, an index value of an original set data mode in a preset data mode base can be calculated based on a starting logical block address, a preset count value and a preset random number of a logical block address interval, and then the original set data mode of the logical block address interval and the allocated memory space are associated and recorded in the preset data mode base according to the index value, so that the recording of various different data modes in the preset data mode base is realized.
For example, when calculating the index value, the start logical block address may be determined based on a logical block address interval carried in a certain command, where the logical block address interval may refer to an interval from a start LBA to an end LBA of a single command, and the logical block address interval may be a single LBA or n LBAs; the preset count value may be determined based on an incremented counter that may be used to count the number of commands received; the preset random number can be mainly realized by generating the random number according to a certain default sequence, and can be obtained by adopting randseed. The specific calculation formula of the index value index can be expressed as (initial LBA+counter+random)% 1001 of the pen command, so that the pre-allocated memory and the corresponding data mode can be loaded according to the index value index, and the actual landing data can be obtained by fast splicing, namely, the logic block data is generated.
In practical applications, because the original set data patterns of the address intervals of the corresponding logical blocks in the same command are the same, in order to avoid the same landing data in one command, other relevant information, such as LBA, NSID, crc, may be added to the data patterns of the respective logical block addresses.
Specifically, the logical block data of each logical block address in the logical block address section may be generated based on the original set data pattern of the logical block address section and the allocated memory space, so that the logical block data is written into the storage device in response to the write operation command. In a specific implementation, since one memory space may include multiple logic spaces, each logic space may include an ID to distinguish, which NS is used to specify in a command which NS is a logical block to read or write, for example, if NS is not specified, for the same LBA, it is assumed that LBA0 is not known where to read or write, because each logic space includes LBA0, as shown in fig. 5, a logical space identifier NSID may be obtained based on a memory space pre-allocated corresponding to an index value, and data Datapattern data generated based on an original set data pattern, then a check value crc is calculated based on a logical block address LBA of a logical block address section, a logical space identifier NSID, and data Datapattern data generated based on an original set data pattern, and then, based on the logical block address LBA of the logical block address section, the logical space identifier NSID, the data of the data block where the current logical block address is located, and the check value crc are spliced, so as to obtain the logical block data of the data block where the current logical block address is located, and to implement multiple data pattern recording for each data pattern in the memory device when the corresponding logical block data is written into the corresponding logical block address section.
It should be noted that, when writing the corresponding logic block data into the data block of the corresponding logic block address, the check value crc of the logic block data can also be synchronously recorded into the data block, so that the quick check can be realized based on the check value crc when the read command is initiated later.
In some embodiments of the present application, when a read-write test on a storage device is detected, a preset data pattern library can be restored to the storage device, and when different test cases are tested, a restoration can be performed in the storage device of different test cases based on the preset data pattern library for recording the data pattern types of each logical block address in the storage device, so that unlimited multiplexing of the data pattern types of each logical block address recorded by the preset data pattern library on the whole SSD is rapidly realized, and thus, cross-script and cross-test data multiplexing is realized. The read-write test of the storage device can be embodied based on a read command and a write command of the storage device, in practical application, after the preset data pattern library is stored, the data can be restored to the memory of the storage device before the next test, so that the data written in the logical block address of the storage device in the previous test process can be directly multiplexed in the test, and the test progress of the storage device is integrally improved under the condition that the data is not cleaned and then rewritten, thereby achieving the purpose of quick verification of the data.
Step 302, generating and/or updating a pattern trace sequence of each logical block address in the logical block address interval in response to a write command to the storage device;
after multiplexing the preset data pattern library, in the process of responding to the write command of the storage device, for the same command, maintaining a logic address interval and a corresponding data pattern type in each command by taking the command as a unit, wherein the specific expression is recording the data pattern corresponding to the corresponding operation to form a group of pattern tracking sequences, namely recording the original set data pattern of each logic block address; the pattern tracking sequence of the corresponding logical block address may also be updated when a write command to the storage device is subsequently received again.
Specifically, after responding to a write command and writing the logic block data into the storage device, the index value of each logic block address in the logic block address interval is obtained, and then the mode tracking sequence of each logic block address in the logic block address interval is generated and/or updated according to each logic block address in the logic block address interval and the index value corresponding to each logic block address in the logic block address interval, so that the mode tracking sequence is obtained based on the history read operation and/or history write operation record of the target logic block address, and the follow-up data tracing of the data block of the corresponding logic block address is facilitated.
Wherein, a command is a command defined by NVMe protocol, host (Host) mainly operates SSD by using a command, the logical block address interval to be processed in a single command may be a single LBA or n LBAs, and in the process of generating and updating the pattern trace sequence pattern trace, if each command processes a single LBA, its compression ratio for the pattern trace sequence is 1:1, and if each command processes n LBAs, the compression ratio of the pattern trace sequence pattern may reach n:1, further reduce IO overhead.
In some embodiments of the present application, to avoid infinite increase of the content of the pattern trace sequence pattern trace, a rotation mode may be used to fix the upper limit size, specifically, when the space occupied by the pattern trace sequence pattern trace reaches the upper limit, old data with corresponding size may be deleted while continuing to save new data, so as to ensure that the new pattern trace may be recorded, and, for example, assuming that the size of the upper limit of the pattern trace sequence pattern trace is 100MB, about 364 thousands of IO operations and corresponding data patterns may be recorded.
In step 303, a mode tracking sequence for the target logical block address is obtained in response to a read command from the storage device, and data tracing is performed on the data block according to the mode tracking sequence.
The detection of a read-write test, i.e. an IO test scenario, of a storage device is typically manifested in that upon receipt of a read command to the storage device, data stored on a previously written data block in the storage device may be read based on the data by a response to the read command, so as to achieve verification of the data.
The data stored in the data block is verified in a data verification manner, which is usually implemented by using checksum or verification data or verification value, and can be usually determined based on a result of judging whether the checksum or the verification data or the verification value is consistent or not.
Specifically, the received read command may include a read operation command, a target logic space of the read operation, and a target logic block address of the read operation, where a check value of the read operation and a check value stored in the read data block may be obtained, and in one case, if the check value of the read operation is consistent with the check value of the data block, it is determined that the data block passes the check; in another case, if the check value of the read operation and the check value of the data block are not identical, it is determined that the data block check fails.
In the embodiment of the application, for the check value of the read operation, the preset data pattern library can be obtained, the preset data pattern library is used for recording the data pattern types of each logic block address in the storage device, the data pattern types can be used for indicating the index values in the preset data pattern library, at the moment, the data pattern data can be obtained from the preset data pattern library based on the index values, and then the check value of the read operation is obtained by calculation based on the data pattern data, the logic space identifier of the target logic space and the target logic address, so that consistency check is carried out based on the calculated check value and the check value recorded in the data block.
Under the condition that the verification of the data block fails, the historical data of the logical block address can be tracked, so that the problem positioning speed can be effectively improved based on the tracing of the historical data. In one embodiment of the present application, in the case of failure of checking the data block, the mode tracking sequence of the target logical block address may be obtained, and the obtained mode tracking sequence may be mainly used to maintain the original set data mode and the historical operation data mode of the target logical block address.
The original setting data mode maintained by the mode tracking sequence is expressed as the original setting data mode for a certain logic block address; the data pattern of the historical operation maintained by the pattern tracking sequence is obtained based on the history read operation and/or the history write operation of the logical block address, namely, the data pattern of the corresponding read data when a certain read operation is performed in the history or the data pattern of the corresponding write data when a certain write operation is performed in the history can be represented for the current target logical block address. That is, the pattern trace sequence pattern may record its original set data pattern, as well as a historical operating data pattern associated with a historical read operation and/or a historical write operation, at a logical block address level. It should be noted that, the original set data mode may be defined according to a specific test, and for different logical block addresses in the storage device, different data modes may be set as far as possible based on the preset data mode library, so as to implement covering the data modes possibly involved as far as possible; the history data pattern is recorded during history writing or reading, and the number of the history data patterns may be plural.
In practical application, the data of the data block failing to be checked currently is traced, and under the condition that the mode tracing sequence can maintain the original set data mode and the historical operation data mode, the historical read-write state of the historical read operation and/or the historical write operation of the data block can be presented directly based on a plurality of historical operation data modes and the original set data mode recorded by the mode tracing sequence, so that the problem locating speed is effectively improved based on the presented historical read-write state. The historical read-write state may refer to a corresponding state of a read operation or a write operation and a data pattern of corresponding data in a pattern tracking sequence, and when the verification of a data block fails, that is, a crc error, a data error comparison error notification (that is, a DMC error notification) may be generated, and a source causing the data error may be located through the data pattern corresponding to different operations recorded in the sequence presented by the data error comparison error notification.
Specifically, a target historical operation data mode inconsistent with an original set data mode can be obtained from a plurality of historical operation data modes recorded by a mode tracking sequence, then a corresponding historical read operation or a historical write operation is positioned from the mode tracking sequence based on the target historical operation data mode, and historical logic block data read by the positioned historical read operation or historical logic block data written by the positioned historical write operation are obtained, so that determination of error data sources is realized, and a logic block address for data error comparison and auxiliary positioning of the error data sources are captured.
In some embodiments of the present application, when responding to a read command and performing a quick check using a check value crc, in one case, when discovering the DMC, the historical IO operation of the current target logical block address and the corresponding data pattern type may be resolved from the pattern trace sequence to quickly locate the problem; in another case, when the DMC is not found, in addition to reading the logic block data stored in the data block corresponding to the corresponding target logic block address, the slave mode tracking sequence may be updated based on the current read operation command, so that the current read operation and the data mode type corresponding to the read data are recorded by the mode tracking sequence pattern trace of the current target logic block address, and the data tracing is realized on the data block corresponding to the logic block address based on the mode tracking sequence pattern trace.
In the embodiment of the application, under the condition that the verification of the data block of the read storage device fails, the mode tracking sequence of the read target logic block address corresponding to the read command can be obtained, and the historical data tracking of the logic block address level is realized while the verification of the data of the storage device is realized based on the original set data mode and the historical operation data mode of the target logic block address maintained by the mode tracking sequence, so that the problem positioning speed is effectively improved based on the tracing of the historical data under the condition that the verification of the data block fails. Further, when the read-write test of the storage device is detected, the data pattern library for recording the data pattern types of each logical block address can be recovered in the storage device, so that the data of the written logical block address are multiplexed in different test examples, the test progress of the storage device is integrally improved, and the data quick verification during the read-write test of the storage device is realized based on the realized cross-script and cross-test data multiplexing.
Referring to fig. 6, an application scenario diagram of data verification of a storage device provided by an embodiment of the present application is mainly applied to a scenario of a read-write test, i.e. an IO test, on the storage device, and relates to communication between a test Host (Host) 610 and a storage device (assumed to be an SSD) 611.
The test Host (Host) 610 is mainly responsible for performing input and output operations, in this test scenario, the input and output operations are mainly performed on the SSD through a pen command, and the input and output operations may be respectively represented as a write operation and a read operation, and then access to the SSD may be specifically realized through the LBA; the storage device 611 may include a control unit, a storage unit, a buffer unit, and a computer program executed by the control unit, where the computer program is executed by the control unit to implement the data verification method of the storage device according to the embodiment of the present application.
For the storage device 611, it relates to management of data patterns, management of history data of logical block addresses, and a solidification process of data patterns, so as to achieve quick verification of correctness of data based on the foregoing process.
Specifically, the management of the data patterns is represented by generating a pattern library of preset data patterns for maintaining the data pattern types corresponding to the addresses of the logic blocks in the storage device.
The management of the history data of the logical block addresses may be represented as an update or generation of a pattern trace sequence for each logical block address in the logical block address interval. The method can be characterized in that after multiplexing a preset data pattern library, in the process of responding to a write command of the storage device, for the same command, a logic address interval and a corresponding data pattern type in each command can be maintained by taking the command as a unit, and the method is particularly characterized in that the data pattern corresponding to the corresponding operation is recorded to form a group of pattern tracking sequences, namely, original set data patterns of each logic block address are recorded; when a write command to the storage device is received again later, the mode tracking sequence of the corresponding logical block address can be updated, so that the data tracing can be realized under the condition that the verification of the data block fails later.
The data mode curing process can be expressed as the storage of a preset data mode library, so that the data written in the logical block address of the storage device in the previous testing process can be directly multiplexed in the current test based on the preset data mode library when different test examples are tested, and the cross-script and cross-test data multiplexing is realized under the condition that the data is not cleaned and then rewritten once, so that the overall improvement of the test progress of the storage device is achieved.
The quick verification process of the data correctness can be expressed as that when the verification of the data block fails, the historical IO operation of the current target logical block address and the corresponding data mode type are obtained through analysis from the mode tracking sequence of the corresponding logical block address so as to quickly locate the problem.
In practical applications, when the Host sends a write command, the storage device may perform the following steps:
step S1, a write command sent by a test host is received, and the write command is generated based on the response of the test host to the write operation of a user on storage equipment; step S2, in response to a write command to the storage device, updating the pattern tracking sequence of the target logical block address.
When Host610 sends a read command, storage device 611 may perform the following steps:
step S3, receiving a read command sent by the test host, wherein the read command is generated based on the response of the test host to the read operation of the user on the storage device; step S4, responding to a read command of the storage device, and acquiring a data block corresponding to the target logical block address; step S5, if the data block verification fails, a mode tracking sequence aiming at the target logic block address is obtained; the mode tracking sequence is used for maintaining an original set data mode and a historical operation data mode of the target logic block address; and S6, performing data tracing on the data block according to the mode tracing sequence.
For the specific implementation process of the above steps, reference may be made to the description of the foregoing data verification method embodiment of the storage device, and this embodiment of the present application is described herein in detail.
In the embodiment of the application, the data mode types of each logic block address in the storage device can be recorded based on a preset data mode library, the record is loaded between different tests, cross-script and cross-test data multiplexing is realized, a mode tracking sequence is combined, history data tracking is realized, the problem positioning speed is effectively improved, namely, under the condition that the SSD read-write performance is not influenced as far as possible, the purposes of capturing LBA of the DMC and assisting in positioning error data sources in a general test mode are realized, under the premise of providing DMC LBA of a position offset of a specific error of data on the DMC LBA and providing DMC LBA in a single command, the quick verification of the data in SSD read-write is realized, and the purposes of LBA-level history data tracking and full disk data test multiplexing are supported.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the application.
Referring to fig. 7, there is shown a block diagram of an embodiment of a data verification apparatus of a storage device according to the present application, where the storage device may specifically include the following modules:
a read command response module 701, configured to respond to a read command of the storage device, and obtain a data block corresponding to a target logical block address;
a trace sequence acquisition module 702, configured to acquire a pattern trace sequence for the target logical block address when the data block verification fails; the mode tracking sequence is a sequence of data modes of recording operated data when the data block corresponding to the target logical block address is subjected to read operation and/or write operation, and is used for maintaining an original set data mode and a historical operation data mode of the target logical block address;
and the data tracing module 703 is configured to trace data of the data block according to the pattern tracing sequence.
In one embodiment of the application, the read command includes a read operation command, a target logical space for a read operation, and a target logical block address for a read operation; the read command response module 701 may include the following sub-modules:
the database reading sub-module is used for responding to the reading operation command of the storage device and reading the data block corresponding to the target logic block address in the target logic space;
The read command response module 701 may also include the following sub-modules:
the data verification sub-module is used for obtaining a verification value of the read operation and a verification value of the data block; when the check value of the read operation is consistent with the check value of the data block, judging that the data block passes the check; and/or when the check value of the read operation is inconsistent with the check value of the data block, judging that the data block fails to check.
In one embodiment of the present application, the historical operation data patterns in the pattern tracking sequence are obtained based on historical read operation and/or historical write operation records of the target logical block address, the number of the historical operation data patterns is a plurality, and the data trace source is used for indicating tracking of data origin of the data block and reproduction of data history states;
the data tracing module 703 may include the following sub-modules:
and the historical operation data mode presenting sub-module is used for presenting the historical reading and writing states of the historical reading operation and/or the historical writing operation of the data block based on the plurality of historical operation data modes and the original setting data modes recorded by the mode tracking sequence.
In one embodiment of the present application, before the responding to the read command of the storage device, the apparatus proposed by the embodiment of the present application may further include the following modules:
The data pattern type recording module is used for creating a preset data pattern library; recording the data pattern type of each logical block address in the storage device through the data pattern library; wherein the data pattern type is used for indicating an index value in a preset data pattern base.
In one embodiment of the present application, the data pattern type recording module may include the following sub-modules:
a write command response sub-module for responding to a write command of the storage device; the write command comprises a write operation instruction and a write operation logic block address interval, wherein the original set data modes of the corresponding logic block address intervals in the same write command are the same; calculating an index value of the original set data mode in the preset data mode base based on a starting logic block address, a preset count value and a preset random number of the logic block address interval; and according to the index value, the original set data mode of the logical block address interval and the allocated memory space are associated and recorded in the preset data mode library.
In one embodiment of the present application, the data pattern type recording module may further include the following sub-modules:
The logic block data writing sub-module is used for generating logic block data of each logic block address in the logic block address interval based on an original set data mode of the logic block address interval and the allocated memory space; and writing the logic block data into the storage device in response to the write operation command.
In one embodiment of the present application, after writing the logical block data to the storage device, the data pattern type recording module may further include the following sub-modules:
a mode tracking sequence updating sub-module, configured to obtain index values of each logical block address in the logical block address interval; and generating and/or updating a mode tracking sequence of each logic block address in the logic block address interval according to each logic block address in the logic block address interval and the index value corresponding to each logic block address in the logic block address interval.
In one embodiment of the application, the logical block data writing sub-module may include the following elements:
the logic block data generation unit is used for acquiring a logic space identifier based on the memory space and generating data based on an original set data mode; calculating a check value based on the logical block address of the logical block address interval, the logical space identifier and the data generated based on the original set data mode; and splicing the logic block address based on the logic block address interval, the logic space identifier, the data generated based on the original set data mode and the check value to obtain the logic block data of the data block where the current logic block address is located.
In an embodiment of the present application, the apparatus provided in the embodiment of the present application may further include the following modules:
the data pattern library multiplexing module is used for recovering the preset data pattern library into the storage device when the read-write test of the storage device is detected, so as to realize multiplexing of the data pattern types of all the logic block addresses recorded by the preset data pattern library; wherein the read-write test of the storage device is embodied based on a read command and a write command to the storage device.
In the embodiment of the application, the data verification device of the storage device provided by the embodiment of the application can acquire the mode tracking sequence of the target logic block address read corresponding to the read command under the condition that the verification of the read data block of the storage device fails, and can realize the historical data tracking of the logic block address level while the verification of the data of the storage device is realized based on the original set data mode and the historical operation data mode of the target logic block address maintained by the mode tracking sequence, so that the tracing speed of the problem positioning is effectively improved based on the historical data under the condition that the verification of the data block fails.
Referring to fig. 8, there is shown a block diagram of another embodiment of a data verification apparatus of a storage device of the present application, where the storage device is connected to a test host, and may specifically include the following modules:
a read command receiving module 801, configured to receive a read command sent by the test host, where the read command is generated based on a response of the test host to a read operation of the storage device by a user;
a read command response module 802, configured to respond to a read command of the storage device, and obtain a data block corresponding to the target logical block address;
a trace sequence obtaining module 803, configured to obtain a pattern trace sequence for the target logical block address when the data block verification fails; the mode tracking sequence is a sequence of data modes of recording operated data when the data block corresponding to the target logical block address is subjected to read operation and/or write operation, and is used for maintaining an original set data mode and a historical operation data mode of the target logical block address;
and the data tracing module 804 is configured to trace data of the data block according to the pattern tracing sequence.
For the data verification device of the storage device shown in fig. 8, the specific process of implementing data verification by the corresponding module may refer to the foregoing, and the embodiment of the present application is not described herein again.
In the embodiment of the application, the data verification device of the storage device provided by the embodiment of the application can acquire the mode tracking sequence of the target logic block address read corresponding to the read command under the condition that the verification of the read data block of the storage device fails, and can realize the historical data tracking of the logic block address level while the verification of the data of the storage device is realized based on the original set data mode and the historical operation data mode of the target logic block address maintained by the mode tracking sequence, so that the tracing speed of the problem positioning is effectively improved based on the historical data under the condition that the verification of the data block fails.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
The embodiment of the application also provides electronic equipment, which comprises:
the data verification method comprises a processor, a memory and a computer program which is stored in the memory and can run on the processor, wherein the computer program realizes all the processes of the data verification method embodiment of the storage device when being executed by the processor, can achieve the same technical effects, and is not repeated here.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, realizes the processes of the data verification method embodiment of the storage device, and can achieve the same technical effects, and in order to avoid repetition, the description is omitted here.
In this specification, each embodiment is described in a progressive manner, and the emphasis of each embodiment is on the difference from other embodiments, so that identical and similar parts of each embodiment are mutually referred.
It will be apparent to those skilled in the art that embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the application may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and alterations and modifications as fall within the scope of the embodiments of the application.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or fully authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region, and provide corresponding operation entries for the user to select authorization or rejection.
It is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The foregoing description of the data verification method of a storage device, the data verification apparatus of a storage device, the corresponding electronic device and the corresponding computer readable storage medium provided by the present application has been provided by the present application, and specific examples have been applied to illustrate the principles and embodiments of the present application, and the above description of the embodiments is only for helping to understand the method and core idea of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (14)

1. A method for verifying data of a storage device, the method comprising:
responding to a read command of the storage equipment, and acquiring a data block corresponding to a target logical block address;
if the data block verification fails, a mode tracking sequence aiming at the target logic block address is obtained; the mode tracking sequence is a sequence of data modes of recording operated data when the data block corresponding to the target logical block address is subjected to read operation and/or write operation, and is used for maintaining an original set data mode and a historical operation data mode of the target logical block address;
And carrying out data tracing on the data block according to the mode tracing sequence.
2. The method of claim 1, wherein the read command comprises a read operation command, a target logical space for a read operation, and a target logical block address for a read operation; the responding to the read command of the storage device, obtaining the data block corresponding to the target logical block address, including:
responding to a read operation command of the storage device, and reading a data block corresponding to a target logic block address in the target logic space;
further comprises:
acquiring a check value of a read operation and a check value of the data block;
if the check value of the read operation is consistent with the check value of the data block, judging that the data block passes the check; and/or if the check value of the read operation is inconsistent with the check value of the data block, judging that the data block fails to check.
3. Method according to claim 1 or 2, wherein the historical operation data patterns in the pattern trace sequence are derived based on historical read operations and/or historical write operation records for the target logical block address, the number of the historical operation data patterns being a plurality, the data trace being indicative of trace of the origin of the data block data and reproduction of the data history state;
The step of performing data tracing on the data block according to the pattern tracing sequence includes:
and presenting the historical read-write state of the historical read operation and/or the historical write operation of the data block based on a plurality of historical operation data modes and original setting data modes recorded by the mode tracking sequence.
4. The method of claim 1, further comprising, prior to said responding to a read command from said storage device:
creating a preset data pattern library;
recording the data pattern type of each logical block address in the storage device through the data pattern library; wherein the data pattern type is used for indicating an index value in a preset data pattern base.
5. The method of claim 4, wherein the recording, by the data pattern library, the data pattern type of each logical block address in the storage device, comprises:
responding to a write command to the storage device; the write command comprises a write operation instruction and a write operation logic block address interval, wherein the original set data modes of the corresponding logic block address intervals in the same write command are the same;
Calculating an index value of the original set data mode in the preset data mode base based on a starting logic block address, a preset count value and a preset random number of the logic block address interval;
and according to the index value, the original set data mode of the logical block address interval and the allocated memory space are associated and recorded in the preset data mode library.
6. The method as recited in claim 5, further comprising:
generating logic block data of each logic block address in the logic block address interval based on an original set data mode of the logic block address interval and the allocated memory space;
and writing the logic block data into the storage device in response to the write operation command.
7. The method of claim 6, further comprising, after writing the logical block data to the storage device:
acquiring index values of all logical block addresses in the logical block address interval;
and generating and/or updating a mode tracking sequence of each logic block address in the logic block address interval according to each logic block address in the logic block address interval and the index value corresponding to each logic block address in the logic block address interval.
8. The method of claim 6, wherein generating the logical block data for each logical block address in the logical block address interval based on the originally set data pattern and the allocated memory space for the logical block address interval comprises:
acquiring a logic space identifier based on the memory space and generating data based on an original set data mode;
calculating a check value based on the logical block address of the logical block address interval, the logical space identifier and the data generated based on the original set data mode;
and splicing the logic block address based on the logic block address interval, the logic space identifier, the data generated based on the original set data mode and the check value to obtain the logic block data of the data block where the current logic block address is located.
9. The method as recited in claim 4, further comprising:
when the read-write test of the storage device is detected, restoring the preset data pattern library to the storage device, and multiplexing the data pattern types of all the logic block addresses recorded by the preset data pattern library; wherein the read-write test of the storage device is embodied based on a read command and a write command to the storage device.
10. A method of data verification of a storage device, the storage device being coupled to a test host, the method comprising:
receiving a read command sent by the test host, wherein the read command is generated based on the response of the test host to the read operation of the storage device by a user;
responding to a read command of the storage equipment, and acquiring a data block corresponding to a target logical block address;
if the data block verification fails, a mode tracking sequence aiming at the target logic block address is obtained; the mode tracking sequence is a sequence of data modes of recording operated data when the data block corresponding to the target logical block address is subjected to read operation and/or write operation, and is used for maintaining an original set data mode and a historical operation data mode of the target logical block address;
and carrying out data tracing on the data block according to the mode tracing sequence.
11. A data verification apparatus for a storage device, the apparatus comprising:
the read command response module is used for responding to the read command of the storage device and acquiring a data block corresponding to the target logical block address;
The tracking sequence acquisition module is used for acquiring a mode tracking sequence aiming at the target logical block address when the data block verification fails; the mode tracking sequence is a sequence of data modes of recording operated data when the data block corresponding to the target logical block address is subjected to read operation and/or write operation, and is used for maintaining an original set data mode and a historical operation data mode of the target logical block address;
and the data tracing module is used for tracing the data of the data block according to the mode tracing sequence.
12. A data verification apparatus for a storage device, wherein the data verification apparatus is located in the storage device, and the storage device is connected to a test host, the apparatus comprising:
the read command receiving module is used for receiving a read command sent by the test host, and the read command is generated based on the response of the test host to the read operation of the storage device by a user;
the read command response module is used for responding to the read command of the storage device and acquiring a data block corresponding to the target logical block address;
the tracking sequence acquisition module is used for acquiring a mode tracking sequence aiming at the target logical block address when the data block verification fails; the mode tracking sequence is a sequence of data modes of recording operated data when the data block corresponding to the target logical block address is subjected to read operation and/or write operation, and is used for maintaining an original set data mode and a historical operation data mode of the target logical block address;
And the data tracing module is used for tracing the data of the data block according to the mode tracing sequence.
13. A storage device comprising a control unit, a storage unit, a cache unit and a computer program based on execution of the control unit, which computer program, when executed by the control unit, implements a data verification method of a storage device according to any one of claims 1 to 9 or claim 10.
14. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements a data verification method of a storage device according to any one of claims 1 to 9 or claim 10.
CN202310771154.XA 2023-06-27 2023-06-27 Data verification method, device and equipment of storage equipment and storage medium Pending CN116841463A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310771154.XA CN116841463A (en) 2023-06-27 2023-06-27 Data verification method, device and equipment of storage equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310771154.XA CN116841463A (en) 2023-06-27 2023-06-27 Data verification method, device and equipment of storage equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116841463A true CN116841463A (en) 2023-10-03

Family

ID=88164585

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310771154.XA Pending CN116841463A (en) 2023-06-27 2023-06-27 Data verification method, device and equipment of storage equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116841463A (en)

Similar Documents

Publication Publication Date Title
US10528416B2 (en) Checking data integrity of data storage systems
CN105205053A (en) Method and system for analyzing database incremental logs
US20070156778A1 (en) File indexer
CN107479823B (en) Data verification method and device in random read-write file test
KR20070089603A (en) Apparatus, method, and computer program for processing information
CN112463724A (en) Data processing method and system for lightweight file system
WO2017143843A1 (en) Metadata recovery method and device
US20210389882A1 (en) Storage device and low-level formatting method therefor
US9009430B2 (en) Restoration of data from a backup storage volume
CN113419897A (en) File processing method and device, electronic equipment and storage medium thereof
CN111259020A (en) Method, system, equipment and medium for checking multi-storage-volume copy consistency
CN116841463A (en) Data verification method, device and equipment of storage equipment and storage medium
CN114491145B (en) Metadata design method based on stream storage
CN111367710A (en) eMMC problem reduction method and device
US11803317B2 (en) Interrupted replicated write recognition
CN115373608A (en) Data storage method and device
CN111427756B (en) Method, system, equipment and medium for carrying out mixed pressure test on single hard disk
US9262264B2 (en) Error correction code seeding
CN110018784B (en) Data processing method and device and computing equipment
CN107885640B (en) Hard disk management method and device
CN111309526A (en) File backup and recovery method and device
CN112433738B (en) Firmware update test method, system, equipment and medium
CN110008227B (en) Consistency group reliability verification method and related device
US9400721B2 (en) Error correction code seeding
CN117520213A (en) Data processing method, device, computer equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: Room 553, 5th Floor, Building 3, No. 969 Wenyi West Road, Wuchang Street, Hangzhou City, Zhejiang Province, 311100

Applicant after: Hangzhou Alibaba Cloud Feitian Information Technology Co.,Ltd.

Address before: Room 553, 5th Floor, Building 3, No. 969 Wenyi West Road, Wuchang Street, Yuhang District, Hangzhou City, Zhejiang Province, 311100

Applicant before: Hangzhou Alibaba Feitian Information Technology Co.,Ltd.

CB02 Change of applicant information