CN102034516B - Method for detecting read-write error of storage medium - Google Patents

Method for detecting read-write error of storage medium Download PDF

Info

Publication number
CN102034516B
CN102034516B CN 201010595387 CN201010595387A CN102034516B CN 102034516 B CN102034516 B CN 102034516B CN 201010595387 CN201010595387 CN 201010595387 CN 201010595387 A CN201010595387 A CN 201010595387A CN 102034516 B CN102034516 B CN 102034516B
Authority
CN
China
Prior art keywords
lba
write order
test case
write
host side
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.)
Active
Application number
CN 201010595387
Other languages
Chinese (zh)
Other versions
CN102034516A (en
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.)
Innovation Technology Co., Ltd.
Shenzhen Innovation Software Technology Co., Ltd.
Original Assignee
CHUANGXINKE SOFTWARE TECHNOLOGY (SHENZHEN) Co Ltd
Innovation And Technology Storage 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 CHUANGXINKE SOFTWARE TECHNOLOGY (SHENZHEN) Co Ltd, Innovation And Technology Storage Technology Co Ltd filed Critical CHUANGXINKE SOFTWARE TECHNOLOGY (SHENZHEN) Co Ltd
Priority to CN 201010595387 priority Critical patent/CN102034516B/en
Publication of CN102034516A publication Critical patent/CN102034516A/en
Application granted granted Critical
Publication of CN102034516B publication Critical patent/CN102034516B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The invention discloses a method for detecting the read-write error of a storage medium, which comprises the following steps that: a host terminal adds logical block addressing (LBA) and a test case identity (ID) in a write command and sends a writing command to a storage terminal; the storage terminal stores the LBA and the test case ID to a test section, reads data back on an address of the determined test section and returns the data read back to the host terminal; and thus, the storage terminal and the host terminal judges the type of the error by comparing data read back and written data. By the method, the read-write error of the storage medium can be detected quickly.

Description

