CN113791930A - Method and device for processing read command, storage medium and electronic device - Google Patents

Method and device for processing read command, storage medium and electronic device Download PDF

Info

Publication number
CN113791930A
CN113791930A CN202111075655.1A CN202111075655A CN113791930A CN 113791930 A CN113791930 A CN 113791930A CN 202111075655 A CN202111075655 A CN 202111075655A CN 113791930 A CN113791930 A CN 113791930A
Authority
CN
China
Prior art keywords
target
physical address
data
error
address
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
CN202111075655.1A
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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202111075655.1A priority Critical patent/CN113791930A/en
Publication of CN113791930A publication Critical patent/CN113791930A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1008Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
    • G06F11/1044Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices with specific ECC/EDC distribution

Abstract

The application discloses a read command processing method and device, a storage medium and an electronic device, wherein the method comprises the following steps: receiving a read command from a host, wherein the read command is used for reading data at a target logical address in a storage device; responding to the read command, and determining a target physical address corresponding to the target logical address; inquiring a target error record table according to the target physical address, wherein the target error record table is used for recording the physical address of the uncorrectable error in the storage device; and sending invalid data to the host side under the condition that the physical address matched with the target physical address is inquired from the target error record table. By the method and the device, the problem of low data reading efficiency caused by the fact that error correction needs to be carried out on abnormal data for many times and re-reading operation needs to be carried out in a read command processing mode in the related technology is solved.

Description

