WO2021196663A1 - 读写方法及存储器装置 - Google Patents

读写方法及存储器装置 Download PDF

Info

Publication number
WO2021196663A1
WO2021196663A1 PCT/CN2020/130391 CN2020130391W WO2021196663A1 WO 2021196663 A1 WO2021196663 A1 WO 2021196663A1 CN 2020130391 W CN2020130391 W CN 2020130391W WO 2021196663 A1 WO2021196663 A1 WO 2021196663A1
Authority
WO
WIPO (PCT)
Prior art keywords
storage unit
address information
read
code
data
Prior art date
Application number
PCT/CN2020/130391
Other languages
English (en)
French (fr)
Inventor
寗树梁
Original Assignee
长鑫存储技术有限公司
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 长鑫存储技术有限公司 filed Critical 长鑫存储技术有限公司
Priority to EP20928574.1A priority Critical patent/EP4006709A4/en
Priority to US17/310,415 priority patent/US11886287B2/en
Publication of WO2021196663A1 publication Critical patent/WO2021196663A1/zh

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/16Error detection or correction of the data by redundancy in hardware
    • G06F11/1666Error detection or correction of the data by redundancy in hardware where the redundant component is memory or memory area
    • 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/1012Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices using codes or arrangements adapted for a specific type of error
    • G06F11/1016Error in accessing a memory location, i.e. addressing error
    • 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/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0727Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a storage system, e.g. in a DASD or network based storage system
    • 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/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • 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
    • 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/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • 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/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/2053Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant
    • G06F11/2094Redundant storage or storage space
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0877Cache access modes
    • G06F12/0882Page mode
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0616Improving the reliability of storage systems in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0647Migration mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0658Controller construction arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1032Reliability improvement, data loss prevention, degraded operation etc
    • G06F2212/1036Life time enhancement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7201Logical to physical mapping or translation of blocks or pages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7205Cleaning, compaction, garbage collection, erase control
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present invention relates to the field of semiconductor storage, in particular to a reading and writing method and a memory device.
  • Semiconductor memory is a memory component used to store various data and information. With the increase in circuit complexity, various forms of memory devices are inevitably prone to produce defective or damaged memory cells during manufacturing or during use, resulting in reduced reliability and lifespan of semiconductor memory devices.
  • the technical problem to be solved by the present invention is to provide a reading and writing method and a memory device, which can greatly improve the reliability of the memory device and prolong the life of the memory device.
  • the present invention provides a read and write method, which applies a read command to a memory device, the read command points to address information, and reads data to be read from a storage unit corresponding to the address information pointed to by the read command. If an error occurs in the read data, the address information pointed to by the read command is associated with the spare storage unit, and the address information pointed to by the read command and its associated information with the spare storage unit are backed up in Africa according to preset rules. Volatile storage unit.
  • the preset rule is a preset period or a preset action.
  • the read-write method further includes the following steps: after the storage device is turned on, load address information and its associated information with the spare storage unit from the non-volatile storage unit.
  • the method for reading and writing further includes the following steps: generating an identification code for identifying the spare storage unit, and the address information pointed to by the read command is associated with the spare storage unit through the identification code.
  • the reading and writing method further includes the following steps: if an error occurs in the data to be read, marking the address information pointed to by the read command as invalid, and marking the invalid mark according to the preset rule
  • the backup is in the non-volatile storage unit, and after the storage device is turned on, the invalid mark is loaded from the non-volatile storage unit.
  • the address information pointed to by the read command is marked as valid, and the valid mark is backed up in the non-volatile storage according to the preset rule.
  • the valid mark is loaded from the non-volatile storage unit.
  • the address information that is not marked as invalid is initially set to be valid, and the valid mark is backed up in the non-volatile storage unit according to the preset rule, after the storage device is turned on , Loading the valid mark from the non-volatile storage unit.
  • the step of reading the data to be read from the storage unit corresponding to the address information pointed to by the read command further includes: reading the data to be read from the storage unit corresponding to the address information pointed to by the read command.
  • the first ECC code corresponding to the data is output; the method for determining whether an error occurs in the data to be read includes: decoding the first ECC code to determine whether an error occurs in the data to be read.
  • a look-up table records the address information of the storage unit and a numerical code corresponding to the address information.
  • the numerical code is composed of a first type code and a second type code.
  • the type code is used to mark whether the address information is valid
  • the second type code is used to record the identification code of the spare storage unit, and if an error occurs in the data to be read, the read command is stored in the lookup table
  • the first type code of the numerical code corresponding to the pointed-to address information is modified to an invalid mark value
  • the second type code is modified to an identification code for identifying the spare storage unit.
  • the reading and writing method further includes the following steps: recording the number of times of modification of the second type code, and generating a corresponding identification code according to the number of times of modification.
  • the numerical code has an initial value, in the initial value, the first type code includes a valid mark value or an invalid mark value, and the second type code is a meaningless value code.
  • a write command is applied to the memory device, and if the tag of the address information pointed to by the write command is valid, the write operation is performed on the storage unit corresponding to the address information pointed to by the write command, if the write command If the mark of the pointed address information is invalid, the writing operation to the storage unit corresponding to the address information pointed to by the write command is stopped, and the identification code corresponding to the address information pointed to by the write command is marked.
  • the backup storage unit performs the write operation.
  • the address information pointed to by the write command is used as an index, and the numerical code is searched in the look-up table.
  • the step of performing a write operation on the storage unit corresponding to the address information pointed to by the write command further includes: forming a second ECC code corresponding to the data to be written in the write operation, and combining it with the to-be-written data The input data is also written into the storage unit corresponding to the address information pointed to by the write command.
  • the method further includes: judging what the read command points to Whether the address information is valid, if the address information pointed to by the read command is valid, the read operation is performed on the memory cell corresponding to the address information pointed to by the read command, and if the mark of the address information pointed to by the read command is invalid , Stop performing the read operation on the storage unit corresponding to the address information pointed to by the read command, and perform the read operation on the spare storage unit identified by the identification code corresponding to the address information pointed to by the read command.
  • the method for reading and writing further includes the following steps: if an error occurs in the data to be read, if the data to be read is corrected, the corrected data is stored in the backup storage unit ; If the data to be read is not corrected, the data to be read is stored in the backup storage unit.
  • the present invention also provides a memory device, which includes: a command receiving unit for receiving a read command or a write command; a storage unit corresponding to the address information corresponding to the read command or write command; a spare storage unit; For recording the address information and its associated information with the backup storage unit; an execution unit for performing a read operation or a write operation on the storage unit or the backup storage unit; a non-volatile storage unit for The address information recorded by the associating unit and the associated information with the backup storage unit are backed up according to a preset rule.
  • the memory device further includes an identification code generating unit connected to the associating unit and configured to generate an identification code for identifying the spare storage unit, and the associating unit uses the identification code to associate the address information with the Spare storage unit association.
  • the associating unit is also used to record mark information, and the mark information records that the address information is valid or invalid.
  • the association unit is a lookup table, and the lookup table records address information of the storage unit and a numerical code corresponding to the address information, and the numerical code is composed of a first type code and a second type code, The first type code is used to mark whether the address information is valid, and the second type code is used to record the identification code of the backup storage unit. If an error occurs in the data to be read, the The first type code of the numerical code corresponding to the address information pointed to by the read command is modified to an invalid mark value, and the second type code is modified to an identification code for identifying a spare storage unit.
  • the memory device further includes a loading unit connected to the associating unit and the non-volatile storage unit and configured to store the address information backed up in the non-volatile storage unit And the tag information is loaded into the associated unit.
  • the memory device further includes an ECC encoding and decoding unit for decoding the first ECC encoding corresponding to the data to be read in the read operation and forming the second ECC encoding corresponding to the data to be written in the writing operation.
  • the memory device includes a logic layer and at least one storage layer, the command receiving unit, the association unit, and the execution unit are arranged in the logic layer, the storage unit is arranged in the storage layer, and the The spare storage unit is arranged in the storage layer or the logic layer, and the non-volatile storage unit is arranged in the storage layer or the logic layer.
  • the advantage of the present invention is that when the user performs read and write operations on the memory device, the storage units that have data errors are distinguished in real time and replaced by spare storage units, so that when the user performs read and write operations on the memory device subsequently, Read and write operations can be performed on the spare storage unit, instead of reading and writing operations on the storage unit with data errors, which can greatly improve the reliability of the memory device and prolong the life of the memory device.
  • the read-write method of the present invention also backs up the address information pointed to by the read command and its associated information with the spare storage unit in the non-volatile storage unit according to preset rules. After the storage device is powered on again, it will automatically The non-volatile storage unit loads the address information and its associated information with the spare storage unit.
  • the associated information is used as the initial associated information of the address information and the spare storage unit in the subsequent read and write operations, so as to avoid re-associating the spare storage unit with the address information that has been associated with the spare storage unit after the memory device is powered on again, greatly improving The operating speed of the memory device is improved.
  • FIG. 1 is a schematic flowchart of the first specific implementation of the reading and writing method of the present invention
  • FIG. 2 is a schematic flowchart of a second specific embodiment of the reading and writing method of the present invention.
  • FIG. 3 is a schematic flowchart of a third specific implementation of the reading and writing method of the present invention.
  • FIG. 4 is a schematic diagram of the framework of the first specific embodiment of the memory device of the present invention.
  • FIG. 5 is a schematic diagram of the framework of the second specific embodiment of the memory device of the present invention.
  • FIG. 6 is a schematic diagram of the framework of the third specific embodiment of the memory device of the present invention.
  • FIG. 7 is a schematic diagram of a framework of a fourth specific embodiment of the memory device of the present invention.
  • FIG. 8 is a schematic diagram of a framework of a fifth specific embodiment of the memory device of the present invention.
  • FIG. 9 is a schematic diagram of the framework of the sixth specific embodiment of the memory device of the present invention.
  • a common method to improve the reliability of the memory device is to encode the data as an Error Correction Code (ECC) before the data is written into the memory device, and store the data and the error correction code in the memory device at the same time.
  • ECC Error Correction Code
  • the error correction code can only correct the data when the data is read, and the storage unit where the data error occurred in the memory still exists. If in the subsequent data storage process, at least one storage unit with data error occurs in the storage segment corresponding to the storage unit where the data error occurs, there will be at least two storage units with data error in the storage segment. The error correction code will not be able to correct the error, causing the storage segment to be unusable, or even causing the memory device to be unusable, thereby affecting the reliability and life of the memory device.
  • the present invention provides a method of reading and writing, which can not only distinguish the storage units with data errors in real time, and replace the storage units with data errors with spare storage units, but also can compare the address information according to preset rules. And its associated information with the spare storage unit is backed up in the non-volatile storage unit.
  • FIG. 1 is a schematic flowchart of the first specific implementation of the reading and writing method of the present invention.
  • the reading and writing method includes the following steps:
  • Step S10 A read command is applied to the memory device, the read command points to address information.
  • the address information pointed to by the read command is A0.
  • Step S11 Read the data to be read from the storage unit corresponding to the address information pointed to by the read command.
  • the data to be read is read from the storage unit corresponding to the address information A0.
  • step S12 it is judged whether an error occurs in the data to be read.
  • the address information pointed to by the read command is associated with the backup storage unit, and the data to be read is stored in the backup storage unit. That is, a spare storage unit is used to replace a failed storage unit to improve the reliability of the memory device. Further, in another specific embodiment of the present invention, if an error occurs in the data to be read, if the data to be read is corrected, the data to be read will be corrected. The data is stored in the spare storage unit.
  • the read and write method further includes step S13, generating an identification code for identifying the spare storage unit, so The identification code is stored in the look-up table 10, and the address information pointed to by the read command is associated with the spare storage unit through the identification code. It is understandable that the identification codes corresponding to different spare storage units are different to ensure that the spare storage units associated with the address information pointed to by the read command will not be repeated, thereby avoiding data storage errors.
  • a lookup table 10 is provided, and the lookup table 10 is provided with an address information column ADD and a value column DATA.
  • the address information column ADD prestores all address information of the memory device, such as A0, A1, A2, A3, A4, A5, A6...An, and the amount of the address information can be based on the actual situation of the memory device set up.
  • the value column DATA is used to store the value code corresponding to the address information.
  • each address information corresponds to a numerical code.
  • the numerical code includes at least an identification code or a meaningless code for identifying the spare storage unit.
  • the numerical code is composed of a first type code and a second type code.
  • the first type code is used to mark whether the address information is valid. For example, the first type code is 0 or 1, 0 is a valid flag value indicating that the address information is valid, and 1 is an invalid flag value indicating that the address information is invalid.
  • the address information pointed to by the read command is marked as invalid. For example, if an error occurs in the data to be read read from the memory cell corresponding to the address information A0 pointed to by the read command, then the address information A0 pointed to by the read command is corresponding to the address information A0 in the look-up table 10.
  • the first type code of the numerical code is marked as invalid tag value 1; if an error occurs in the data to be read read from the storage unit corresponding to the address information A4 pointed to by the read command, the look-up table 10
  • the first type code of the numerical code corresponding to the address information A4 pointed to by the read command is marked as an invalid mark value 1.
  • the second type code is used to record the identification code or meaningless code.
  • the second type code may be multiple bits, which may be determined according to the number of spare storage units.
  • the second type code is three digits, which can be 000, 001, 010, 100, 101, 011, 110, 111, and so on.
  • the first type code is an invalid tag value that is invalid for the address information (for example, when the first type code is 1)
  • the second type code is the identification code
  • the read command is The pointed address information is associated with the spare storage unit through the identification code, and the data to be read is stored in the spare storage unit.
  • the first type code of the numerical code corresponding to the address information A0 is the invalid flag value 1
  • the second type code 001 of the numerical code corresponding to the address information A0 is an identification code that can identify a spare storage unit, so The address information pointed to by the read command is associated with the spare storage unit through the identification code 001, and the data to be read is stored in the spare storage unit identified by the identification code 001
  • the numerical code corresponding to the address information A4 The first type code is the invalid tag value 1
  • the second type code 010 of the numerical code corresponding to the address information A4 is the identification code that can identify the spare storage unit, and the address information pointed to by the read command passes the identification
  • the code 010 is associated with the spare storage unit, and the data to be read is stored in the spare storage unit identified by the identification code 010.
  • the first type code of the numerical code corresponding to the address information pointed to by the read command is a valid tag value, so
  • the second type code is meaningless code. The meaningless code is only used to fill digits, and it is not used to identify any spare storage unit.
  • the read command The first type code of the numerical code corresponding to the pointed address information A1 is a valid tag value of 0, and the second type code is a meaningless code 000; if it is from the storage unit corresponding to the address information A2 pointed to by the read command There is no error in reading the data to be read, then in the look-up table 10, the first type code of the numerical code corresponding to the address information A2 pointed to by the read command is the valid tag value 0, and the second type code It is the meaningless code 000.
  • the value 000 is used to represent the meaningless code. In other specific embodiments of the present invention, other values can also be set to represent the meaningless code.
  • the first method of setting the first type code of the numerical code corresponding to the address information pointed to by the read command as a valid tag value is that in the look-up table, all the numerical codes corresponding to the address information are initialized If it is set as a combination of a valid tag value and a meaningless code, if there is no error in the data to be read, the numerical code in the look-up table is not modified, that is, the initial setting of the numerical code is retained. For example, if there is no error in the data to be read read from the memory cell corresponding to the address information A1 pointed to by the read command, then the address information pointed to by the read command is assigned to the address information A1 in the look-up table 10. The numerical code is retained as the initial setting, that is, the initial setting of the numerical code is not modified. In this specific embodiment, this processing method is adopted.
  • the read command pointed to by the read command is set in the look-up table 10.
  • the first type code of the numeric code corresponding to the address information is modified from a valid tag value to an invalid tag value
  • the second type code of the numeric code is modified from a meaningless code to an identification code.
  • the numerical code corresponding to the address information A0 pointed to by the read command is set in the look-up table 10
  • the first type code of the numeric code is modified from a valid tag value to an invalid tag value
  • the second type code of the numerical code is modified from a meaningless code to an identification code.
  • the look-up table when the memory device is powered on or shipped out of the factory, in the look-up table, all the numeric codes corresponding to the address information are initially set as the effective tag value and the meaningless code. combination. It is understandable that with the use of the memory device, after performing read and write operations on the memory device multiple times, in the look-up table, the numerical code corresponding to the address information may be an invalid flag value and identification value. The combination of codes may also be a combination of valid tag values and meaningless codes. Therefore, when a read command is applied to the memory device, the lookup table after the previous read and write operation is the initial lookup table of the current read operation, and the initial lookup table records the storage unit after the previous read and write operation.
  • the numeric code corresponding to the address information of, the numeric code is the initial numeric code of the current read operation, and the numeric code may be a combination of an invalid tag value and an identification code, or a combination of a valid tag value and a meaningless code. If an error occurs in the data to be read, the numerical code of the address information pointed to by the read command is modified in the look-up table 10 to a combination of an invalid tag value and a meaningless code.
  • the reading and writing method of the present invention further includes the following steps: recording the number of times of modification of the second type code, and generating a corresponding identification code according to the number of times of modification. Specifically, if a data error occurs in the address information pointed to by the read command, the second type code needs to be modified as an identification code to associate the address information with a spare storage unit through the identification code. In order to avoid duplication of spare storage units associated with different address information, different identification codes can be generated according to the modification times of the second type code, that is, different address information corresponds to different identification codes, so that different address information is different from different ones. Spare storage unit association.
  • the identification code when the number of times the second type code is modified is 0, the identification code is 001, and when the number of times the second type code is modified is 1, the identification code is 010, and when the second type code is modified When the number of times is 2, the identification code is 100..., and so on, the corresponding identification code is generated according to the number of modifications.
  • the second processing method of setting the first type code of the numerical code corresponding to the address information pointed to by the read command as a valid tag value is, if no error occurs in the data to be read, then set it in the lookup table 10
  • the first type code of the numerical code corresponding to the address information pointed to by the read command is marked as a valid tag value, and a meaningless code is used to fill the position of the second type code.
  • the value corresponding to the address information A1 pointed to by the read command is set in the look-up table 10
  • the first type code of the code is marked with a valid tag value of 0, and a meaningless code is used to fill the position of the second type code.
  • the numerical code may also consist of only the second type code, that is, the numerical code only includes an identification code or a meaningless code for identifying a spare storage unit. If an error occurs in the data to be read, it means that the storage unit is invalid, and the numerical code corresponding to the address information corresponding to the storage unit is an identification code. If there is no error in the data to be read, it means that the storage unit is valid. Then the numerical code corresponding to the address information corresponding to the storage unit is a meaningless code.
  • the reading and writing method of the present invention also includes the following steps: Step S14, backing up the address information pointed to by the read command and the associated information with the backup storage unit in the non-volatile storage unit according to a preset rule.
  • Step S14 backing up the address information pointed to by the read command and the associated information with the backup storage unit in the non-volatile storage unit according to a preset rule.
  • the look-up table 10 is backed up in the non-volatile storage unit according to a preset rule.
  • the preset rule may be a preset period or a preset action.
  • the preset period may be a preset time period after the memory device is powered on. For example, after the memory device is powered on, the address information pointed to by the read command and the associated information with the backup storage unit are backed up in a period of ten minutes. In the non-volatile storage unit, that is, the address information pointed to by the read command and its associated information with the backup storage unit are backed up in the non-volatile storage unit every ten minutes after the storage device is powered on; or One hour as a cycle, the address information pointed to by the read command and its associated information with the backup storage unit are backed up in the nonvolatile storage unit, that is, after the memory device is powered on, the read command is saved every hour. The pointed address information and its associated information with the spare storage unit are backed up in the non-volatile storage unit.
  • the preset action may be an operation received by the memory device.
  • the operation of shutting down the memory device the operation of restarting the memory device received by the memory device, the triggering operation including the backup of the address information and the marking instruction set by the user or the system, and the like.
  • the trigger operation may be an operation of clicking a certain trigger button by the user, or an operation of turning off a certain trigger button, or any operation of issuing a trigger instruction, which is not limited in the present invention.
  • the read-write method of the present invention backs up the address information and its associated information with the backup storage unit in a non-volatile storage unit. If the memory device is powered off, the address information and its associated information with the backup storage unit will still be recorded In the non-volatile storage unit, it will not be cleared and can be used as a basis for subsequent read and write operations.
  • the look-up table 10 is backed up in a non-volatile storage unit, that is, the address information and its corresponding numerical code recorded in the look-up table 10 are backed up in a non-volatile storage unit middle.
  • the reading and writing method of the present invention further includes the following steps: step S15, after the storage device is turned on (that is, the storage device is powered on again), load address information and its backup data from the non-volatile storage unit The associated information of the storage unit. Specifically, in this embodiment, after the storage device is turned on (that is, the storage device is powered on again), the look-up table 10 is loaded from the non-volatile storage unit.
  • the numerical code corresponding to the address information recorded in the look-up table 10 is used as the initial numerical code for subsequent read and write operations, thereby avoiding re-modification of the modified numerical code after the memory device is powered on again, and avoiding the failure of the storage unit and The spare storage unit is re-associated, which greatly improves the operating speed of the storage device.
  • the present invention also provides a method for judging whether the data to be read out has an error.
  • the step of reading the data to be read from the storage unit corresponding to the address information pointed to by the read command further includes: reading the data to be read from the storage unit corresponding to the address information pointed to by the read command.
  • the first ECC code corresponding to the data to be read For example, the number of bits of data read from the storage unit corresponding to the address information pointed to by the read command is 64b+8b, where 64b is the number of bits of data to be read, and 8b is the first ECC code. Number of digits.
  • the first ECC code can be decoded to restore the data that may have errors. The algorithm is the prior art and will not be repeated. Therefore, it can be determined whether an error occurs in the data to be read based on the decoding of the first ECC code.
  • the present invention lists a method for judging whether the data to be read out has an error based on decoding the first ECC code: re-encoding the data to be read out to form a new ECC code, and encoding the new ECC code Perform exclusive OR comparison of each bit with the first ECC code. If each bit is consistent, it means that the data to be read has no error and the storage unit is valid. Then the look-up table 10 is not modified.
  • the first type code of the numerical code corresponding to the address information of the unit is a valid tag value; if there is an inconsistency between the new ECC code and the first ECC code, it means that an error has occurred in the data to be read, and the storage unit If it is invalid, the first type code of the numerical code corresponding to the address information pointed to by the read command is modified to the invalid mark value in the look-up table 10.
  • the data to be read is used as the output data of the memory device, and if an error occurs in the data to be read, the first ECC encoding can be used to perform Correction, using the corrected data as the output data of the memory device, and storing the corrected data in the corresponding spare storage unit.
  • the reading and writing method of the present invention can distinguish the storage unit with data error in real time when the user performs the reading and writing operation on the storage device, and replace it with a spare storage unit. That is, every time a read operation is performed, the storage unit with the data error will be replaced with a spare storage unit, so that when a subsequent user performs a read and write operation on the memory device, the spare storage unit can be read and written without any data occurrence. Performing read and write operations on the wrong storage unit can greatly improve the reliability of the storage device and prolong the life of the storage device.
  • the read-write method of the present invention also backs up the address information pointed to by the read command and its associated information with the spare storage unit in the non-volatile storage unit according to preset rules. After the storage device is powered on again, it will automatically The non-volatile storage unit loads the address information and its associated information with the spare storage unit.
  • the associated information is used as the initial associated information of the address information and the spare storage unit in the subsequent read and write operations, so as to avoid re-associating the spare storage unit with the address information that has been associated with the spare storage unit after the memory device is powered on again, greatly improving The operating speed of the memory device is improved.
  • the reading and writing method of the present invention also provides a second specific implementation manner. After the application of the read command to the memory device, before the reading of the data to be read from the storage unit corresponding to the address information pointed to by the read command, the method further includes: determining the address information pointed to by the read command Whether the steps are effective. Specifically, please refer to FIG. 2, which is a schematic flowchart of the second embodiment of the reading and writing method of the present invention.
  • Step S20 Apply a read command to the memory device, where the read command points to address information.
  • Step S21 It is judged whether the address information pointed to by the read command is valid.
  • the address information pointed to by the read command is used as an index, and the tag is searched in the lookup table 20.
  • the first type code of the numerical code corresponding to the address information pointed to by the read command is a valid tag value, it means that the address information pointed to by the read command is valid.
  • the first type code of the numerical code corresponding to the pointed address information is an invalid flag value, which indicates that the address information pointed to by the read command is invalid.
  • the address information pointed to by the read command is A1
  • the address information A1 pointed to by the read command is used as an index, and the mark is searched in the lookup table 20.
  • the first type code of the numerical code corresponding to the address information A1 pointed to by the read command is a valid tag value of 0, which indicates that the address information A1 pointed to by the read command is valid.
  • the address information pointed to by the read command is A4.
  • the mark is searched in the lookup table 20.
  • the first type code of the numerical code corresponding to the address information A4 pointed to by the read command is the invalid flag value 1, indicating that the address information A4 pointed to by the read command is invalid.
  • step S22 a read operation is performed on the storage unit corresponding to the address information pointed to by the read command, that is, step S22 is executed.
  • the first type code of the numerical code corresponding to the address information A1 pointed to by the read command is a valid tag value of 0, indicating that the storage unit corresponding to the address information A1 pointed to by the read command is valid.
  • a read operation is performed on the storage unit corresponding to the address information A1 pointed to by the read command, that is, step S22 is executed.
  • the address information pointed to by the read command is address information A1.
  • the second type code of the numerical code is no longer identified.
  • step S23 is executed. For example, if in the look-up table 20, the first type code of the numerical code corresponding to the address information A4 pointed to by the read command is the invalid flag value 1, then stop processing the data corresponding to the address information pointed to by the write command.
  • the storage unit performs a read operation, and step S23 is performed.
  • the numerical code may also consist of only the second type code, that is, the numerical code only includes an identification code or a meaningless code for identifying a spare storage unit.
  • the address information pointed to by the read command is used as an index, and the numerical code is searched in the look-up table 20.
  • the numerical code corresponding to the address information pointed to by the read command is a meaningless code, it means that the storage unit corresponding to the address information pointed to by the read command is valid, and the storage unit is valid.
  • step S22 Perform a read operation, that is, perform step S22; if the numerical code corresponding to the address information pointed to by the read command is an identification code, it means that the storage unit corresponding to the address information pointed to by the read command is invalid, and then the identification code is The corresponding spare storage unit executes a read operation, that is, step S23 is executed.
  • Step S22 Read the data to be read from the storage unit corresponding to the address information pointed to by the read command.
  • the data to be read is read from the storage unit corresponding to the address information A1 pointed to by the read command. This step is the same as step S11 in the first specific embodiment.
  • Step S23 Perform a read operation on the spare storage unit identified by the second type code (ie identification code) of the numerical code corresponding to the address information pointed to by the read command. For example, if in the look-up table 20, the first type code of the numerical code corresponding to the address information A4 pointed to by the read command is the invalid flag value 1, then the address information A4 pointed to by the read command corresponds to The spare storage unit identified by the second type code 101 of the numerical code performs a read operation.
  • Step S25 is executed after step S23.
  • step S24 it is judged whether an error occurs in the data to be read.
  • This step is the same as step S12 in the first specific embodiment. If an error occurs in the data to be read, the first type code of the numerical code corresponding to the address information pointed to by the read command is marked as an invalid mark value in the look-up table 20, and the second type code is modified to The identification code used to identify the backup storage unit and store the data to be read in the backup storage unit; if the data to be read does not have an error, then the read command pointed to by the lookup table 20 The first type code of the numeric code corresponding to the address information is modified to a valid tag value, and the second type code is filled with meaningless codes, or the numeric codes in the look-up table 20 are initially set as valid tag values and meaningless codes.
  • Step S25 output data.
  • the output data may be data stored in the backup storage unit, and may be the data to be read in the storage unit that has been modified or not.
  • step S26 the look-up table 20 is backed up in a non-volatile storage unit according to a preset rule.
  • the preset rule may be a preset period or a preset action.
  • Step S27 after the memory device is turned on, load the look-up table 20 from the non-volatile storage unit. This step is the same as step S15.
  • the numerical code corresponding to the address information recorded in the look-up table 20 is used as the initial numerical code of the read and write operation, thereby avoiding the re-association of the spare storage unit with the address information that has been associated with the spare storage unit after the memory device is powered on again, which greatly improves The operating speed of the memory device is improved.
  • the address information pointed to by the read command can be selectively executed.
  • the read command can improve the reliability of the memory device.
  • the address information of the storage unit can be marked according to whether the data to be read has an error, and in the case of an error in the data to be read, a backup storage is used. The unit replaces the storage unit and stores the corrected data in the spare storage unit to provide a basis for subsequent read and write operations, which greatly improves the reliability and life of the memory device.
  • step S23 it is also possible to continue to determine whether the data read from the corresponding backup storage unit has an error, and if the data does not have an error, the data is output; if an error occurs in the data, change The value of the second type code corresponding to the address information pointed to by the read command is associated with another spare storage unit, and the revised data to be read can be stored in the new spare storage unit.
  • the reading and writing method of the present invention also provides a third specific implementation manner.
  • the third specific embodiment is a write operation to a memory device.
  • FIG. 3 is a schematic flowchart of a third specific embodiment of the reading and writing method of the present invention.
  • Step S30 applying a write command to the memory device, the write command pointing to address information. For example, a write command is applied to the memory device, and the write command points to address information A0.
  • Step S31 It is judged whether the address information pointed to by the write command is valid.
  • the address information pointed to by the write command is used as an index, and the tag corresponding to the address information is searched in the lookup table to determine whether the address information pointed to by the write command is valid according to the tag. .
  • the address information pointed to by the write command is A0
  • the address information A0 pointed to by the write command is used as an index
  • the first type code of the numerical code corresponding to the address information A0 is searched in the lookup table 30 .
  • the write operation is performed on the memory cell corresponding to the address information pointed to by the write command. If a type code is an invalid tag value, the write operation to the storage unit corresponding to the address information pointed to by the write command is stopped, the second type code of the numerical code is identified, and the second type code is identified by the second type code.
  • the backup storage unit performs the write operation.
  • the first type code of the numerical code corresponding to the address information A0 pointed to by the write command is the invalid flag value 1, and the storage unit corresponding to the address information A0 pointed to by the write command is stopped.
  • Perform a write operation identify the second type code 001 of the numerical code, and perform a write operation on the spare storage unit identified by the second type code 001; in the lookup table, the address pointed to by the write command
  • the first type code of the numerical code corresponding to the information A1 is the valid tag value 0, and the write operation is performed on the storage unit corresponding to the address information A1 pointed to by the write command.
  • step S32 the look-up table 30 is backed up in a non-volatile storage unit according to a preset rule.
  • the preset rule may be a preset period or a preset action.
  • Step S33 after the memory device is turned on, load the look-up table 30 from the non-volatile storage unit. This step is the same as step S15.
  • the numerical code corresponding to the address information recorded in the look-up table 30 is used as the initial numerical code of the read and write operation, thereby avoiding the operation of re-associating the spare storage unit on the address information that has been associated with the spare storage unit after the memory device is powered on again , Which greatly improves the operating speed of the memory device.
  • the numerical code may also consist of only the second type code, that is, the numerical code only includes an identification code or a meaningless code for identifying a spare storage unit.
  • the address information pointed to by the write command is used as an index, and the numerical code is searched in the lookup table 30.
  • the numerical code corresponding to the address information pointed to by the write command is a meaningless code, it means that the storage unit corresponding to the address information pointed to by the write command is valid, and the storage unit is valid.
  • the read and write method further includes the following steps: forming a second ECC code corresponding to the data to be written in the write operation, and combining it with the data to be written And write it into the storage unit corresponding to the address information pointed to by the write command.
  • the data in the storage unit is read, the data and the second ECC code are read at the same time, and the second ECC code is decoded to restore the data that may have errors.
  • the reading and writing method of the present invention determines whether the address pointed to by the write command is valid after applying the write command to the memory device, and if it is invalid, the write operation is performed on the corresponding spare memory unit, and then It can avoid performing write operations on failed memory cells, thereby improving the reliability of the memory device and prolonging the life of the memory device.
  • the present invention also provides a memory device capable of realizing the above-mentioned reading and writing method.
  • the memory device includes, but is not limited to, volatile memory such as DRAM and SRAM, and non-volatile memory such as NAND, NOR, FeRAM, RRAM, MRAM, and PCRAM.
  • FIG. 4 is a schematic diagram of the framework of the first embodiment of the memory device of the present invention.
  • the memory device includes a command receiving unit 40, a storage unit 41, an association unit 42, an execution unit 43, a backup storage unit 44, and a non-volatile storage unit 45.
  • the command receiving unit 40 is configured to receive address information pointed to by a read command, a write command, or a read/write command applied to the memory device.
  • the storage unit 41 corresponds to the address information corresponding to the read command or the write command, and is used to store data.
  • the storage unit 41 may be a storage unit well-known to those skilled in the art, such as a basic cell, a segment, a page, and a block. No restrictions.
  • the associating unit 42 is used to record the address information and its associated information with the spare storage unit.
  • the associating unit 42 is also used to store tag information, and the tag information records that the address information is valid or invalid.
  • the associating unit 42 is a look-up table.
  • the look-up table records the address information of the storage unit 41 and the numerical code corresponding to the address information.
  • the numerical code is composed of a first type code and a second type code, the first type code is used to mark whether the address information is valid, and the second type code is used to record the identification code of the spare storage unit 44 .
  • the first type code of the numerical code corresponding to the address information pointed to by the read command is modified to an invalid flag value in the lookup table, and the second type code is modified to use To identify the identification code of the spare storage unit 44.
  • the execution unit 43 is configured to control the execution of a read operation or a write operation on the storage unit 41.
  • the execution unit 43 is also connected to the associating unit 42, and is configured to perform a read operation or a write operation on the storage unit 41 corresponding to the address information according to the record of the associating unit 42, or stop the operation on the storage unit 41 corresponding to the address information.
  • the storage unit 41 performs a read operation or a write operation. Specifically, if the first type code of the numerical code corresponding to the address information pointed to by the read command or the write command is a valid tag value, the execution unit 43 performs a read operation or a read operation on the storage unit corresponding to the address information.
  • the execution unit 43 stops performing the read operation on the storage unit corresponding to the address information or Write operation, and perform a read operation or a write operation on the spare storage unit identified by the second type code according to the second type code of the numerical code.
  • the command receiving unit 40 can be directly connected to the execution unit 43, and the associating unit 42 is connected to the execution unit 43, but not to the command receiving unit 40.
  • the present invention does not do this connection method. Specific restrictions can be set by those of ordinary skill in the art to realize the above-mentioned functions as needed.
  • the spare storage unit 44 corresponds to the address information pointed to by the read command or the write command through the second type code, and is used to store data.
  • the spare storage unit 44 may be a storage unit well-known to those skilled in the art such as storage basic cells (cells), storage segments (segments), storage pages (pages), and storage blocks (blocks). This is not restricted.
  • the non-volatile storage unit 45 is used to back up the address information and its associated information with the backup storage unit 44 according to a preset rule. Specifically, in this specific embodiment, the non-volatile storage unit 45 is used to back up the lookup table according to a preset rule.
  • the non-volatile storage unit 45 may be a non-volatile storage structure such as NAND, NOR, FeRAM, RRAM, MRAM, and PCRAM.
  • the non-volatile storage unit 45 is connected to the execution unit 43, and the execution unit 43 controls the address information and its associated information with the backup storage unit to be backed up in the non-volatile storage unit according to preset rules. 45 in.
  • the preset rule may be a preset period or a preset action.
  • the command receiving unit 40 can receive the trigger action, and the execution unit 43 can control the address information and its connection with the backup storage unit according to the trigger action.
  • the associated information is backed up in the non-volatile storage unit 45.
  • the execution unit 43 can also control the address information backed up in the non-volatile storage unit 45 and its associated information with the backup storage unit to be loaded into the association unit 42. For example, after the memory device is turned on, the execution unit 43 controls the address information backed up in the non-volatile storage unit 45 and its associated information with the backup storage unit to be loaded into the association unit 42 to As a basis for subsequent read and write operations, it is possible to prevent the memory device from being re-associated with the address information of the backup storage unit after the memory device is powered on again, thereby greatly improving the operating speed of the memory device.
  • the memory device of the present invention also provides a second specific embodiment. Please refer to FIG. 5, which is a schematic diagram of the framework of the second specific embodiment of the memory device of the present invention.
  • the difference between the second specific embodiment and the first specific embodiment is that the memory device of the present invention further includes an identification code generation unit. 46.
  • the identification code generating unit 46 is used to generate an identification code for identifying the spare storage unit.
  • the identification code generating unit 46 is connected to the associating unit 42, and the associating unit 42 can modify the second type code of the numerical code to the identification code generated by the identification code generating unit 46. Further, the identification code generation unit 46 can record the number of times of modification of the second type code of the numerical code in the association unit 42 to generate an identification code according to the number of times of modification.
  • the associating unit 42 associates the address information with the spare storage unit 44 through the identification code, so that the execution unit 43 can perform a read operation or a write operation on the spare storage unit 44.
  • the memory device of the present invention also provides a third specific implementation manner. Please refer to FIG. 6, which is a schematic diagram of the framework of the third embodiment of the memory device of the present invention. Compared with the first embodiment, the difference between the third embodiment and the first embodiment is that the memory device further includes a loading unit 47. .
  • the loading unit 47 is connected to the associating unit 42 and the non-volatile storage unit 45, and is used to associate the address information backed up in the non-volatile storage unit 45 and its association with the backup storage unit. Information is loaded into the associating unit 42. Further, the loading unit 43 is also connected to the execution unit 43, and the execution unit 43 controls the loading unit 47 to back up the address information in the non-volatile storage unit 45 and the backup storage. The association information of the unit is loaded into the association unit 42. For example, after the memory device is turned on, the execution unit 43 controls the loading unit 47 to load the address information backed up in the non-volatile storage unit 45 and the associated information with the backup storage unit into the storage unit.
  • the associating unit 42 is used as a basis for subsequent read and write operations, so as to avoid re-associating the spare storage unit with the address information of the already associated spare storage unit after the memory device is powered on again, which greatly improves the memory device’s performance. Operating speed.
  • the memory device of the present invention also provides a fourth specific implementation manner. Please refer to FIG. 7, which is a schematic diagram of the framework of the fourth embodiment of the memory device of the present invention. Compared with the first embodiment, the difference between the fourth embodiment and the first embodiment is that the memory device further includes an ECC encoding and decoding unit. 48.
  • the ECC encoding and decoding unit 48 is connected to the execution unit 43, the storage unit 41, and the association unit 42.
  • the ECC encoding and decoding unit 48 is used to decode the first ECC encoding corresponding to the data to be read in the read operation to restore the data that may be erroneous, and can be used to restore the data according to whether the ECC encoding and decoding unit 44 restores the data. Modify the numerical code in the associating unit 42.
  • the ECC encoding and decoding unit 48 is also used to form a second ECC encoding corresponding to the data to be written in the write operation.
  • the command receiving unit receives a write command, and when performing a write operation on the storage unit corresponding to the address information pointed to by the write command, the ECC encoding and decoding unit 48 forms and writes.
  • the ECC code corresponding to the data to be written is simultaneously stored in the storage unit 41 corresponding to the address information pointed to by the write command.
  • the ECC encoding and decoding unit 48 decodes the ECC encoding.
  • the decoding of the ECC encoding and decoding unit 48 can be used to determine whether an error occurs in the data to be read read by the read operation, and then the numerical code in the associating unit 42 can be modified.
  • the numerical code in the associating unit 42 can be modified according to whether the ECC encoding and decoding unit 48 restores the data. Specifically, if the ECC encoding and decoding unit 48 decodes the ECC encoding and restores the data, indicating that an error occurs in the data to be read read by the read operation, the storage is stored in the associating unit 42 The numerical code corresponding to the address information of the unit is modified to a combination of an invalid tag value and an identification code.
  • the associating unit 42 modifies the numeric code corresponding to the address information to a combination of a valid tag value and a meaningless code, or keeps the initial tag of the numeric code corresponding to the address information.
  • the ECC encoding and decoding unit 48 decodes the ECC encoding. Although the data is not restored, according to the decoding of the ECC encoding and decoding unit 48, it can be determined that the read operation reads If an error occurs in the data to be read, the numerical code corresponding to the address information of the storage unit is modified in the associating unit 42 to a combination of an invalid tag value and an identification code.
  • the execution unit 43 is not only connected to the ECC encoding and decoding unit 48, but also connected to the storage unit 41.
  • FIG. 8 is the memory A schematic diagram of the framework of the fifth specific implementation of the device, the execution unit 43 is connected to the ECC encoding and decoding unit 48, and the ECC encoding and decoding unit 48 is then connected to the storage unit 41. It is understandable that different connection relationships can be selected according to different needs.
  • the memory device of the present invention also provides a sixth specific implementation manner.
  • FIG. 9, is a schematic diagram of the framework of the sixth embodiment of the memory device.
  • the memory device includes a logic layer 100 and a plurality of storage layers 200 (only A case of a storage layer is shown), the storage layer 200 may be a DRAM chip, and the logic layer 100 may be a layer equipped with logic circuits such as a control chip or an interposer.
  • the several storage layers 200 can be vertically stacked above or below the logic layer 100, but the present invention is not limited to this, and other packaging methods can also be used to integrate them.
  • the command receiving unit 40, the associating unit 42, the execution unit 43, and the ECC encoding and decoding unit 48 can all be set in the logic layer 100, and the storage unit 41 and the spare storage unit 44 and the non-volatile storage unit 45 are provided in the storage layer 200.
  • the associating unit 42, the ECC encoding and decoding unit 48 may also be arranged in the storage layer 200, the spare storage unit 44 may be arranged in the logic layer 100, and the The non-volatile storage unit 45 may also be provided in the logic layer 100.
  • the logic layer 100 has at least one first data transmission port 49
  • the storage layer 200 has at least one second data transmission port 50. Instructions and data are transmitted between the logic layer 100 and the storage layer 200 through the first data transmission port 49 and the second data transmission port 50.
  • the execution unit 43 is not only connected to the ECC encoding and decoding unit 48, but also connected to the storage unit 41 through the first data transmission port 49 and the second data transmission port 50, and
  • the execution unit 43 is connected to the ECC encoding and decoding unit 48, and the ECC encoding and decoding unit 48 is then connected to the first data transmission port 49 and the second data transmission port 50
  • the storage unit 41 is connected. It is understandable that different connection relationships can be selected according to different needs.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

