Data integrity protection for relocating data in a memory system
By using cryptographic hash functions and transaction records, the solution ensures data integrity during relocation in memory systems, preventing data loss and malicious alterations, thereby enhancing security and reliability.
Patent Information
- Application Number
- CN201980082862.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2018-12-21
- Filing Date
- 2019-12-06
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2039-12-06
AI Technical Summary
Data integrity is compromised during relocation operations in memory systems, particularly in flash memory, due to security vulnerabilities that can alter data content, leading to loss of valid data and potential security breaches.
Implementing a cryptographic hash function to generate a hash value for data transactions, verifying the data to be written in a destination memory area, and stopping the relocation process if the data is altered, thereby ensuring data integrity through transaction records and blockchain ledger storage.
Enhances data reliability and security by preventing the loss of original data and detecting malicious alterations during relocation, ensuring the integrity of data within memory systems.
Smart Images

Figure CN113243013B_ABST
Abstract
Description
[0001] Related Applications
[0002] This application claims priority to U.S. patent application serial number 16 / 231,308, filed on December 21, 2018 and entitled “Data Integrity Protection for Relocating Data in a Memory System,” the complete disclosure of which is hereby incorporated by reference herein. Technical Field
[0003] At least some embodiments disclosed herein relate generally to memory systems, and more particularly, but not limited to, data integrity protection for relocating data in a memory system. Background Art
[0004] In general, a memory system may be a memory module, a storage device, or a hybrid memory / storage device. Examples of memory modules include dual in-line memory modules (DIMMs), small outline DIMMs (SO-DIMMs), or non-volatile dual in-line memory modules (NVDIMMs). Examples of storage devices include solid-state drives (SSDs) or hard disk drives (HDDs).
[0005] The host system may utilize the memory system to store data and / or instructions and to retrieve data and / or instructions.The memory system may include one or more memory components that may store data and / or instructions.
[0006] In general, memory components can be nonvolatile or volatile. Volatile memory components require power to maintain stored data. Nonvolatile memory components can retain stored data even when power is not supplied. Examples of memory components include memory integrated circuits. Some memory integrated circuits are volatile, such as dynamic random access memory (DRAM) and static random access memory (SRAM). Some memory integrated circuits are nonvolatile, such as flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), and electrically erasable programmable read-only memory (EEPROM) memory, etc.
[0007] A memory system can move content from one location to another. For example, flash memory is typically organized in blocks and pages. A flash memory block contains multiple flash memory pages. Each page can be individually programmed to store data. However, before a page can be reprogrammed to store different data, the page will be erased; and the pages in the block are configured to be erased together. Instead of erasing the entire block at once to reprogram the page, a controller can mark a page as containing invalid data and use another page to store the data. Garbage collection operations are typically configured to reclaim storage capacity of pages with invalid data. For example, during a garbage collection operation, valid data in other pages in the block can be relocated so that an entire block can be erased to claim storage capacity of pages with invalid data. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Embodiments are illustrated by way of example and not limitation in the figures of the accompanying drawings in which like references indicate similar elements.
[0009] Figure 1 An example computing system having a memory system according to some embodiments of the present disclosure is described.
[0010] Figure 2 A controller configured to protect data integrity when relocating data in a memory system is presented.
[0011] Figure 3 Describes a system for relocating data from one block to another.
[0012] Figures 4 to 6 An example of building a hash to protect data integrity when relocating data in a memory system is described.
[0013] Figure 7 Demonstrate methods for protecting data integrity when relocating data. DETAILED DESCRIPTION
[0014] Security vulnerabilities in computer systems can be used to alter data content during operations where data is moved from one memory location to another. For example, during a garbage collection operation, valid data retrieved from a source block of flash memory may be altered before being written into a destination block of flash memory. Writing the altered data into the destination block and erasing the source block may result in the loss of valid data originally stored in the source block. Furthermore, the altered data content may contain malicious code that, when executed, may create additional data exfiltration and / or security vulnerabilities.
[0015] At least some aspects of the present disclosure relate to techniques for ensuring data integrity during operations to move data from one memory location to another memory location.
[0016] For example, when data is written / programmed into a memory area, a transaction record may be generated to include a hash value (or "hash") of the data in the memory area. A cryptographic hash function may be applied to the data to generate the hash value. The cryptographic hash function may map data to a hash value of a predetermined size; and it is difficult to modify the data without changing its hash generated using the cryptographic hash function. In addition, it is generally difficult to reconstruct the original data from its hash; and different data may be mapped to the same hash. When data is to be moved from a memory area to a destination memory area, the controller is configured to verify the data to be written / programmed into the destination memory area based on the transaction record and / or hash. When the data to be written / programmed into the destination memory area has been changed and is therefore determined to be invalid based on the transaction record / hash, the operation of moving the data may be stopped to prevent the loss of the original data in the source memory area; and a warning or notification regarding a possible security vulnerability and / or data corruption in the memory system may be generated.
[0017] Figure 1 An example computing system having a memory system (101) according to some embodiments of the present disclosure is described. The memory system (101) may include media, such as memory areas (111, ..., 113). The memory areas (111, ..., 113) may be volatile memory areas, non-volatile memory areas, or a combination of such memory areas. In some embodiments, the memory system (101) is a memory module. Examples of memory modules include DIMMs, NVDIMMs, and NVDIMM-Ps. In some embodiments, the memory system (101) is a storage device. An example of a storage device is a solid-state drive (SSD). In some embodiments, the memory system (101) is a hybrid memory / storage subsystem. In general, a computing system may include a host system (102) that uses the memory system (101). For example, the host system (102) may write data to the memory system (101) and read data from the memory system (101).
[0018] The computing system and / or host system (102) may be a computing device, such as a desktop computer, a laptop computer, a network server, a mobile device, or such computing devices that include a memory and a processing device. The host system (102) may include or be coupled to the memory system (101) so that the host system (102) can read data from the memory system (101) or write data to the memory system. The host system (102) may be coupled to the memory system (101) via a physical host interface. As used herein, "coupled to" generally refers to a connection between components, which may be an indirect communication connection or a direct communication connection (e.g., without an intermediate component), whether wired or wireless, including connections such as electrical connections, optical connections, magnetic connections, etc. Examples of physical host interfaces include, but are not limited to, a Serial Advanced Technology Attachment (SATA) interface, a Peripheral Component Interconnect Express (PCIe) interface, a Universal Serial Bus (USB) interface, Fibre Channel, Serial Attached SCSI (SAS), a Double Data Rate (DDR) memory bus, etc. The physical host interface may be used to transfer data between the host system (102) and the memory system (101). The host system (102) may further utilize an NVM Express (NVMe) interface to access the memory regions (111, ..., 113) when the memory system (101) is coupled to the host system (102) via a PCIe interface. The physical host interface may provide an interface for passing control, address, data, and other signals between the memory system (101) and the host system (102). Figure 1 The memory system (101) is described as an example. In general, the host system (102) can access multiple memory systems via the same communication connection, multiple separate communication connections, and / or a combination of communication connections.
[0019] The host system (102) includes a processing device (104) and a controller (106). The processing device (104) of the host system (102) may be, for example, a microprocessor, a central processing unit (CPU), a processing core of a processor, an execution unit, etc. In some cases, the controller (106) may be referred to as a memory controller, a memory management unit, and / or an initiator. In one example, the controller (106) controls communication via a bus coupled between the host system (102) and the memory system (101).
[0020] In general, the controller (106) may send commands or requests for desired access to the memory regions (111) to (113) to the memory system (101). The controller (106) may further include interface circuitry for communicating with the memory system (101). The interface circuitry may convert responses received from the memory system (101) into information for the host system (102).
[0021] The controller (106) of the host system (102) can communicate with the controller (105) of the memory system (101) to perform operations such as reading data, writing data, or erasing data at the memory areas (111, ..., 113), as well as other such operations. In some cases, the controller (106) is integrated into the same package as the processing device (104). In other cases, the controller (106) is separate from the package of the processing device (104). The controller (106) and / or the processing device (104) may include hardware such as one or more integrated circuits and / or discrete components, buffer memory, cache memory, or a combination thereof. The controller (106) and / or the processing device (104) may be a microcontroller, a dedicated logic circuit system (e.g., a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), etc.), or another suitable processor.
[0022] The memory areas (111, ..., 113) may include any combination of different types of non-volatile memory areas and / or volatile memory areas. Examples of non-volatile memory areas include non-AND (NAND) type flash memory. Each of the memory areas (111) to (113) may include one or more arrays of memory cells, such as single-level cells (SLC) or multi-level cells (MLC) (e.g., triple-level cells (TLC) or quad-level cells (QLC)). In some embodiments, a particular memory component may include both an SLC portion and an MLC portion of a memory cell. Each of the memory cells may store one or more bits of data (e.g., a data block) used by the host system (102). Although non-volatile memory areas such as NAND type flash memory are described, the memory areas (111, ..., 113) may be based on any other type of memory, such as volatile memory. In some embodiments, the memory region (111, ..., 113) may be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a phase change memory (PCM), a magnetic random access memory (MRAM), a spin transfer torque (STT)-MRAM, a ferroelectric random access memory (FeTRAM), a ferroelectric RAM (FeRAM), a conductive bridge RAM (CBRAM), a resistive random access memory (RRAM), an oxide-based RRAM (OxRAM), a non-OR (NOR) flash memory, an electrically erasable programmable read-only memory (EEPROM), a nanowire-based nonvolatile memory, a memory incorporating memristor technology, and a cross-point array of nonvolatile memory cells. The cross-point array of the nonvolatile memory may be combined with a stackable cross-grid data access array to perform bit storage based on changes in bulk resistance. In addition, in contrast to many flash-based memories, the cross-point non-volatile memory can perform write-in-place operations, where non-volatile memory cells can be programmed without pre-erasing the non-volatile memory cells. In addition, the memory cells of the memory region (111, ..., 113) can be grouped into memory pages or data blocks, which can refer to units of a memory component used to store data.
[0023] A controller (105) of a memory system (101) may communicate with memory areas (111, ..., 113) to perform operations such as reading data, writing data, or erasing data at memory areas (111) to (113), as well as other such operations (e.g., in response to commands dispatched on a command bus by the controller (106)). The controller (105) may include hardware, such as one or more integrated circuits and / or discrete components, a buffer memory, or a combination thereof. The controller (105) may be a microcontroller, a dedicated logic circuit system (e.g., a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), etc.), or another suitable processor. The controller (105) may include a processing device (103) (e.g., a processor) configured to execute instructions (107). In the illustrated example, the cache memory (109) of the controller (105) includes embedded memory configured to store instructions (107) for executing various processes, operations, logic flows, and routines that control the operation of the memory system (101), including handling communications between the memory system (101) and the host system (102). In some embodiments, the cache memory (109) may include memory registers that store memory pointers, fetched data, etc. The controller (105) may also include a read-only memory (ROM) for storing microcode. Although Figure 1 The example memory system (101) in has been described as including a controller (105), but in another embodiment of the present disclosure, the memory system (101) may not include a controller (105), and may instead rely on external control (e.g., provided by an external host, or by a processor or controller separate from the memory system).
[0024] In general, the controller (105) may receive commands or operations from the host system (102) and may convert the commands or operations into instructions (107) or suitable commands to achieve the desired access to the memory area (111, ..., 113). The controller (105) may be responsible for other operations, such as wear leveling operations, garbage collection operations, error detection and correction code (ECC) operations, encryption operations, cache operations, and address conversion between logical block addresses and physical block addresses associated with the memory area (111, ..., 113). The controller (105) may further include a host interface circuit system to communicate with the host system (102) via a physical host interface. The host interface circuit system may convert commands received from the host system into command instructions (107) to access the memory area (111, ..., 113) and convert responses associated with the memory area (111, ..., 113) into information for the host system (102).
[0025] The memory system (101) may also include additional circuitry or components not illustrated. In some embodiments, the memory system (101) may include a cache or buffer (e.g., DRAM) and address circuitry (e.g., row decoder and column decoder) that may receive addresses from the controller (105) and decode the addresses to access the memory regions (111, ..., 113).
[0026] Figure 1 The memory system (101) stores a hash (115) of data stored in a memory region. When the controller (105) moves data from a source memory region (e.g., 111) to a destination memory region (e.g., 113) (e.g., in a garbage collection operation, or in response to a command from a host system (102)), the memory system (101) is configured to verify the data to be written to the destination memory region (e.g., 113) before erasing the corresponding data in the source memory region (e.g., 111).
[0027] For example, when Figure 1 When a memory system (101) programs / writes a page to store a data set, the memory system (101) may generate a transaction record of the transaction for programming the page. The transaction record may include a hash of the data set, which may be used to verify the data set retrieved from the page. The transaction record may further include other information, such as a timestamp of the programming / writing operation, identification of the program responsible for initiating the programming / writing operation, an identifier of the page, and / or a user account responsible for the programming / writing operation, etc.
[0028] To further enhance data security, a transaction record may be linked to a previous transaction record via a cryptographic hash (e.g., via storage in a blockchain ledger) by including a hash of a transaction record of a previous operation to program the page or another page. To enhance security, the transaction records may be stored in multiple locations in the computer system and / or memory system (101) so that a data set may be verified against a majority of the transaction records.
[0029] Thus, the techniques in this disclosure improve the reliability and integrity of data in the memory system (101).
[0030] Figure 2 The display is configured to relocate the memory system, e.g. Figure 1 A controller (139) is provided for protecting the integrity of data in the memory system (101).
[0031] exist Figure 2In , the source memory area (111) stores data version A (131). To move data from the source memory area (111) to the destination memory area (113), the data is initially retrieved (135) from the source memory area (111) and then organized in the cache memory (109).
[0032] In general, data version B (133) in the cache memory (109) may be different from data version A (131) in the source memory area (111).
[0033] For example, while data is organized in cache memory (109), the data may be altered via a malicious attack that exploits security holes in the instructions (107) of the memory system (101).
[0034] In some cases, data movement may be initiated by a malicious program without even actually retrieving data version A (131) from the source memory area (111).
[0035] exist Figure 2 In the embodiment, the controller (139) is configured to control the completion of data movement. For example, the controller (139) may be Figure 1 In some cases, the controller (139) may be implemented at least in part via the instruction set (107).
[0036] Figure 2 The controller (139) is configured to complete the data move by erasing at least data version A (131) in the source memory area (111). Before erasing data version A (131) from the source memory area (111), the controller (139) verifies the validity of data version B (133) in the cache memory (109) and / or the destination memory area (113).
[0037] For example, the controller (139) is configured to control writing of data into a memory area. During the process of writing data into a memory area, the controller (139) calculates a hash of the data written / programmed into the memory area. The hash may be stored as a transaction record of the write operation.
[0038] During the process of writing (137) data version B (133) into the destination memory version (113), the controller (139) calculates a hash (134) of data version B (133). Before erasing (141) data version A (131) from the source memory area (111), the controller (139) compares the hash (134) with the hash (132) of data version A (131) for verification of data version B (133). If the verification is successful, the controller (139) erases (141) data version (131) from the source memory area (111) to complete the data move. Otherwise, the controller (139) may abort the data move, generate an alert, and / or restart the data move.
[0039] In some implementations, a hash (134) of data version B (133) is calculated prior to writing / programming data version B (133) into the destination memory area (113). Thus, if verification by comparing hashes (132 and 134) is unsuccessful, the controller (139) may prevent (143) writing data version B (133) into the destination memory area (113).
[0040] In some embodiments, after successful verification and before completion of writing data version B (133) to the destination memory area (113), the cache memory (109) is configured to be locked to prevent changes. After completion of writing data version B (133), the cache memory (109) may be unlocked for further operations.
[0041] In some embodiments, a hash (134) of data version B (133) is calculated by reading back data version B (133) from the destination memory area (113) and comparing it to the hash (132) of data version A (131). Thus, errors that occur during write / program operations can also be detected.
[0042] The hashes (132 and 134) may be stored as part of a transaction record of a write operation that identifies the data versions (131 and 133).
[0043] Preferably, the hashes (132 and 134) (and the transaction records) are stored separately from the data versions (131 and 133) and accessed independently of the data versions (131 and 133).
[0044] Optionally, the hashes (132 and 134) (and the transaction records) are stored in corresponding memory areas (111 and 113).
[0045] In addition, multiple copies of the hashes (132 and 134) (and transaction records) may be stored in various memory areas (e.g., 111 and 113). The controller (139) may verify the data version (133) against the majority of the copies of the hashes (132 and 134) (and transaction records). A distributed hash storage configuration may be used, where copies of the hashes (e.g., 132) may be stored in multiple locations, such as a block (151) storing the data from which the hash (e.g., 132) is calculated, one or more blocks (e.g., 171) that do not store the data from which the hash (e.g., 132) is calculated, and / or a cache memory (109).
[0046] Optionally, the memory system (101) may include multiple controllers similar to the controller (139). The controllers may operate in parallel. Each controller (e.g., 139) may maintain a set of hashes (e.g., 132, 134) of the data stored in the memory areas (e.g., 111, 113) and independently verify the data sets using a copy of its hashes (e.g., 132, 134). Thus, even when some of the controllers and / or their hashes are hacked or corrupted, the memory system (101) may still verify the integrity of the data to be moved.
[0047] Figure 3 Describes a system for relocating data from one block to another. For example, Figure 3 The blocks (151 and 171) may be Figure 1 1 and 113 of the memory system (101) described in FIG. 1 . For example, the blocks (151 and 171) may be flash memories configured in an SSD. For example, Figure 3 The system can be Figure 2 Application of the controller (139).
[0048] A source block (151) may contain multiple pages (153, ..., 163). Each of the pages (153, ..., 163) may be individually programmed when the block (151) is free and / or has been cleared via an erase operation.
[0049] Source block (151) may store validity status (155, ..., 165) of pages (153, ..., 163). For example, the content of validity status (155) may indicate that the data content (157) in page (153) is valid; and the content of validity status (165) may indicate that the data content (167) in page (163) is invalid.
[0050] A hash (132) of valid data (eg, 157, ...) in block (151) may be stored in block (151) (and / or another location).
[0051] During a garbage collection operation, valid data (eg, 157, ...) is collected and / or organized in the cache memory (109) for writing to the destination block (171).
[0052] Before, during, and / or after copying data (eg, 157, ...) from cache memory (109) to destination block (171), controller (105 or 139) computes a hash (134) of the data (eg, 157, ...).
[0053] If the hash (134) matches the hash (132) of valid data (e.g., 157, ...) in the source block (151) for the garbage collection operation, then the garbage collection operation can be completed, where the source block (151) can be erased after completing writing the data to the destination block (171).
[0054] If the hash (134) does not match the hash (132) of valid data (eg, 157, ...) in the source block (151) for the garbage collection operation, then the garbage collection operation is stopped; and erasure of the source block (151) is prevented.
[0055] In some cases, the destination block (171) contains no data at all before the valid data (e.g., 157, ...) in the cache memory (109) is written to the destination block (171). After the data is moved, the destination block (171) may store a hash (134) that is equal to the hash (132) of the valid data in the source block (151).
[0056] In other cases, before writing valid data (e.g., 157, ...) in the cache memory (109) into the destination block (171), the destination block (171) may have data in some pages. The valid data (e.g., 157, ...) may be written to available free pages in the destination block (171). After the data is moved, the block (171) stores a hash (134) of the current valid data in the block (171), which is usually different from the hash (132) of the valid data in the source block (151).
[0057] Figures 4 to 6 An example of building a hash to protect data integrity when relocating data in a memory system is described.
[0058] Figure 4 A scenario is described in which a hash (186) of a set of pages (181, 183, 185, ..., 187) written to a block (eg, 151) is calculated from a series of hashes.
[0059] For example, after the initial page (181) is written into the block (151), a hash (182) is generated from the page (181). When a subsequent page (183) is written into the block (151), a subsequent hash (184) is calculated from the hash (182) of the previous page (181) and the content of the subsequent page (183). Similarly, when another page (185) is written into the block (151), another hash (186) is calculated from the hash (184) of the previous page (183) and the content of the another page (185). Therefore, when the last page (187) is written into the block (151), the last hash (188) depends on the content of all pages (181, 183, 185, ..., 187). Verification against the last hash (188) may be used to verify the contents of the entire set of pages (181, 183, 185, ..., 187).
[0060] Figure 5 A scenario is described in which a hash (189) of a group of pages (181, 183, 185, ..., 187) written into a block (e.g., 151) is calculated directly from the hashes (182, 184, 186, ..., 188) of the corresponding pages (181, 183, 185, ..., 187). When one of the pages (e.g., 183) is marked as invalid, the corresponding hash (e.g., 184) of the invalid page (e.g., 183) can be excluded from the calculation of the hashes of the remaining valid pages (e.g., 181, 183, 185, ..., 187). Thus, the hash (189) of the entire group of valid pages can be efficiently updated after one or more pages become invalid.
[0061] Figure 6 A transaction record (191) is illustrated for storing a hash (199) of a page identified by a page ID (195). Optionally, the transaction record (191) may include a timestamp (193), a hash of a previous transaction record, and / or other information, such as the identity of the host system (102), the user or program responsible for the page identified by the page ID (195), whether the page identified by the page ID is marked invalid, the address used by the host system (102) to access the page identified by the page ID (195), etc.
[0062] Generally speaking, Figure 6 The transaction record (191) and / or a copy thereof may be stored in the memory system (101) and / or other memory systems connected to the memory system (101).
[0063] For example, transaction records (eg, 191 ) of pages (eg, 153 , . . . , 163 ) of a block (eg, 151 ) may be stored in the block ( 151 ).
[0064] Furthermore, copies of transaction records (eg, 191 ) of pages (eg, 153 , . . . , 163 ) of a block (eg, 151 ) may be stored in one or more other selected blocks (eg, 171 ).
[0065] For example, multiple controllers (e.g., 139) may be configured to control multiple sets of blocks. Each controller (139) is a master device for a set of blocks (e.g., 151). A first controller (139) may provide transaction records (e.g., 191) in a block controlled by the first controller (139) to one or more second controllers that are not masters of blocks of the first controller (139). One or more second controllers may store a copy of the transaction record (e.g., 191) received from the first controller (139) and store the record in a block under the control of the second controller. During a verification process in the first controller (139), the second controller may provide a copy of the transaction record (or related information from the copy) to verify the transaction record (e.g., 191) used by the first controller (139) when verifying a page or block.
[0066] Transaction records (e.g., 191) can be used to verify data cached in cache memory (109), not only for moving data within memory system (101), but also for servicing data for other purposes, such as transferring data to a host system (102) or another memory system connected to memory system (101).
[0067] Optionally, the transaction record (e.g., 191) can also be used to check authorization to access data in the memory system. For example, when the transaction record (e.g., 191) includes ownership information (e.g., the host system, user, account, and / or program responsible for writing data in page (153)), the ownership information can be checked against a data access request to determine whether the request will be accepted or denied. For example, the data access request can be a request to trim or erase the page, a request to read the page, a request to modify the page, etc.
[0068] In some cases, the controller implements a blockchain ledger of transaction records for writing data to the memory system (101); and the transaction records (e.g., 191) may be recorded in the blockchain ledger along with redundant copies and an encrypted chain of the records.
[0069] Figure 7 Demonstrate methods for protecting data integrity when relocating data. For example, Figure 7 The method can be used according to Figure 4 or 5 constructed hash implementation in Figure 1 in a computer system for Figure 2 or the data relocation operation described in 3. The hash can be stored in Figure 6 In the transaction record (191) described in.
[0070] At block 201 , a memory system ( 101 ) stores first data ( 131 , or 157 , . . . ) in a first memory area ( 111 or 151 ) of the memory system ( 101 ).
[0071] At block 203 , the controller ( 105 or 139 ) calculates a first hash ( 132 ) of first data ( 131 , or 157 , . . . ) stored in a first memory area ( 111 or 151 ).
[0072] At block 205, the memory system (101) and / or the controller (105 or 139) stores the first hash (132) in the memory system (101).
[0073] At box 207, during an operation of moving first data (131, or 157, ...) from a first memory area (111 or 151) to a second memory area (113 or 171), the controller (105 or 139) uses a first hash (132) to verify second data (133, or 157, ...) to be stored in the second memory area (113 or 171) of the memory system (101).
[0074] At block 209 , after determining that the second data ( 133 , or 157 , . . . ) is valid in view of the first hash ( 132 ), the controller ( 105 or 139 ) erases the first data ( 131 , or 157 , . . . ) from the first memory area ( 111 or 151 ).
[0075] For example, the first memory area (111) may be a first block (151) of a flash memory of a solid-state drive; the second memory area (113) may be a second block (171) of a flash memory of the solid-state drive; and the operation is a garbage collection operation of erasing the first block (151) of the flash memory after storing the second data (133, or 157, ...) in the second block (171). For example, the first block (151) of the flash memory may have one or more first pages (e.g., 153, ...) storing the first data (e.g., 157, ...) and one or more second pages (e.g., 163) having invalid data. The garbage collection operation erases the first block (151) of the flash memory to require at least a storage capacity corresponding to the one or more second pages (e.g., 163) having invalid data.
[0076] For example, the solid state drive may have a cache memory (109) configured to cache second data (133, or 157, ...) that is typically a version of the first data (131, or 157, ...) retrieved from the first memory area (111 or 151). The controller (105 or 139) is configured to generate a second hash (134) of the second data (133, or 157, ...) and compare the second hash (134) with the first hash (132) to verify the second data (133, or 157, ...).
[0077] Optionally, the controller (105 or 139) may be configured to generate a second hash (134) during writing of the second data into the second memory area (113 or 171). After completing writing of the second data (133, or 157, ...) into the second memory area (113 or 171), the controller (105 or 139) may determine whether the second data written into the second memory area (113 or 171) is valid.
[0078] Optionally, or in combination, the controller (105 or 139) may be configured to generate a second hash (134) based on the second data (133, or 157, ...) stored in the cache memory (109) before starting to copy the second data (133, or 157, ...) to the second memory area (113 or 171). After verifying the data in the cache memory (109), the controller (105 or 139) locks the cache memory (109) to prevent changes until the copying of the second data (133, or 157, ...) from the cache memory (109) to the second memory area (113 or 171) is completed. If the data in the cache memory (109) fails via the first hash (132), then this arrangement prevents the data from being copied from the cache memory (109) to the second memory area (113 or 171).
[0079] Optionally, or in combination, the controller (105 or 139) may be configured to generate a second hash (134) based on second data (133, or 157, ...) stored in the second memory area (113 or 171) after the second data (133, or 157, ...) has been copied from the cache memory (109) to the second memory area (113 or 171).
[0080] Optionally, the first hash (132) may be stored in a transaction record (191) of writing the first data (131, or 157, ...) into the first memory area (111 or 151). Before writing the first data (131, or 157, ...) into the first memory area (111 or 151), the transaction record (191) may include a hash (197) of a previous transaction record of a previous operation that wrote data into the first memory area (111 or 151). Optionally, the transaction record (191) is stored in the first memory area (111 or 151); and one or more additional copies of the transaction record (191) may be stored in other locations of the memory system (101). Verifying the data in the cache memory (109) may be performed using the transaction record (191) stored in the first memory area (111 or 151) and / or one or more additional copies stored in other locations in the memory system (101).
[0081] The controller (105 or 139) may be configured to control completion of data movement within the memory system (101). During completion of the data movement, the controller (105 or 139) is configured to erase the first data (131, or 157, ...) from the first memory area (111 or 151) only after determining that the second data (133, or 157, ...) is valid in view of the first hash (132).
[0082] Optionally, the controller (105 or 139) may be further configured to control the generation of a transaction record (191) that writes data to the memory area. The transaction record (191) may be stored in a block chain implemented in the memory system (101).
[0083] Some portions of the previous detailed description have been presented in terms of algorithms and symbolic representations of operations on data bits within a computer memory. These algorithmic descriptions and representations are the means by which those skilled in the art of data processing most effectively convey the substance of their work to others skilled in the art. In this document, and generally, an algorithm is conceived to be a self-consistent sequence of operations that produces a desired result. An operation is one that requires physical manipulation of physical quantities. Typically (but not necessarily), these quantities take the form of electrical or magnetic signals that can be stored, combined, compared, and otherwise manipulated. It has proven convenient at times, primarily for common reasons, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers, and the like.
[0084] It should be borne in mind, however, that all of these and similar terms will be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. The present disclosure may refer to the actions and processes of a computer system or similar electronic computing device that manipulates and transforms data represented as physical (electronic) quantities within the computer system's registers and memories into other data similarly represented as physical quantities within the computer system's memories or registers or other such information storage systems.
[0085] The present disclosure also relates to an apparatus for performing the operations described herein. This apparatus may be specially constructed for the desired purpose, or it may comprise a general purpose computer selectively activated or reconfigured by a computer program stored in the computer. Such a computer program may be stored in a computer-readable storage medium, such as, but not limited to, any type of disk, including a floppy disk, an optical disk, a CD-ROM, and a magnetic optical disk, a read-only memory (ROM), a random access memory (RAM), an EPROM, an EEPROM, a magnetic card or an optical card, or any type of medium suitable for storing electronic instructions, each coupled to a computer system bus.
[0086] The algorithms and displays presented herein are not inherently related to any particular computer or other device. Various general purpose systems can be used together with the programs according to the teachings herein, or it can be proven that it is convenient to construct a more specialized device to perform the method. The structures of various these systems will be presented as described below. In addition, the present disclosure is described without reference to any specific programming language. It should be understood that the teachings of the present disclosure as described herein can be implemented using various programming languages.
[0087] The present disclosure may be provided as a computer program product or software, which may include a machine-readable medium having stored thereon instructions that can be used to program a computer system (or other electronic device) to perform a process according to the present disclosure. A machine-readable medium includes any mechanism for storing information in a form readable by a machine (e.g., a computer). In some embodiments, a machine-readable (e.g., computer-readable) medium includes a machine (e.g., computer) readable storage medium, such as a read-only memory ("ROM"), a random access memory ("RAM"), a magnetic disk storage medium, an optical storage medium, a flash memory area, etc.
[0088] In this specification, various functions and operations are described as being performed or caused by computer instructions to simplify the description. However, those skilled in the art will recognize that the intent of such expressions is that the functions are generated by one or more controllers or processors (e.g., microprocessors) executing computer instructions. Alternatively or in combination, the functions and operations may be implemented using dedicated circuitry with or without software instructions, such as using an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA). Embodiments may be implemented using hard-wired circuitry without software instructions or in combination with software instructions. Therefore, the technology is not limited to any particular combination of hardware circuitry and software, nor is it limited to any particular source of instructions executed by a data processing system.
[0089] In the foregoing description, embodiments of the present disclosure have been described with reference to specific example embodiments thereof. It will be apparent that various modifications may be made to the present disclosure without departing from the broader spirit and scope of the embodiments of the present disclosure as set forth in the appended claims. Therefore, the description and drawings should be viewed in an illustrative sense rather than a restrictive sense.
Claims
1. A solid state drive comprising: a plurality of memory regions including a first memory region and a second memory region; and a controller configured to generate a first hash value of first data stored in the first memory area using a hash function; wherein the controller is further configured to write the first hash value to a memory area of the plurality of memory areas or to a cache memory or to both; wherein the controller is further configured to perform an operation to copy the first data from the first memory area to the second memory area as second data, wherein the second data is not completely located in the second memory area until the operation is completed; and Wherein the controller is configured to erase the first data from the first memory area after determining that the second data is valid in view of the first hash value.
2. The solid-state drive of claim 1 , wherein the first memory area is a first block of a flash memory of the solid-state drive, the second memory area is a second block of a flash memory of the solid-state drive; and the operation erases the first block of the flash memory after storing the second data in the second block.
3. The solid-state drive of claim 2, wherein the first block includes one or more first pages storing the first data and one or more second pages having invalid data; and the operation erases the first block of flash memory to require at least a storage capacity corresponding to the one or more second pages; And the solid state drive further comprises: a cache memory configured to store the second data; Wherein the second data is a version of the first data retrieved from the first memory area.
4. The solid-state drive of claim 3, wherein the controller is configured to generate a second hash value of the second data and compare the second hash value with the first hash value to verify the second data; and wherein the controller is configured to: generating the second hash value during writing of the second data into the second memory area; generating the second hash value based on the second data stored in the cache memory and locking the cache memory from changes after the determination that the second data is valid in view of the first hash; or The second hash value is generated based on the second data stored in the second memory area after copying the second data from the cache memory to the second memory area.
5. A method for memory operation, comprising: storing first data in a first memory area of a memory system; calculating a first hash value of the first data stored in the first memory area using a first hash function; storing the first hash value in the memory system; performing an operation to copy the first data from the first memory area to a second memory area of the memory system as second data, wherein the second data is not completely located in the second memory area until the operation is completed; as well as The first data is erased from the first memory area based at least in part on verifying the second data using the first hash value.
6. The method according to claim 5, further comprising: A second hash value is calculated from a first transaction record of writing the first data into the first memory area using a second hash function, wherein the first transaction record includes the first hash value.
7. The method according to claim 6, further comprising: A second transaction record for writing third data into the first memory area is generated to include at least the second hash value in the second transaction record.
8. The method according to claim 6, further comprising: storing third data in a memory area of the memory system; Calculating a third hash value of the third data using the first hash function; as well as The second transaction record for writing the third data into a third memory area of the memory system is generated by including at least the second hash value and the third hash value in a second transaction record.
9. The method according to claim 6, further comprising: storing one or more copies of the first transaction record in the memory system; wherein the verification is based at least in part on the one or more copies; wherein the first transaction record further comprises a timestamp of writing the first data into the first memory area; wherein the first memory area is a first block of flash memory in the solid state drive; wherein the second memory area is a second block of flash memory in the solid state drive; and Wherein the operation comprises a garbage collection operation in the solid-state drive to erase the first block.
10. A memory system comprising: a first memory area configured to store first data, and a second memory area; a cache memory configured to store second data corresponding to a version of the first data stored in the first memory area; as well as A controller configured to: managing a first hash value of the first data stored in the first memory area; verifying second data stored in the cache memory using the first hash value; and An operation is performed to copy the first data from the first memory area to the second memory area as second data, wherein the second data is not completely located in the second memory area until the operation is completed. 11 . The memory system of claim 10 , wherein the controller is configured to erase the first data from the first memory area after determining that the second data is valid in view of the first hash value.
12. The memory system of claim 10, wherein the controller is configured to generate a transaction record of writing data into the first memory area; and wherein the controller is configured to record the transaction record in a block chain implemented in the memory system.
13. An apparatus for memory operation, comprising: Cache memory; a plurality of memory regions, each respective memory region in the plurality of memory regions being configured to store a data set; as well as a controller configured to generate a hash value of the data set for the corresponding memory area using a cryptographic hash function and store one or more copies of the hash value in the device; The controller is further configured to perform an operation to load the data set from the memory area into the cache memory, wherein the data set is not completely located in the cache memory until the operation is completed, and the controller is further configured to verify the data set in the cache memory using the one or more copies of the hash value after loading the data set from the memory area into the cache memory.
14. The apparatus of claim 13, wherein the controller is configured to store a copy of the hash value in the cache memory, store a copy of the hash value in the corresponding memory area, and store a copy of the hash value in a memory area other than the corresponding memory area.
15. The apparatus of claim 13, wherein the controller is configured to erase the data set from the corresponding memory area to move the data set to a memory area other than the corresponding memory area after a hash value calculated from the data set in the cache memory using the cryptographic hash function is consistent with the one or more copies.
16. A managed memory device having the apparatus according to claim 13, wherein the controller is further configured to: managing first hash values of data sets stored in the plurality of memory areas; loading a data set from a first memory area of the plurality of memory areas into the cache memory; calculating a second hash value using the data set from the cache memory; as well as It is determined whether the second hash value is consistent with the first hash value managed by the controller.
17. The managed memory device of claim 16, wherein the controller is configured to calculating the second hash value during writing of the data set from the cache memory to a second memory region, wherein the controller is further configured to allow erasure of the data set from the first memory region to complete moving the data set from the first memory region after determining that the second hash value is consistent with the first hash value managed by the controller; allowing writing of the data set from the cache memory to a second memory area after determining that the second hash value is consistent with the first hash value managed by the controller, wherein the controller is further configured to lock the cache memory from changes during the writing of the data set from the cache memory to the second memory area; or Allowing a host system to read the data set from the cache memory after determining that the second hash value is consistent with the first hash value managed by the controller, wherein the controller is further configured to lock the cache memory from changes during the host system reading the data set from the cache memory.
Citation Information
Patent Citations
Data Integrity Protection for Relocating Data in a Memory System
US20200201788A1
Data caching in non-volatile memory
CN102576333A
Memory system including key-value store
CN102929793A
Storage device performing hashing-based translation between logical address and physical address
CN108345545A
Reliability of write operations to a non-volatile memory
US20070233937A1