Method and device for processing read command, storage medium and electronic device
Technical Field
The present application relates to the field of storage technologies, and in particular, to a method and an apparatus for processing a read command, a storage medium, and an electronic apparatus.
Background
Storage devices, such as Solid State Drives (SSD), can be widely used in data storage scenarios. Taking an SSD as an example, the accessories of the SSD include a control chip, a cache chip, and a Flash memory chip (i.e., Flash) for storing data. When the life cycle of a certain block in Flash is close to the end, data reading abnormity may occur when data of a certain physical address in the block is read, and multiple error correction and re-reading operations need to be executed. If the correct data is still not read after performing multiple re-reads and error correction operations, the data read will fail.
At present, in order to improve the hit rate of the read operation, the reference voltage offset value of the physical address may be adjusted according to the probability of the re-read operation occurring at the physical address. However, since the data reading method described above is to count the probability of error-correctable read errors occurring in the data at the physical address, and modify the re-read voltage to perform the read operation, there is a possibility that error correction is performed many times and data acquisition still fails after re-reading.
Therefore, the processing mode of the read command in the related art has the problem of low data reading efficiency caused by the need of carrying out multiple times of error correction and rereading operation on abnormal data.
Disclosure of Invention
The embodiment of the application provides a method and a device for processing a read command, a storage medium and an electronic device, so as to solve at least the problem of low data reading efficiency caused by the fact that error correction needs to be performed on abnormal data for many times and re-reading operation exists in the processing mode of the read command in the related art.
According to an aspect of an embodiment of the present application, there is provided a method for processing a read command, including: receiving a read command from a host, wherein the read command is used for reading data at a target logical address in a storage device; responding to the read command, and determining a target physical address corresponding to the target logical address; inquiring a target error record table according to the target physical address, wherein the target error record table is used for recording the physical address of the uncorrectable error in the storage device; and sending invalid data to the host side under the condition that the physical address matched with the target physical address is inquired from the target error record table.
In an exemplary embodiment, the target error record table is used for recording the physical page address of the memory device where the uncorrectable error occurs; querying the target error record table according to the target physical address comprises: and inquiring the physical page address containing the target physical address in the target error record table according to the target physical address.
In an exemplary embodiment, after querying the target error log table according to the target physical address, the method further comprises: reading data at the target logical address in the storage device under the condition that a physical address matched with the target physical address is not inquired from the target error record table; and adding a target record in the target error record table when the occurrence of the uncorrectable error is detected, wherein the target record is used for indicating that the physical page where the target physical address is located has the uncorrectable error.
In one exemplary embodiment, after reading the data at the target logical address in the storage device, the method further comprises: correcting a data read error in the case where the occurrence of the data read error is detected; re-reading the data on the target logical address in the storage device, and performing a check operation on the re-read data, wherein the check operation is used for performing error check on the re-read data; and under the condition that the error correction fails in the verification result of the verification operation, determining that the data on the target logical address has an uncorrectable error.
In an exemplary embodiment, after adding the target record in the target error record table, the method further comprises: and sorting the records according to the size of the physical address recorded by each record in the target error record table.
In an exemplary embodiment, sending the invalid data to the host comprises: and sending invalid data and target indication information to the host end, wherein the target indication information is used for indicating that uncorrectable errors occur in the data read by the read command.
In one exemplary embodiment, determining the target physical address corresponding to the target logical address comprises: and inquiring an address mapping table of the storage device, and converting the target logical address into the corresponding target physical address, wherein the address mapping table is used for recording the mapping relationship between the logical address and the physical address in the storage device.
According to another aspect of the embodiments of the present application, there is also provided a device for processing a read command, including: the storage device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a read command of a host end, and the read command is used for reading data on a target logical address in the storage device; a first determining unit, configured to determine, in response to the read command, a target physical address corresponding to the target logical address; the query unit is used for querying a target error record table according to the target physical address, wherein the target error record table is used for recording the physical address of the uncorrectable error in the storage device; and the sending unit is used for sending invalid data to the host side under the condition that the physical address matched with the target physical address is inquired from the target error record table.
In an exemplary embodiment, the target error record table is used for recording the physical page address of the memory device where the uncorrectable error occurs; the query unit includes: and the query module is used for querying the physical page address containing the target physical address in the target error record table according to the target physical address.
In one exemplary embodiment, the apparatus further comprises: a first reading unit, configured to, after querying the target error record table according to the target physical address, read data at the target logical address in the storage device if a physical address matching the target physical address is not queried from the target error record table; an adding unit, configured to add a target record in the target error record table when an uncorrectable error is detected to occur, where the target record is used to indicate that an uncorrectable error occurs in a physical page where the target physical address is located.
In one exemplary embodiment, the apparatus further comprises: a correcting unit, configured to correct a data read error in the case where the occurrence of the data read error is detected after reading data at the target logical address in the storage device; a second reading unit, configured to re-read data at the target logical address in the storage device; the verification unit is used for performing verification operation on the re-read data, wherein the verification operation is used for carrying out error verification on the re-read data; and the second determining unit is used for determining that the data on the target logical address has an uncorrectable error under the condition that the checking result of the checking operation is error correction failure.
In an exemplary embodiment, after adding the target record in the target error record table, the apparatus further comprises: and the sorting unit is used for sorting the records according to the size of the physical address recorded by each record in the target error record table after the target record is added in the target error record table.
In one exemplary embodiment, the transmitting unit includes: and the sending module is used for sending invalid data and target indication information to the host end, wherein the target indication information is used for indicating that uncorrectable errors occur in the data read by the read command.
In one exemplary embodiment, the first determination unit includes: and the conversion module is used for inquiring an address mapping table of the storage device and converting the target logical address into the corresponding target physical address, wherein the address mapping table is used for recording the mapping relation between the logical address and the physical address in the storage device.
According to another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the processing method of the read command when running.
According to another aspect of the embodiments of the present application, there is also provided an electronic apparatus, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method for processing the read command through the computer program.
In the embodiment of the application, a mode of adding a record table to record a physical address where an uncorrectable error occurs is adopted, and a read command from a host end is received, wherein the read command is used for reading data on a target logical address in a storage device; responding to the read command, and determining a target physical address corresponding to the target logical address; inquiring a target error record table according to the target physical address, wherein the target error record table is used for recording the physical address of the uncorrectable error in the storage device; in the case where a physical address matching the target physical address is found from the target error record table, invalid data is transmitted to the host, since the physical address of the data in which the uncorrectable read error has occurred is recorded, it can be determined whether an uncorrectable read error has occurred for the physical address by querying the record table when data reading is performed, the physical address with uncorrectable reading error does not need to carry out multiple error correction and re-reading operations, invalid data is directly returned, thereby achieving the purposes of reducing unnecessary rereading and error detection operations, achieving the technical effects of improving the data reading efficiency and shortening the response time required by acquiring data, and the problem of low data reading efficiency caused by the fact that error correction needs to be carried out on abnormal data for many times and re-reading operation exists in the processing mode of the read command in the related technology is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
FIG. 1 is a flow chart illustrating an alternative read command processing method according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of physical pages in an alternative storage device according to an embodiment of the present application;
FIG. 3 is a flow chart illustrating an alternative read command processing method according to an embodiment of the application;
FIG. 4 is a flow chart illustrating a method for processing an alternative read command according to an embodiment of the present application;
FIG. 5 is a block diagram of an alternative read command processing apparatus according to an embodiment of the present application;
fig. 6 is a block diagram of an alternative electronic device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to one aspect of the embodiment of the application, a method for processing a read command is provided. Optionally, in this embodiment, the processing method of the read command may be applied to an electronic device including a host and a storage device, where the electronic device may be a terminal device, for example, a Personal Computer (PC), an intelligent terminal, or other terminal devices, and this is not limited in this embodiment.
The processing method of the read command in this embodiment may be executed by the storage device, or may be executed by a control device connected to the storage device. Taking the method for processing the read command in this embodiment executed by the storage device as an example, fig. 1 is a schematic flow chart of an optional method for processing the read command according to this embodiment, and as shown in fig. 1, the flow chart of the method may include the following steps:
step S102, receiving a read command from the host, wherein the read command is used for reading data at a target logical address in the storage device.
The processing method of the read command in this embodiment may be applied to a scenario in which a host reads data stored in a specific logical address in a storage device, where the host and the storage device may be located in the same electronic device, and optionally, the storage device may also be a storage device connected to the electronic device through a data line. The storage device may be a device having a data storage function, for example, an SSD, or may be another device having a similar data storage function, and the SSD is taken as an example in this embodiment for description.
The internal components of the SSD comprise a control chip, a cache chip and a Flash memory chip (Flash) for storing data, and the host end can issue a read command to the SSD for reading the data stored in the Flash chip in the SSD. The control chip of the SSD may receive the read command issued by the host.
It should be noted that what is seen from the perspective of the application program in the computer system is the logical addresses of the memory unit, the storage unit, and the network host, and the required data is obtained by looking up the logical address in the storage device, that is, the read command is used to read the data at the target logical address in the storage device.
Step S104, responding to the read command, and determining a target physical address corresponding to the target logical address.
In response to the received read command, the control chip may determine a target physical address corresponding to the target logical address. The physical address is an address determined by the physical position of the cylinder, head, segment, etc. of the disk, and the read logical address of the data is converted into the corresponding physical address stored on the host address line through the conversion of the addressing mode according to the received read command.
It should be noted that, determining the physical address corresponding to the target logical address may be performed in various manners, for example, may be querying an address mapping table inside the storage device, or may be performed in other manners, for example, by using a transformation formula between the logical address and the physical address, which is not limited in this embodiment.
And step S106, inquiring a target error record table according to the target physical address, wherein the target error record table is used for recording the physical address of the uncorrectable error in the storage device.
In this embodiment, the target Error recording table may be used to record a physical address where an Uncorrectable Error (UNC) occurs in the storage device, for example, a physical address where an Error occurs during data reading and a valid data still cannot be read after performing Error correction, re-reading and Error detection operations, that is, a physical address corresponding to such abnormal data where an Uncorrectable Error occurs.
The control chip can inquire the target error record table according to the target physical address and determine whether a physical address matched with the target physical address exists in the target error record table. Each record in the target error record table may be a physical address or a physical page address. Correspondingly, the determination of whether a physical address matching the target physical address exists in the target error record table may be the determination of whether the same physical address as the target physical address exists in the target error record table, the determination of whether a physical address located in the same physical page as the target physical address exists in the target error record table, or the determination of whether a physical page address including the target physical address exists in the target error record table.
It should be noted that, what is recorded by using the target error record table is the physical address of the UNC that has occurred in the storage device, not the logical address, and the record may be valid all the time, so the target error record table may also be referred to as the UNC record table.
And step S108, sending invalid data to the host end under the condition that the physical address matched with the target physical address is inquired from the target error record table.
If a physical address matching the target physical address, for example, the same physical address, a physical address belonging to the same physical page, a physical page address including the target physical address, or the like, is found from the target error log table, it indicates that an uncorrectable error has occurred in the data at the target physical address, and valid data cannot be read even if the data is read. In this case, the control chip can directly send invalid data to the host, thereby avoiding redundant error correction, re-reading and error detection operations, shortening the response time of data reading, and prolonging the service life of the storage device.
For example, when the physical address corresponding to the data read by the host hits the address in the UNC record table, the UNC error is directly returned to the host without performing processing such as error correction, re-reading, error detection and the like, so that the reading performance can be greatly improved, and the accuracy of abnormal data feedback is also improved.
Receiving a read command from a host, wherein the read command is used for reading data on a target logical address in the storage device; responding to the read command, and determining a target physical address corresponding to the target logical address; inquiring a target error record table according to the target physical address, wherein the target error record table is used for recording the physical address of the uncorrectable error in the storage device; when the physical address matched with the target physical address is inquired from the target error record table, invalid data is sent to the host, and the processing mode of the read command in the related technology has the problems of low data reading efficiency caused by the fact that multiple times of error correction and re-reading operation are needed to be carried out on abnormal data, so that the data reading efficiency is improved, and the response time required for obtaining the data is shortened.
In one exemplary embodiment, determining the target physical address corresponding to the target logical address comprises:
and S11, inquiring an address mapping table of the storage device, and converting the target logical address into a corresponding target physical address, wherein the address mapping table is used for recording the mapping relationship between the logical address and the physical address in the storage device.
In this embodiment, an address mapping table may be used to record the mapping relationship between the logical address and the physical address in the storage device. When determining the physical address corresponding to the target logical address, the address mapping table may be queried to convert the target logical address to the corresponding physical address, i.e., the target physical address.
For example, for the SSD, after receiving the host command, the internal address mapping table (an example of the address mapping table) of the SSD may be queried to obtain the corresponding physical address.
By the embodiment, the read logical address of the data is converted into the corresponding physical address by inquiring the address mapping table, so that the efficiency of address conversion can be improved.
In one exemplary embodiment, when data reading and writing within the storage device are performed, reading and writing may be performed in units of pages (i.e., physical pages). Since the physical states of one page are generally consistent, if a UNC error occurs when a physical address corresponding to a certain logical address is read, UNC generally occurs when another logical address corresponding to the physical page address is read again. Based on this, in the present embodiment, the target error record table may be used to record the physical page address where the uncorrectable error occurs in the storage device, that is, the target error record table records the physical page address where the uncorrectable error occurs in the storage device.
Taking SSD as an example, since the minimum granularity of the general mapping inside SSD is 4KB, i.e., DBU (decibel unit, i.e., measure of voltage ratio), while Flash minimum reads and writes in page unit, the page size is typically 16KB or 32KB, corresponding to at least 4 DBUs in a page. Generally, the physical states of one page are consistent, so if an UNC error occurs when a physical address corresponding to a certain logical address is read, UNC generally occurs when another logical address corresponding to the physical page address is read again. Based on the above, a UNC record table is added inside the SSD, and the physical page address where UNC has occurred is recorded.
Correspondingly, in this embodiment, querying the target error record table according to the target physical address may include:
s21, according to the target physical address, the physical page address containing the target physical address in the target error record table is inquired.
Recorded in the target error record table is the physical page address where the physical address where the UNC error occurred is located. The control chip can inquire the physical page address containing the target physical address in the UNC record table according to the target physical address. If queried (i.e., hit), it may be determined that there is a physical address in the UNC record table that matches the target physical address; otherwise (i.e., a miss), it may be determined that there is no physical address in the UNC record table that matches the target physical address.
Illustratively, the data distribution of a certain page in Flash is shown in fig. 2. If UNC occurs when reading DBUm for the page, UNC will also typically occur when reading DBUx because the grain states are consistent on the same physical page. The physical page address may be recorded in the UNC record table, and when the read operation hits the physical page address, invalid data may be returned directly, and the UNC status may also be returned.
Through the embodiment, the accuracy of judging the physical address with the UNC error can be improved by recording the physical page address where the physical address with the UNC error exists, invalid data reading operation is avoided, and the data reading efficiency is improved.
In an exemplary embodiment, after querying the target error log table according to the target physical address, the method further includes:
s31, reading the data on the target logical address in the storage device under the condition that the physical address matched with the target physical address is not inquired from the target error record table;
s32, when the occurrence of the uncorrectable error is detected, adding a target record in the target error record table, wherein the target record is used for indicating that the uncorrectable error occurs in the physical page where the target physical address is located.
If the physical address matched with the target physical address is not inquired from the UNC record table, the fact that the UNC error does not occur in the physical address or the physical page address where the physical address is located can be determined, and the control chip can read data on the target logical address in the storage device.
If the correct data is read, the control chip can send the read correct data to the host side. If correctable errors occur, the generated errors can be corrected, and correct data read after correction is sent to a host side.
Alternatively, if the occurrence of an uncorrectable error is detected, the control chip may add a new record, i.e., a target record, in the UNC record table, where the target record indicates that an uncorrectable error occurs at the target physical address or the physical page where the target physical address is located.
For example, after receiving a read command from the host, the SSD first checks the address mapping table to obtain a physical address (block, page, offset) corresponding to the logical address; and searching the UNC record table according to the block address and the page address, and determining whether the UNC address is hit. If not, a normal read operation is performed. If UNC still occurs after error correction, rereading, and error detection, the physical addresses (block and page) are recorded in the UNC record table.
According to the embodiment, when the UNC error is detected, a new record is added into the UNC record table to record the physical page address of the UNC, so that the UNC recorded in the UNC record table is updated in real time, the accuracy and comprehensiveness of abnormal data query and matching are improved, and the data reading performance is also improved.
In an exemplary embodiment, after reading the data at the target logical address in the storage device, the method further includes:
s41, correcting the data reading error when detecting the data reading error;
s42, re-reading the data at the target logical address in the storage device, and performing a check operation on the re-read data, wherein the check operation is used for performing error check on the re-read data;
s43, in case that the result of the verification operation is that the error correction fails, determining that an uncorrectable error occurs in the data at the target logical address.
In this embodiment, when reading data at a target logical address in a storage device, if a data read error is detected, the data may be corrected, and data reread (i.e., reread the data at the target logical address in the storage device) and a check operation (i.e., the error detection operation described above) may be performed on the reread data to determine whether UNC occurs on the data at the target logical address. And if the checking result of the checking operation is error correction failure, determining that the data on the target logical address generates the UNC, otherwise, determining that the data on the target logical address does not generate the UNC.
Alternatively, the above-described correction operation, rereading operation, and verification operation may be performed in multiple rounds (the number of times of repeated execution may be flexibly configured as necessary) in order to determine whether UNC occurs in the data to be read.
For example, a control chip of the SSD issues a Flash read command to read data. If an ECC (Error correction Code) Error occurs, re-reading is performed, and whether LDPC (Low Density Parity Check) is performed is determined according to an Error correction condition, where multiple re-reading and multiple LDPC may be required. If the data is successfully corrected, the correct data and the correct state can be returned to the host; invalid data may be returned to the host if UNC occurs, and UNC status may also be returned.
By the embodiment, the data with the read error is corrected and re-read, so that the probability of obtaining effective data in the read operation can be improved.
In an exemplary embodiment, after adding the target record to the target error record table, the method further includes:
s51, the records are sorted according to the size of the physical address recorded by each record in the target error record table.
When adding the target record, the target record may be directly added to the tail or head of the UNC record table without performing other processing on individual records in the UNC record table. Alternatively, the sorting may be performed according to the number of times that each record in the UNC record table is matched, for example, the sorting may be performed according to the number of times that each record is matched.
In this embodiment, in order to ensure convenience of searching the UNC record table and improve the table lookup efficiency, after the target record is added to the UNC record table, the records may be sorted according to the size of the physical address recorded by each record in the UNC record table.
Because the records in the UNC record table are sorted according to the size of the physical address, when table lookup is performed, binary method or other methods can be used for performing fast table lookup. And if the records in the UNC record table are sorted according to the sequence of the physical addresses from small to small, when the first physical address larger than the physical address to be searched is searched, the physical address matched with the physical address to be searched is not searched, and the physical address matched with the physical address to be searched can be determined not to be searched. If the records in the UNC record table are sorted according to the sequence of the physical addresses from small to small, when the first physical address smaller than the physical address to be searched is searched, the physical address matched with the physical address to be searched is not searched, and the physical address matched with the physical address to be searched can be determined not to be searched.
Through the embodiment, the records in the UNC record table are sorted according to the address size, so that the table lookup efficiency can be improved.
In one exemplary embodiment, sending invalid data to the host comprises:
and S61, sending invalid data and target indication information to the host end, wherein the target indication information is used for indicating that uncorrectable errors occur in the data read by the read command.
In addition to sending invalid data to the host, the control chip may send target indication information to the host, where the target indication information may be used to indicate that the read data of the read command has UNC, for example, the target indication information may be indication information of the state of UNC. The invalid data and the target indication information may be sent simultaneously or separately, which is not limited in this embodiment.
Alternatively, the target indication information may also contain information related to the UNC status, for example, information related to the time when UNC occurs (the time may be the time when a record related to the UNC is first added in the UNC record table), the physical page address, and the like.
Through the embodiment, the invalid data and the indication information of the data generation UNC read by the read command are sent to the host side together, so that the host side can conveniently execute subsequent processing operation based on the indication information, and the convenience of information acquisition can be improved.
The following explains a processing method of the read command in the embodiment of the present application with reference to an alternative example. In this alternative example, the storage device is an SSD and the destination error record table is a UNC record table.
For the SSD, an alternative processing manner of the read command may be as shown in fig. 3, and a flow of the processing method of the read command may include the following steps:
step S302, receiving a reading command from the host.
A control chip of the SSD receives a read command from a host, wherein the read command is used for reading data at a logical address in the SSD.
Step S304, looking up the table and obtaining the corresponding physical address.
After receiving the host command, the control chip of the SSD inquires an internal address mapping table to obtain a corresponding physical address.
And step S306, sending a Flash read command to read data.
And the control chip issues a Flash read command, and the Flash chip reads the data stored in the SSD according to the Flash read command.
Step S308, ECC error is generated, and rereading and LDPC are performed.
If ECC error occurs, re-reading is carried out, whether LDPC is carried out or not is determined according to the error correction condition, and multiple re-reading and multiple LDPC are possibly required in the middle, so that the performance of the storage device is lost. When the life cycle of a certain block in Flash is close to the end, reading data on a certain physical address may still fail to read correct data after repeated reading and LDPC reading occur for many times, thereby affecting the read performance of the SSD.
Step S310, judging whether the error correction is successful, if so, executing step S312, otherwise, executing step S314.
And correcting the error of the abnormal data with the read error, and executing the next operation according to the error correction condition.
Step S312, return the correct data and status to the host.
If the error correction succeeds after the abnormal data is re-read and subjected to the LDPC operation, correct data can be read. The control chip sends correct data and correct state to the host computer.
Step S314 returns the invalid data and the UNC status to the host.
And if the error correction of the abnormal data still fails after the rereading and the LDPC operation, determining that UNC occurs in the abnormal data. And the control chip sends invalid data and the UNC state to the host.
In the scheme for improving the SSD read performance provided in this optional example, the physical address where UNC has occurred is recorded by the UNC record table. When the physical address corresponding to the data read by the host hits the address in the UNC record table, the UNC error is directly returned to the host without re-reading and LDPC processing, so that the reading performance is greatly improved.
As shown in fig. 4, the flow of the processing method of the read command in this alternative example may include the following steps:
step S402, the host end issues a read command.
A control chip of the SSD receives a read command from a host, wherein the read command is used for reading data at a logical address in the SSD.
Step S404, looking up the table and obtaining the corresponding physical address.
After receiving the host command, the control chip of the SSD inquires an internal address mapping table to obtain a corresponding physical address.
Step S406, inquiring the UNC record table, detecting whether the UNC record table is hit, if so, executing step S408, otherwise, executing step S410.
Since the physical page address where the physical address where the UNC error occurs is recorded in the UNC record table, whether the physical page address contains the physical address is detected by inquiring whether the UNC table has the physical page address. If yes, go to step S408, otherwise, go to step S410.
Step S408 returns the invalid data and the UNC status to the host.
And if the physical address matched with the target physical address is determined to be inquired in the UNC table through table lookup, and the uncorrectable error of the physical address corresponding to the data is shown, invalid data and the UNC state are sent to the host.
In step S410, a normal read operation is performed.
And if the physical address matched with the target physical address is not found in the UNC table through table lookup, which indicates that the physical address corresponding to the data has no uncorrectable error, performing normal reading operation.
Step S412, determining whether UNC error occurs in data reading, if yes, executing step S414, otherwise, executing step S416.
In the normal reading operation, it can be determined whether correct data is read, and if an ECC error occurs, correct data is read after one or more rounds of re-reading and LDPC. If correct data is not read, it is determined that UNC occurs in data reading, and step S414 is performed, otherwise, if correct data is read, it is determined that UNC does not occur in data reading, and step S416 is performed.
Step S414, the invalid data and the UNC state are returned to the host, and the UNC record table is updated.
If the data reading occurs to the UNC, the control chip returns invalid data and the UNC state to the host end, and updates the error record in the UNC record table.
Step S416, returns the correct data and status to the host.
If the UNC does not occur in the data reading, the data can be read normally, and after the reading operation, the control chip returns correct data and a correct state to the host.
By the present alternative example, the physical address where UNC has occurred is recorded, and the physical page address containing the physical address information is recorded in the UNC record table, and the record is always valid; when the physical address corresponding to the data read by the host hits the address in the UNC record table, the UNC error is directly returned to the host without re-reading and LDPC processing, so that the loss of the storage device is reduced, the response time of data reading is shortened, and the reading performance of the SSD is greatly improved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., a ROM (Read-Only Memory)/RAM (Random Access Memory), a magnetic disk, an optical disk) and includes several instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the methods according to the embodiments of the present application.
According to another aspect of the embodiments of the present application, there is also provided a read command processing apparatus for implementing the method for processing a read command. Fig. 5 is a block diagram of an alternative read command processing apparatus according to an embodiment of the present application, and as shown in fig. 5, the apparatus may include:
a receiving unit 502, configured to receive a read command from a host, where the read command is used to read data at a target logical address in a storage device;
a first determining unit 504, connected to the receiving unit 502, configured to determine, in response to the read command, a target physical address corresponding to the target logical address;
a querying unit 506, connected to the first determining unit 504, configured to query a target error record table according to a target physical address, where the target error record table is used to record a physical address of the storage device where an uncorrectable error occurs;
and a sending unit 508, connected to the querying unit 506, configured to send invalid data to the host if a physical address matching the target physical address is queried from the target error record table.
It should be noted that the receiving unit 502 in this embodiment may be configured to execute the step S102, the first determining unit 504 in this embodiment may be configured to execute the step S104, the querying unit 506 in this embodiment may be configured to execute the step S106, and the sending unit 508 in this embodiment may be configured to execute the step S108.
Receiving a read command from a host through the module, wherein the read command is used for reading data on a target logical address in the storage device; responding to the read command, and determining a target physical address corresponding to the target logical address; inquiring a target error record table according to the target physical address, wherein the target error record table is used for recording the physical address of the uncorrectable error in the storage device; when the physical address matched with the target physical address is inquired from the target error record table, invalid data is sent to the host, and the processing mode of the read command in the related technology has the problems of low data reading efficiency caused by the fact that multiple times of error correction and re-reading operation are needed to be carried out on abnormal data, so that the data reading efficiency is improved, and the response time required for obtaining the data is shortened.
In one exemplary embodiment, the above apparatus includes:
the receiving unit is used for receiving a read command from a host, wherein the read command is used for reading data on a target logical address in the storage device;
a first determining unit configured to determine a target physical address corresponding to the target logical address in response to the read command;
the device comprises a query unit, a storage unit and a processing unit, wherein the query unit is used for querying a target error record table according to a target physical address, and the target error record table is used for recording the physical address of an uncorrectable error in the storage device;
and the sending unit is used for sending invalid data to the host end under the condition that the physical address matched with the target physical address is inquired from the target error record table.
In one exemplary embodiment, the target error log table is used to record the physical page address where an uncorrectable error occurs in the memory device; the query unit includes:
and the query module is used for querying the physical page address containing the target physical address in the target error record table according to the target physical address.
In an exemplary embodiment, the apparatus further includes:
a first reading unit, configured to, after querying a target error record table according to a target physical address, read data at a target logical address in a storage device if a physical address matching the target physical address is not queried from the target error record table;
and the adding unit is used for adding a target record in the target error record table under the condition that the occurrence of the uncorrectable error is detected, wherein the target record is used for indicating that the physical page where the target physical address is located has the uncorrectable error.
In an exemplary embodiment, the apparatus further includes:
a correcting unit for correcting a data read error in the case where an occurrence of the data read error is detected after reading data at a target logical address in the memory device;
the second reading unit is used for re-reading the data on the target logical address in the storage device;
the verifying unit is used for performing verifying operation on the re-read data, wherein the verifying operation is used for performing error verification on the re-read data;
and the second determination unit is used for determining that the data on the target logical address has an uncorrectable error under the condition that the checking result of the checking operation is error correction failure.
In an exemplary embodiment, after adding the target record in the target error record table, the apparatus further comprises:
and the sorting unit is used for sorting the records according to the size of the physical address recorded by each record in the target error record table after the target record is added in the target error record table.
In one exemplary embodiment, the transmitting unit includes:
and the sending module is used for sending invalid data and target indication information to the host end, wherein the target indication information is used for indicating that uncorrectable errors occur in the data read by the read command.
In one exemplary embodiment, the first determination unit includes:
the conversion module is used for inquiring an address mapping table of the storage device and converting the target logical address into a corresponding target physical address, wherein the address mapping table is used for recording the mapping relation between the logical address and the physical address in the storage device.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules may be implemented by software or hardware, where the hardware environment includes a network environment.
According to still another aspect of an embodiment of the present application, there is also provided a storage medium. Optionally, in this embodiment, the storage medium may be configured to execute a program code of a processing method of any read command in this embodiment of the present application.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
s1, receiving a read command from the host, wherein the read command is used for reading data on a target logical address in the storage device;
s2, responding to the read command, and determining a target physical address corresponding to the target logical address;
s3, inquiring a target error record table according to the target physical address, wherein the target error record table is used for recording the physical address of the uncorrectable error in the storage device;
s4, when the physical address matching the target physical address is found from the target error log table, sends invalid data to the host.
Optionally, the specific example in this embodiment may refer to the example described in the above embodiment, which is not described again in this embodiment.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing program codes, such as a U disk, a ROM, a RAM, a removable hard disk, a magnetic disk, or an optical disk.
According to another aspect of the embodiments of the present application, there is also provided an electronic device for implementing the method for processing a read command, where the electronic device may be a server, a terminal, or a combination thereof.
Fig. 6 is a block diagram of an alternative electronic apparatus according to an embodiment of the present invention, as shown in fig. 6, including a processor 602 (which may be an example of the host), a communication interface 604, a memory 606 (which may be an example of the storage device), and a communication bus 608, where the processor 602, the communication interface 604, and the memory 606 communicate with each other through the communication bus 608, where,
a memory 706 for storing computer programs;
the processor 706, when executing the computer program stored in the memory 706, implements the following steps:
s1, receiving a read command from the host, wherein the read command is used for reading data on a target logical address in the storage device;
s2, responding to the read command, and determining a target physical address corresponding to the target logical address;
s3, inquiring a target error record table according to the target physical address, wherein the target error record table is used for recording the physical address of the uncorrectable error in the storage device;
s4, when the physical address matching the target physical address is found from the target error log table, sends invalid data to the host.
Alternatively, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 6, but this is not intended to represent only one bus or type of bus. The communication interface is used for communication between the electronic device and other equipment.
The memory may include an SSD, or other storage components with data storage capabilities. Alternatively, the memory may be at least one memory device located remotely from the processor.
As an example, the memory 606 may include, but is not limited to, the receiving unit 502, the first determining unit 504, the querying unit 506, and the sending unit 508 in the processing device of the read command. In addition, the module unit may further include, but is not limited to, other module units in the processing apparatus of the read command, which is not described in this example again.
The processor may be a general-purpose processor, and may include but is not limited to: a CPU (Central Processing Unit), an NP (Network Processor), and the like; but also a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 6 is only an illustration, and the device implementing the processing method of the read command may be a terminal device, and the terminal device may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 6 is a diagram illustrating a structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 6, or have a different configuration than shown in FIG. 6.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disk, ROM, RAM, magnetic or optical disk, and the like.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including instructions for causing one or more computer devices (which may be personal computers, servers, network devices, or the like) to execute all or part of the steps of the method described in the embodiments of the present application.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, and may also be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method for processing a read command, comprising:
receiving a read command from a host, wherein the read command is used for reading data at a target logical address in a storage device;
responding to the read command, and determining a target physical address corresponding to the target logical address; inquiring a target error record table according to the target physical address, wherein the target error record table is used for recording the physical address of the uncorrectable error in the storage device;
and sending invalid data to the host side under the condition that the physical address matched with the target physical address is inquired from the target error record table.
2. The method of claim 1, wherein the target error log table is used for recording physical page addresses where uncorrectable errors occur in the storage device;
querying the target error record table according to the target physical address comprises:
and inquiring the physical page address containing the target physical address in the target error record table according to the target physical address.
3. The method of claim 1, wherein after querying the target error log table by the target physical address, the method further comprises:
reading data at the target logical address in the storage device under the condition that a physical address matched with the target physical address is not inquired from the target error record table; and adding a target record in the target error record table when the occurrence of the uncorrectable error is detected, wherein the target record is used for indicating that the physical page where the target physical address is located has the uncorrectable error.
4. The method of claim 3, wherein after reading the data at the target logical address in the storage device, the method further comprises:
correcting a data read error in the case where the occurrence of the data read error is detected;
re-reading the data on the target logical address in the storage device, and performing a check operation on the re-read data, wherein the check operation is used for performing error check on the re-read data;
and under the condition that the error correction fails in the verification result of the verification operation, determining that the data on the target logical address has an uncorrectable error.
5. The method of claim 3, wherein after adding the target record in the target error record table, the method further comprises:
and sorting the records according to the size of the physical address recorded by each record in the target error record table.
6. The method of claim 1, wherein sending the invalid data to the host comprises:
and sending invalid data and target indication information to the host end, wherein the target indication information is used for indicating that uncorrectable errors occur in the data read by the read command.
7. The method of any of claims 1 to 6, wherein determining the target physical address corresponding to the target logical address comprises:
and inquiring an address mapping table of the storage device, and converting the target logical address into the corresponding target physical address, wherein the address mapping table is used for recording the mapping relationship between the logical address and the physical address in the storage device.
8. An apparatus for processing a read command, comprising:
the storage device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a read command of a host end, and the read command is used for reading data on a target logical address in the storage device;
a first determining unit, configured to determine, in response to the read command, a target physical address corresponding to the target logical address;
the query unit is used for querying a target error record table according to the target physical address, wherein the target error record table is used for recording the physical address of the uncorrectable error in the storage device;
and the sending unit is used for sending invalid data to the host side under the condition that the physical address matched with the target physical address is inquired from the target error record table.
9. A computer-readable storage medium, comprising a stored program, wherein the program when executed performs the method of any of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 7 by means of the computer program.
CN202111075655.1A 2021-09-14 2021-09-14 Method and device for processing read command, storage medium and electronic device Pending CN113791930A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111075655.1A CN113791930A (en) 2021-09-14 2021-09-14 Method and device for processing read command, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111075655.1A CN113791930A (en) 2021-09-14 2021-09-14 Method and device for processing read command, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN113791930A true CN113791930A (en) 2021-12-14