本发明提供一种读写方法及存储器装置,读写方法为:对存储器装置施加读命令,读命令指向地址信息,从读命令所指向的地址信息对应的存储单元中读取待读出数据,若待读出数据发生错误,则将读命令所指向的地址信息与备用存储单元关联,并将读命令所指向的地址信息及其与备用存储单元的关联信息按预设规则备份在非易失性存储单元中。本发明将发生数据错误的存储单元实时地区分出,并采用备用存储单元替换,大大提高存储器装置可靠性,并延长寿命。同时,将读命令所指向的地址信息及其与备用存储单元的关联信息备份在非易失性存储单元,作为后续读写操作依据,大大提高了存储器装置运行速度。

Description

读写方法及存储器装置
相关申请引用说明
本申请要求于2020年04月01日递交的中国专利申请号202010250023.3,申请名为“读写方法及存储器装置”的优先权,其全部内容以引用的形式附录于此。
技术领域
本发明涉及半导体存储领域,尤其涉及一种读写方法及存储器装置。
背景技术
半导体存储器是用来存储各种数据信息的记忆部件。随着电路复杂度的提升,各种形式的存储器装置在制造上或者使用过程中无可避免地容易产生不良或受损的存储单元,导致半导体存储器装置可靠度降低,寿命减少。
因此,如何提高存储器装置的可靠性及延长所述存储器装置的寿命,成为目前亟需解决的问题。
发明内容
本发明所要解决的技术问题是,提供一种读写方法及存储器装置,其能够大大提高存储器装置的可靠性,并延长存储器装置的寿命。
本发明提供一种读写方法,对存储器装置施加读命令,所述读命令指向地址信息,从所述读命令所指向的地址信息对应的存储单元中读取待读出数据,若所述待读出数据发生错误,则将所述读命令所指向的地址信息与备用存储单元关联,并将所述读命令所指向的地址信息及其与备用存储单元的关联信息按预设规则备份在非易失性存储单元中。
进一步,所述预设规则为预设周期或者预设动作。
进一步,所述读写方法还包括如下步骤:在所述储存器装置开启后,自所述非易失性存储单元中载入地址信息及其与备用存储单元的关联信息。
进一步,所述读写方法还包括如下步骤:生成用于标识所述备用存储单元的识别码,所述读命令所指向的地址信息通过所述识别码与所述备用存储单元关联。
进一步,所述读写方法还包括如下步骤:若所述待读出数据发生错误,则将所述读命令所指向的地址信息标记为无效,并将所述无效的标记按所述预设规则备份在所述非易失性存储单元中,在所述储存器装置开启后,自所述非易失性存储单元中载入所述无效的标记。
进一步,若所述待读出数据没有发生错误,则将所述读命令所指向的地址信息标记为有效,并将所述有效的标记按所述预设规则备份在所述非易失性存储单元中,在所述储存器装置开启后,自所述非易失性存储单元中载入所述有效的标记。
进一步,未被标记为无效的地址信息,其初始设置为有效,并将所述有效的标记按所述预设规则备份在所述非易失性存储单元中,在所述储存器装置开启后,自所述非易失性存储单元中载入所述有效的标记。
进一步,从所述读命令所指向的地址信息对应的存储单元中读取待读出数据的步骤还包括:从所述读命令所指向的地址信息对应的存储单元中读取与所述待读出数据对应的第 一ECC编码;判断所述待读出数据是否发生错误的方法包括:对所述第一ECC编码进行解码,以判断所述待读出数据是否发生错误。
进一步,提供查找表,所述查找表记录有所述存储单元的地址信息及与所述地址信息对应的数值码,所述数值码由第一类型码及第二类型码组成,所述第一类型码用于标记所述地址信息是否有效,所述第二类型码用于记录所述备用存储单元的识别码,若所述待读出数据发生错误,则在查找表中将所述读命令所指向的地址信息对应的数值码的第一类码修改为无效标记值,将所述第二类型码修改为用于标识备用存储单元的识别码。
进一步,所述读写方法还包括如下步骤:记录所述第二类型码的修改次数,并根据所述修改次数生成对应的识别码。
进一步,所述数值码具有一初始值,在所述初始值中,所述第一类型码包括为有效标记值或者无效标记值,所述第二类型码为无意义值码。
进一步,对所述存储器装置施加写命令,若所述写命令所指向的地址信息的标记为有效,则对所述写命令所指向的地址信息对应的存储单元执行写操作,若所述写命令所指向的地址信息的标记为无效,则停止对所述写命令所指向的地址信息对应的存储单元执行写操作,并对与所述写命令所指向的地址信息对应的所述识别码标识的备用存储单元执行写操作。
进一步,对存储器装置施加写命令时,以所述写命令所指向的地址信息为索引,在所述查找表中查找所述数值码。
进一步,对所述写命令所指向的地址信息对应的存储单元执行写操作的步骤进一步包括:形成与所述写操作中待写入数据对应的第二ECC编码,并将其与所述待写入数据一并写入所述写命令所指向的地址信息对应的存储单元中。
进一步,在所述对存储器装置施加读命令之后,在所述从所述读命令所指向的地址信息对应的存储单元中读取待读出数据之前,还包括:判断所述读命令所指向的地址信息是否有效,若所述读命令所指向的地址信息有效,则对所述读命令所指向的地址信息对应的存储单元执行读操作,若所述读命令所指向的地址信息的标记为无效,则停止对所述读命令所指向的地址信息对应的存储单元执行读操作,并对与所述读命令所指向的地址信息对应的所述识别码标识的备用存储单元执行读操作。
进一步,所述读写方法进一步包括如下步骤:在所述待读出数据发生错误的情况下,若对所述待读出数据进行修正,则将修正后的数据存储在所述备用存储单元中;若未对待读出数据进行修正,则将所述待读出数据存储在所述备用存储单元中。
本发明还提供一种存储器装置,其包括:命令接收单元,用于接收读命令或写命令;存储单元,与所述读命令或写命令对应的地址信息对应;备用存储单元;关联单元,用于记录所述地址信息及其与所述备用存储单元的关联信息;执行单元,用于对所述存储单元或所述备用存储单元执行读操作或写操作;非易失性存储单元,用于按预设规则备份所述关联单元记录的所述地址信息及其与所述备用存储单元的关联信息。
进一步,所述存储器装置还包括识别码生成单元,与所述关联单元连接,用于生成识 别所述备用存储单元的识别码,所述关联单元通过所述识别码将所述地址信息与所述备用存储单元关联。
进一步,所述关联单元还用于记录标记信息,所述标记信息记录所述地址信息有效或者无效。
进一步,所述关联单元为查找表,所述查找表记录有所述存储单元的地址信息及与所述地址信息对应的数值码,所述数值码由第一类型码及第二类型码组成,所述第一类型码用于标记所述地址信息是否有效,所述第二类型码用于记录所述备用存储单元的识别码,若所述待读出数据发生错误,则在查找表中将所述读命令所指向的地址信息对应的数值码的第一类码修改为无效标记值,将所述第二类型码修改为用于标识备用存储单元的识别码。
进一步,所述存储器装置还包括载入单元,所述载入单元与所述关联单元及所述非易失性存储单元连接,用于将备份在所述非易失性存储单元中的地址信息及标记信息载入所述关联单元。
进一步,所述存储器装置还包括ECC编码解码单元,用于解码读操作中与待读出数据对应的第一ECC编码及形成写操作中与待写入数据对应的第二ECC编码。
进一步,所述存储器装置包括逻辑层及至少一存储层,所述命令接收单元、所述关联单元及所述执行单元设置在所述逻辑层,所述存储单元设置在所述存储层,所述备用存储单元设置在所述存储层或所述逻辑层,所述非易失性存储单元设置在所述存储层或所述逻辑层。
本发明的优点在于,在用户对存储器装置执行读写操作时将发生数据错误的存储单元实时地区分出来,并采用备用存储单元替换,以在后续用户对所述存储器装置执行读写操作时,可对备用存储单元执行读写操作,而不对数据发生错误的存储单元执行读写操作,能够大大提高存储器装置的可靠性,并延长存储器装置的寿命。同时,本发明读写方法还将所述读命令所指向的地址信息及其与备用存储单元的关联信息按预设规则备份在非易失性存储单元中,在存储器装置再次上电后,自所述非易失性存储单元中载入所述地址信息及其与备用存储单元的关联信息。所述关联信息作为后续读写操作中所述地址信息与备用存储单元的初始关联信息,从而可避免存储器装置再次上电后对已经关联过备用存储单元的地址信息重新关联备用存储单元,大大提高了存储器装置的运行速度。
附图说明
图1是本发明读写方法的第一具体实施方式的流程示意图;
图2是本发明读写方法的第二具体实施方式的流程示意图;
图3是本发明读写方法的第三具体实施方式的流程示意图;
图4是本发明存储器装置的第一具体实施方式的框架示意图;
图5是本发明存储器装置的第二具体实施方式的框架示意图;
图6是本发明存储器装置的第三具体实施方式的框架示意图;
图7是本发明存储器装置的第四具体实施方式的框架示意图;
图8是本发明存储器装置的第五具体实施方式的框架示意图;
图9是本发明存储器装置的第六具体实施方式的框架示意图。
具体实施方式
下面结合附图对本发明提供的读写方法及存储器装置的具体实施方式做详细说明。
一种常见的改善存储器装置可靠性的方法是在数据写入存储器装置之前事先将数据编码为错误修正码(Error Correction Code,ECC),同时将数据和错误修正码储存于存储器装置中。当读出时,同时读取数据和错误修正码,解码错误修正码以还原可能发生错误的数据。
但是,发明人发现,错误修正码仅能够在数据被读出时修正数据,存储器中发生数据错误的存储单元依然存在。若在后续的数据存储过程中,该发生数据错误的存储单元对应的存储段再出现至少一个发生数据错误的存储单元,则该存储段会存在至少两个数据错误的存储单元。而错误修正码将无法对该错误进行修正,导致该存储段不能使用,甚至会导致存储器装置不能使用,从而影响存储器装置的可靠性及寿命。
发明人研究发现,在用户使用存储器装置时,若是能够将发生数据错误的存储单元实时地区分出来,并采用备用存储单元替换,则可避免再对数据发生错误的存储单元(即失效的存储单元)执行读写操作,进而能够大大提高存储器装置的可靠性,并延长存储器装置的寿命。因此,本发明提供一种读写方法,其不仅能够将发生数据错误的存储单元实时地区分出来,并采用备用存储单元替换发生数据错误的存储单元,还能够按预设规则将所述地址信息及其与备用存储单元的关联信息备份在非易失性存储单元中。
在本发明读写方法的第一具体实施方式中,在执行读操作时,将待读出数据发生错误的存储单元实时地区分出来,并采用备用存储单元替换。具体地说,请参阅图1,其为本发明读写方法的第一具体实施方式的流程示意图,所述读写方法包括如下步骤:
步骤S10,对存储器装置施加读命令,所述读命令指向地址信息。例如,所述读命令指向的地址信息为A0。
步骤S11,从所述读命令所指向的地址信息对应的存储单元中读取待读出数据。例如,从所述地址信息A0对应的存储单元中读取待读出数据。
步骤S12,判断所述待读出数据是否发生错误。
若所述待读出数据发生错误,说明该存储单元失效,则将所述读命令所指向的地址信息与备用存储单元关联,并将所述待读出数据存储在所述备用存储单元中。即采用备用存储单元替换失效的存储单元,以提高存储器装置的可靠性。进一步,在本发明另一具体实施方式中,在所述待读出数据发生错误的情况下,若对所述待读出数据进行了修正,则将对所述待读出数据进行修正后的数据存储在所述备用存储单元中。
进一步,为了将所述读命令所指向的地址信息与备用存储单元关联,在本具体实施方式中,所述读写方法还包括步骤S13,生成用于标识所述备用存储单元的识别码,所述标识码存储在所述查找表10中,所述读命令所指向的地址信息通过所述识别码与所述备用存储单元关联。可以理解的是,不同的备用存储单元对应的识别码不同,以保证所述读命令所指向的地址信息关联的备用存储单元不会重复,进而避免数据存储发生错误。
在本具体实施方式中,提供一查找表10,所述查找表10设置有地址信息栏ADD及数 值栏DATA。
所述地址信息栏ADD预存有所述存储器装置的所有地址信息,例如A0、A1、A2、A3、A4、A5、A6……An,所述地址信息的数量可根据所述存储器装置的实际情况设置。
所述数值栏DATA用于存储所述地址信息对应的数值码。其中,每一所述地址信息对应一个数值码。所述数值码至少包括用于识别备用存储单元的识别码或者无意义码。
在本具体实施方式中,所述数值码由第一类型码及第二类型码组成。
所述第一类型码用于标记所述地址信息是否有效。例如,所述第一类型码为0或者1,0为表示所述地址信息有效的有效标记值,1为表示所述地址信息无效的无效标记值。
具体地说,若所述待读出数据发生错误,说明该存储单元失效,则将所述读命令所指向的地址信息标记为无效。例如,若从所述读命令所指向的地址信息A0对应的存储单元中读取的待读出数据发生错误,则在所述查找表10中将所述读命令所指向的地址信息A0对应的数值码的第一类型码标记为无效标记值1;若从所述读命令所指向的地址信息A4对应的存储单元中读取的待读出数据发生错误,则在所述查找表10中将所述读命令所指向的地址信息A4对应的数值码的第一类型码标记为无效标记值1。
所述第二类型码用于记录所述识别码或者无意义码。所述第二类型码可以为多位,其可根据备用存储单元的数量而确定。例如,所述第二类型码为三位,其可为000、001、010、100、101、011、110、111等。
其中,当所述第一类型码为所述地址信息无效的无效标记值时(例如所述第一类型码为1时),所述第二类型码为所述识别码,所述读命令所指向的地址信息通过所述识别码与备用存储单元关联,并将待读出数据存储在所述备用存储单元中。例如,所述地址信息A0对应的数值码的第一类型码为无效标记值1,则所述地址信息A0对应的数值码的第二类型码001为能够识别一个备用存储单元的识别码,所述读命令所指向的地址信息通过所述识别码001与备用存储单元关联,并将待读出数据存储在该识别码001标识的所述备用存储单元中;所述地址信息A4对应的数值码的第一类型码为无效标记值1,则所述地址信息A4对应的数值码的第二类型码010为能够识别备用存储单元的识别码,所述读命令所指向的地址信息通过所述识别码010与备用存储单元关联,并将待读出数据存储在该识别码010标识的所述备用存储单元中。
若所述待读出数据没有发生错误,说明该存储单元有效,则在所述查找表10中,所述读命令所指向的地址信息对应的数值码的第一类型码为有效标记值,所述第二类型码为无意义码。所述无意义码仅用于填充数位,其不用于识别任何一个备用存储单元。
具体地说,在本具体实施方式中,从所述读命令所指向的地址信息A1对应的存储单元中读取待读出数据没有发生错误,则在所述查找表10中,所述读命令所指向的地址信息A1对应的数值码的第一类型码为有效标记值0,所述第二类型码为无意义码000;若从所述读命令所指向的地址信息A2对应的存储单元中读取待读出数据没有发生错误,则在所述查找表10中,所述读命令所指向的地址信息A2对应的数值码的第一类型码为有效标记值0,所述第二类型码为无意义码000。在本具体实施方式中,以数值000表示无意义码,在 本发明其他具体实施方式中,也可设置其他数值表示无意义码。
在本发明中,将所述读命令所指向的地址信息对应的数值码的第一类型码设置为有效标记值有如下两种处理方式:
将所述读命令所指向的地址信息对应的数值码的第一类型码设置为有效标记值的第一种处理方式是,在所述查找表中,所有的地址信息对应的数值码均被初始设置为有效标记值与无意义码的组合,则若所述待读出数据没有发生错误,则不修改所述查找表中的数值码,即保留数值码的初始设置。例如,若从读命令所指向的地址信息A1对应的存储单元中读取的待读出数据没有发生错误,则在所述查找表10中将所述读命令所指向的地址信息所A1对应的数值码保留为初始设置,即不修改所述数值码的初始设置。在本具体实施方式中,采用的是该种处理方式。
对于该第一种处理方式,在从读命令所指向的地址信息对应的存储单元中读取的待读出数据发生错误的情况下,才在所述查找表10中将所述读命令所指向的地址信息对应的数值码的第一类型码由有效标记值修改为无效标记值,并将所述数值码的第二类型码由无意义码修改为识别码。例如,若从读命令所指向的地址信息A0对应的存储单元中读取的待读出数据发生错误,则在所述查找表10中将所述读命令所指向的地址信息A0对应的数值码的第一类型码由有效标记值修改为无效标记值,并将所述数值码的第二类型码由无意义码修改为识别码。
进一步,在该第一种处理方式中,在所述存储器装置上电或出厂时,在所述查找表中,所有的地址信息对应的数值码均被初始设置为有效标记值与无意义码的组合。可以理解的是,随着所述存储器装置的使用,在多次对所述存储器装置执行读写操作后,在所述查找表中,所述地址信息对应的数值码可能为无效标记值与识别码的组合,也可能为有效标记值与无意义码的组合。因此,在对所述存储器装置施加读命令时,前次读写操作后的查找表即为当前读操作的初始查找表,所述初始查找表记录有经前次读写操作后所述存储单元的地址信息对应的数值码,该数值码为当前读操作的初始数值码,所述数值码可能为无效标记值与识别码的组合,也可能为有效标记值与无意义码的组合。若所述待读出数据发生错误,则在查找表10中将所述读命令所指向的地址信息的数值码修改为无效标记值与无意义码的组合。
进一步,本发明读写方法还包括如下步骤:记录所述第二类型码的修改次数,并根据所述修改次数生成对应的识别码。具体地说,若所述读命令所指向的地址信息发生数据错误,则需要修改第二类型码为识别码,以通过所述识别码将所述地址信息与一个备用存储单元关联。为了避免不同的地址信息关联的备用存储单元重复,可根据所述第二类型码的修改次数生成不同的识别码,即不同的地址信息对应的识别码不同,从而将不同的地址信息与不同的备用存储单元关联。例如,当所述第二类型码修改次数为0时,所述识别码为001,当所述第二类型码修改次数为1时,所述识别码为010,当所述第二类型码修改次数为2时,所述识别码为100……,以此类推,根据所述修改次数生成对应的识别码。
将所述读命令所指向的地址信息对应的数值码的第一类型码设置为有效标记值的第二 种处理方式是,若所述待读出数据没有发生错误,则在查找表10中将所述读命令所指向的地址信息对应的数值码的第一类型码标记为有效标记值,并采用无意义码填充所述第二类型码的位置。例如,若从读命令所指向的地址信息A1对应的存储单元中读取的待读出数据没有发生错误,则在所述查找表10中将所述读命令所指向的地址信息A1对应的数值码的第一类型码标记为有效标记值0,并采用无意义码填充所述第二类型码的位置。
在本发明另一具体实施方式中,所述数值码也可以仅由第二类型码组成,即所述数值码仅包括用于识别备用存储单元的识别码或者无意义码。若所述待读出数据发生错误,说明该存储单元失效,则所述存储单元对应的地址信息对应的数值码为识别码,若所述待读出数据没有发生错误,说明该存储单元有效,则所述存储单元对应的地址信息对应的数值码为无意义码。
本发明读写方法还包括如下步骤:步骤S14,将所述读命令所指向的地址信息及其与备用存储单元的关联信息按预设规则备份在非易失性存储单元中。具体地说,在本具体实施方式中,将所述查找表10按预设规则备份在所述非易失性存储单元中。
其中,所述预设规则可为预设周期或者预设动作。
所述预设周期可为存储器装置上电后的预设时间周期,例如存储器装置上电后以十分钟作为一个周期将所述读命令所指向的地址信息及其与备用存储单元的关联信息备份在非易失性存储单元中,即存储器装置上电后每隔十分钟将所述读命令所指向的地址信息及其与备用存储单元的关联信息备份在非易失性存储单元中;或者以一个小时作为一个周期将所述读命令所指向的地址信息及其与备用存储单元的关联信息备份在非易失性存储单元中,即存储器装置上电后每隔一个小时将所述读命令所指向的地址信息及其与备用存储单元的关联信息备份在非易失性存储单元中。
所述预设动作可为所述存储器装置接收到的操作。例如,存储器装置接收到的关闭存储器装置的操作、重启存储器装置的操作、用户或者系统设定的包含备份所述地址信息及所述标记指令的触发操作等。其中,所述触发操作可以为用户点击某一触发按钮的操作、或者关闭某一触发按钮的操作等任何发出触发指令的操作,本发明对此不做任何限定。
本发明读写方法在非易失性存储单元中备份所述地址信息及其与备用存储单元的关联信息,若存储器装置掉电,所述地址信息及其与备用存储单元的关联信息依然会记录在非易失性存储单元中,不会被清除,可作为后续读写操作的依据。在本具体实施方式中,所述查找表10备份在非易失性存储单元中,即所述查找表10中记录的所述地址信息及其对应的数值码被备份在非易失性存储单元中。
进一步,本发明读写方法还包括如下步骤:步骤S15,在所述储存器装置开启(即存储器装置再次上电)后,自所述非易失性存储单元中载入地址信息及其与备用存储单元的关联信息。具体地说,在本具体实施方式中,在所述储存器装置开启(即存储器装置再次上电)后,自所述非易失性存储单元中载入所述查找表10。所述查找表10中记录的地址信息对应的数值码作为后续读写操作的初始数值码,从而可避免存储器装置再次上电后对已经修改过的数值码重新修改,避免对失效的存储单元与备用存储单元进行重新关联,大大提 高了存储器装置的运行速度。
进一步,本发明还提供一种判断所述待读出数据是否发生错误的方法。具体地说,在从所述读命令所指向的地址信息对应的存储单元中读取待读出数据的步骤还包括:从所述读命令所指向的地址信息对应的存储单元中读取与所述待读出数据对应的第一ECC编码。例如,从所述读命令所指向的地址信息对应的存储单元中读取的数据的位数为64b+8b,其中64b为所述待读出数据位数,8b为所述第一ECC编码的位数。根据相应的算法,对所述第一ECC编码进行解码,可还原可能发生错误的数据,所述算法为现有技术,不再赘述。因此,可依据对所述第一ECC编码进行解码判断所述待读出数据是否发生错误。
本发明列举一种依据对所述第一ECC编码进行解码判断所述待读出数据是否发生错误的方法:将待读出数据重新编码,形成一个新的ECC编码,将所述新的ECC编码与所述第一ECC编码进行每位异或比对,若每位均一致,说明所述待读出数据没有发生错误,所述存储单元有效,则不对所述查找表10进行修改,该存储单元对应的地址信息对应的数值码的第一类型码为有效标记值;若所述新的ECC编码与所述第一ECC编码存在不一致的情况,说明待读出数据发生错误,所述存储单元失效,则在所述查找表10中将所述读命令所指向的地址信息对应的数值码的第一类型码修改为无效标记值。
其中,若所述待读出数据没有发生错误,则将所述待读出数据作为所述存储器装置的输出数据,若所述待读出数据发生错误,则可利用所述第一ECC编码进行修正,将修正后的数据作为所述存储器装置的输出数据,并将修正后的数据存储在对应的备用存储单元中。
本发明读写方法可在用户对存储器装置执行读写操作时将发生数据错误的存储单元实时地区分出来,并采用备用存储单元替换。即每进行一次读操作,都会将数据发生错误的存储单元采用备用存储单元替换,以在后续用户对所述存储器装置执行读写操作时,可对备用存储单元进行读写操作,而不对数据发生错误的存储单元进行读写操作,能够大大提高存储器装置的可靠性,并延长存储器装置的寿命。
同时,本发明读写方法还将所述读命令所指向的地址信息及其与备用存储单元的关联信息按预设规则备份在非易失性存储单元中,在存储器装置再次上电后,自所述非易失性存储单元中载入所述地址信息及其与备用存储单元的关联信息。所述关联信息作为后续读写操作中所述地址信息与备用存储单元的初始关联信息,从而可避免存储器装置再次上电后对已经关联过备用存储单元的地址信息重新关联备用存储单元,大大提高了存储器装置的运行速度。
本发明读写方法还提供第二具体实施方式。在所述对存储器装置施加读命令之后,在所述从所述读命令所指向的地址信息对应的存储单元中读取待读出数据之前,还包括:判断所述读命令所指向的地址信息是否有效的步骤。具体地说,请参阅图2,其为本发明读写方法的第二具体实施方式的流程示意图。
步骤S20,向存储器装置施加读命令,所述读命令指向地址信息。
步骤S21,判断所述读命令所指向的地址信息是否有效。
具体地说,对存储器装置施加读命令时,以所述读命令所指向的地址信息为索引,在 查找表20中查找所述标记。在所述查找表20中,若所述读命令所指向的地址信息对应的数值码的第一类型码为有效标记值,则说明所述读命令所指向的地址信息有效,若所述读命令所指向的地址信息对应的数值码的第一类型码为无效标记值,则说明所述读命令所指向的地址信息无效。
例如,所述读命令指向的地址信息为A1,以所述读命令所指向的地址信息A1为索引,在所述查找表20中查找所述标记。在所述查找表20中,所述读命令所指向的地址信息A1对应的数值码的第一类型码为有效标记值0,则说明所述读命令所指向的地址信息A1有效。
再例如,所述读命令指向的地址信息为A4。以所述读命令所指向的地址信息A4为索引,在查找表20中查找所述标记。在所述查找表20中,所述读命令所指向的地址信息A4对应的数值码的第一类型码为无效标记值1,则说明所述读命令所指向的地址信息A4无效。
若所述读命令所指向的地址信息有效,则对所述读命令所指向的地址信息对应的存储单元执行读操作,即执行步骤S22。例如,在查找表20中,所述读命令所指向的地址信息A1对应的数值码的第一类型码为有效标记值0,说明所述读命令所指向的地址信息A1对应的存储单元有效,则对所述读命令所指向的地址信息A1对应的存储单元执行读操作,即执行步骤S22,在步骤S22中,所述读命令所指向的地址信息为地址信息A1。
进一步,若所述读命令所指向的地址信息对应的数值码的第一类型码为有效标记值,则不再对所述数值码的第二类型码进行识别。
若所述读命令所指向的地址信息无效,即在所述查找表20中,所述读命令所指向的地址信息对应的数值码的第一类型码为无效标记值,说明所述读命令所指向的地址信息对应的存储单元失效,则停止对所述写命令所指向的地址信息对应的存储单元执行读操作,并执行步骤S23。例如,若在所述查找表20中,所述读命令所指向的地址信息A4对应的数值码的第一类型码为无效标记值1,则停止对所述写命令所指向的地址信息对应的存储单元执行读操作,并执行步骤S23。
进一步,在本发明另一具体实施方式中,所述数值码也可以仅由第二类型码组成,即所述数值码仅包括用于识别备用存储单元的识别码或者无意义码。对存储器装置施加读命令时,以所述读命令所指向的地址信息为索引,在查找表20中查找所述数值码。在所述查找表20中,若所述读命令所指向的地址信息对应的数值码为无意义码,则说明所述读命令所指向的地址信息对应的存储单元有效,则对所述存储单元执行读操作,即执行步骤S22;若所述读命令所指向的地址信息对应的数值码为识别码,则说明所述读命令所指向的地址信息对应的存储单元无效,则对所述识别码所对应的备用存储单元执行读操作,即执行步骤S23。
步骤S22,从所述读命令所指向的地址信息对应的存储单元中读取待读出数据。例如,从所述读命令所指向的地址信息A1对应的存储单元中读取待读出数据。该步骤与第一具体实施方式中的步骤S11相同。
步骤S23,对所述读命令所指向的地址信息对应的数值码的第二类型码(即识别码)标识的备用存储单元执行读操作。例如,若在所述查找表20中,所述读命令所指向的地址信 息A4对应的数值码的第一类型码为无效标记值1,则对所述读命令所指向的地址信息A4对应的数值码的第二类型码101所标识的备用存储单元执行读操作。在步骤S23之后执行步骤S25。
步骤S24,判断所述待读出数据是否发生错误。该步骤与第一具体实施方式中的步骤S12相同。若所述待读出数据发生错误,则在所述查找表20中将所述读命令所指向的地址信息对应的数值码的第一类型码标记为无效标记值,将第二类型码修改为用于识别备用存储单元的识别码,并将待读出数据存储在备用存储单元中;若所述待读出数据未发生错误,则在所述查找表20中将所述读命令所指向的地址信息对应的数值码的第一类型码修改为有效标记值,第二类型码采用无意义码填充,或者在所述查找表20的数值码均被初始设置为有效标记值与无意义码的组合时,不对所述查找表做修改。在本具体实施方式中,采用的是不修改所述查找表的方式。进一步,在本发明另一具体实施方式中,在所述待读出数据发生错误的情况下,若对所述待读出数据进行了修正,则将对所述待读出数据进行修正后的数据存储在所述备用存储单元中。
步骤S25,输出数据。在该步骤中,输出的数据可为备用存储单元存储的数据,与可为存储单元中被修正或没有被修正的待读取数据。
步骤S26,将所述查找表20按预设规则备份在非易失性存储单元中。该步骤与步骤S14相同,所述预设规则可为预设周期或者预设动作。
步骤S27,在所述存储器装置开启后,自所述非易失性存储单元中载入所述查找表20。该步骤与步骤S15相同。所述查找表20中记录的地址信息对应的数值码作为读写操作的初始数值码,从而可避免存储器装置再次上电后对已经关联过备用存储单元的地址信息重新关联备用存储单元,大大提高了存储器装置的运行速度。
在所述第二具体实施方式中,在对所述存储器装置施加读命令后,判断所述读命令所指向的地址信息是否有效,以可选择性地对所述读命令所指向的地址信息执行读命令,从而可提高存储器装置的可靠性。另外,在读出待读出数据后,还可根据所述待读出数据是否发生错误而对该存储单元的地址信息标记,并在所述待读出数据发生错误的情况下,采用备用存储单元替换存储单元,并将修正后的数据存储在备用存储单元中,以为后续的读写操作提供基础,大大提高了存储器装置的可靠性及寿命。
需要说明的是,在另一具体实施方式中,在步骤S23之后也可继续判断从对应备用存储单元中读出的数据是否发生错误,如果数据未发生错误则输出数据;如果数据发生错误,改变所述读命令所指向的地址信息对应的第二类型码的数值,将其关联到另一备用存储单元,并可将修正后的待读出数据存入新的备用存储单元中。
本发明读写方法还提供第三具体实施方式。该第三具体实施方式为对存储器装置的写操作。具体地说,请参阅图3,其为本发明读写方法的第三具体实施方式的流程示意图。
步骤S30,对所述存储器装置施加写命令,所述写命令指向地址信息。例如,对所述存储器装置施加写命令,所述写命令指向地址信息A0。
步骤S31,判断所述写命令所指向的地址信息是否有效。
在本具体实施方式中,以所述写命令所指向的地址信息为索引,在查找表中查找所述地址信息对应的标记,以根据所述标记判断所述写命令所指向的地址信息是否有效。
例如,若所述写命令所指向的地址信息为A0,则以所述写命令所指向的地址信息A0为索引,在查找表30中查找所述地址信息A0对应的数值码的第一类型码,以根据所述第一类型码判断所述写命令所指向的地址信息A0是否有效;若所述写命令所指向的地址信息为A1,则以所述写命令所指向的地址信息A1为索引,在查找表30中查找所述地址信息A1对应的数值码的第一类型码,以根据所述第一类型码判断所述写命令所指向的地址信息A1是否有效。
若所述写命令所指向的地址信息的标记为有效,则对所述写命令所指向的地址信息对应的存储单元执行写操作,若所述写命令所指向的地址信息对应的数值码的第一类型码为无效标记值,则停止对所述写命令所指向的地址信息对应的存储单元执行写操作,并识别所述数值码的第二类型码,并对所述第二类型码标识的备用存储单元执行写操作。
例如,在查找表30中,所述写命令所指向的地址信息A0对应的数值码的第一类型码为无效标记值1,则停止对所述写命令所指向的地址信息A0对应的存储单元执行写操作,并识别所述数值码的第二类型码001,并对所述第二类型码001标识的备用存储单元执行写操作;在所述查找表中,所述写命令所指向的地址信息A1对应的数值码的第一类型码为有效标记值0,则对所述写命令所指向的地址信息A1对应的存储单元执行写操作。
步骤S32,将所述查找表30按预设规则备份在非易失性存储单元中。该步骤与步骤S14相同,所述预设规则可为预设周期或者预设动作。
步骤S33,在所述存储器装置开启后,自所述非易失性存储单元中载入所述查找表30。该步骤与步骤S15相同。所述查找表30中记录的地址信息对应的数值码作为读写操作的初始数值码,从而可避免存储器装置再次上电后对已经关联过备用存储单元的地址信息重新进行关联备用存储单元的操作,大大提高了存储器装置的运行速度。
进一步,在本发明另一具体实施方式中,所述数值码也可以仅由第二类型码组成,即所述数值码仅包括用于识别备用存储单元的识别码或者无意义码。对存储器装置施加写命令时,以所述写命令所指向的地址信息为索引,在查找表30中查找所述数值码。在所述查找表30中,若所述写命令所指向的地址信息对应的数值码为无意义码,则说明所述写命令所指向的地址信息对应的存储单元有效,则对所述存储单元执行写操作;若所述写命令所指向的地址信息对应的数值码为识别码,则说明所述写命令所指向的地址信息对应的存储单元无效,则对所述识别码所对应的备用存储单元执行写操作。
进一步,在本第三具体实施方式中,所述读写方法还包括如下步骤:形成与所述写操作中待写入数据对应的第二ECC编码,并将其与所述待写入数据一并写入所述写命令所指向的地址信息对应的存储单元中。当读出该存储单元中的数据时,同时读取数据和第二ECC编码,解码所述第二ECC编码以还原可能发生错误的数据。
在本第三具体实施方式中,本发明读写方法在对存储器装置施加写命令之后判断所述写命令所指向的地址是否有效,若无效,则对其对应的备用存储单元执行写操作,进而可 避免对失效的存储单元执行写操作,从而提高存储器装置的可靠性,并延长存储器装置的寿命。
本发明还提供一种能够实现上述读写方法的存储器装置。所述存储器装置包括但不限于DRAM、SRAM等易失性存储器,以及NAND、NOR、FeRAM、RRAM、MRAM、PCRAM等非易失存储器。
请参阅图4,其为本发明存储器装置的第一具体实施方式的框架示意图。所述存储器装置包括命令接收单元40、存储单元41、关联单元42、执行单元43、备用存储单元44及非易失性存储单元45。
所述命令接收单元40用于接收施加在存储器装置的读命令、写命令或者读/写命令所指向的地址信息。
所述存储单元41与所述读命令或写命令对应的地址信息对应,并用于存储数据。在本发明中,所述存储单元41可为存储基本单元(cell)、存储段(segment)、存储页(pages)、存储块(blocks)等本领域技术人员熟知的存储单位,本发明对此不进行限制。
所述关联单元42用于记录所述地址信息及其与所述备用存储单元的关联信息。在本具体实施方式中,所述关联单元42还用于存储标记信息,所述标记信息记录所述地址信息有效或者无效。具体地说,在本具体实施方式中,所述关联单元42为查找表。所述查找表记录有所述存储单元41的地址信息及与所述地址信息对应的数值码。所述数值码由第一类型码及第二类型码组成,所述第一类型码用于标记所述地址信息是否有效,所述第二类型码用于记录所述备用存储单元44的识别码。若所述待读出数据发生错误,则在查找表中将所述读命令所指向的地址信息对应的数值码的第一类型码修改为无效标记值,将所述第二类型码修改为用于标识备用存储单元44的识别码。
所述执行单元43用于控制对所述存储单元41执行读操作或写操作。所述执行单元43还与所述关联单元42连接,用于根据所述关联单元42的记录对所述地址信息对应的存储单元41执行读操作或者写操作,或停止对所述地址信息对应的存储单元41执行读操作或写操作。具体地说,若所述读命令或者写命令所指向的地址信息对应的数值码的第一类型码为有效标记值,则所述执行单元43对所述地址信息对应的存储单元执行读操作或写操作,若所述读命令或写命令所指向的地址信息对应的数值码的第一类型码为无效标记值,则所述执行单元43停止对所述地址信息对应的存储单元执行读操作或写操作,并根据所述数值码的第二类型码对所述第二类型码标识的备用存储单元执行读操作或写操作。
需要说明的是,在其他具体实施方式中,命令接收单元40可直接与执行单元43连接,而关联单元42与执行单元43连接,不与命令接收单元40连接,本发明对此连接方式不做具体限制,本领域内普通技术人员可根据需要自行设置以实现上述功能。
所述备用存储单元44通过所述第二类型码与所述读命令或写命令指向的地址信息对应,并用于存储数据。在本发明中,所述备用存储单元44可为存储基本单元(cell)、存储段(segment)、存储页(pages)、存储块(blocks)等本领域技术人员熟知的存储单位,本发明对此不进行限制。
所述非易失性存储单元45用于按预设规则备份所述地址信息及其与备用存储单元44的关联信息。具体地说,在本具体实施方式中,所述非易失性存储单元45用于按预设规则备份查找表。
所述非易失性存储单元45可以为NAND、NOR、FeRAM、RRAM、MRAM、PCRAM等非易失性存储结构。
所述非易失性存储单元45与所述执行单元43连接,所述执行单元43控制所述地址信息及其与备用存储单元的关联信息按预设规则备份在所述非易失性存储单元45中。其中,所述预设规则可为预设周期或者预设动作。进一步,当所述预设动作为用户输入的触发动作时,所述命令接收单元40能够接收触发动作,所述执行单元43能够根据所述触发动作控制所述地址信息及其与备用存储单元的关联信息备份在所述非易失性存储单元45中。
进一步,所述执行单元43还可控制备份在所述非易失性存储单元45中的地址信息及其与备用存储单元的关联信息载入所述关联单元42中。例如,在所述存储器装置开启后,所述执行单元43控制备份在所述非易失性存储单元45中的地址信息及其与备用存储单元的关联信息载入所述关联单元42中,以作为后续读写操作的依据,从而可避免存储器装置再次上电后对已经关联过备用存储单元的地址信息再重新进行关联备用存储单元的操作,大大提高了存储器装置的运行速度。
进一步,本发明存储器装置还提供一第二具体实施方式。请参阅图5,其为本发明存储器装置的第二具体实施方式的框架示意图,所述第二具体实施方式相较于第一具体实施方式的区别在于,本发明存储器装置还包括识别码生成单元46。所述识别码生成单元46用于生成识别所述备用存储单元的识别码。所述识别码生成单元46与所述关联单元42连接,所述关联单元42能够将数值码的第二类型码修改为所述识别码生成单元46生成的所述识别码。进一步,所述识别码生成单元46能够记录所述关联单元42中数值码的第二类型码的修改次数,从而根据所述修改次数生成识别码。
所述关联单元42通过所述识别码将所述地址信息与所述备用存储单元44关联,从而使得所述执行单元43能够对所述备用存储单元44进行读操作或写操作。
进一步,本发明存储器装置还提供一第三具体实施方式。请参阅图6,其为本发明存储器装置的第三具体实施方式的框架示意图,所述第三具体实施方式相较于第一具体实施方式的区别在于,所述存储器装置还包括载入单元47。
所述载入单元47与所述关联单元42及所述非易失性存储单元45连接,用于将备份在所述非易失性存储单元45中的地址信息及其与备用存储单元的关联信息载入所述关联单元42。进一步,所述载入单元43还与所述执行单元43连接,所述执行单元43控制所述载入单元47将备份在所述非易失性存储单元45中的地址信息及其与备用存储单元的关联信息载入所述关联单元42中。例如,在所述存储器装置开启后,所述执行单元43控制所述载入单元47将备份在所述非易失性存储单元45中的地址信息及其与备用存储单元的关联信息载入所述关联单元42中,以作为后续读写操作的依据,从而可避免存储器装置再次上电后对已经关联过备用存储单元的地址信息再重新进行关联备用存储单元的操作,大大提高 了存储器装置的运行速度。
进一步,本发明存储器装置还提供一第四具体实施方式。请参阅图7,其为本发明存储器装置的第四具体实施方式的框架示意图,所述第四具体实施方式相较于第一具体实施方式的区别在于,所述存储器装置还包括ECC编码解码单元48。
所述ECC编码解码单元48与执行单元43、存储单元41及关联单元42连接。
所述ECC编码解码单元48用于解码读操作中与待读出数据对应的第一ECC编码,以还原有可能发生错误的数据,并可根据所述ECC编码解码单元44是否对数据进行还原来修改所述关联单元42中的数值码。所述ECC编码解码单元48还用于形成写操作中与待写入数据对应的第二ECC编码。
具体地说,在本具体实施方式中,所述命令接收单元接收写命令,在对写命令所指向的地址信息对应的存储单元执行写操作时,所述ECC编码解码单元48形成与写操作中待写入数据对应的ECC编码,并同时存储在所述写命令所指向的地址信息对应的存储单元41中。在该写操作完成后,在后续对该地址信息对应的存储单元执行读操作时,所述ECC编码解码单元48解码所述ECC编码。其中,可根据所述ECC编码解码单元48的解码来判断所述读操作读取的待读出数据是否发生错误,进而修改所述关联单元42中的数值码。
进一步,在本具体实施方式中,可根据所述ECC编码解码单元48是否对数据进行还原来修改所述关联单元42中的数值码。具体地说,若所述ECC编码解码单元48解码所述ECC编码,并对数据进行还原,说明所述读操作读取的待读出数据发生错误,则在所述关联单元42中将该存储单元的地址信息对应的数值码修改为无效标记值与识别码的组合,若所述ECC编码解码单元48解码所述ECC编码,但未对数据进行还原,说明所述读操作读取的待读出数据未发生错误,则在所述关联单元42将所述地址信息对应的数值码修改为有效标记值与无意义码的组合,或者保持所述地址信息对应的数值码的初始标记。
在本发明其他具体实施方式中,所述ECC编码解码单元48解码所述ECC编码,虽然未对数据进行还原,但根据所述ECC编码解码单元48的解码可判断出所述读操作读取的待读出数据发生了错误,则在所述关联单元42中将该存储单元的地址信息对应的数值码修改为无效标记值与识别码的组合。
在第四具体实施方式中,所述执行单元43不仅与ECC编码解码单元48连接,还与存储单元41连接,而在本发明第五具体实施方式中,请参阅图8,其为所述存储器装置的第五具体实施方式的框架示意图,所述执行单元43与ECC编码解码单元48连接,所述ECC编码解码单元48再与存储单元41连接。可以理解的是,可根据不同的需求选择不同的连接关系。
本发明存储器装置还提供第六具体实施方式。请参阅图9,其为所述存储器装置的第六具体实施方式的框架示意图,相较于存储器装置的第四具体实施方式,所述存储器装置包括逻辑层100及若干存储层200(图中仅示出一个存储层情形),所述存储层200可为DRAM芯片,所述逻辑层100可以为控制芯片或中介层等具备逻辑电路的层。所述若干存储层200可以垂直堆叠于所述逻辑层100之上或之下,但本发明不限定于此,也可用其他封装方式 将其集成在一起。
其中,所述命令接收单元40、所述关联单元42、所述执行单元43及所述ECC编码解码单元48均可设置在所述逻辑层100,而所述存储单元41、所述备用存储单元44及所述非易失性存储单元45设置在所述存储层200。在本发明另一具体实施方式中,所述关联单元42、所述ECC编码解码单元48也可设置在所述存储层200,所述备用存储单元44可设置在所述逻辑层100,所述非易失性存储单元45也可设置在所述逻辑层100。
在本具体实施方式中,所述逻辑层100具有至少一第一数据传输端口49,所述存储层200具有至少一第二数据传输端口50。所述逻辑层100与所述存储层200之间通过所述第一数据传输端口49及所述第二数据传输端口50传输指令及数据。
进一步,在第六具体实施方式中,所述执行单元43不仅与ECC编码解码单元48连接,还通过所述第一数据传输端口49及所述第二数据传输端口50与存储单元41连接,而在本发明第七具体实施方式中,所述执行单元43与ECC编码解码单元48连接,所述ECC编码解码单元48再通过所述第一数据传输端口49及所述第二数据传输端口50与存储单元41连接。可以理解的是,可根据不同的需求选择不同的连接关系。
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。

