WO2014015522A1 - 在非易失性存储器件中存储信息的方法和装置 - Google Patents
在非易失性存储器件中存储信息的方法和装置 Download PDFInfo
- Publication number
- WO2014015522A1 WO2014015522A1 PCT/CN2012/079288 CN2012079288W WO2014015522A1 WO 2014015522 A1 WO2014015522 A1 WO 2014015522A1 CN 2012079288 W CN2012079288 W CN 2012079288W WO 2014015522 A1 WO2014015522 A1 WO 2014015522A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- block
- information
- empty
- area
- signature
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/023—Free address space management
- G06F12/0238—Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
- G06F12/0246—Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
Definitions
- the present invention relates to memory technologies, and more particularly to a method and apparatus for storing information in a non-volatile memory device. Background technique
- Non-volatile storage media are indispensable in a variety of smart products or devices. There are many media with storage functions, such as EPROM, EEPROM, Flash EEPROM, etc. Each storage medium is used in different technical fields according to its cost and performance. For example, a normal EEPROM is flexible and can be erased in a single byte, but a large-capacity EEPROM is very expensive and sized. Therefore,
- FLASH EEPROM FLASH
- FLASH FLASH EEPROM
- it When using FLASH for storage, it usually operates with the entire block (memory block): For example, if you need to modify some bytes stored in FLASH, you need to erase the block where these bytes are located, and then Write the value that needs to be written.
- Embodiments of the present invention provide a method and apparatus for storing information in a non-volatile memory device for avoiding the formation of "bad data" when an event such as an accidental power loss or a Reset occurs during an erasing process.
- the area does not take too long to store information.
- a method of storing information in a non-volatile memory device wherein the memory device comprises two blocks: a first block or a second block, the method comprising:
- the second block is checked; if it is determined that one of the blocks is empty, the information to be stored is stored in one of the empty blocks; And erase the other block.
- the method further includes: writing the signature information in the signature area of the block.
- the method further includes:
- the verification information is written in the check area of the block.
- the method further includes: determining whether the information in the first block is valid; if the information in the first block is valid, reading the information in the first block as Block information; if the information in the first block is invalid, then:
- Determining whether the information in the second block is valid if the information in the second block is valid, reading the information in the second block as the block information;
- the block storing the information to be stored to one of the empty blocks is specifically:
- an apparatus for storing information in a non-volatile memory device comprising:
- the empty module is configured to check the first block; if it is determined that the first block is not empty, the second block is checked; wherein the first block or the second block is two blocks in the storage device.
- the information storage module is configured to store the to-be-stored information in one of the empty blocks if it is determined that one of the blocks is empty; and perform an erase operation on the other block. Further, the information storage module is further configured to write signature information in a signature area of the block after storing the to-be-stored information in one of the empty blocks.
- the information storage module is further configured to write verification information in the check area of the block after the signature information is written in the signature area of the block.
- the device further includes:
- An information reading module configured to determine whether the information in the first block is valid; if the information in the first block is valid, reading the information in the first block as the block information; if the information in the first block is invalid, determining Whether the information in the second block is valid; if the information in the second block is valid, the information in the second block is read as the Block information;
- An information modification module configured to modify the block information according to the to-be-stored information; and the information storage module stores the to-be-stored information in one of the empty blocks, specifically: the information storage module to be modified
- the Block information carrying the information to be stored is stored in one of the blocks that is empty.
- information storage is performed by using two blocks in turn, and at the same time, one of the blocks is empty, that is, the value in the block is OxFF, and another block stores information.
- one of the blocks is empty, that is, the value in the block is OxFF, and another block stores information.
- the block for writing and storing information is not the same block as the block for performing the erasing operation, even if an unexpected situation occurs during a long-time erasing process, such as a power failure, the storage is not affected. Information to another block, so that the information stored in the Block is not affected.
- FIG. 1 and 6 are flowcharts of a method for storing information in a nonvolatile memory device according to an embodiment of the present invention
- Figure lb is a schematic diagram of a signature area and a check area in a block according to an embodiment of the present invention
- Figures 2a, 2b, and 2c are schematic diagrams of storing information to Block_A according to an embodiment of the present invention
- 2d is a schematic diagram of erasing Block_B after storing information to Block_A according to an embodiment of the present invention
- FIG. 3a, 3b, and 3c are schematic diagrams for storing information to Block_B according to an embodiment of the present invention
- FIG. 3d is a block diagram for storing Block_B according to an embodiment of the present invention. After the information, the schematic diagram of Block_A is erased
- FIG. 4a, 4b, 4c are schematic diagrams of Block_A or Block_B storage abnormality according to an embodiment of the present invention
- FIG. 5 is a method for reading information from a nonvolatile memory device according to an embodiment of the present invention
- FIG. 7 is a block diagram showing the internal structure of an apparatus for storing information in a nonvolatile memory device according to an embodiment of the present invention.
- a module can be, but is not limited to: a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and/or a computer.
- an application running on a computing device and this computing device can be modules.
- One or more modules may be located within a process and/or thread of execution, and a module may be located on one computer and/or distributed between two or more computers.
- the main idea of the present invention is to utilize two blocks in a non-volatile memory device to perform information storage in turn.
- two blocks in a non-volatile memory device a first block (Block_A) and a second block (Block_B) are used to perform information storage in turn.
- a first block (Block_A) and a second block (Block_B) are used to perform information storage in turn.
- one of the blocks is empty, that is, the value in the block is OxFF, and another block stores information.
- Flash it can be directly written by " ⁇ "0", and changed from "0" to "1". It needs to be erased before writing. So when there is information to be saved, first determine the non-volatileness.
- Block_A or Block_B in the storage device is empty: for example, first check the first block; if it is determined that the first block is not empty, check the second block; if it is determined that one of the blocks is empty, The information to be stored is stored in one of the empty blocks; the other block is erased. Thus, before the information is stored in the empty block, the erasing operation is not necessary, thereby avoiding the erasing process. If an accidental power failure or an event such as Reset occurs, the entire block forms a "bad data"area; and, since only one block needs to be erased during the storage process, instead of the prior art method, two blocks need to be erased.
- a non-volatile memory device is taken as an example of Flash, and a method for storing information in a non-volatile memory device is specifically described:
- Block_A and Block_B are used to store information in turn.
- the first area (or area A) and the second area (or area B) may be divided in the Flash, and the number of blocks included in the area A and the area B is equal; for example, in the area A and the area B There are N blocks (N is a natural number).
- the mth block in area A corresponds to the mth block in area B, where m is a natural number less than N.
- the two blocks in the area A and the area B can be stored in the block storage mode of the block_A and the block_B as shown in FIG.
- step S101 Checking Block_A in Flash; if it is determined that Block_A is empty, step S102 is performed; otherwise, step S111 is performed;
- Block_A and Block_B may be the corresponding two blocks in the above area A and area B.
- Block_A is the nth block in area A
- Block_B is the nth block in area B
- Block_B is the nth in area A.
- Block, Block_A is the nth block in area B, where n is a natural number less than N. That is, Block_A and Block_B are the two corresponding Blocks in Flash.
- Block_A the nth block in area A or the nth block (Block_B) in area B can be stored; therefore, first for Block_A and Block_B performs a check.
- the check of Block_A specifically includes: Judging whether Block_A is empty, that is, determining whether all values in Block_A are OXFF. If all values in Block_A are OXFF, then Block_A is judged to be empty; otherwise, 81( ⁇ 1 ⁇ _ is not empty.
- S102 Store the information to be stored in Block_A.
- Block_A If Block_A is empty, the information to be saved is written to Block_A.
- each block in the Flash usually has M bytes (M can be 256 or 512), and the M bytes are divided into three areas: where, the first M-2 bytes
- the storage information is called the information area; the M-1 byte is used to store the signature, which is called the signature area; the Mth byte is used to store the checksum (check information), which is called the check area. .
- the signature in Block_A The name field writes the signature information, indicating that the block is successfully written; the signature information may be 0X00, or other values.
- the verification information can also be written to the check area of Block_A.
- the check information may specifically be a checksum of the first M-1 bytes in Block_A.
- the check information in the Mth byte in Block_A is specifically obtained according to the following formula 1:
- i l where the i-th byte refers to the i-th byte in Block_A.
- Figures 2a, 2b, and 2c show the process of storing information to Block_A:
- Block_A is empty
- Figure 2b shows Block_A and Block_B after changing the value of 124 to 125, where the value of 125 is written to the empty Block_A
- Figure 2c After the 125 value is written to Block_A, the signature information and the verification information are written in Block_A, where S represents signature information and C represents verification information.
- step S103 After erasing Block_B, the process goes to step S151 to end the information storage process.
- Block_B Since the erase operation of Block_B is performed after the information to be stored is stored in Block_A, even if an abnormality such as a power failure occurs during the erasure of Block_B, the information stored in Block_A is not affected. That is to say, this is different from the prior art. In the prior art, since the block is to be erased before the information is written, if the power is lost during the erasing process, the information cannot be directly stored into the block, thereby causing the block. The information in the error is incorrect.
- Block_B Before erasing Block_B, it may first determine whether Block_B is empty; if Block_B is empty, it is not necessary to perform an erase operation, and directly jumps to step S151; if 81 0 ⁇ 8 is not empty, After the erase operation is performed on Block_B, the process proceeds to step S151, and the information storage process is ended. After erasing Block_B, all values in Block_B are OXFF.
- Figure 2d shows that after writing a 125 value to Block_A, Block_B is erased to empty.
- the check of Block_B specifically includes: Judging whether Block_B is empty, that is, determining whether all values in Block_B are OXFF. If all the values in Block_B are OXFF, then judge
- Block_B is empty; otherwise, Block_B is not empty.
- S112 Store the information to be stored in Block_B.
- Block_B If Block_B is empty, the information to be saved is written to Block_B.
- the signature area and the check area may also be included in the Block_B.
- the signature information is written in the signature area of Block_B, indicating that the block is successfully written; and the verification information is written to the check area of Block_B.
- the check information is specifically the checksum of the first M-1 bytes in Block_B.
- the check information in the Mth byte in Block_B is specifically obtained according to the following formula 2:
- i l where the i-th byte refers to the i-th byte in Block_B.
- Figures 3a, 3b, 3c show the process of storing information to Block_B:
- Block_B is empty;
- Figure 3b shows Block_A and Block_B after changing the value of 123 to 124, where the value of 124 is written to the empty Block_B;
- Figure 3c After the 124 value is written to Block_B, the signature information and the check information are written in Block_B, and SC in Fig. 3c represents the check information.
- step S113 After erasing Block_A, the process goes to step S151 to end the information storage process.
- Block_A Since the erase operation of Block_A is performed after the information to be stored is stored in Block_B, even if an abnormality such as a power failure occurs during the erasure of Block_A, the information stored in Block_B is not affected. That is to say, this is different from the prior art.
- the block since the block is to be erased before the information is written, if the power is lost during the erasing process, the information cannot be directly stored into the block, thereby causing the block. The information in the error is incorrect.
- Block_A After erasing Block_A, all values in Block_A are OXFF.
- Figure 3d shows that after writing a 124 value to Block_B, Block_A is erased to empty.
- Block_A and Block_B are empty, it indicates that an abnormal condition may occur during the last stored procedure. If the erase operation of Block_A or Block_B is not completed, the Block_B is erased, and after step S112, The above S112 and S113 will continue to be performed.
- Figures 4a, 4b, and 4c show the case where 810 ⁇ or 81 0 ⁇ 8 stores an exception, respectively:
- Figure 4a shows the case where the memory is accidentally powered down when the write information to Block_B is not completed, resulting in a storage exception;
- Figure 4b shows The case where the memory is abnormally caused by the accidental power-down before the erase of the spare block 81 0 ⁇ is shown;
- FIG. 4c shows the case where the memory is accidentally powered down during the erasing of the spare block Block_A to cause the storage abnormality.
- S151 End the information storage process.
- the non-volatile memory device may further include: a third block (or Block_C) for storing default information.
- the default information is stored in Block_C for use when the data in Block_A and Block_B is corrupted.
- the specific method flow is as shown in the figure. 5, including the following steps:
- Whether the information in the Block_A is valid or not includes: first determining whether the signature area in the Block_A has signature information; if there is no signature information, determining that the information in the Block_A is invalid and cannot be read; if there is signature information, continuing the following judgment :
- Block_A It is determined whether the verification information in the check area in Block_A is correct; if the verification information is correct, it is determined that the information in Block_A is valid and can be read; if the verification information is incorrect, it is determined that the information in Block_A is invalid, cannot Read.
- step S502 After reading the information in the Block_A, the process goes to step S551 to end the information reading process.
- the information in the Block_A After judging that the information in the Block_A is valid, the information is read from the Block_A into the RAM, and the flow jumps to step S551 to end the information reading process.
- Block_A After judging that the information in Block_A is invalid, it is further determined whether the information in Block_B is valid.
- the method for determining whether the information in the Block_B is valid is the same as the method for determining whether the information in the Block_A is valid in the above step S501, and specifically includes: first determining whether the signature area in the Block_B has signature information; if there is no signature information, determining that the Block_B is in the Block_B The information is invalid and cannot be read. If there is signature information, continue with the following judgment:
- Block_B Determine whether the check information in the check area in Block_B is correct; if the check information is correct, it is determined that the information in Block_B is valid and can be read; if the check information is wrong, it is determined that the information in Block_B is invalid, cannot Read.
- step S512 After reading the information in Block_B, the process goes to step S551 to end the information reading process. After judging that the information in the Block_B is valid, the information is read from the Block_B into the RAM, and the flow jumps to step S551 to end the information reading process.
- step S521 After reading the default information from the Block_C, the process jumps to step S551 to end the information reading process.
- Block_A and Block_B After it is determined that the information in Block_A and Block_B is invalid, in order to prevent the product or device from reading the wrong data, the program runs away or performs an error, so as to avoid serious consequences, the product or device can be read from Block_C.
- the default information written at the factory is sent to RAM.
- the flowchart of the method for storing information in the non-volatile storage device includes the following steps:
- the specific method for reading the valid information may adopt the method shown in FIG. 5 above, that is, the method of steps S501-S551, and details are not described herein again.
- this article will read the information in the RAM from the Block of Flash called Block information.
- S602 Modify the information of the corresponding byte in the block information in the RAM.
- the first byte in the block information is modified to the information to be stored.
- the specific method flow for writing the modified Block information carrying the information to be stored into the Flash is similar to the method flow shown in FIG. 1 except that the information to be stored is stored in the Block_A in step S102.
- the modified Block information carrying the information to be stored is stored in the Block_A; in Step S112, the information to be stored is stored in the Block_B as follows:
- the modified Block information carrying the information to be stored is: Stored in Block_B; the other steps are basically the same, and will not be described here.
- the method further includes: first determining whether there is signature information in the signature area of the Block_A; if there is signature information, determining that the Block_A is not empty; The signature information is further determined whether all the values in Block_A are OXFF. If all values in Block_A are OXFF, then Block_A is judged to be empty; otherwise, 81 ( ⁇ 1 ⁇ _ is not empty.
- the check of Block_B in Flash may also be performed. Including: first determining whether there is signature information in the signature area of Block_B; if there is signature information, it is determined that Block_B is not empty; if there is no signature information, it is further determined whether all values in Block_B are OXFF. If all values in Block_B are OXFF, then it is determined that Block_B is empty; otherwise, 81 ( ⁇ 1 ⁇ _8 is not empty.
- the device for storing information in the non-volatile storage device includes: a check module 701 and an information storage module 702.
- the empty module 701 is configured to check the first block; if it is determined that the first block is not empty, the second block is checked; wherein the first block or the second block is two blocks in the storage device.
- the storage device includes a first area and a second area, where the first area and the second area respectively include N blocks; the mth block in the first area corresponds to the mth block in the second area Where N is a natural number, m is a natural number less than N; and the first block and the second block are two corresponding blocks in the first area and the second area.
- the information storage module 702 is configured to store the information to be stored into one of the blocks that is empty if it is determined that one of the blocks is empty; and perform an erase operation on the other block.
- the information storage module 702 writes the signature information in the signature area of the block after storing the information to be stored in one of the blocks, and writes the verification information in the check area of the block.
- the apparatus for storing information in the non-volatile storage device of the embodiment of the present invention further includes: an information reading module 703 and an information modification module 704.
- the information reading module 703 is configured to determine whether the information in the first block is valid; if the information in the first block is valid, the information in the first block is read as the block information; if the information in the first block is invalid, Whether the information in the second block is valid; if the information in the second block is valid, the information in the second block is read as the Block information.
- the information reading module 703 determines whether the information in the second block is valid, if the information in the second block is invalid, the default information stored in the third block is read as the block information; wherein, the third block is the A block in which the default information is stored in the storage device.
- the information modification module 704 is configured to modify the block information according to the to-be-stored information.
- the information of the information storage module 702 storing the information to be stored to one of the blocks is: the information storage module 702 stores the modified block information carrying the information to be stored to one of the blocks. Block.
- the specific working process involved in each module in the apparatus for storing information in the non-volatile storage device may refer to the related disclosure in the method flow shown in the foregoing diagrams la, 5, and 6. Content, no more details here.
- information storage is performed by using two blocks in turn, and at the same time, one of the blocks is empty, that is, the value in the block is OxFF, and another block stores information.
- the block for writing and storing information is not the same block as the block for performing the erasing operation, even if an unexpected situation occurs during a long-time erasing process, such as a power failure, the storage is not affected. Information to another block, so that the information stored in the Block is not affected.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Description
在非易失性存储器件中存储信息的方法和装置
技术领域
本发明涉及存储技术, 尤其涉及一种在非易失性存储器件中存储信息的 方法和装置。 背景技术
非易失性存储介质在各种智能产品或设备中是不可或缺的。 具有存储功 能的介质有很多, EPROM、 EEPROM、 Flash EEPROM等等, 每种存储介质 根据其成本和性能运用在不同的技术领域。 例如, 普通的 EEPROM使用灵活, 可以单字节擦除, 但大容量的 EEPROM, 成本和尺寸都非常高。 因此,
在需要进行大容量信息存储时, 通过都采用 FLASH EEPROM (或筒称 FLASH )介质进行存储。 在使用 FLASH进行存储时, 通常都是以整个 Block (存储块)进行操作的: 例如, 需要修改 FLASH中存储的某几个字节, 则需 要擦除这几个字节所在的 Block之后, 再写入需要写入的值。
众所周知, 非易失性存储器的擦除过程比较耗时, 如果在此擦除过程中 有意外掉电或者 Reset等事件发生, 将会导致整个 Block的值被擦除或者部分擦 除, 而新写入的值却没有正常写入, 这样原来存储在 Flash中的值将不再完整, 形成一块 "坏数据" 区域。 如果有相关程序使用到上述 "坏数据" 区域, 会 对整个程序造成严重的后果, 例如程序跑飞或者执行错误, 对相关产品的稳 定性造成极大的隐患。
为防止上述问题, 现有技术的 Flash保存方法中, 多是先读取一块 Block中 所有值到 RAM区中备份, 然后擦除这块 Block, 最后在此 Block中写入最新更 新的值以及备份的值。这种方法在 Flash擦除 Block时意外断电,将会丢失 Block 中原来存储的信息, 导致信息丢失。 也有些方法是通过在 Flash中另外开辟一 块新的 Block用于存储备份信息, 当往 Flash保存时, 除了按照上述方法正常擦 除、 写入外, 同时, 在备份区 Block也进行如此操作: 擦除、 写入, 当其中一 块 Block在擦除过程中出现意外掉电时, 使用另外一块备份 Block中的信息, 从 而防止出现意外掉电而引起的信息丢失。 这种防止信息丢失的方法虽然可行, 但需要同时擦除、 写入两块 Block, 耗费时间过长。 在很多产品, 尤其是光模 块产品应用中, 需要快速保存一些信息到 Flash, 因此, 两块 Block同时擦除、 写入所耗时间不能满足要求。
综上所述, 现有技术的在 Flash中存储信息的方法, 或者在擦除过程中有 意外掉电或者 Reset等事件发生时, 将会导致整个 Block形成 "坏数据" 区域, 或者在存储信息过程中耗费时间过长。 发明内容
本发明的实施例提供了一种在非易失性存储器件中存储信息的方法和装 置,用以在擦除过程中有意外掉电或者 Reset等事件发生时,既能避免形成 "坏 数据" 区域, 又不耗费过长时间进行信息存储。
根据本发明的一个方面, 提供了一种在非易失性存储器件中存储信息的 方法, 其中所述存储器件包括两个 Block: 第一 Block或第二 Block, 所述方 法包括:
对第一 Block查空; 若判断出第一 Block不为空, 则对第二 Block查空; 若判断出其中一个 Block为空, 则将待存入信息存储到其中一个为空的 Block中; 并对另一个 Block进行擦除操作。
进一步, 在所述将待存入信息存储到其中一个为空的 Block后, 还包括: 在该 Block的签名区域写入签名信息。
在该 Block的签名区域写入签名信息后, 还包括:
在该 Block的校验区域写入校验信息。
在所述将待存入信息存储到其中一个为空的 Block之前, 还包括: 判断第一 Block中的信息是否有效; 若第一 Block中的信息有效, 则读取 第一 Block中的信息作为 Block信息; 若第一 Block中的信息无效, 则:
判断第二 Block中的信息是否有效; 若第二 Block中的信息有效, 则读取 第二 Block中的信息作为 Block信息;
根据所述待存入信息修改所述 Block信息; 以及
所述将待存入信息存储到其中一个为空的 Block具体为:
将修改后的、携带有所述待存入信息的 Block信息存储到其中一个为空的
Block。
根据本发明的另一个方面, 提供了一种在非易失性存储器件中存储信息 的装置, 包括:
查空模块, 用于对第一 Block查空; 若判断出第一 Block不为空, 则对第 二 Block查空;其中,第一 Block或第二 Block为所述存储器件中的两个 Block; 信息存储模块,用于若判断出其中一个 Block为空,则将待存入信息存储 到其中一个为空的 Block中; 并对另一个 Block进行擦除操作。
进一步, 所述信息存储模块还用于在将待存入信息存储到其中一个为空 的 Block后, 在该 Block的签名区域写入签名信息。
所述信息存储模块还用于在该 Block 的签名区域写入签名信息后, 在该 Block的校验区域写入校验信息。
进一步, 所述装置还包括:
信息读取模块, 用于判断第一 Block中的信息是否有效; 若第一 Block中 的信息有效, 则读取第一 Block中的信息作为 Block信息; 若第一 Block中的 信息无效,则判断第二 Block中的信息是否有效;若第二 Block中的信息有效, 则读取第二 Block中的信息作为 Block信息;
信息修改模块, 用于根据所述待存入信息修改所述 Block信息; 以及 所述信息存储模块将待存入信息存储到其中一个为空的 Block具体为:所 述信息存储模块将修改后的、携带有所述待存入信息的 Block信息存储到其中 一个为空的 Block。
本发明实施例由于利用两个 Block轮流进行信息存储,并同时保证其中一 个 Block为空, 即该 Block中的值都为 OxFF, 并且另外一个 Block存储了信 息。 这样, 在向空的 Block中存入信息前, 不必进行擦除操作, 从而可以避免 擦除过程中若意外掉电或者有 Reset等事件发生, 而导致整个 Block形成 "坏 数据" 区域; 而直接向 Block写入信息所耗时间较短, 因此, 大大降低了在存 储过程中出现意外情况而导致存储异常的几率。
此外, 由于写入、存储信息的 Block与进行擦除操作的 Block不是同一个 Block, 则即使在耗时较长的擦除过程中出现意外情况, 如掉电等情况, 也不 会影响到存储到另一个 Block中的信息,从而保证存储到 Block中的信息不受 影响。
而且, 由于在存储过程中只需擦除一个 Block, 而非现有技术的方法中需 要擦除两块 Block, 从而大大减少了非易失性存储器件的存储时间, 既可以满 足产品中对非易失性存储器件写入的时间指标要求, 又减少对非易失性存储 器件的擦除次数, 可以提高效率和非易失性存储器件的寿命, 降低功耗。 附图说明
图 la、 6 为本发明实施例的在非易失性存储器件中存储信息的方法流程 图;
图 lb为本发明实施例的 Block中的签名区域和校验区域的示意图; 图 2a、 2b、 2c为本发明实施例的向 Block_A存储信息的示意图;
图 2d为本发明实施例的向 Block_A存储信息后,擦除 Block_B的示意图; 图 3a、 3b、 3c为本发明实施例的向 Block_B存储信息的示意图; 图 3d为本发明实施例的向 Block_B存储信息后,擦除 Block_A的示意图; 图 4a、 4b、 4c为本发明实施例的 Block_A或 Block_B存储异常的示意图; 图 5为本发明实施例的从非易失性存储器件中读取信息的方法流程图; 图 7 为本发明实施例的在非易失性存储器件中存储信息的装置的内部结 构框图。
具体实施方式
为使本发明的目的、 技术方案及优点更加清楚明白, 以下参照附图并举 出优选实施例, 对本发明进一步详细说明。 然而, 需要说明的是, 说明书中 列出的许多细节仅仅是为了使读者对本发明的一个或多个方面有一个透彻的
"本申请使用的 "模块"、、 "系统: 等 语旨在包括与计算机相关的实体, 例如但不限于硬件、 固件、 软硬件组合、 软件或者执行中的软件。 例如, 模 块可以是, 但并不仅限于: 处理器上运行的进程、 处理器、 对象、 可执行程 序、 执行的线程、 程序和 /或计算机。 举例来说, 计算设备上运行的应用程序 和此计算设备都可以是模块。 一个或多个模块可以位于执行中的一个进程和 / 或线程内, 一个模块也可以位于一台计算机上和 /或分布于两台或更多台计算 机之间。
本发明的主要思路为,利用非易失性存储器件中的两个 Block来轮流进行 信息存储。例如,利用非易失性存储器件中的两个 Block:第一 Block( Block_A ) 和第二 Block ( Block_B )来轮流进行信息存储。 同时保证其中一个 Block为 空,即该 Block中的值都为 OxFF,并且另外一个 Block存储了信息。根据 Flash 的特性可知, 由 "Γ 变 "0" 可以直接写入, 由 "0" 变 "1" 需要先擦除后 再写入。 所以当有信息需要保存时, 先分别判断非易失性存储器件中的 Block_A或 Block_B是否为空: 例如, 先对第一 Block查空; 若判断出第一 Block不为空, 则对第二 Block查空; 若判断出其中一个 Block为空, 则将待 存入信息存储到其中一个为空的 Block中; 而对另一个 Block进行擦除操作。 这样, 在向空的 Block中存入信息前, 不必进行擦除操作, 从而可以避免擦除 过程中若意外掉电或者有 Reset等事件发生,而导致整个 Block形成"坏数据" 区域; 并且, 由于在存储过程中只需擦除一个 Block, 而非现有技术的方法中 需要擦除两块 Block, 从而大大减少了非易失性存储器件的存储时间, 既可以
满足产品中对非易失性存储器件写入的时间指标要求, 又减少对非易失性存 储器件的擦除次数, 可以提高效率和非易失性存储器件的寿命, 降低功耗。
下面结合附图详细说明本发明实施例的技术方案。 本发明实施例以非易 失性存储器件为 Flash 为例, 具体讲述在非易失性存储器件中存储信息的方 法: 在 Flash中以 Block_A和 Block_B轮流进行信息存储。 具体地, Flash中 可以划分出第一区域(或称区域 A )和第二区域(或称区域 B ), 区域 A和区 域 B中包括的 Block的个数相等; 比如, 区域 A和区域 B中分别包括有 N个 Block ( N为自然数 )。 区域 A中的第 m个 Block与区域 B中的第 m个 Block 相对应, 其中, m为小于 N的自然数。 那么, 区域 A和区域 B中相对应的两 个 Block, 可以如图 la所示的 Block_A和 Block_B的轮流存储方式进行信息 存储, 具体包括如下步骤:
S101: 对 Flash中的 Block_A进行查空; 若判断 Block_A为空, 则执行 步骤 S102; 否则, 执行步骤 S111;
Block_A和 Block_B可以是上述区域 A和区域 B中相对应的两个 Block, 例如, Block_A为区域 A中第 n个 Block, Block_B为区域 B中第 n个 Block, 或者, Block_B为区域 A中第 n个 Block, Block_A为区域 B中第 n个 Block, 其中 n为小于 N的自然数。也就是说, Block_A和 Block_B为 Flash中的两个 相对应的 Block。
如果待存入 Flash中的信息需要写入到第 n个 Block中, 那么可以区域 A 中第 n个 Block ( Block_A )或区域 B中第 n个 Block ( Block_B )进行存储; 因此, 先对 Block_A和 Block_B进行查空。
对 Block_A的查空具体包括: 判断 Block_A是否为空, 即判断 Block_A 中所有的值是否都为 OXFF。 如果 Block_A 中所有的值都为 OXFF, 则判断 Block_A为空; 否则, 81(^1^_ 不为空。
S102: 将待存入的信息存储到 Block_A中。
如果 Block_A为空, 则将需要待存入的信息写入到 Block_A中。
较佳地, Block_A中还可包括签名区域和校验区域。 具体地, 如图 lb所 示, Flash中的每个 Block通常有 M个字节 ( M可以是 256或 512 ), 将这 M 个字节分成三个区域: 其中, 前 M-2个字节用于存放保存信息, 称为信息区 域; 第 M-1个字节用于存放签名, 称为签名区域; 第 M个字节用于存放校验 和(校验信息), 称为校验区域。
在待存入的信息成功地写入到 Block_A的信息区域后, 在 Block_A的签
名区域写入签名信息,表明该 Block被成功写入;签名信息具体可以是 0X00, 或者其它值。
在待存入的信息成功地写入到 Block_A的信息区域后, 还可以将校验信 息写入到 Block_A的校验区域。
校验信息具体可以是 Block_A中的前 M-1个字节的校验和。 Block_A中 的第 M个字节中的校验信息具体根据如下公式 1得到:
第 M个字节 = OXFF - U 第 i个字节 (公式 1)
i=l 其中, 第 i个字节指的是 Block_A中的第 i个字节。
图 2a、 2b、 2c示出了向 Block_A存储信息的过程:
从图 2a所示的 Block_A和 Block_B, 可以看出 Block_A为空; 图 2b则 示出将 124值更改为 125值后的 Block_A和 Block_B , 其中, 125值被写入到 空的 Block_A中; 图 2c示出 125值被写入到 Block_A后,在 Block_A写入签 名信息和校验信息, 其中 S表示签名信息, C表示校验信息。
S103: 对 Block_B进行擦除操作后, 跳转到步骤 S151 , 结束此次信息存 储过程。
由于对 Block_B进行擦除的操作是在将待存入的信息存储到 Block_A之 后, 因此, 即使在擦除 Block_B 的过程中出现掉电等异常现象也不会影响 Block_A中存储的信息。 也就是说, 这不同于现有技术, 在现有技术中由于在 写入信息之前要擦除 Block, 如果在擦除过程中掉电, 则直接导致无法正常向 Block存入信息, 从而导致 Block中的信息错误。
较佳地, 在对 Block_B进行擦除之前, 可以先判断 Block_B是否为空; 如果 Block_B为空, 则不必再进行擦除操作, 而直接跳转到步骤 S151; 如果 810^8不为空, 再对 Block_B进行擦除操作后, 跳转到步骤 S151 , 结束此 次信息存储过程。 在对 Block_B进行擦除操作后, Block_B 中所有的值都为 OXFF。
图 2d示出了将 125值写入到 Block_A后, 将 Block_B擦除为空。
S111: 对 Flash中的 Block_B进行查空; 若判断 Block_B为空, 则执行步 骤 S112; 否则, 执行步骤 S121。
对 Block_B的查空具体包括: 判断 Block_B是否为空, 即判断 Block_B 中所有的值是否都为 OXFF。 如果 Block_B 中所有的值都为 OXFF, 则判断
Block_B为空; 否则, Block_B不为空。
S112: 将待存入的信息存储到 Block_B中。
如果 Block_B为空, 则将需要待存入的信息写入到 Block_B中。
较佳地, 与 Block_A类似, Block_B 中还可包括签名区域和校验区域。 在待存入的信息成功地写入到 Block_B的信息区域后, 在 Block_B的签名区 域写入签名信息,表明该 Block被成功写入;并且,将校验信息写入到 Block_B 的校验区域。校验信息具体为 Block_B中的前 M-1个字节的校验和。 Block_B 中的第 M个字节中的校验信息具体根据如下公式 2得到:
第 M个字节 = OXFF - ¾ 第 i个字节 (公式 2)
i=l 其中, 第 i个字节指的是 Block_B中的第 i个字节。
图 3a、 3b、 3c示出了向 Block_B存储信息的过程:
从图 3a所示的 Block_A和 Block_B, 可以看出 Block_B为空; 图 3b则 示出将 123值更改为 124值后的 Block_A和 Block_B , 其中, 124值被写入到 空的 Block_B中; 图 3c示出 124值被写入到 Block_B后, 在 Block_B写入签 名信息和校验信息, 图 3c中的 SC表示校验信息。
S113: 对 Block_A进行擦除操作后, 跳转到步骤 S151 , 结束此次信息存 储过程。
由于对 Block_A进行擦除的操作是在将待存入的信息存储到 Block_B之 后, 因此, 即使在擦除 Block_A 的过程中出现掉电等异常现象也不会影响 Block_B中存储的信息。 也就是说, 这不同于现有技术, 在现有技术中由于在 写入信息之前要擦除 Block, 如果在擦除过程中掉电, 则直接导致无法正常向 Block存入信息, 从而导致 Block中的信息错误。
在对 Block_A进行擦除操作后, Block_A中所有的值都为 OXFF。
图 3d示出了将 124值写入到 Block_B后, 将 Block_A擦除为空。
S121: 对 Block_B进行擦除操作后, 跳转到步骤 S112。
如果 Block_A和 Block_B都不为空, 则说明在上次的存储过程中可能出 现了异常情况, 导致 Block_A或 Block_B的擦除操作未完成, 则对 Block_B 进行擦除操作, 跳转到步骤 S112后, 将继续执行上述 S112和 S113。
图 4a、 4b、 4c分别示出了 810^ 或810^8存储异常的情况: 图 4a示出了向 Block_B 写入信息未完成时意外掉电导致存储异常的情 况; 图 4b示出了在擦除备用块 810^ 之前意外掉电导致存储异常的情况; 图 4c示出了在擦除备用块 Block_A的过程中意外掉电导致存储异常的情况。
S151: 结束此次信息存储过程。
在实际应用中, 为了更进一步保证产品和设备的稳定性, 非易失性存储 器件中还可包括:用于存储默认信息的第三 Block(或称 Block_C )。在 Block_C 中存储了默认信息, 以备 Block_A和 Block_B中的数据被损坏时使用。
根据上述的存储方法将信息存储到 Flash之后, 如果需要对 Rash进行信 息读取 , 即读取 Flash中的信息到 RAM ( random, access memory, 随机存取存 储器) 中, 则具体的方法流程如图 5所示, 包括如下步骤:
S501: 判断 Block_A中的信息是否有效; 若有效, 则执行步骤 S502; 否 则, 执行步骤 S511;
判断 Block_A中的信息是否有效具体包括: 先判断 Block_A中的签名区 域是否有签名信息; 若没有签名信息, 则判断出 Block_A中的信息无效, 不 能读取; 若有签名信息, 则继续如下的判断:
判断 Block_A中的校验区域中的校验信息是否正确; 若校验信息正确, 则判断出 Block_A 中的信息有效, 可以读取; 若校验信息错误, 则判断出 Block_A中的信息无效, 不能读取。
S502: 读取 Block_A中的信息后, 跳转到步骤 S551 , 结束此次信息读取 过程。
在判断出 Block_A中的信息有效后, 从 Block_A中读取信息到 RAM中, 并跳转到步骤 S551 , 结束此次信息读取过程。
S511: 判断 Block_B中的信息是否有效; 若有效, 则执行步骤 S512; 否 则, 执行步骤 S521;
在判断出 Block_A中的信息无效后, 进而判断 Block_B中的信息是否有 效。
判断 Block_B中的信息是否有效的方法与上述步骤 S501中判断 Block_A 中的信息是否有效的方法相同, 具体包括: 先判断 Block_B 中的签名区域是 否有签名信息; 若没有签名信息, 则判断出 Block_B 中的信息无效, 不能读 取; 若有签名信息, 则继续如下的判断:
判断 Block_B 中的校验区域中的校验信息是否正确; 若校验信息正确, 则判断出 Block_B 中的信息有效, 可以读取; 若校验信息错误, 则判断出 Block_B中的信息无效, 不能读取。
S512: 读取 Block_B中的信息后, 跳转到步骤 S551 , 结束此次信息读取 过程。
在判断出 Block_B中的信息有效后, 从 Block_B中读取信息到 RAM中, 并跳转到步骤 S551 , 结束此次信息读取过程。
S521: 从 Block_C中读取默认信息后, 跳转到步骤 S551 , 结束此次信息 读取过程。
在判断出 Block_A和 Block_B中的信息都无效后, 为防止产品或设备读 取错误的数据而发生程序跑飞或者执行错误的现象, 以免造成严重的后果, 可以从 Block_C中读取产品或设备在出厂时即写入的默认信息到 RAM中。
S551: 结束此次信息读取过程。
事实上, 在将信息存储到 Flash时, 可能只是需要存储几个字节, 也就意 味着只需要修改 Block中某几个字节的信息,对于 Block中其它字节的信息则 不需要进行改动, 那么本发明实施例提供的更优的一种在非易失性存储器件 中存储信息的方法的流程图, 如图 6所示, 包括如下步骤:
S601: 读取有效信息到 RAM中。
读取有效信息的具体方法可以采用如上述图 5 所示的方法, 即步骤 S501-S551的方法,此处不再赘述。为便于后续的描述,本文将从 Flash的 Block 读取到 RAM中的信息称为 Block信息。
S602: 在 RAM中修改 Block信息中相应字节的信息。
例如,待存入的信息需要写入到 Block的第 1个字节, 则将 Block信息中 的第 1个字节修改为待存入的信息。
S603: 将修改后的 Block信息写入到 Flash中。
将修改后的、携带有待存入的信息的 Block信息写入到 Flash中的具体方 法流程与上述图 1所示的方法流程相类似, 只是在步骤 S102中将待存入的信 息存储到 Block_A具体为: 将修改后的、 携带有待存入的信息的 Block信息 存储到 Block_A; 在步骤 S112中将待存入的信息存储到 Block_B具体为: 将 修改后的、携带有待存入的信息的 Block信息存储到 Block_B; 其它步骤基本 相同, 此处不再赘述。
更优地, 在上述步骤 S101的对 Flash中的 Block_A进行查空过程中还可 包括: 先判断 Block_A的签名区域中是否有签名信息; 如果有签名信息, 则 判断出 Block_A不为空; 如果没有签名信息, 则再进一步判断 Block_A中所 有的值是否都为 OXFF。如果 Block_A中所有的值都为 OXFF,则判断 Block_A 为空; 否则, 81(^1^_ 不为空。
类似地, 在上述步骤 S111的对 Flash中的 Block_B进行查空过程中还可
包括: 先判断 Block_B 的签名区域中是否有签名信息; 如果有签名信息, 则 判断出 Block_B不为空; 如果没有签名信息, 则再进一步判断 Block_B中所 有的值是否都为 OXFF。如果 Block_B中所有的值都为 OXFF,则判断 Block_B 为空; 否则, 81(^1^_8不为空。
本发明实施例提供的在非易失性存储器件中存储信息的装置, 如图 7所 示, 包括: 查空模块 701、 信息存储模块 702。
查空模块 701用于对第一 Block查空; 若判断出第一 Block不为空, 则对 第二 Block查空; 其中, 第一 Block或第二 Block为所述存储器件中的两个 Block。 所述存储器件中包括有第一区域和第二区域, 第一区域和第二区域中 分别包括 N个 Block;第一区域中的第 m个 Block与第二区域中的第 m个 Block 相对应, 其中, N为自然数, m为小于 N的自然数; 以及第一 Block和第二 Block为第一区域和第二区域中相对应的两个 Block。
信息存储模块 702用于若判断出其中一个 Block为空,则将待存入信息存 储到其中一个为空的 Block中; 并对另一个 Block进行擦除操作。信息存储模 块 702在将待存入信息存储到其中一个为空的 Block后,在该 Block的签名区 域写入签名信息, 在该 Block的校验区域写入校验信息。
进一步, 本发明实施例的在非易失性存储器件中存储信息的装置还包括: 信息读取模块 703、 信息修改模块 704。
信息读取模块 703用于判断第一 Block中的信息是否有效; 若第一 Block 中的信息有效, 则读取第一 Block中的信息作为 Block信息; 若第一 Block中 的信息无效, 则判断第二 Block中的信息是否有效; 若第二 Block中的信息有 效, 则读取第二 Block中的信息作为 Block信息。
进一步,信息读取模块 703在判断第二 Block中的信息是否有效之后,若 第二 Block中的信息无效,则读取第三 Block中存储的默认信息作为 Block信 息; 其中, 第三 Block为所述存储器件中存储默认信息的 Block。
信息修改模块 704用于根据所述待存入信息修改所述 Block信息。
由此, 信息存储模块 702 的将待存入信息存储到其中一个为空的 Block 具体为:信息存储模块 702将修改后的、携带有所述待存入信息的 Block信息 存储到其中一个为空的 Block。
具体地, 本发明实施例的在非易失性存储器件中存储信息的装置中的各 模块所涉及的具体工作过程, 可以参考上述图 la、 5、 6所示的方法流程中所 公开的相关内容, 此处不再赘述。
本发明实施例由于利用两个 Block轮流进行信息存储,并同时保证其中一 个 Block为空, 即该 Block中的值都为 OxFF, 并且另外一个 Block存储了信 息。 这样, 在向空的 Block中存入信息前, 不必进行擦除操作, 从而可以避免 擦除过程中若意外掉电或者有 Reset等事件发生, 而导致整个 Block形成 "坏 数据" 区域; 而直接向 Block写入信息所耗时间较短, 因此, 大大降低了在存 储过程中出现意外情况而导致存储异常的几率。
此外, 由于写入、存储信息的 Block与进行擦除操作的 Block不是同一个 Block, 则即使在耗时较长的擦除过程中出现意外情况, 如掉电等情况, 也不 会影响到存储到另一个 Block中的信息,从而保证存储到 Block中的信息不受 影响。
而且, 由于在存储过程中只需擦除一个 Block, 而非现有技术的方法中需 要擦除两块 Block, 从而大大减少了非易失性存储器件的存储时间, 既可以满 足产品中对非易失性存储器件写入的时间指标要求, 又减少对非易失性存储 器件的擦除次数, 可以提高效率和非易失性存储器件的寿命, 降低功耗。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分步骤 是可以通过程序来指令相关的硬件来完成, 该程序可以存储于一计算机可读 取存储介质中, 如: ROM/RAM、 磁碟、 光盘等。
以上所述仅是本发明的优选实施方式, 应当指出, 对于本技术领域的普 通技术人员来说, 在不脱离本发明原理的前提下, 还可以作出若干改进和润 饰, 这些改进和润饰也应视为本发明的保护范围。
Claims
1. 一种在非易失性存储器件中存储信息的方法, 其中所述存储器件包括 两个 Block: 第一 Block或第二 Block, 其特征在于, 所述方法包括:
对第一 Block查空; 若判断出第一 Block不为空, 则对第二 Block查空; 若判断出其中一个 Block为空, 则将待存入信息存储到其中一个为空的 Block中; 并对另一个 Block进行擦除操作。
2. 如权利要求 1所述的方法, 其特征在于, 在所述将待存入信息存储到 其中一个为空的 Block后, 还包括:
在该 Block的签名区域写入签名信息。
3. 如权利要求 2所述的方法, 其特征在于, 在该 Block的签名区域写入 签名信息后, 还包括:
在该 Block的校验区域写入校验信息。
4. 如权利要求 3所述的方法, 其特征在于, 在所述将待存入信息存储到 其中一个为空的 Block之前, 还包括:
判断第一 Block中的信息是否有效; 若第一 Block中的信息有效, 则读取 第一 Block中的信息作为 Block信息; 若第一 Block中的信息无效, 则: 判断第二 Block中的信息是否有效; 若第二 Block中的信息有效, 则读取 第二 Block中的信息作为 Block信息;
根据所述待存入信息修改所述 Block信息; 以及
所述将待存入信息存储到其中一个为空的 Block具体为:
将修改后的、携带有所述待存入信息的 Block信息存储到其中一个为空的 Block。
5. 如权利要求 3所述的方法, 其特征在于, 所述存储器件中还包括: 存 储有默认信息的第三 Block; 以及,
在所述判断第二 Block中的信息是否有效之后, 所述方法还包括: 若第二 Block中的信息无效, 则读取第三 Block中存储的默认信息作为 Block信息。
6. 如权利要求 5所述的方法, 其特征在于, 所述判断第一 Block中的信 息是否有效具体包括:
判断第一 Block中的签名区域是否有签名信息;若没有签名信息,则判断 出第一 Block中的信息无效; 若有签名信息, 贝 |J :
判断第一 Block中的校验区域中的校验信息是否正确; 若校验信息正确, 则判断出第一 Block中的信息有效; 若校验信息错误, 则判断出第一 Block中 的信息无效; 以及
所述判断第二 Block中的信息是否有效具体包括:
判断第二 Block中的签名区域是否有签名信息;若没有签名信息,则判断 出第二 Block中的信息无效; 若有签名信息, 贝 |J :
判断第二 Block中的校验区域中的校验信息是否正确; 若校验信息正确, 则判断出第二 Block中的信息有效; 若校验信息错误, 则判断出第二 Block中 的信息无效。
7. 如权利要求 3-6任一所述的方法, 其特征在于, 所述对第一 Block查 空具体包括:
判断第一 Block的签名区域中是否有签名信息;如果有签名信息,则判断 出第一 Block不为空; 如果没有签名信息, 贝' J :
判断第一 Block中所有的值是否都为 0XFF; 如果第一 Block中所有的值 都为 0XFF, 则判断第一 Block为空; 否则, 第一 Block不为空; 以及
所述对第二 Block查空具体包括:
判断第二 Block的签名区域中是否有签名信息;如果有签名信息,则判断 出第二 Block不为空; 如果没有签名信息, 贝' J :
判断第二 Block中所有的值是否都为 0XFF; 如果第二 Block中所有的值 都为 OXFF, 则判断第二 Block为空; 否则, 第二 Block不为空。
8. 如权利要求 7所述的方法, 其特征在于, 在所述对第二 Block查空之 后, 还包括:
若判断出第二 Block不为空, 则将第二 Block擦除为空。
9. 如权利要求 1所述的方法, 其特征在于, 所述存储器件中包括有第一 区域和第二区域,第一区域和第二区域中分别包括 N个 Block; 第一区域中的
第 m个 Block与第二区域中的第 m个 Block相对应, 其中, N为自然数, m 为小于 N的自然数; 以及
第一 Block和第二 Block为第一区域和第二区域中相对应的两个 Block。
10. 一种在非易失性存储器件中存储信息的装置, 包括:
查空模块, 用于对第一 Block查空; 若判断出第一 Block不为空, 则对第 二 Block查空;其中,第一 Block或第二 Block为所述存储器件中的两个 Block;
信息存储模块,用于若判断出其中一个 Block为空,则将待存入信息存储 到其中一个为空的 Block中; 并对另一个 Block进行擦除操作。
11. 如权利要求 10所述的装置, 其特征在于,
所述信息存储模块还用于在将待存入信息存储到其中一个为空的 Block 后, 在该 Block的签名区域写入签名信息。
12. 如权利要求 11所述的装置, 其特征在于,
所述信息存储模块还用于在该 Block 的签名区域写入签名信息后, 在该 Block的校验区域写入校验信息。
13. 如权利要求 12所述的装置, 其特征在于, 还包括:
信息读取模块, 用于判断第一 Block中的信息是否有效; 若第一 Block中 的信息有效, 则读取第一 Block中的信息作为 Block信息; 若第一 Block中的 信息无效,则判断第二 Block中的信息是否有效;若第二 Block中的信息有效, 则读取第二 Block中的信息作为 Block信息;
信息修改模块, 用于根据所述待存入信息修改所述 Block信息; 以及 所述信息存储模块将待存入信息存储到其中一个为空的 Block具体为:所 述信息存储模块将修改后的、携带有所述待存入信息的 Block信息存储到其中 一个为空的 Block。
14. 如权利要求 13所述的装置, 其特征在于,
所述信息读取模块还用于在判断第二 Block中的信息是否有效之后,若第 二 Block中的信息无效, 则读取第三 Block中存储的默认信息; 其中, 第三 Block为所述存储器件中存储默认信息的 Block。
15. 如权利要求 10-14任一所述的装置, 其特征在于, 所述存储器件中包 括有第一区域和第二区域,第一区域和第二区域中分别包括 N个 Block; 第一 区域中的第 m个 Block与第二区域中的第 m个 Block相对应, 其中, N为自 然数, m为小于 N的自然数; 以及
第一 Block和第二 Block为第一区域和第二区域中相对应的两个 Block。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2012/079288 WO2014015522A1 (zh) | 2012-07-27 | 2012-07-27 | 在非易失性存储器件中存储信息的方法和装置 |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2012/079288 WO2014015522A1 (zh) | 2012-07-27 | 2012-07-27 | 在非易失性存储器件中存储信息的方法和装置 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2014015522A1 true WO2014015522A1 (zh) | 2014-01-30 |
Family
ID=49996521
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2012/079288 Ceased WO2014015522A1 (zh) | 2012-07-27 | 2012-07-27 | 在非易失性存储器件中存储信息的方法和装置 |
Country Status (1)
| Country | Link |
|---|---|
| WO (1) | WO2014015522A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112908390A (zh) * | 2021-02-02 | 2021-06-04 | 深圳市显控科技股份有限公司 | 数据存储方法、装置、电子设备及存储介质 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20030069671A1 (en) * | 2001-10-09 | 2003-04-10 | Honda Giken Kogyo Kabushiki Kaisha | Vehicle controller for controlling rewriting data in a nonvolatile memory |
| CN101162608A (zh) * | 2006-10-10 | 2008-04-16 | 北京华旗资讯数码科技有限公司 | 闪存的存储块的标识方法 |
| CN102789426A (zh) * | 2012-07-27 | 2012-11-21 | 青岛海信宽带多媒体技术有限公司 | 在非易失性存储器件中存储信息的方法和装置 |
-
2012
- 2012-07-27 WO PCT/CN2012/079288 patent/WO2014015522A1/zh not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20030069671A1 (en) * | 2001-10-09 | 2003-04-10 | Honda Giken Kogyo Kabushiki Kaisha | Vehicle controller for controlling rewriting data in a nonvolatile memory |
| CN101162608A (zh) * | 2006-10-10 | 2008-04-16 | 北京华旗资讯数码科技有限公司 | 闪存的存储块的标识方法 |
| CN102789426A (zh) * | 2012-07-27 | 2012-11-21 | 青岛海信宽带多媒体技术有限公司 | 在非易失性存储器件中存储信息的方法和装置 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112908390A (zh) * | 2021-02-02 | 2021-06-04 | 深圳市显控科技股份有限公司 | 数据存储方法、装置、电子设备及存储介质 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| TWI467376B (zh) | 資料保護方法、記憶體控制器與記憶體儲存裝置 | |
| KR102567097B1 (ko) | 임베디드 시스템의 부트 롬 업데이트 방법 및 부팅 방법 | |
| US8478930B1 (en) | Solid state drive power safe wear-leveling | |
| JP5990430B2 (ja) | Ssd(ソリッドステートドライブ)装置 | |
| KR101343262B1 (ko) | 동시 판독 및 기록 메모리 동작을 수행하는 방법 및 장치 | |
| CN108804045B (zh) | 一种坏块表建立方法及相关装置 | |
| TWI554886B (zh) | 資料保護方法、記憶體控制電路單元及記憶體儲存裝置 | |
| CN106021002B (zh) | 一种嵌入式设备数据读写方法及装置 | |
| TW201916018A (zh) | 資料儲存裝置與將資料寫入記憶體裝置之方法 | |
| JP2003058432A (ja) | メモリカード及びメモリコントローラ | |
| JP2008198310A (ja) | ビットエラーの修復方法および情報処理装置 | |
| CN101567217A (zh) | 一种安全烧写闪存的方法及数据写入方法 | |
| JP2012063884A (ja) | 記憶装置、電子機器、および記憶装置の制御方法 | |
| TWI486957B (zh) | Nand快閃記憶體燒錄資料的處理、使用方法及裝置、運行系統 | |
| US10198198B2 (en) | Storage device that stores setting values for operation thereof | |
| JP4775969B2 (ja) | 不揮発性記憶装置 | |
| US20150082124A1 (en) | Spatially decoupled redundancy schemes for a solid state drive (ssd) | |
| CN103514103A (zh) | 数据保护方法、存储器控制器与存储器储存装置 | |
| CN108073364A (zh) | 一种数据数组保护和修复闪存内数据方法 | |
| WO2024087939A1 (zh) | 固态硬盘及其限次访问控制方法、电子设备 | |
| JP2018067072A (ja) | 半導体記憶装置及びその制御方法 | |
| TWI393146B (zh) | 具有錯誤修正碼容量設定單元之快閃記憶體控制器及其方法 | |
| JP2010067098A (ja) | 情報処理装置、情報処理方法および情報処理プログラム | |
| TWI570738B (zh) | 具有使用歷程記錄的主記憶體模組以及此主記憶體模組於電腦系統之應用 | |
| JP5306745B2 (ja) | フラッシュメモリの管理方法及びフラッシュメモリデバイス |
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: 12881653 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 12881653 Country of ref document: EP Kind code of ref document: A1 |