Family

ID=78880231

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111075655.1A Pending CN113791930A (en) 2021-09-14 2021-09-14 Method and device for processing read command, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN113791930A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104021806A (en) * 2014-05-16 2014-09-03 华为技术有限公司 Data processing method and data processing equipment
CN105308575A (en) * 2013-08-06 2016-02-03 桑迪士克科技股份有限公司 Method and device for error correcting code (ECC) error handling
CN106936781A (en) * 2015-12-29 2017-07-07 亿阳安全技术有限公司 A kind of decision method and device of user's operation behavior
CN106981314A (en) * 2017-03-10 2017-07-25 记忆科技(深圳)有限公司 A kind of method of the quick error correction of solid state hard disc
CN108399134A (en) * 2017-02-06 2018-08-14 三星电子株式会社 The operating method of storage device and storage device
CN109491820A (en) * 2018-11-06 2019-03-19 湖南国科微电子股份有限公司 A kind of solid state hard disk read error processing method
CN110109714A (en) * 2019-04-25 2019-08-09 深圳忆联信息系统有限公司 Promote method, apparatus, computer equipment and the storage medium of firmware loads efficiency
CN112579329A (en) * 2019-09-29 2021-03-30 北京忆恒创源科技有限公司 Method for rapidly processing UECC and storage device thereof

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105308575A (en) * 2013-08-06 2016-02-03 桑迪士克科技股份有限公司 Method and device for error correcting code (ECC) error handling
CN104021806A (en) * 2014-05-16 2014-09-03 华为技术有限公司 Data processing method and data processing equipment
CN106936781A (en) * 2015-12-29 2017-07-07 亿阳安全技术有限公司 A kind of decision method and device of user's operation behavior
CN108399134A (en) * 2017-02-06 2018-08-14 三星电子株式会社 The operating method of storage device and storage device
CN106981314A (en) * 2017-03-10 2017-07-25 记忆科技(深圳)有限公司 A kind of method of the quick error correction of solid state hard disc
CN109491820A (en) * 2018-11-06 2019-03-19 湖南国科微电子股份有限公司 A kind of solid state hard disk read error processing method
CN110109714A (en) * 2019-04-25 2019-08-09 深圳忆联信息系统有限公司 Promote method, apparatus, computer equipment and the storage medium of firmware loads efficiency
CN112579329A (en) * 2019-09-29 2021-03-30 北京忆恒创源科技有限公司 Method for rapidly processing UECC and storage device thereof

