Table data error correction method, system, device and storage medium
By detecting and correcting erroneous physical addresses in table data, and using bit flipping and re-parsing technology, the problem of low error correction efficiency in the existing technology is solved, error correction of a large number of physical address errors is realized, and source data loss is avoided.
Patent Information
- Application Number
- CN202010847678.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-19
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-08-19
AI Technical Summary
The existing technology can only perform error correction on table data when a small number of physical addresses are in error. The error correction efficiency is low and cannot effectively handle the situation when a large number of physical addresses are in error, resulting in the loss of source data.
By detecting erroneous physical addresses in the table data, using bit flipping and re-parsing technology, the data identifier is extracted, and error correction is performed based on the preset logical address, and the mapping relationship is updated to complete the error correction.
It improves the efficiency of table data error correction, can handle the situation where there are many physical address errors, avoids the loss of source data, and improves the speed of the error correction process.
Smart Images

Figure CN111984451B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data storage, and in particular to a table data error correction method, system, terminal equipment and computer storage medium. Background Art
[0002] In the process of storing the source data provided by the data owner (host) in a storage device, a mapping relationship is usually established between the source data and the physical address of the source data in the storage device. For example, one or more mapping relationship tables are developed in an independent storage space of the storage device, and then the physical storage address is saved in the mapping relationship table. Therefore, when the source data needs to be extracted from the storage device, the physical address can be determined directly by reading the table data of the mapping relationship table, thereby quickly locating the source data and extracting the data.
[0003] However, in actual application, errors may occur when reading table data. If the table data cannot be corrected, it will easily lead to the loss of source data corresponding to the physical address on the mapping table. Although the existing storage device itself can correct the table data through the hardware module, thereby restoring the successful reading of the table data, the above method can only correct the table data in the case of a small number of physical address errors.
[0004] In summary, the existing error correction method for table data is limited to correcting table data when the amount of physical address errors is small (the amount of table data errors is within the range that the storage device can correct based on its own hardware). When a large number of physical address errors occur in the table data, the above method will not be able to complete the error correction, and the error correction efficiency is low. Summary of the invention
[0005] The main purpose of the present invention is to provide a table data error correction method, device, terminal device and computer storage medium, aiming to solve the technical problem in the prior art that the table data can only be corrected for a small number of physical addresses that are erroneous based on the storage device's own hardware, resulting in low error correction efficiency.
[0006] To achieve the above object, the present invention provides a method for correcting errors in table data, the method comprising:
[0007] When a table data reread error is detected, determining an error physical address in the table data, wherein the error physical address is identified by bytes;
[0008] Performing bit flipping on the byte corresponding to the erroneous physical address, and re-parsing to obtain the physical address to be confirmed;
[0009] Extracting a data identifier according to the physical address to be confirmed;
[0010] If the data identifier matches the preset logical address, the table data is reconstructed using the physical address to be confirmed to complete error correction.
[0011] Further, before the step of determining the erroneous physical address in the table data when a table data reread error is detected, the method further includes:
[0012] The physical addresses of the storage device storing the source data are organized into sets and identified with bytes, and the bytes are encapsulated to form table data, wherein the physical address includes one or more of a channel, a logical unit number, a row address, and a cluster offset.
[0013] Further, before the step of determining the erroneous physical address in the table data when a table data reread error is detected, the method further includes:
[0014] After the storage device performs decoding and error correction on the table data based on a preset hardware error correction module, it detects whether the table data has a reread error.
[0015] Furthermore, there is a mutual mapping relationship between the preset logical address and the erroneous physical address.
[0016] If the data identifier matches the preset logical address, the step of reconstructing the table data using the physical address to be confirmed to complete the error correction includes:
[0017] If it is detected that the data identifier matches the preset logical address mapped to the erroneous physical address, it is determined that the physical address to be confirmed is restored to normal;
[0018] Replacing the erroneous physical address with the restored normal physical address to be confirmed to construct new table data;
[0019] The mapping relationship is updated based on the new table data to complete error correction.
[0020] Furthermore, the step of determining the erroneous physical address in the table data includes:
[0021] Parsing the bytes in the table data in sequence to obtain the physical addresses of the byte identifiers;
[0022] Extracting a data identifier according to the physical address of the byte identifier;
[0023] If the data identifier does not match the preset logical address, it is determined that the physical address of the current byte identifier is an erroneous physical address.
[0024] Furthermore, the step of re-parsing to obtain the physical address to be confirmed includes:
[0025] Reparse the bytes formed by bit flipping to get the default physical address;
[0026] If it is detected that the default physical address is a legal address, the default physical address is marked as a physical address to be confirmed.
[0027] Furthermore, the step of extracting the data identifier according to the physical address to be confirmed includes:
[0028] Performing a read operation on the physical address to be confirmed to detect whether the physical address to be confirmed carries a data identifier;
[0029] If so, the data identifier is extracted.
[0030] In addition, to achieve the above-mentioned purpose, the present invention further provides an error correction system for table data, the error correction system for table data comprising:
[0031] A determination module, configured to determine an erroneous physical address in the table data when a table data reread error is detected, wherein the erroneous physical address is identified by a preset byte;
[0032] A correction module, used for performing bit flipping on the byte corresponding to the erroneous physical address, and re-analyzing to obtain the physical address to be confirmed;
[0033] An extraction module, used for extracting a data identifier according to the physical address to be confirmed;
[0034] The reconstruction module is used to reconstruct the table data using the physical address to be confirmed to complete error correction if the data identifier matches the preset logical address.
[0035] Each functional module of the table data error correction system of the present invention implements the steps of the table data error correction method as described above during operation.
[0036] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal device, which includes: a memory, a processor, and an error correction program for table data stored in the memory and executable on the processor, wherein the error correction program for table data, when executed by the processor, implements the steps of the error correction method for table data as described above.
[0037] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the error correction method for table data as described above are implemented.
[0038] The table data error correction method, system, terminal device and computer storage medium proposed in the present invention determine the erroneous physical address in the table data when a table data reread error is detected, wherein the erroneous physical address is identified by bytes; perform bit flipping on the bytes corresponding to the erroneous physical address, and reparse to obtain the physical address to be confirmed; extract the data identifier according to the physical address to be confirmed; if the data identifier matches the preset logical address, reconstruct the table data using the physical address to be confirmed to complete the error correction.
[0039] When the present invention detects that the storage device has repeated errors that cannot be corrected by itself for table data (the table data is used to represent the mapping relationship between the logical address of the source data and the physical address of the source data in the storage device), it detects and determines the erroneous physical address in which the error occurs among multiple physical addresses (each physical address is identified in the form of bytes) encapsulated by the table data, then performs bit flipping on the byte identifying the erroneous physical address, re-parses the new byte obtained after the bit flipping to obtain a legal physical address to be confirmed, extracts the data identifier through the physical address to be confirmed, then compares the data identifier to see if it matches the preset logical address, and when it is found that the data identifier matches the preset logical address, the physical address to be confirmed is used to reconstruct the table data to update the mapping relationship, thereby completing the error correction of the reread erroneous table data.
[0040] Compared with the existing error correction method based only on its own hardware decoding, the present invention identifies the physical address mapped to the logical address of the source data in byte form, thereby locating the physical address where the error occurs, performing bit flipping on the byte corresponding to the erroneous physical address to re-parse and recover the new physical address, and reconstructing the table data based on the new physical address to update the mapping relationship to complete the error correction of the table data. Not only can it correct the table data with more physical address errors, but it can also complete the error correction process of the table data more quickly, thereby improving the error correction efficiency of the table data and effectively avoiding the situation where the storage device is unable to correct the table data with a large number of physical address errors based on its own hardware, thereby causing the loss of source data. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a schematic diagram of the structure of the hardware operation of the terminal device involved in the embodiment of the present invention;
[0042] Figure 2 It is a flow chart of an embodiment of a method for correcting errors in table data of the present invention;
[0043] Figure 3 It is a detailed flow chart of step S400 in an embodiment of a method for correcting errors in table data of the present invention;
[0044] Figure 4 It is a schematic diagram of the module structure of a table data error correction system of the present invention.
[0045] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0046] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0047] like Figure 1 As shown, Figure 1 It is a structural diagram of the hardware operating environment of the terminal device involved in the embodiment of the present invention.
[0048] It should be noted that Figure 1 The terminal device of the embodiment of the present invention can be a data storage control terminal, a PC, a portable computer and other terminal devices.
[0049] like Figure 1 As shown, the terminal device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0050] Those skilled in the art will understand that Figure 1 The terminal device structure shown in the figure does not constitute a limitation on the terminal device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0051] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a distributed task processing program. Among them, the operating system is a program that manages and controls the hardware and software resources of the sample terminal device, and supports the operation of the distributed task processing program and other software or programs.
[0052] exist Figure 1 In the terminal device shown, the user interface 1003 is mainly used to communicate data with each terminal; the network interface 1004 is mainly used to connect to the backend server and communicate data with the backend server; and the processor 1001 can be used to call the error correction program of the table data stored in the memory 1005 and perform the following operations:
[0053] When a table data reread error is detected, determining an error physical address in the table data, wherein the error physical address is identified by bytes;
[0054] Performing bit flipping on the byte corresponding to the erroneous physical address, and re-parsing to obtain the physical address to be confirmed;
[0055] Extracting a data identifier according to the physical address to be confirmed;
[0056] If the data identifier matches the preset logical address, the table data is reconstructed using the physical address to be confirmed to complete error correction.
[0057] Further, the processor 1001 may call the error correction program of the table data stored in the memory 1005, and before determining the error physical address in the table data when a table data reread error is detected, further perform the following operations:
[0058] The physical addresses of the storage device storing the source data are organized into sets and identified with bytes, and the bytes are encapsulated to form table data, wherein the physical address includes one or more of a channel, a logical unit number, a row address, and a cluster offset.
[0059] Further, the processor 1001 may call the error correction program of the table data stored in the memory 1005, and before executing the step of determining the error physical address in the table data when a table data reread error is detected, further perform the following operations:
[0060] After the storage device performs decoding and error correction on the table data based on a preset hardware error correction module, it detects whether the table data has a reread error.
[0061] Furthermore, there is a mutual mapping relationship between the preset logical address and the erroneous physical address, and the processor 1001 may call the error correction program of the table data stored in the memory 1005, and further perform the following operations:
[0062] If it is detected that the data identifier matches the preset logical address mapped to the erroneous physical address, it is determined that the physical address to be confirmed is restored to normal;
[0063] Replacing the erroneous physical address with the restored normal physical address to be confirmed to construct new table data;
[0064] The mapping relationship is updated based on the new table data to complete error correction.
[0065] Furthermore, the processor 1001 may call the error correction program of the table data stored in the memory 1005, and further perform the following operations:
[0066] Parsing the bytes in the table data in sequence to obtain the physical addresses of the byte identifiers;
[0067] Extracting a data identifier according to the physical address of the byte identifier;
[0068] If the data identifier does not match the preset logical address, it is determined that the physical address of the current byte identifier is an erroneous physical address.
[0069] Furthermore, the processor 1001 may call the error correction program of the table data stored in the memory 1005, and further perform the following operations:
[0070] Reparse the bytes formed by bit flipping to get the default physical address;
[0071] If it is detected that the default physical address is a legal address, the default physical address is marked as a physical address to be confirmed.
[0072] Furthermore, the processor 1001 may call the error correction program of the table data stored in the memory 1005, and further perform the following operations:
[0073] Performing a read operation on the physical address to be confirmed to detect whether the physical address to be confirmed carries a data identifier;
[0074] If so, the data identifier is extracted.
[0075] Based on the above structure, various embodiments of the table data error correction method of the present invention are proposed.
[0076] Please refer to Figure 2 , Figure 2 It is a flowchart diagram of a first embodiment of a method for correcting table data of the present invention.
[0077] The embodiment of the present invention provides an embodiment of a method for correcting errors in table data. It should be noted that although a logical order is shown in the flow chart, in some cases, the steps shown or described may be executed in an order different from that shown here.
[0078] The error correction method for table data in the embodiment of the present invention is applied to the above-mentioned terminal device for controlling data storage. The terminal device in the embodiment of the present invention can be a data storage control terminal, a PC, a portable computer and other terminal devices, and no specific limitation is made here.
[0079] The error correction method of the table data in this embodiment includes:
[0080] Step S100, when a table data reread error is detected, determining an erroneous physical address in the table data, wherein the erroneous physical address is identified by bytes;
[0081] When the current terminal device detects that an error occurs when the storage device rereads the table data, the current terminal device immediately starts to determine all erroneous physical addresses that cause the storage device to reread the table data in error from multiple physical addresses encapsulated and stored in the table data.
[0082] It should be noted that, in the present embodiment, the table data is used to identify the mapping relationship between the source data logical address and the physical address of the source data in the solid state storage in the storage device, that is, the physical address encapsulated in the table data is respectively mapped to the logical address of the source data. In addition, in the table data, each physical address is identified in the form of bytes. For example, when the table data is managed in 2KB (kilobyte, unit of measurement, 2KB=2048byte), a mapped physical address is identified by every 4 bytes. It should be understood that, based on the different design needs of actual applications, in other feasible implementations, the table data can of course be managed in other unit sizes, and in the table data, of course, bytes of other digits can be used to identify a physical address. The error correction method for the table data in the embodiment of the present invention does not specifically limit the size of the table data and the number of bytes in the table data that identify the physical address mapped to the logical address of the source data.
[0083] Furthermore, in a feasible embodiment, before the above step S100, the table data error correction method of the embodiment of the present invention may further include:
[0084] Step S500, organize the physical addresses of the storage device storing source data into sets and identify them with bytes, and encapsulate the bytes to form table data, wherein the physical address includes one or more of a channel, a logical unit number, a row address and a cluster offset.
[0085] Before the current terminal device detects whether an error occurs when the storage device rereads the table data, the physical address of the source data stored in the storage device in a solid state, such as the channel, logical unit number, row address and / or cluster offset, is integrated into a set, and then the physical address is identified in the form of bytes, and the bytes are encapsulated to form table data.
[0086] Specifically, for example, the current terminal device integrates the physical address mapped by the logical address (logical address 0 to 7) of a sector source data, namely the channel, logical unit number lun, row address-row and cluster offset to form a set, and then represents the set with 4 bytes (wherein the third byte can represent the cluster offset) to identify the physical address based on the 4 bytes, and then, the current terminal device develops one or more blank tables of 2KB in size in an independent storage space of the storage device, and finally, the current terminal device encapsulates the 4 bytes identifying each physical address in sequence on the blank table (one table can encapsulate 4 bytes identifying 512 physical addresses, and after one table is filled, continue to develop a new blank table to encapsulate other bytes identifying the physical address), thereby encapsulating the blank table to form tabular data in which one physical address is identified by every 4 bytes, and represents the mapping relationship between the logical address and the physical address based on the tabular data.
[0087] In this embodiment, the physical addresses mapped to the logical addresses of the source data are represented in a set manner, that is, the channel, logical unit number, row address and cluster offset are identified by bytes. In this way, when it is subsequently detected that a table data reread error is caused by an error in the physical address of a large amount of data, the bytes identifying the erroneous physical address are directly bit-flipped to restore the correct physical address for error correction of the data table, thereby ensuring the normal implementation of error correction of the table data when an error occurs in the physical address of a large amount of data in the table data.
[0088] It should be noted that, in this embodiment, when the current terminal device is used to perform error correction on the table data in case of an error in the mapping relationship between the logical address of the source data and the physical address where the source data is stored in the solid state in the storage device, and the error is an error that the storage device cannot successfully correct based on its own hardware (the storage device can only correct errors in a small number of physical addresses in the table data based on its own hardware, and when a large number of physical addresses in the table data are all wrong, the storage device cannot implement the error correction process), error correction is performed on the table data to ensure that the mapping relationship between the logical address and the physical address is normal, and to ensure that the source data will not be accidentally lost due to an error in the mapping relationship. In addition, the current terminal device is connected to the storage device.
[0089] Further, in a feasible embodiment, in the above step S100, when a table data reread error is detected, before determining an erroneous physical address in the table data, the table data error correction method of the embodiment of the present invention may further include:
[0090] Step S600 , after the storage device performs decoding and error correction on the table data based on a preset hardware error correction module, it is detected whether the table data has a reread error.
[0091] After the current terminal device encapsulates the bytes identifying the physical address in the independent storage space of the storage device to form table data, if the source data cannot be extracted based on the table data, the storage device first corrects the erroneous physical address in the table data based on its own integrated preset hardware error correction module. Then, after the storage device completes the error correction based on the preset error correction module, the current terminal device starts to detect whether a reread error still occurs when the storage device rereads the table data.
[0092] It should be noted that, in the present embodiment, the preset hardware error correction module is a functional module preset by the storage device itself based on hard decoding or soft decoding, which performs an error correction process for errors in the physical address of a small amount of data in the table data. For example, the preset hardware error correction module can specifically be a functional module based on the LDPC (LowDensity Parity Check Code) error correction algorithm integrated in the storage device.
[0093] In this embodiment, when the storage device extracts source data based on the physical address encapsulated in the table data, if it is found that the read source data is erroneous, that is, it is determined that the physical address in the table data is erroneous, resulting in the inability to correctly extract the source data. Thus, the storage device first starts to perform error correction on the table data by hard decoding (or soft decoding) based on its own preset functional module based on the LDPC error correction algorithm. After the error correction process is completed, the current terminal device connected to the storage device immediately controls the storage device to perform a reread operation on the table data again, thereby detecting whether the table data after the storage device's own hardware error correction will still have a reread error.
[0094] Furthermore, in a feasible embodiment, the current terminal device records the amount of error in the table data when an error occurs when the storage device rereads the table data. Then, the current terminal device determines all the erroneous physical addresses that cause errors in rereading the table data from the table data with the smallest error amount, for subsequent bit flipping of the byte identifying the erroneous physical address.
[0095] Specifically, for example, in the process of the current terminal device rereading the table data multiple times by adjusting voltages of different sizes in the storage device - storage medium Nnad Flash, the different error amounts (number of error bits) of the table data obtained by rereading the storage medium Nnad Flash based on different voltages each time are recorded. Then, the current terminal device determines the error physical addresses among all the stored physical addresses in sequence based on comparing the sizes of the error amounts and from the table data corresponding to the smallest error amount.
[0096] In this embodiment, by determining the erroneous physical address corresponding to the minimum error amount of the reread table data, a subsequent bit flipping operation is performed on the byte identifying the erroneous physical address, which greatly reduces the workload of bit flipping and is beneficial to improving the overall error correction efficiency for the table data.
[0097] Further, in a feasible embodiment, in step S100, the step of “determining an erroneous physical address in the table data” may include:
[0098] Step S101, parse the bytes in the table data in sequence to obtain the physical address of the byte identifier;
[0099] Step S102, extracting a data identifier according to the physical address of the byte identifier;
[0100] It should be noted that in this embodiment, when the current terminal device detects the storage device and detects that the table data still rereads errors after the storage device corrects the errors based on its own hardware error correction module, it determines that the storage device has not successfully corrected the table data based on its own hardware error correction module, and thus begins to locate the erroneous physical address of the table data where the error occurs and causes the table data to reread errors. In addition, the data identifier is a portion of redundant data existing in each physical address, and the redundant data is used to represent the logical address of the source data mapped to the physical address (the logical address of a sector of source data).
[0101] The current terminal device sequentially extracts and parses the bytes identifying each physical address from the bytes identifying the physical address encapsulated in the table data, thereby sequentially obtaining all the physical addresses identified by the byte, and sequentially reading out the data identifiers carried in the physical addresses.
[0102] Specifically, for example, the current terminal device extracts 2KB of table data from the independent storage space of the storage device, and parses 4 bytes in sequence each time to obtain all 512 physical addresses in the order that each 4 bytes on the table data identifies a physical address. After the current terminal device obtains a physical address each time, it immediately performs a read operation on the physical address, thereby extracting the redundant data carried in the physical address, that is, the logical address of the source data mapped by the physical address (e.g., logical addresses 0 to 7).
[0103] Step S103: If the data identifier does not match the preset logical address, it is determined that the physical address of the current byte identifier is an erroneous physical address.
[0104] It should be noted that, in this embodiment, the preset logical address is the logical address of the source data mapped to the physical address parsed by the current terminal device.
[0105] After the current terminal device reads the data identifier to be written in the physical address obtained from the parsed bytes, the current terminal device further compares the data identifier with the logical address of the source data mapped by the physical address, thereby detecting whether the data identifier matches the logical address. If it is detected that the data identifier does not match the logical address, it can be determined that the physical address is an erroneous physical address that causes a table data reread error.
[0106] Specifically, for example, the logical address of the source data mapped by the current physical address is logical addresses 8 to 15. After the current terminal device reads the redundant data carried by the current physical address, that is, the logical address of the source data mapped by the current physical address (logical addresses 0 to 7), from the current physical address obtained based on the sequential parsing of 4 bytes, the current terminal device compares the logical address with the logical addresses 8 to 15 of the source data mapped by the current physical address, and detects that the logical addresses 0 to 7 do not match the logical addresses 8 to 15. The current terminal device can then determine that the current physical address is an erroneous physical address that causes a table data reread error.
[0107] Furthermore, in another feasible embodiment, when the current terminal device detects that the data identifier carried in the current physical address matches the logical address of the source data mapped by the current physical address, the current terminal device immediately skips the current physical address and continues to detect whether the next physical address is an erroneous physical address.
[0108] It should be noted that, in this embodiment, since the amount of data with errors in the table data is random, and the physical address where the error occurs is also random, for example, in the table data of 2KB, there may be 512 bits with errors in the physical address, and the 512 erroneous bits are just distributed in 512 physical addresses identified by 4 bytes, which will cause all 512 physical addresses in the table data to be erroneous. Therefore, based on the random uncertainty of the erroneous bits of each byte in the table data, when the current terminal device detects that the table data still has a reread error after the storage device corrects the error based on its own hardware error correction module, the current terminal device needs to parse the physical address identified by each 4 bytes in sequence, so as to achieve comprehensive and accurate positioning of all erroneous physical addresses in the table data.
[0109] Step S200, performing bit flipping on the byte corresponding to the erroneous physical address, and re-analyzing to obtain the physical address to be confirmed;
[0110] After the current terminal device determines all the erroneous physical addresses in the table data, it extracts the bytes identifying each erroneous physical address from the table data in turn, then performs a bit flip operation on the byte based on the existing mature bit flipping algorithm, and finally, re-parses the byte obtained after the bit flipping operation to obtain the physical address to be confirmed that is restored to normal based on the bit flipping.
[0111] It should be noted that, in this embodiment, bit flipping is often referred to as bit inversion. Since the physical address is identified by bytes in a set manner, each byte consists of 8 bits, and each bit is filled with "0" or "1". Therefore, in the process of correcting the erroneous physical address to restore the correct physical address, the "0" and "1" on the 4 bytes and 32 bits that identify the erroneous physical address are bit flipped, that is, the "1" on the occupied bit is flipped to "0" and the "0" on the occupied bit is flipped to "1".
[0112] Further, in a feasible embodiment, in the above step S200, the step of "re-parsing to obtain the physical address to be confirmed" includes:
[0113] Step S201, re-analyzing the bytes formed by bit flipping to obtain a default physical address;
[0114] After the current terminal device performs bit flipping on the byte identifying the wrong physical address, it reparses the byte formed by the bit flipping to obtain a default physical address according to the rule of using bytes to identify the physical address in a set form.
[0115] Specifically, for example, the current terminal device performs bit flipping on the "0" and "1" on the occupied bits of the 4-byte 32 bits "00011001 00001101 0000010 01100011" that identifies the current erroneous physical address, thereby obtaining the 4 bytes after bit flipping - "00000110 00000010 0000101 00011100". Then, the current terminal device compiles and parses the 4 bytes - "00000110 00000010 0000101 00011100" according to the rule that each byte identifies the channel, logical unit number, row address and cluster offset in the physical address, and obtains a default physical address.
[0116] Step S202: If it is detected that the default physical address is a legal address, the default physical address is marked as a physical address to be confirmed.
[0117] After the current terminal device re-parses the bytes formed by bit flipping to obtain the default physical address, it detects whether the default physical address is a valid and legal address. If so, the current terminal device marks the default physical address as a physical address to be confirmed that has been corrected and recovered from the erroneous physical address and may have been restored to normal.
[0118] Step S300, extracting a data identifier according to the physical address to be confirmed;
[0119] Step S400: If the data identifier matches the preset logical address, the table data is reconstructed using the physical address to be confirmed to complete error correction.
[0120] After the current terminal re-parses the bytes obtained after the bit flipping operation to obtain the physical address to be confirmed that has been restored to normal based on the bit flipping, the current terminal device performs a read operation on the physical address to be confirmed, thereby extracting a data identifier from the physical address to be confirmed, and then the current terminal device compares and matches the data identifier with a preset logical address (wherein the preset logical address is the logical address of the source data mapped by the current erroneous physical address), and upon detecting that the data identifier matches the preset logical address, determines that the physical address to be confirmed is a physical address obtained after the recovery of the erroneous physical address, that is, there is a correct mapping relationship between the physical address to be confirmed and the logical address of the source data, thereby the current terminal device uses the confirmed physical address to replace the erroneous physical address to reconstruct a new data table, and uses the new data table to replace the original data table with the erroneous physical address, thereby completing the error correction of the original data table.
[0121] Further, in a feasible embodiment, the above step S300, extracting the data identifier according to the physical address to be confirmed, may include:
[0122] Step S301, performing a read operation on the physical address to be confirmed to detect whether the physical address to be confirmed carries a data identifier;
[0123] Step S302: If yes, extract the data identifier.
[0124] After the current terminal device re-parses the bytes formed by the bit flipping to restore the normal physical address to be confirmed, it performs a read operation on the physical address to be confirmed based on the existing mature storage address reading technology, so as to detect whether the physical address to be confirmed contains redundant data representing the logical address of the source data mapped by the physical address (the logical address of a certain sector source data). If it is detected that the physical address to be confirmed contains the redundant data, the redundant data is marked as a data identifier in the physical address to be confirmed, and the data identifier is extracted to compare whether the data identifier matches the logical address.
[0125] It should be noted that, in the present embodiment, in the above step S400, the preset logical address may be the logical address of the source data mapped to the erroneous physical address (specifically, it may be the logical address of the source data of a sector, such as logical addresses 0 to 7).
[0126] Further, please refer to Figure 3 The detailed flow diagram of step S400 shown in the figure, in a feasible embodiment, in the above step S400, if the data identifier matches the preset logical address, reconstructing the table data using the physical address to be confirmed to complete the error correction may include:
[0127] Step S401, if it is detected that the data identifier matches the preset logical address mapped to the erroneous physical address, it is determined that the physical address to be confirmed is restored to normal;
[0128] Specifically, for example, the current terminal device performs a read operation on the physical address to be confirmed, thereby marking the redundant data of the logical address of the source data mapped by the physical address (the redundant address represents the logical address of the first sector source data, that is, logical addresses 0 to 7) from the physical address to be confirmed as a data identifier and extracts the data identifier. Then, the current terminal device compares the data identifier with the logical address of the source data mapped by the erroneous physical address (logical addresses 0 to 7), and detects that the data identifier matches the logical address of the source data mapped by the erroneous physical address, that is, both represent logical addresses 0 to 7 of the first sector source data. Then, the current terminal device determines that the physical address to be confirmed obtained by recovering the byte identifying the erroneous physical address by bit flipping is restored to normal.
[0129] Step S402, replacing the erroneous physical address with the restored normal physical address to be confirmed to construct new table data;
[0130] Step S403: updating the mapping relationship based on the new table data to complete error correction.
[0131] Specifically, for example, after the current terminal device determines that the physical address to be confirmed has returned to normal, it replaces all the erroneous physical addresses identified by the bytes before the bit flipping with all the physical addresses to be confirmed that have been confirmed to have returned to normal. Thus, a new table data that does not contain the erroneous physical address is reconstructed in the independent storage space of the storage device, and based on the new table data as a new mapping relationship between the logical address of the source data and the physical address where the source data is stored in the storage device, the entire error correction process for the table data containing the erroneous physical address is completed.
[0132] In this embodiment, when it is detected that the storage device has repeated errors that cannot be corrected by itself for table data (the table data is used to represent the mapping relationship between the logical address of the source data and the physical address of the source data in the storage device), the error physical address in which the error occurs among the multiple physical addresses encapsulated by the table data (each physical address is identified in the form of bytes) is detected and determined, and then, the byte identifying the erroneous physical address is bit flipped, and the new byte obtained after the bit flipping is re-parsed to obtain a valid physical address to be confirmed, and the data identifier is extracted through the physical address to be confirmed, and then the data identifier is compared to see whether it matches the preset logical address, and when it is found that the data identifier matches the preset logical address, the table data is reconstructed using the physical address to be confirmed to update the mapping relationship, thereby completing the error correction of the reread erroneous table data.
[0133] Compared with the existing error correction method based only on its own hardware decoding, the error correction method for table data in the embodiment of the present invention identifies the physical address mapped to the logical address of the source data in byte form, thereby locating the physical address where the error occurs, performing bit flipping on the byte corresponding to the erroneous physical address to re-parse and recover a new physical address, and reconstructing the table data based on the new physical address to update the mapping relationship to complete the error correction of the table data. Not only can the error correction be performed on the table data with more physical address errors, but the error correction process of the table data can also be completed more quickly, thereby improving the error correction efficiency of the table data and effectively avoiding the situation where the storage device is unable to correct the table data with a large number of physical address errors based on its own hardware, thereby causing the loss of source data.
[0134] In addition, please refer to Figure 4 The embodiment of the present invention further provides a table data error correction system, the table data error correction system comprising:
[0135] A determination module, configured to determine an erroneous physical address in the table data when a table data reread error is detected, wherein the erroneous physical address is identified by a preset byte;
[0136] A correction module, used for performing bit flipping on the byte corresponding to the erroneous physical address, and re-analyzing to obtain the physical address to be confirmed;
[0137] An extraction module, used for extracting a data identifier according to the physical address to be confirmed;
[0138] The reconstruction module is used to reconstruct the table data using the physical address to be confirmed to complete error correction if the data identifier matches the preset logical address.
[0139] Preferably, the table data error correction system of the embodiment of the present invention further includes:
[0140] The collection module is used to organize the physical addresses of the storage device storing source data into collections and identify them with bytes, and encapsulate the bytes to form table data, wherein the physical address includes one or more of the channel, logical unit number, row address and cluster offset.
[0141] Preferably, the table data error correction system of the embodiment of the present invention further includes:
[0142] The detection module is used to detect whether there is a reread error in the table data after the storage device decodes and corrects the table data based on a preset hardware error correction module.
[0143] Preferably, there is a mutual mapping relationship between the preset logical address and the erroneous physical address, and the reconstruction module includes:
[0144] A first determining unit, configured to determine that the to-be-confirmed physical address is restored to normal if it is detected that the data identifier matches a preset logical address mapped to the erroneous physical address;
[0145] A construction unit, used for replacing the erroneous physical address with the restored normal physical address to be confirmed to construct new table data;
[0146] An updating unit is used to update the mapping relationship based on the new table data to complete error correction.
[0147] Preferably, the determining module includes:
[0148] A parsing unit, used for sequentially parsing bytes in the table data to obtain physical addresses of the byte identifiers;
[0149] An extraction unit, used for extracting a data identifier according to a physical address of the byte identifier;
[0150] The second determining unit is configured to determine that the physical address of the current byte identifier is an erroneous physical address if the data identifier does not match the preset logical address.
[0151] Preferably, the correction module comprises:
[0152] A flip unit, used for re-analyzing the bytes formed by bit flipping to obtain a default physical address;
[0153] The marking unit is used to mark the default physical address as a physical address to be confirmed if it is detected that the default physical address is a legal address.
[0154] Preferably, the extraction module comprises:
[0155] A detection unit, configured to perform a read operation on the physical address to be confirmed, so as to detect whether the physical address to be confirmed carries a data identifier;
[0156] An extraction unit is used to extract the data identifier.
[0157] The steps implemented by the functional modules of the table data correction device of the present invention during operation can refer to the various embodiments of the table data correction device method of the present invention described above, and will not be described in detail here.
[0158] In addition, an embodiment of the present invention also proposes a terminal device, which includes: a memory, a processor, and an error correction program for table data stored in the memory and executable on the processor, wherein the error correction program for table data, when executed by the processor, implements the steps of the error correction method for table data as described above.
[0159] Among them, the steps implemented when the error correction program for table data running on the processor is executed can refer to the various embodiments of the error correction method for table data of the present invention, and will not be repeated here.
[0160] In addition, an embodiment of the present invention further proposes a computer storage medium, which is applied to a computer. The computer storage medium can be a non-volatile computer-readable computer storage medium, and an error correction program for table data is stored on the computer storage medium. When the error correction program for table data is executed by a processor, the steps of the error correction method for table data as described above are implemented.
[0161] Among them, the steps implemented when the error correction program for table data running on the processor is executed can refer to the various embodiments of the error correction method for table data of the present invention, and will not be repeated here.
[0162] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0163] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0164] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a computer storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0165] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for correcting errors in table data, characterized in that: The error correction method of the table data comprises: When a table data reread error is detected, determining an error physical address in the table data, wherein the error physical address is identified by bytes; Performing bit flipping on the byte corresponding to the erroneous physical address, and re-parsing to obtain the physical address to be confirmed; Extracting a data identifier according to the physical address to be confirmed; If the data identifier matches the preset logical address, the table data is reconstructed using the physical address to be confirmed to complete error correction; The step of determining an erroneous physical address in the table data comprises: Parsing the bytes in the table data in sequence to obtain the physical addresses of the byte identifiers; Extracting a data identifier according to the physical address of the byte identifier; If the data identifier does not match the preset logical address, determining that the physical address of the current byte identifier is an erroneous physical address; The step of re-analyzing to obtain the physical address to be confirmed includes: Reparse the bytes formed by bit flipping to get the default physical address; If it is detected that the default physical address is a legal address, the default physical address is marked as a physical address to be confirmed.
2. The table data error correction method according to claim 1, characterized in that: Before the step of determining an erroneous physical address in the table data when a table data reread error is detected, the method further comprises: The physical addresses of the storage device storing the source data are organized into sets and identified with bytes, and the bytes are encapsulated to form table data, wherein the physical address includes one or more of a channel, a logical unit number, a row address, and a cluster offset.
3. The table data error correction method according to claim 1, characterized in that: Before the step of determining an erroneous physical address in the table data when a table data reread error is detected, the method further comprises: After the storage device performs decoding and error correction on the table data based on a preset hardware error correction module, it detects whether the table data has a reread error.
4. The table data error correction method according to claim 1, characterized in that: There is a mutual mapping relationship between the preset logical address and the erroneous physical address, If the data identifier matches the preset logical address, the step of reconstructing the table data using the physical address to be confirmed to complete the error correction includes: If it is detected that the data identifier matches the preset logical address mapped to the erroneous physical address, it is determined that the physical address to be confirmed is restored to normal; Replacing the erroneous physical address with the restored normal physical address to be confirmed to construct new table data; The mapping relationship is updated based on the new table data to complete error correction.
5. The table data error correction method according to claim 1, characterized in that: The step of extracting a data identifier according to the physical address to be confirmed includes: Performing a read operation on the physical address to be confirmed to detect whether the physical address to be confirmed carries a data identifier; If so, the data identifier is extracted.
6. A table data error correction system, characterized in that: The error correction system of the table data comprises: A determination module, configured to determine an erroneous physical address in the table data when a table data reread error is detected, wherein the erroneous physical address is identified by a preset byte; sequentially parse the bytes in the table data to obtain a physical address identified by the byte; extract a data identifier according to the physical address identified by the byte; and determine that the current physical address identified by the byte is an erroneous physical address if the data identifier does not match a preset logical address; A correction module, configured to perform bit flipping on the byte corresponding to the erroneous physical address, and re-parse to obtain a physical address to be confirmed; re-parse the byte formed by the bit flipping to obtain a default physical address; if the default physical address is detected to be a legal address, mark the default physical address as a physical address to be confirmed; An extraction module, used for extracting a data identifier according to the physical address to be confirmed; The reconstruction module is used to reconstruct the table data using the physical address to be confirmed to complete error correction if the data identifier matches the preset logical address.
7. A terminal device, characterized in that: The terminal device comprises: a memory, a processor, and an error correction program for table data stored in the memory and executable on the processor, wherein the error correction program for table data, when executed by the processor, implements the steps of the error correction method for table data as described in any one of claims 1 to 5.
8. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the table data error correction method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Method for reducing retention error of flash memory as well as solid state disk
CN108804025A
Data acquisition method, data transmission method, host and embedded memory
CN109800179A
SSD mapping table protection mechanism verification method and device, computer equipment and storage medium
CN111143111A
Storage device, electronic device, and data error correction method
US20120066568A1