Claims (23)

  1. 一种读写方法,其特征在于,对存储器装置施加读命令,所述读命令指向地址信息,从所述读命令所指向的地址信息对应的存储单元中读取待读出数据,若所述待读出数据发生错误,则将所述读命令所指向的地址信息与备用存储单元关联,并将所述读命令所指向的地址信息及其与备用存储单元的关联信息按预设规则备份在非易失性存储单元中。
  2. 根据权利要求1所述的读写方法,其特征在于,所述预设规则为预设周期或者预设动作。
  3. 根据权利要求1所述的读写方法,其特征在于,所述读写方法还包括如下步骤:在所述储存器装置开启后,自所述非易失性存储单元中载入地址信息及其与备用存储单元的关联信息。
  4. 根据权利要求3所述的读写方法,其特征在于,所述读写方法还包括如下步骤:生成用于标识所述备用存储单元的识别码,所述读命令所指向的地址信息通过所述识别码与所述备用存储单元关联。
  5. 根据权利要求3所述的读写方法,其特征在于,所述读写方法还包括如下步骤:若所述待读出数据发生错误,则将所述读命令所指向的地址信息标记为无效,并将所述无效的标记按所述预设规则备份在所述非易失性存储单元中,在所述储存器装置开启后,自所述非易失性存储单元中载入所述无效的标记。
  6. 根据权利要求5所述的读写方法,其特征在于,若所述待读出数据没有发生错误,则将所述读命令所指向的地址信息标记为有效,并将所述有效的标记按所述预设规则备份在所述非易失性存储单元中,在所述储存器装置开启后,自所述非易失性存储单元中载入所述有效的标记。
  7. 根据权利要求5所述的读写方法,其特征在于,未被标记为无效的地址信息,其初始设置为有效,并将所述有效的标记按所述预设规则备份在所述非易失性存储单元中,在所述储存器装置开启后,自所述非易失性存储单元中载入所述有效的标记。
  8. 根据权利要求7所述的读写方法,其特征在于,从所述读命令所指向的地址信息对应的存储单元中读取待读出数据的步骤还包括:从所述读命令所指向的地址信息对应的存储单元中读取与所述待读出数据对应的第一ECC编码;
    判断所述待读出数据是否发生错误的方法包括:对所述第一ECC编码进行解码,以判断所述待读出数据是否发生错误。
  9. 根据权利要求7所述的读写方法,其特征在于,提供查找表,所述查找表记录有所述存储单元的地址信息及与所述地址信息对应的数值码,所述数值码由第一类型码及第二类型码组成,所述第一类型码用于标记所述地址信息是否有效,所述第二类型码用于记录所述备用存储单元的识别码,若所述待读出数据发生错误,则在查找表中将所述读命令所指向的地址信息对应的数值码的第一类码修改为无效标记值,将所述第二类型码修改为用于标识备用存储单元的识别码。
  10. 根据权利要求9所述的读写方法,其特征在于,所述读写方法还包括如下步骤:记录所述第二类型码的修改次数,并根据所述修改次数生成对应的识别码。
  11. 根据权利要求10所述的读写方法,其特征在于,所述数值码具有一初始值,在所述初 始值中,所述第一类型码为有效标记值,所述第二类型码为无意义码。
  12. 根据权利要求9所述的读写方法,其特征在于,对所述存储器装置施加写命令,若所述写命令所指向的地址信息的标记为有效,则对所述写命令所指向的地址信息对应的存储单元执行写操作,若所述写命令所指向的地址信息的标记为无效,则停止对所述写命令所指向的地址信息对应的存储单元执行写操作,并对与所述写命令所指向的地址信息对应的所述识别码标识的备用存储单元执行写操作。
  13. 根据权利要求12所述的读写方法,其特征在于,对存储器装置施加写命令时,以所述写命令所指向的地址信息为索引,在所述查找表中查找所述数值码。
  14. 根据权利要求12所述的读写方法,其特征在于,对所述写命令所指向的地址信息对应的存储单元执行写操作的步骤进一步包括:
    形成与所述写操作中待写入数据对应的第二ECC编码,并将其与所述待写入数据一并写入所述写命令所指向的地址信息对应的存储单元中。
  15. 根据权利要求9所述的读写方法,其特征在于,在所述对存储器装置施加读命令之后,在所述从所述读命令所指向的地址信息对应的存储单元中读取待读出数据之前,还包括:判断所述读命令所指向的地址信息是否有效,若所述读命令所指向的地址信息有效,则对所述读命令所指向的地址信息对应的存储单元执行读操作,若所述读命令所指向的地址信息的标记为无效,则停止对所述读命令所指向的地址信息对应的存储单元执行读操作,并对与所述读命令所指向的地址信息对应的所述识别码标识的备用存储单元执行读操作。
  16. 根据权利要求1所述的读写方法,其特征在于,所述读写方法进一步包括如下步骤:在所述待读出数据发生错误的情况下,若对所述待读出数据进行修正,则将修正后的数据存储在所述备用存储单元中;若未对待读出数据进行修正,则将所述待读出数据存储在所述备用存储单元中。
  17. 一种存储器装置,其特征在于,包括:
    命令接收单元,用于接收读命令或写命令;
    存储单元,与所述读命令或写命令对应的地址信息对应;
    备用存储单元;
    关联单元,用于记录所述地址信息及其与所述备用存储单元的关联信息;
    执行单元,用于对所述存储单元或所述备用存储单元执行读操作或写操作;
    非易失性存储单元,用于按预设规则备份所述关联单元记录的所述地址信息及其与所述备用存储单元的关联信息。
  18. 根据权利要求17所述的存储器装置,其特征在于,所述存储器装置还包括识别码生成单元,与所述关联单元连接,用于生成识别所述备用存储单元的识别码,所述关联单元通过所述识别码将所述地址信息与所述备用存储单元关联。
  19. 根据权利要求17所述的存储器装置,其特征在于,所述关联单元还用于记录标记信息,所述标记信息记录所述地址信息有效或者无效。
  20. 根据权利要求19所述的存储器装置,其特征在于,所述关联单元为查找表,所述查找表记录有所述存储单元的地址信息及与所述地址信息对应的数值码,所述数值码由第一类型码及第二类型码组成,所述第一类型码用于标记所述地址信息是否有效,所述第二类型码用于记录所述备用存储单元的识别码,若所述待读出数据发生错误,则在查找表中将所述读命令所指向的地址信息对应的数值码的第一类码修改为无效标记值,将所述第二类型码修改为用于标识备用存储单元的识别码。
  21. 根据权利要求17所述的存储器装置,其特征在于,所述存储器装置还包括载入单元,所述载入单元与所述关联单元及所述非易失性存储单元连接,用于将备份在所述非易失性存储单元中的地址信息及标记信息载入所述关联单元。
  22. 根据权利要求17所述的存储器装置,其特征在于,所述存储器装置还包括ECC编码解码单元,用于解码读操作中与待读出数据对应的第一ECC编码及形成写操作中与待写入数据对应的第二ECC编码。
  23. 根据权利要求17所述的存储器装置,其特征在于,所述存储器装置包括逻辑层及至少一存储层,所述命令接收单元、所述关联单元及所述执行单元设置在所述逻辑层,所述存储单元设置在所述存储层,所述备用存储单元设置在所述存储层或所述逻辑层,所述非易失性存储单元设置在所述存储层或所述逻辑层。