Similar Documents

Publication Publication Date Title
US8429468B2 (en) System and method to correct data errors using a stored count of bit values
US7971112B2 (en) Memory diagnosis method
US7725805B2 (en) Method and information apparatus for improving data reliability
CN109785893B (en) Redundancy storage of error correction code check bits for verifying proper operation of memory
CN111104246B (en) Method, device, computer equipment and storage medium for improving verification efficiency of error detection and correction of DRAM
CN111506452B (en) Data storage protection method, device, computer equipment and storage medium
CN103077095A (en) Error correction method and device for stored data and computer system
US20080140869A1 (en) Circuits and Methods for Correcting Errors in Downloading Firmware
US8566689B2 (en) Data integrity units in nonvolatile memory
US8738989B2 (en) Method and apparatus for detecting free page and a method and apparatus for decoding error correction code using the method and apparatus for detecting free page
CN109918221B (en) Hard disk error reporting analysis method, system, terminal and storage medium
CN113791930A (en) Method and device for processing read command, storage medium and electronic device
CN110955916B (en) Data integrity protection method, system and related equipment
CN116935940A (en) Error correction code verification
CN107844273B (en) Data writing method and device and verification method and device
CN115729746A (en) Data storage protection method based on CRC and ECC
CN114442953A (en) Data verification method, system, chip and electronic equipment
CN110471818B (en) Method, device and equipment for marking error physical address of flash memory
US11609813B2 (en) Memory system for selecting counter-error operation through error analysis and data process system including the same
CN117079703B (en) Method and device for testing embedded memory of chip and electronic equipment
US11494262B2 (en) Electronic device having one-time-programmable (OTP) memory and method for writing and reading OTP memory
US20230386598A1 (en) Methods for real-time repairing of memory failures caused during operations, memory systems performing repairing methods, and data processing systems including repairing memory systems
CN110321073B (en) Data storage method, device and equipment of flash memory
CN115827304A (en) System and method for checking on-chip high-speed bus data
CN117711475A (en) Fault detection circuit and method of storage unit and functional chip

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 1202, Floor 12, Building 3, No. 126, Yueda Lane, Changhe Street, Binjiang District, Hangzhou City, Zhejiang Province, 310051

Applicant after: Zhejiang Huayi Core Technology Co.,Ltd.

Address before: 310013 room 512, building 2, No. 2930, South Ring Road, Puyan street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant before: Zhejiang Dahua Technology Co.,Ltd.

CB02 Change of applicant information