The wrong detection method of storage medium read-write
Technical field
The present invention relates to memory technology, the wrong detection method of particularly a kind of storage medium read-write.
Background technology
Fig. 1 is the principle schematic of storage medium read-write process in the prior art, as shown in Figure 1, when storage medium 103 is carried out write operation, host side 101 issues write order to storage end 102, each processing module (scheming not shown) of storage end 102 inside writes desired data to storage medium 103 corresponding addresses after the included address of write order and data are carried out a series of processing.The processing that described each processing module is carried out is complicated and diversified, and for example, the processing module that has is responsible for address translation.
Similarly, when storage medium 103 is carried out read operation, host side 101 issues read command to storage end 102, after each processing module (scheming not shown) of storage end 102 inside is carried out a series of processing to the included address of read command, take out data from storage medium 103 corresponding addresses, each processing module (scheming not shown) of storage end 102 inside carries out being back to host side 101 after a series of processing to data then.
Need to prove the disk groups that above-mentioned storage medium 103 is generally disk or is made of some disks.
In actual applications, when the data consistency problem occurring, when data that promptly read and desired data are inconsistent, need detect, with definite type of error is read error or write error on earth, even determines that further concrete which link problem occurred and just caused occurring read error or write error.
In the prior art, usually adopt following method that the read-write mistake of disk is detected: the data of disk are derived, judge whether the data on the disk are desired data, if not, then write error has appearred in explanation, if the data on the disk are desired data really, then judge read error to have occurred.Further, if type of error is a write error, then increase key point on each processing module by manual type responsible write operation in storage end 102 successively, and detect the output information of key point, to check specifically on which processing module, problem occurred.Similarly, if type of error is a read error, then increase key point on each processing module by manual type responsible read operation in storage end 102 successively, and detect the output information of key point, to check specifically on which processing module, mistake occurred.
As seen, mainly be to carry out the wrong detection of storage medium read-write in the prior art by manual type, whole testing process must rely on manual type to carry out length by length, and detection efficiency is lower.
Summary of the invention
In view of this, the invention provides the wrong detection method of a kind of storage medium read-write, apace the read-write mistake of detection of stored medium.
For solving the problems of the technologies described above, technical scheme of the present invention is achieved in that
The wrong detection method of a kind of storage medium read-write, this method comprises:
A, host side structure write order, described write order is used for determining the address of storage medium test sector;
B, host side are added LBA (Logical Block Addressing) LBA and test case number-mark in described write order, then described write order is sent to the storage end, and wherein, the test case sign of adding in the different write orders is identical, and LBA has nothing in common with each other;
C, host side judge whether to receive that the write order that the storage end returns finishes response, if, execution in step D then; Otherwise, return execution in step A;
The read command of D, host side structure is sent to described read command the storage end then, and described read command is used for readback data on the address of described definite test sector;
E, host side judge that the LBA in the readback data that the storage end returns is whether identical with the LBA that adds in the write order described in the step B, whether test case in readback data sign is identical with the test case sign of adding in the write order described in the step B, if the LBA that adds in the LBA in the readback data and the described write order is identical, and the test case of adding in the test case in readback data sign and the described write order identifies identical, then returns execution in step A; Otherwise, execution in step F;
F, host side are sent to read command described in the step D storage end again;
G, host side judge that the LBA in the readback data that the storage end returns is whether identical with the LBA that adds in the write order described in the step B, whether test case in readback data sign is identical with the test case sign of adding in the write order described in the step B, if the LBA that adds in the LBA in the readback data and the described write order is identical, and the test case of adding in the test case in readback data sign and described write order sign is identical, and then definite type of error is a read error; Otherwise, determine that type of error is a write error;
The type of error of determining described in H, the host side recording step G.
Step H further comprises: the address of the test sector in the write order of host side misregistration type correspondence, LBA and test case sign.
The content of described record is kept in the host side with the form of error log.
Described storage medium is a disk.
A kind of detection method of storage medium write error, this method comprises:
A, storage termination are received the write order from host side, and judge whether described write order is first write order that receives, if then preserve the test case number-mark in the described write order, then execution in step B; Otherwise, direct execution in step B;
B, storage end are according to the address of testing the sector in the definite storage medium of described write order, LBA (Logical Block Addressing) LBA in the described write order and test case sign are saved on the described test sector, and after preservation finishes, return write order and finish response to host side;
C, storage termination are received the read command from host side, readback data on described definite test sevtor address, and return readback data to host side;
D, storage end judge that the LBA in the readback data is whether identical with LBA in the write order that receives described in the steps A, whether the test case sign in the readback data is identical with the test case sign of preserving described in the steps A, if the LBA in the write order that receives described in LBA in the readback data and the steps A is inequality, or the test case sign of preserving described in sign of the test case in the readback data and the steps A is inequality, determine that then type of error is a write error, then execution in step E; Otherwise, return execution in step A;
E, storage end are printed described definite type of error.
Step e further comprises: address, LBA and the test case sign of the test sector in the write order of storage end misprint type correspondence.
Described storage medium is a disk.
According to technical scheme provided by the present invention, host side is added LBA and test case ID in write order, then write order is sent to the storage end, the storage end is saved to LBA in the write order and test case ID on the test sector, storage end readback data on the test sevtor address of determining, and return readback data to host side, thereby storage end and host side are come the misjudgment type by comparison readback data and the data that write with this.As seen, the present invention is to provide the automatic detection scheme that host side and storage end cooperatively interact, do not need artificial intervention, apace the read-write mistake of detection of stored medium.
Description of drawings
Fig. 1 is the principle schematic of storage medium read-write process in the prior art.
Fig. 2 is the process flow diagram of the embodiment one of the wrong detection method of a kind of storage medium read-write provided by the present invention.
Fig. 3 is the process flow diagram of the embodiment two of the wrong detection method of a kind of storage medium read-write provided by the present invention.
Embodiment
For making purpose of the present invention, technical scheme and advantage clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, scheme of the present invention is described in further detail.
The wrong detection method of a kind of storage medium read-write provided by the present invention relates to two aspects: the testing process of the testing process of host side and storage end describes in detail to the testing process of host side and the testing process of storage end respectively below by two embodiment.
Embodiment one
Embodiment one is the testing process of host side.
Fig. 2 is the process flow diagram of the embodiment one of the wrong detection method of a kind of storage medium read-write provided by the present invention.As shown in Figure 2, this method may further comprise the steps:
Step 201, host side structure write order, described write order is used for determining the address of storage medium test sector.
Wherein, the concrete grammar of host side structure write order is the content of prior art, will not give unnecessary details herein.
The address of described test sector is used to indicate this detected sector which is, for example, supposes to have 100 sectors, and the numbering of each sector is respectively 1 to 100, and may this detected sector only be wherein to be numbered 10 sectors of 1 to 10.
Step 202, host side are added LBA (Logical Block Addressing) (LBA) and test case numbering (ID) in described write order, then described write order is sent to the storage end, and wherein, the test case ID that adds in the different write orders is identical, and LBA has nothing in common with each other.
In this step, in the write order that step 201 is constructed, add LBA and test case ID.Need to prove, in whole test process, (for example the judged result of step 203 is not for the time might to return execution in step 201 after some step is finished, then return step 201), whenever return step 201 and item mean that host side constructs a new write order again, like this, before detecting end, host side has been constructed many write orders, in these many write orders, the address possibility of the test sector that different write orders are determined is identical also may be different, but the test case ID that adds in the different write orders is identical, and the LBA that adds in the different write orders is inequality.
Step 203, host side judge whether to receive to store holds the write order that returns to finish response, if then execution in step 204; Otherwise, return execution in step 201.
In this step, if the storage end has returned write order to host side and has finished response, mean LBA in the write order and test case ID are write storage medium, then host side is carried out subsequent step, does not finish response if receive write order, means that LBA and the test case ID in the write order also all do not write storage medium, then can return step 201, construct other write orders, and send other write orders, to continue other sector detection to the storage end.
Step 204, the read command of host side structure is sent to described read command the storage end then, and described read command is used for readback data on the address of described definite test sector.
Wherein, the concrete grammar of host side structure read command is the content of prior art, will not give unnecessary details herein.
This step has been initiated read operation in the position that writes data before.
Step 205, host side judges that the LBA in the readback data that the storage end returns is whether identical with the LBA that adds in the write order described in the step 202, whether the test case ID in the readback data is identical with the test case ID that adds in the write order described in the step 202, if the LBA that adds in the LBA in the readback data and the described write order is identical, and the test case ID that adds in the test case ID in the readback data and the described write order is identical, then returns execution in step 201; Otherwise, execution in step 206.
In this step, if the LBA that adds in the LBA in the readback data and the write order is identical, and the test case ID that adds in the test case ID in the readback data and the described write order is identical, show and any read-write mistake do not occur, then return step 201, construct other write orders, and send other write orders, other sectors are detected with continuation to the storage end.
Step 206, host side are sent to read command described in the step 204 the storage end again.
This step has been initiated read operation for the second time in the position that writes data before.
Step 207, host side judges that the LBA in the readback data that the storage end returns is whether identical with the LBA that adds in the write order described in the step 202, whether the test case ID in the readback data is identical with the test case ID that adds in the write order described in the step 202, if the LBA that adds in the LBA in the readback data and the described write order is identical, and the test case ID that adds in the test case ID in the readback data and the described write order is identical, determines that then type of error is a read error; Otherwise, determine that type of error is a write error.
In this step, judge that again the LBA in the readback data that the storage end returns is whether identical with the LBA that adds in the write order described in the step 202, whether the test case ID in the readback data is identical with the test case ID that adds in the write order described in the step 202, if the LBA that adds in the LBA in the readback data and the write order described in the step 202 is different, perhaps the test case ID that adds in the test case ID in the readback data and the write order described in the step 202 is different, show that then it still is wrong reading once back again, the data that this explanation writes itself are wrong, then judge write error has taken place.
On the contrary, if the LBA that adds in the LBA in the readback data and the described write order is identical, and the test case ID that adds in the test case ID in the readback data and the described write order is identical, then show after reading once again it then is correct, illustrating that the data itself that write are not wrong, is wrong owing to reading for the first time, is correct and read again for the second time, deducibility is in the process existing problems of read data, and then misjudgment type is a read error.
Step 208, the type of error of determining described in the host side recording step 207.
Also further address, LBA and the test case ID of the test sector in the write order of misregistration type correspondence.
The content of above-mentioned record can error log form be kept in the host side.
So far, one introduction finishes to embodiment.
Embodiment two
Embodiment two is the testing process of storage end.
Fig. 3 is the process flow diagram of the embodiment two of the wrong detection method of a kind of storage medium read-write provided by the present invention.As shown in Figure 3, this method may further comprise the steps:
Step 301, the storage termination is received the write order from host side, and judges whether described write order is first write order that receives, if, then preserve the test case ID in the described write order, execution in step 302 then; Otherwise, direct execution in step 302.
In this step, if the storage termination is received first write order, then preserve the test case ID in the write order.
In actual applications, global variable of definable makes described global variable equal the test case ID in first write order, has so just realized the preservation of test case ID.
Step 302, the storage end is saved to LBA in the described write order and test case ID on the described test sector according to the address of the definite test sector of described write order, and returns write order to host side and finish response after preservation finishes.
LBA in this step in the preservation write order and the process of test case ID are the process that writes data to the test sector of storage medium.
Step 303, the storage termination is received the read command from host side, readback data on described definite test sevtor address, and return readback data to host side.
Step 304, storage end judges that the LBA in the readback data is whether identical with LBA in the write order of reception described in the step 301, whether the test case ID in the readback data is identical with the test case ID that preserves described in the step 301, if the LBA in the write order that receives described in LBA in the readback data and the step 301 is inequality, or the test case ID that preserves described in test case ID in the readback data and the step 301 is inequality, determine that then type of error is a write error, execution in step 305 then; Otherwise, return execution in step 301.
In this step, if the LBA in the write order that receives described in LBA in the readback data and the step 301 is inequality, or the test case ID that preserves described in test case ID in the readback data and the step 301 is inequality, and mistake has taken place when then showing write data; If the LBA in the write order of LBA in the readback data and reception described in the step 301 is identical, and the test case ID in the readback data is identical with the test case ID that preserves described in the step 301, then show and any read-write mistake do not occur, then can return step 301, continue to receive other orders, other sectors are detected with continuation.
Step 305, the storage end is printed described definite type of error.
Also can further print the information of each processing module in address, LBA and the test case ID of the test sector in the write order corresponding and the storage end etc. with described type of error.Each processing module is to be responsible for functional module that the included address of write order and data are carried out a series of processing in the prior art in the described storage end.
So far, two introductions finish to embodiment.
To sum up, in the present invention, host side is added LBA and test case ID in write order, then write order is sent to the storage end, the storage end is saved to LBA in the write order and test case ID on the test sector, and readback data on the test sevtor address of determining is held in storage, and returns readback data to host side, thereby storage end and host side are come the misjudgment type by comparison readback data and the data that write with this.As seen, the present invention is to provide the automatic detection scheme that host side and storage end cooperatively interact, do not need artificial intervention, apace the read-write mistake of detection of stored medium.
The above is preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (7)