PCT/CN2020/130391 2020-04-01 2020-11-20 读写方法及存储器装置 WO2021196663A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20928574.1A EP4006709A4 (en) 2020-04-01 2020-11-20 READ-WRITE METHOD AND STORAGE DEVICE
US17/310,415 US11886287B2 (en) 2020-04-01 2020-11-20 Read and write methods and memory devices

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010250023.3A CN113495675B (zh) 2020-04-01 2020-04-01 读写方法及存储器装置
CN202010250023.3 2020-04-01

Publications (1)

Publication Number Publication Date
WO2021196663A1 true WO2021196663A1 (zh) 2021-10-07

Family

ID=77928216

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/130391 WO2021196663A1 (zh) 2020-04-01 2020-11-20 读写方法及存储器装置

Country Status (4)

Country Link
US (1) US11886287B2 (zh)
EP (1) EP4006709A4 (zh)
CN (1) CN113495675B (zh)
WO (1) WO2021196663A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4012711A4 (en) * 2020-10-13 2022-11-16 Changxin Memory Technologies, Inc. DATA WRITING METHOD

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101145372A (zh) * 2006-09-13 2008-03-19 日立环球储存科技荷兰有限公司 用于故障数据存储的非易失存储器的盘驱动器
CN101593157A (zh) * 2008-05-27 2009-12-02 中兴通讯股份有限公司 非线性闪存的坏块管理方法及装置
CN101908023A (zh) * 2010-08-06 2010-12-08 四川长虹电器股份有限公司 NandFlash存储器中数据存储方法
US10643668B1 (en) * 2013-08-27 2020-05-05 Seagate Technology Llc Power loss data block marking

Family Cites Families (79)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1074396A (ja) 1996-08-30 1998-03-17 Nec Corp 半導体記憶装置
US5996096A (en) 1996-11-15 1999-11-30 International Business Machines Corporation Dynamic redundancy for random access memory assemblies
US6023434A (en) 1998-09-02 2000-02-08 Micron Technology, Inc. Method and apparatus for multiple row activation in memory devices
US20050022839A1 (en) 1999-10-20 2005-02-03 Savas Stephen E. Systems and methods for photoresist strip and residue treatment in integrated circuit manufacturing
US6418068B1 (en) 2001-01-19 2002-07-09 Hewlett-Packard Co. Self-healing memory
US6854071B2 (en) 2001-05-14 2005-02-08 International Business Machines Corporation Method and apparatus for providing write recovery of faulty data in a non-redundant raid system
US6836438B2 (en) 2002-01-11 2004-12-28 Macronix International Co., Ltd. Method and apparatus for dynamically hiding a defect in an embedded memory
US6801471B2 (en) 2002-02-19 2004-10-05 Infineon Technologies Ag Fuse concept and method of operation
US7159141B2 (en) 2002-07-01 2007-01-02 Micron Technology, Inc. Repairable block redundancy scheme
KR100526186B1 (ko) 2003-04-04 2005-11-03 삼성전자주식회사 플래시 메모리의 오류블록 관리방법 및 장치
US7721146B2 (en) 2006-05-04 2010-05-18 Dell Products L.P. Method and system for bad block management in RAID arrays
US20080181035A1 (en) 2007-01-26 2008-07-31 Atsushi Kawasumi Method and system for a dynamically repairable memory
CN101777013A (zh) 2009-01-12 2010-07-14 成都市华为赛门铁克科技有限公司 一种固态硬盘及数据读写方法
JP4719802B2 (ja) 2009-03-09 2011-07-06 富士通株式会社 ストレージ管理装置、ストレージ管理方法およびストレージシステム
KR20100115970A (ko) 2009-04-21 2010-10-29 삼성전자주식회사 배드 셀 관리 방법과 그 장치
US8412987B2 (en) 2009-06-30 2013-04-02 Micron Technology, Inc. Non-volatile memory to store memory remap information
US20100332950A1 (en) 2009-06-30 2010-12-30 Gurkirat Billing Bit error threshold and content addressable memory to address a remapped memory device
JP2011108306A (ja) * 2009-11-16 2011-06-02 Sony Corp 不揮発性メモリおよびメモリシステム
JP2011112411A (ja) 2009-11-25 2011-06-09 Elpida Memory Inc 半導体装置
US9037928B2 (en) 2012-01-01 2015-05-19 Mosys, Inc. Memory device with background built-in self-testing and background built-in self-repair
US8617993B2 (en) 2010-02-01 2013-12-31 Lam Research Corporation Method of reducing pattern collapse in high aspect ratio nanostructures
TWI420298B (zh) 2010-12-22 2013-12-21 Silicon Motion Inc 快閃記憶裝置及其資料存取方法
CN102592680B (zh) 2011-01-12 2015-04-08 北京兆易创新科技股份有限公司 一种存储芯片的修复装置和方法
TWI444825B (zh) * 2011-03-29 2014-07-11 Phison Electronics Corp 記憶體儲存裝置、記憶體控制器與資料寫入方法
WO2011127866A2 (zh) 2011-05-27 2011-10-20 华为技术有限公司 数据处理方法、装置及系统
CN102200937A (zh) 2011-05-31 2011-09-28 深圳创维-Rgb电子有限公司 一种与非闪存中数据读取的方法、装置及电视机系统
US8887013B2 (en) 2011-07-01 2014-11-11 Avalanche Technology, Inc. Mapping of random defects in a memory device
US9063902B2 (en) 2012-01-05 2015-06-23 International Business Machines Corporation Implementing enhanced hardware assisted DRAM repair using a data register for DRAM repair selectively provided in a DRAM module
CN103247345A (zh) * 2012-02-03 2013-08-14 北京兆易创新科技股份有限公司 快闪存储器及快闪存储器失效存储单元检测方法
CN102789368B (zh) 2012-06-21 2015-10-21 记忆科技(深圳)有限公司 一种固态硬盘及其数据管理方法、系统
US9009566B2 (en) 2012-09-12 2015-04-14 Macronix International Co., Ltd. Outputting information of ECC corrected bits
CN103778065B (zh) 2012-10-25 2016-12-21 北京兆易创新科技股份有限公司 一种闪速存储器及其进行坏块管理的方法
CN103019873B (zh) 2012-12-03 2016-08-10 华为技术有限公司 一种存储器故障单元的替换方法及装置、数据存储系统
CN103269230B (zh) 2013-05-28 2017-02-22 中国科学院自动化研究所 一种自适应调整纠错码的容错系统及方法
US9406403B2 (en) * 2013-06-25 2016-08-02 Advanced Micro Devices, Inc. Spare memory external to protected memory
CN103309775B (zh) 2013-07-03 2015-08-12 苏州科达科技股份有限公司 一种高可靠磁盘阵列的容错方法
US9372750B2 (en) 2013-11-01 2016-06-21 Qualcomm Incorporated Method and apparatus for non-volatile RAM error re-mapping
US9274888B2 (en) 2013-11-15 2016-03-01 Qualcomm Incorporated Method and apparatus for multiple-bit DRAM error recovery
US9378081B2 (en) 2014-01-02 2016-06-28 Qualcomm Incorporated Bit remapping system
CN103839591A (zh) * 2014-03-05 2014-06-04 福州瑞芯微电子有限公司 存储器自动检错和容错电路及控制方法
CN103955430A (zh) 2014-03-31 2014-07-30 深圳市江波龙电子有限公司 一种闪存存储设备中数据管理的方法及装置
TWI527037B (zh) 2014-04-10 2016-03-21 群聯電子股份有限公司 資料儲存方法、記憶體控制電路單元與記憶體儲存裝置
CN103955431B (zh) 2014-04-11 2017-02-08 深圳市江波龙电子有限公司 一种闪存存储设备中数据管理的方法及装置
US9880901B2 (en) 2014-05-15 2018-01-30 Integrated Silicon Solution, Inc. Serial bus DRAM error correction event notification
US9904596B2 (en) 2014-05-15 2018-02-27 Integrated Silicon Solution, Inc. Serial bus event notification in a memory device
US9389973B2 (en) 2014-05-30 2016-07-12 Oracle International Corporation Memory error propagation for faster error recovery
CN104063186B (zh) 2014-06-30 2016-04-06 成都万维图新信息技术有限公司 一种电子设备的数据访问方法
KR20160062809A (ko) 2014-11-25 2016-06-03 삼성전자주식회사 재쓰기를 이용하여 로우 비트 에러 레이트를 개선하는 메모리 시스템 및 그에 따른 재쓰기 방법
CN105788648B (zh) 2014-12-25 2020-09-18 研祥智能科技股份有限公司 基于异构混合内存的nvm坏块识别处理及纠错方法和系统
WO2016175852A1 (en) 2015-04-30 2016-11-03 Hewlett Packard Enterprise Development Lp Memory module error tracking
US20160357462A1 (en) 2015-06-08 2016-12-08 Samsung Electronics Co., Ltd. Nonvolatile Memory Modules and Data Management Methods Thereof
KR102461453B1 (ko) 2015-06-10 2022-11-02 삼성전자주식회사 스토리지 장치
US10235233B2 (en) 2015-11-03 2019-03-19 Hewlett Packard Enterprise Development Lp Storage error type determination
TWI604308B (zh) 2015-11-18 2017-11-01 慧榮科技股份有限公司 資料儲存裝置及其資料維護方法
CN106776362B (zh) 2015-11-24 2019-12-03 中芯国际集成电路制造(上海)有限公司 存储器的控制方法及装置
JP6466315B2 (ja) 2015-12-25 2019-02-06 東京エレクトロン株式会社 基板処理方法及び基板処理システム
CN105740163A (zh) 2016-01-29 2016-07-06 山东鲁能智能技术有限公司 一种Nand Flash坏块管理方法
US10101939B2 (en) 2016-03-09 2018-10-16 Toshiba Memory Corporation Storage system having a host that manages physical data locations of a storage device
CN105868122A (zh) 2016-03-28 2016-08-17 深圳市硅格半导体股份有限公司 快闪存储设备的数据处理方法及装置
CN105893178A (zh) 2016-03-30 2016-08-24 苏州美天网络科技有限公司 移动硬盘的数据备份方法
JP6258399B2 (ja) 2016-05-16 2018-01-10 ウィンボンド エレクトロニクス コーポレーション 半導体装置
KR102471608B1 (ko) 2016-06-03 2022-11-29 에스케이하이닉스 주식회사 반도체 메모리 장치 및 그의 구동 방법
CN106229288B (zh) 2016-07-27 2019-06-28 上海华虹宏力半导体制造有限公司 有源区制备方法
KR20180019791A (ko) 2016-08-16 2018-02-27 에스케이하이닉스 주식회사 반도체장치 및 반도체시스템
KR102628534B1 (ko) 2016-09-13 2024-01-26 에스케이하이닉스 주식회사 반도체 기판의 처리 방법
CN106569742B (zh) 2016-10-20 2019-07-23 华为技术有限公司 存储管理方法及存储设备
KR102487553B1 (ko) 2016-12-07 2023-01-11 삼성전자주식회사 리페어 가능한 휘발성 메모리를 포함하는 스토리지 장치 및 상기 스토리지 장치의 동작 방법
US10553275B2 (en) 2017-04-18 2020-02-04 Taiwan Semiconductor Manufacturing Company, Ltd. Device having write assist circuit including memory-adapted transistors and method for making the same
CN107247563A (zh) 2017-07-06 2017-10-13 济南浪潮高新科技投资发展有限公司 一种nand flash芯片的块信息标识实现方法
CN109697022B (zh) 2017-10-23 2022-03-04 深圳市中兴微电子技术有限公司 一种报文描述符pd的处理方法、装置及计算机可读存储介质
TWI625735B (zh) 2017-11-01 2018-06-01 大心電子股份有限公司 記憶體管理方法以及儲存控制器
KR102511903B1 (ko) 2018-02-26 2023-03-21 에스케이하이닉스 주식회사 고정된 에러정정능력의 에러정정코드 엔진을 이용하여 재구성할 수 있는 에러정정동작을 수행하는 메모리 시스템
KR102658230B1 (ko) 2018-06-01 2024-04-17 삼성전자주식회사 반도체 메모리 장치, 이를 포함하는 메모리 시스템 및 반도체 메모리 장치의 동작 방법
JP6612392B1 (ja) 2018-06-08 2019-11-27 ウィンボンド エレクトロニクス コーポレーション 半導体記憶装置
US11151006B2 (en) 2018-07-02 2021-10-19 Samsung Electronics Co., Ltd. HBM RAS cache architecture
US11645134B2 (en) 2019-08-20 2023-05-09 Micron Technology, Inc. Apparatuses and methods for fuse error detection
CN113394074A (zh) 2020-03-11 2021-09-14 长鑫存储技术有限公司 半导体结构的处理方法
EP3964941B1 (en) 2020-04-01 2024-02-28 Changxin Memory Technologies, Inc. Read-write method and memory device
EP3936996A4 (en) 2020-04-01 2022-07-06 Changxin Memory Technologies, Inc. READ-WRITE METHOD AND STORAGE DEVICE

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101145372A (zh) * 2006-09-13 2008-03-19 日立环球储存科技荷兰有限公司 用于故障数据存储的非易失存储器的盘驱动器
CN101593157A (zh) * 2008-05-27 2009-12-02 中兴通讯股份有限公司 非线性闪存的坏块管理方法及装置
CN101908023A (zh) * 2010-08-06 2010-12-08 四川长虹电器股份有限公司 NandFlash存储器中数据存储方法
US10643668B1 (en) * 2013-08-27 2020-05-05 Seagate Technology Llc Power loss data block marking