1. a storage medium is read and write wrong detection method, it is characterized in that this method comprises:
A, host side structure write order, described write order is used for determining the address of storage medium test sector;
B, host side are added LBA (Logical Block Addressing) and test case numbering in described write order, then described write order is sent to the storage end, and wherein, the test case numbering of adding in the different write orders is identical, and LBA (Logical Block Addressing) has nothing in common with each other;
C, host side judge whether to receive that the write order that the storage end returns finishes response, if, execution in step D then; Otherwise, return execution in step A;
The read command of D, host side structure is sent to described read command the storage end then, and described read command is used for readback data on the address of described definite test sector;
E, host side judge that the LBA (Logical Block Addressing) in the readback data that the storage end returns is whether identical with the LBA (Logical Block Addressing) of adding in the write order described in the step B, whether test case in readback data numbering is identical with the test case numbering of adding in the write order described in the step B, if the LBA (Logical Block Addressing) of adding in the LBA (Logical Block Addressing) in the readback data and the described write order is identical, and the test case of adding in the test case in readback data numbering and the described write order is numbered identical, then returns execution in step A; Otherwise, execution in step F;
F, host side are sent to read command described in the step D storage end again;
G, host side judge that the LBA (Logical Block Addressing) in the readback data that the storage end returns is whether identical with the LBA (Logical Block Addressing) of adding in the write order described in the step B, whether test case in readback data numbering is identical with the test case numbering of adding in the write order described in the step B, if the LBA (Logical Block Addressing) of adding in the LBA (Logical Block Addressing) in the readback data and the described write order is identical, and the test case of adding in the test case in readback data numbering and described write order numbering is identical, and then definite type of error is a read error; Otherwise, determine that type of error is a write error;
The type of error of determining described in H, the host side recording step G.
2. method according to claim 1 is characterized in that step H further comprises: the address of the test sector in the write order of host side misregistration type correspondence, LBA (Logical Block Addressing) and test case numbering.
3. method according to claim 2 is characterized in that the content of described record is kept in the host side with the form of error log.
4. method according to claim 3 is characterized in that, described storage medium is a disk.
5. the detection method of a storage medium write error is characterized in that, this method comprises:
A, storage termination are received the write order from host side, and judge whether described write order is first write order that receives, if then preserve the test case numbering in the described write order, then execution in step B; Otherwise, direct execution in step B;
B, storage end are according to the address of testing the sector in the definite storage medium of described write order, LBA (Logical Block Addressing) LBA (Logical Block Addressing) in the described write order and test case numbering are saved on the described test sector, and after preservation finishes, return write order and finish response to host side;
C, storage termination are received the read command from host side, readback data on described definite test sevtor address, and return readback data to host side;
D, storage end judge that the LBA (Logical Block Addressing) in the readback data is whether identical with LBA (Logical Block Addressing) in the write order that receives described in the steps A, whether the test case numbering in the readback data is identical with the test case numbering of preserving described in the steps A, if the LBA (Logical Block Addressing) in the write order that receives described in LBA (Logical Block Addressing) in the readback data and the steps A is inequality, or the test case numbering of preserving described in numbering of the test case in the readback data and the steps A is inequality, determine that then type of error is a write error, then execution in step E; Otherwise, return execution in step A;
E, storage end are printed described definite type of error.
6. method according to claim 5 is characterized in that step e further comprises: address, LBA (Logical Block Addressing) and the test case numbering of the test sector in the write order of storage end misprint type correspondence.
7. method according to claim 6 is characterized in that, described storage medium is a disk.
CN 201010595387 2010-12-10 2010-12-10 Method for detecting read-write error of storage medium Active CN102034516B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010595387 CN102034516B (en) 2010-12-10 2010-12-10 Method for detecting read-write error of storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010595387 CN102034516B (en) 2010-12-10 2010-12-10 Method for detecting read-write error of storage medium

Publications (2)

Publication Number Publication Date
CN102034516A CN102034516A (en) 2011-04-27
CN102034516B true CN102034516B (en) 2013-07-24

Family

ID=43887292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010595387 Active CN102034516B (en) 2010-12-10 2010-12-10 Method for detecting read-write error of storage medium

Country Status (1)

Country Link
CN (1) CN102034516B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2589378B2 (en) * 1989-06-19 1997-03-12 群馬日本電気株式会社 Magneto-optical disk processing unit
JP2003141824A (en) * 2001-11-06 2003-05-16 Ricoh Co Ltd Disk device
JP2004047032A (en) * 2002-07-16 2004-02-12 Funai Electric Co Ltd Evaluation system and evaluation method for disk reproducing device
CN1573703A (en) * 2003-06-11 2005-02-02 国际商业机器公司 System and method for detecting write errors in a storage device
CN1662987A (en) * 2002-06-19 2005-08-31 索尼株式会社 Data recording/reproduction device, data recording/reproduction method, and digital camera

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4751131B2 (en) * 2005-08-18 2011-08-17 東芝ストレージデバイス株式会社 Data loss prevention method for medium storage device and medium storage device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2589378B2 (en) * 1989-06-19 1997-03-12 群馬日本電気株式会社 Magneto-optical disk processing unit
JP2003141824A (en) * 2001-11-06 2003-05-16 Ricoh Co Ltd Disk device
CN1662987A (en) * 2002-06-19 2005-08-31 索尼株式会社 Data recording/reproduction device, data recording/reproduction method, and digital camera
JP2004047032A (en) * 2002-07-16 2004-02-12 Funai Electric Co Ltd Evaluation system and evaluation method for disk reproducing device
CN1573703A (en) * 2003-06-11 2005-02-02 国际商业机器公司 System and method for detecting write errors in a storage device