Also Published As

Publication number Publication date
EP4006709A4 (en) 2022-11-09
EP4006709A1 (en) 2022-06-01
CN113495675B (zh) 2023-08-11
US11886287B2 (en) 2024-01-30
CN113495675A (zh) 2021-10-12
US20220317890A1 (en) 2022-10-06

Similar Documents

Publication Publication Date Title
EP3964941B1 (en) Read-write method and memory device
US11914479B2 (en) Method for reading and writing and memory device
AU2011229938A1 (en) Non-regular parity distribution detection via metadata tag
WO2021196663A1 (zh) 读写方法及存储器装置
WO2021196620A1 (zh) 读写方法及存储器装置
WO2021196661A1 (zh) 读写方法及存储器装置
WO2021196662A1 (zh) 读写方法及存储器装置
WO2021196623A1 (zh) 读写方法及存储器装置
WO2021196660A1 (zh) 读写方法及存储器装置
WO2021196621A1 (zh) 读写方法及存储器装置
US11899971B2 (en) Method for reading and writing and memory device
EP3985494B1 (en) Read-write method and memory device
CN113495674B (zh) 读写方法及存储器装置
CN103514961A (zh) 自修复存储器

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20928574

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020928574

Country of ref document: EP

Effective date: 20220224

NENP Non-entry into the national phase

Ref country code: DE