Also Published As

Publication number Publication date
CN102034516A (en) 2011-04-27

Similar Documents

Publication Publication Date Title
US6332204B1 (en) Recovering and relocating unreliable disk sectors when encountering disk drive read errors
US6247152B1 (en) Relocating unreliable disk sectors when encountering disk drive read errors with notification to user when data is bad
CN110008136A (en) The method of management flash memory module and relevant flash controller and electronic device
CN101777013A (en) Solid state disk and data read-write method
CN104658612B (en) Method for accessing storage unit in flash memory and device using the same
US5467361A (en) Method and system for separate data and media maintenance within direct access storage devices
US9552287B2 (en) Data management method, memory controller and embedded memory storage apparatus using the same
US20180210784A1 (en) Metadata Recovery Method and Apparatus
CN107643955B (en) Method for improving performance of nonvolatile memory based on error correction write-back technology and nonvolatile memory structure
CN113643746A (en) Flash memory data analysis method and device, terminal equipment and storage medium
CN102929740A (en) Method and device for detecting bad block of storage equipment
CN113496746A (en) Apparatus and method for detecting defect of memory module and memory system
US20020104045A1 (en) System and method for identifying memory modules having a failing or defective address
US20070074073A1 (en) Detection system and method
CN102034516B (en) Method for detecting read-write error of storage medium
US6426928B1 (en) Ability to distinguish true disk write errors
CN110348245B (en) Data integrity protection method, system and device based on NVM and storage medium
CN116382582A (en) RAID remapping method, system, equipment and storage medium
CN107589904B (en) SD card reading and writing method and device
CN108231134B (en) RAM yield remediation method and device
US8953393B2 (en) Semiconductor device and operating method thereof
CN109726040B (en) Small-capacity OTPROM memory with fault-tolerant mechanism and fault-tolerant control method thereof
CN102969026B (en) Based on movable storage device detection method and the device of data handling system
CN102956270B (en) Movable storage device detection method and device
CN111949198A (en) Bad block management method and device and storage equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Room 505, Taixing Building, 11 Garden East Road, Haidian District, Beijing, 100191

Co-patentee after: Shenzhen Innovation Software Technology Co., Ltd.

Patentee after: Innovation Technology Co., Ltd.

Address before: Room 0801-0810, 51 College Road, Haidian District, Beijing, 100191

Co-patentee before: Chuangxinke Software Technology (Shenzhen) Co., Ltd.

Patentee before: Innovation and Technology Storage Technology Co., Ltd.