WO2018059361A1 - Power down protection method for storage system, storage controller, and electronic device - Google Patents

Power down protection method for storage system, storage controller, and electronic device Download PDF

Info

Publication number
WO2018059361A1
WO2018059361A1 PCT/CN2017/103249 CN2017103249W WO2018059361A1 WO 2018059361 A1 WO2018059361 A1 WO 2018059361A1 CN 2017103249 W CN2017103249 W CN 2017103249W WO 2018059361 A1 WO2018059361 A1 WO 2018059361A1
Authority
WO
WIPO (PCT)
Prior art keywords
mapping table
mapping
log
data
mapping relationship
Prior art date
Application number
PCT/CN2017/103249
Other languages
French (fr)
Chinese (zh)
Inventor
许璐
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2018059361A1 publication Critical patent/WO2018059361A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/16Protection against loss of memory contents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7201Logical to physical mapping or translation of blocks or pages

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a storage system power failure protection method, a storage controller, and an electronic device.
  • flash-based storage devices such as SSD, Solid State Drive, Chinese: SSD
  • the flash state is abnormal, causing data to be corrupted, eventually causing the device to fail to boot.
  • the metadata storage module is usually in the OOB (English: Out Of Band) area of each page of each block. Or a summary of the information of the data recorded in the OOB area of the last page, wherein the information digest includes the mapping relationship between the logical address and the physical address of all pages on the block; since the data in the SSD belonging to the non-volatile medium is rewritten When the original data is not rewritten, the rewritten content is stored in other locations in the SSD, and when the mapping relationship needs to be stored in the SSD reaches a certain number, the content can be written to the SSD.
  • OOB American OOB
  • mapping relationship cannot be stored in the SSD in time; when the storage system is powered on, the storage array scanning module scans the OOB area of each page for the entire SSD, or scans the last page of the O.
  • the OB area is used to obtain the mapping relationship of all the data pages, and then determines the latest physical address corresponding to the same logical address according to the degree of the old and new mappings of all the obtained data pages, thereby determining the latest mapping relationship to implement power-down protection. .
  • the present invention provides a storage system power failure protection method, a storage controller, and an electronic device, which can solve the problem that the storage system needs a large amount of time to restore the mapping relationship.
  • the embodiment of the present invention adopts the following technical solutions:
  • the present invention provides a storage system power failure protection method, the method is used in an electronic device, and the electronic device includes: a central processing unit (English: abbreviated as: CPU), a storage controller, a flash, and a high speed non-easy Loss memory and dynamic random access memory (English: abbreviated as DRAM), high-speed non-volatile memory holds a first-level mapping table and a log buffer area, and a secondary mapping table, a three-level mapping table, and a log are stored in the flash. District, where
  • CPU central processing unit
  • storage controller a storage controller
  • flash a flash
  • high-speed non-volatile memory holds a first-level mapping table and a log buffer area
  • a secondary mapping table, a three-level mapping table, and a log are stored in the flash. District, where
  • the log buffer is used to save the mapping relationship between the data written by the storage controller and the data in the log buffer area when the CPU writes the data mapping relationship to the DRAM during normal operation of the electronic device.
  • the log area is used to save the mapping relationship between the data read by the storage controller from the log buffer area after the storage space in the log buffer area reaches the first threshold.
  • the index information of the three-level mapping table is a data mapping relationship.
  • the three-level mapping table is refreshed and the mapping relationship of the data in the log area is saved.
  • the index information of the primary mapping table is a mapping relationship of the secondary mapping table
  • the index information of the secondary mapping table is a mapping relationship of the three-level mapping table
  • the mapping relationship is a correspondence between a logical address and a physical address
  • the method includes:
  • the storage controller determines the physical address of the secondary mapping table according to the index information of the primary mapping table, and finds the secondary mapping table according to the physical address of the secondary mapping table, and accesses the second mapping table.
  • the index information of the level mapping table is used to determine the physical address of the three-level mapping table, and then the three-level mapping table is found according to the physical address of the three-level mapping table, and the index information of the three-level mapping table is determined;
  • the storage controller reads the mapping relationship of all the data in the log buffer area, and the mapping relationship of all the data in the log area;
  • the storage controller sends the index information of the three-level mapping table, the mapping relationship of all the data in the log buffer area, and the mapping relationship of all the data in the log area to the CPU;
  • the storage controller determines, according to the index information of the three-level mapping table and the mapping relationship of all the data in the log buffer area, the mapping relationship between the at least one data in the log buffer area or the mapping relationship in the log area and the third-level mapping table are determined by the CPU.
  • the mapping relationship in the log is inconsistent, the mapping relationship in the log buffer area or the mapping relationship in the log area is used to replace the mapping relationship in the third-level mapping table, wherein, in the replacement, at least one data is preferentially used. Replace the mapping relationship of the log buffer area;
  • the storage controller updates the index information of the secondary mapping table according to the updated three-level mapping table, and then updates the index information of the primary mapping table according to the updated secondary mapping table, and updates the updated secondary mapping table.
  • the mapping relationship that changes before and after is saved to the DRAM.
  • the high-speed non-volatile memory means that the read/write speed is faster than the flash, and at the same time, the granularity of the data that can be directly manipulated is smaller each time (for example, operating in bytes instead of pressing the flash)
  • the memory in which the block operates is, for example, MRAM (English: Magnetic Random Access Memory, Chinese: Magnetic Random Access Memory) or PCM (English: Phase-change memory, Chinese: Phase Change Memory).
  • MRAM Magnetic Random Access Memory
  • PCM Phase-change memory
  • high-speed non-volatile memory is usually more expensive than flash, and its capacity is smaller than that of flash, which is not suitable for large-scale use.
  • a plurality of locations such as a mapping table, a log buffer, and a log area, are set to save data mapping relationships, so that after the CPU is powered off, the storage controller can recover according to the saved mapping relationships.
  • the search is performed one level at a time through the mapping tables of each level, instead of using the prior art full scan method, the speed is improved in the process of finding the mapping relationship of the data.
  • the log buffer area can be placed in the MRAM due to the high speed of the MRAM. Since the CPU writes the data mapping relationship to the DRAM, it also writes to the MRAM. This is a very frequently used operation. If the speed is slow, it will affect the whole system. Therefore, MRAM is used here to save the data in the log buffer area to maximize the performance of the system.
  • the first mapping table is also placed in the MRAM. Since the primary mapping table is used to search the second and third mapping tables, the address of the primary mapping table must be known first, and the address needs to be fixed. . If the first-level mapping table is placed in a fixed address of the flash, due to the characteristics of the flash itself, when the area is continuously read and written, excessive wear and tear will occur, eventually causing the flash to malfunction. MRAM does not have this problem, so an area can be created in MRAM to place the first level mapping table. At the same time, since the capacity of the primary mapping table is not large (only the index information of the secondary table is saved), it is also suitable to use the MRAM to save the mapping table. Other tables (for example, the secondary mapping table and the tertiary mapping table) occupy a relatively large space, and can be placed in the flash by utilizing the large-capacity feature of the flash to achieve an optimal configuration.
  • the storage controller needs to report to the CPU a flag for responding to abnormal power-off, and the flag is located in the register of the storage controller, so that the CPU judges the previous time according to the flag bit. Whether the power is abnormally powered off.
  • the above-mentioned reporting flag can enable the CPU to quickly and effectively distinguish whether the previous power-off is abnormally powered off. If the power-off is normal, the normal power-on process is triggered. Otherwise, the abnormal power-on is triggered. Process.
  • the log buffer is divided into n queues, n queues are represented by Q1 to Qn, where n is a positive integer greater than or equal to 1, and the log area includes at least two blocks, and each The block corresponds to a queue in the log buffer; after the storage space in the log buffer reaches the first threshold, the storage controller reads the mapping relationship of the data in the log buffer from the log buffer and saves it to the log.
  • the area includes: after the storage space of the target column reaches the first threshold in the log buffer area, the storage controller stores the mapping relationship of the data in the target column to the position corresponding to the target block in the log area, and the target block is the target column. Corresponding block.
  • the storage controller when the electronic device is working normally, if the number of modified entries of the three-level mapping table after the refresh reaches the third threshold, the storage controller refreshes the secondary mapping table according to the refreshed three-level mapping table. Index information; if the number of modified entries of the secondary mapping table after refreshing reaches a fourth threshold, the storage controller updates the index information of the primary mapping table according to the refreshed secondary mapping table.
  • the index information is refreshed step by step, and the process of refreshing the secondary mapping table according to the three-level mapping table and refreshing the primary mapping table according to the secondary mapping table is the number of modified entries in the mapping table. Refresh is reached when a certain threshold is reached. It can be seen that the above-mentioned batch refreshing manner can reduce the refreshing frequency of the mapping table under the premise of ensuring that the mapping table is in a new state as much as possible, and at the same time, satisfy the requirement of the mapping table for the refresh operation.
  • the present invention provides a memory controller that can implement the functions performed by the memory controller in the above method examples, and the functions can be implemented by hardware or by executing corresponding software by hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • the present invention provides an electronic device including: a CPU, the above memory controller, a flash, a high speed nonvolatile memory, and a dynamic random access memory (English: Dynamic Random Access Memory, DRAM for short)
  • the memory controller is configured to perform the corresponding function of the memory controller in the above method.
  • the electronic device can also include a communication interface for communicating with other devices.
  • the present invention provides a computer storage medium for storing computer software instructions for use in the storage controller described above, including a program designed to perform the above aspects.
  • the high-speed non-volatile memory refers to a memory with a faster read/write speed than the flash, and at the same time, a smaller granularity of data can be directly manipulated each time, for example , MRAM or PCM.
  • high-speed non-volatile memory is usually more expensive than flash, and its capacity is smaller than that of flash, which is not suitable for large-scale use.
  • a plurality of locations such as a mapping table and a log buffer area and a log area are set to save data mapping relationships, so that after the CPU is powered off, the storage controller can recover according to the saved mapping relationships.
  • the speed is improved in the process of finding the mapping relationship of data.
  • the characteristics of the high-speed nonvolatile memory and the flash are fully utilized when the respective mapping relationships are saved.
  • the log buffer area can be placed in the MRAM due to the high speed of the MRAM. Since the CPU writes the data mapping relationship to the DRAM, it also writes to the MRAM. This is a very frequently used operation. If the speed is slow, it will affect the whole system. Therefore, MRAM is used here to save the data in the log buffer area to ensure the performance of the system to the greatest extent.
  • the present invention also places the primary mapping table in the MRAM. Since the primary mapping table is used to search the secondary and tertiary mapping tables, the address of the primary mapping table must be known first, and this address needs to be fixed. If the first-level mapping table is placed in a fixed address of the flash, due to the characteristics of the flash itself, when the area is continuously read and written, excessive wear and tear will occur, eventually causing the flash to malfunction. MRAM does not have this problem, so an area can be created in MRAM to place the first level mapping table. At the same time, since the capacity of the primary mapping table is not large, it is also suitable to use MRAM to save the mapping table. Other tables occupy a relatively large space, and can be placed in the flash by utilizing the feature of flash large capacity, thereby achieving optimal configuration.
  • FIG. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of a method for powering down protection of a storage system according to an embodiment of the present invention
  • FIG. 6 are schematic structural diagrams of another MRAM according to an embodiment of the present invention.
  • FIG. 7 is a flowchart of another method for powering down protection of a storage system according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a storage controller according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of another storage controller according to an embodiment of the present invention.
  • the present invention is applicable to an electronic device including a CPU, a storage controller, and Flash, high speed non-volatile memory and DRAM.
  • the DRAM can be specifically a memory
  • the high-speed non-volatile memory can be an MRAM
  • the storage controller can be implemented by using an FPGA.
  • the high-speed non-volatile memory stores a first-level mapping table and a log buffer area
  • the flash stores a second-level mapping table, a three-level mapping table, and a log area, wherein the log buffer area is used to save the electronic device.
  • the CPU writes the mapping relationship of the data in the log buffer area through the storage controller while writing the mapping relationship of the data to the DRAM; the log area is used after the storage space in the log buffer area reaches the first threshold.
  • the mapping relationship between the data read by the storage controller from the log buffer area is saved;
  • the index information of the three-level mapping table is a data mapping relationship, and the three-level mapping table is used when the data in the log area reaches a second threshold,
  • the level mapping table is refreshed and saves the mapping relationship of the data in the log area;
  • the index information of the primary mapping table is the mapping relationship of the secondary mapping table;
  • the index information of the secondary mapping table is the mapping relationship of the tertiary mapping table;
  • the mapping relationship is The correspondence between logical addresses and physical addresses.
  • first threshold value and the second to fourth threshold values mentioned later may be preset according to an empirical value or a specific application scenario when setting.
  • the function of the first threshold is to determine whether the mapping relationship of the data stored in the log buffer needs to be written into the log area of the flash; the role of the second threshold is to determine whether the mapping relationship of the data stored in the log area needs to be written to the flash.
  • the third threshold is used to determine whether the modified entry in the refreshed three-level mapping table needs to be refreshed into the secondary mapping table; the fourth threshold is to determine the refreshed secondary mapping table. Whether the modified entry in the need to be refreshed into the primary mapping table.
  • the first threshold and the second threshold are both used as reference values for the storage space occupation.
  • the first threshold and/or the second threshold may be set to 100%, 90%, etc., for indicating storage space.
  • the parameter of the occupancy condition wherein if the first threshold is set to 100%, it indicates that after the storage space in the log buffer is full, the storage controller writes the mapping relationship of the data in the log buffer to the flash log.
  • the third and fourth thresholds are all reference values of the number of modified entries, for example, the third threshold and/or the fourth threshold may be set to 50, 100, etc. are used to indicate the number of modified entries.
  • the parameter wherein if the third threshold is set to 50, it indicates that after the third table is modified to have 50 entries after the refresh, the storage controller refreshes the secondary mapping according to the refreshed three-level mapping table. Index information for the table.
  • the values of the first threshold and the second threshold may be the same or different, and the values of the third threshold and the fourth threshold may be the same or different, which is not limited herein, and the threshold is set.
  • the parameter type is not limited.
  • the parameter type can be other types such as a percentage, an integer, and the like.
  • the storage controller can directly delete the content that has been written to the log area in the log buffer area, and the release is deleted.
  • the log buffer can still provide sufficient storage space for the caching process, that is, storage resources.
  • the storage controller does not delete the content in the log buffer area, but marks the part of the content, and directly overwrites the part that has been marked when the mapping relationship of the new data is written to the log buffer. In the same way, the effect of full use of space can also be achieved.
  • the storage controller For the three-level mapping table, if the data stored in the log area reaches the second threshold, the storage controller also needs to write the contents of the log area into the three-level mapping table by the block, and, in order to save the flash storage. Space, you also need to delete the contents of the log area.
  • Embodiments of the present invention provide a storage system power failure protection method. As shown in FIG. 2, the method may be performed by the foregoing storage controller.
  • the storage controller may specifically include an MRAM controller and an SSD controller, wherein the MRAM controller may be used to monitor the status of the primary mapping table and the log buffer in the MRAM, for example, determining the storage of the log buffer. Whether the space reaches a certain threshold, in addition, the MRAM controller can also notify the SSD controller to perform corresponding operations according to the state of the MRAM; similarly, the SSD controller can be used to monitor the secondary mapping table, the tertiary mapping table and the log area in the flash.
  • the SSD controller can also notify the MRAM controller according to the state of the flash. Take the appropriate action.
  • the method flow includes:
  • the storage controller determines the physical address of the secondary mapping table according to the index information of the primary mapping table, and finds the secondary mapping table according to the physical address of the secondary mapping table.
  • the index information of the secondary mapping table is accessed to determine the physical address of the tertiary mapping table, and then the tertiary mapping table is found according to the physical address of the tertiary mapping table, and the index information of the tertiary mapping table is determined.
  • the storage controller reads the mapping relationship of all the data in the log buffer area and the mapping relationship of all the data in the log area.
  • the storage controller sends the index information of the three-level mapping table, the mapping relationship of all the data in the log buffer area, and the mapping relationship of all the data in the log area to the CPU.
  • the storage controller determines, according to the index information of the three-level mapping table and the mapping relationship of all the data in the log buffer area, the mapping relationship between the at least one data in the log buffer area or the mapping relationship in the log area is at the third level. If the mapping relationship in the mapping table is inconsistent, the mapping relationship in the log buffer area or the mapping relationship in the log area is used to replace the mapping relationship in the third-level mapping table.
  • mapping relationship of at least one data in the log buffer area is preferentially replaced.
  • the storage controller updates the index information of the second mapping table according to the refreshed three-level mapping table, and then updates the index information of the primary mapping table according to the updated secondary mapping table, and the updated secondary mapping table is The mapping relationship that changes before and after the update is saved to the DRAM.
  • the secondary mapping table in the flash may be cleared after the DRAM saves the updated secondary mapping table.
  • some program modules for example, drivers
  • the storage controller may invoke the algorithm power-off interface to notify the algorithm to perform normal power-off operations; the algorithm calls the saveMap3inSSD function and passes The drive logic writes all updated three-level mapping tables in the DRAM to the flash, and returns the physical address of the newly-written three-level mapping table in the flash; according to the physical address of the newly written three-level mapping table in the returned flash Updating the contents of the secondary mapping table in the DRAM; writing all updated secondary mapping tables in the updated DRAM to the flash, and returning the physical address newly written to the secondary mapping table; the secondary mapping table to be returned
  • the physical address is saved to the first-level mapping table of the MRAM; all the blocks in the current log area in the flash are all set as garbage blocks, and the power-off operation is completed to the drive return algorithm, and the driver can be used in the register of the storage controller.
  • the flag flag of the abnormal power-off process in the previous power-off process is set to 1, which
  • the high-speed non-volatile memory means that the reading and writing speed is faster than that of the flash, and at the same time, the granularity of the data can be directly manipulated each time (for example, operating in bytes without operating in blocks like flash) Memory, for example, MRAM or PCM.
  • Memory for example, MRAM or PCM.
  • high-speed non-volatile memory is usually more expensive than flash, and its capacity is smaller than that of flash, which is not suitable for large-scale use.
  • a plurality of locations such as a mapping table, a log buffer, and a log area, are set to save data mapping relationships, so that after the CPU is powered off, the storage controller can recover according to the saved mapping relationships.
  • the search is performed one level at a time through the mapping tables of each level, instead of using the prior art full scan method, the speed is improved in the process of finding the mapping relationship of the data.
  • the log buffer area can be placed in the MRAM due to the high speed of the MRAM. Since the CPU writes the data mapping relationship to the DRAM, it also writes to the MRAM. This is a very frequently used operation. If the speed is slow, it will affect the whole system. Therefore, MRAM is used here to save the data in the log buffer area to ensure the performance of the system to the greatest extent.
  • the first mapping table is also placed in the MRAM. Since the primary mapping table is used to search the second and third mapping tables, the address of the primary mapping table must be known first, and the address needs to be fixed. . If the first-level mapping table is placed in a fixed address of the flash, due to the characteristics of the flash itself, when the area is continuously read and written, excessive wear and tear will occur, eventually causing the flash to malfunction. MRAM does not have this problem, so an area can be created in MRAM to place the first level mapping table. At the same time, since the capacity of the primary mapping table is not large (only the index information of the secondary table is saved), it is also suitable to use the MRAM to save the mapping table. Other tables (for example, the secondary mapping table and the tertiary mapping table) occupy a relatively large space, and can be placed in the flash by utilizing the large-capacity feature of the flash to achieve an optimal configuration.
  • the different power-off states may trigger different processing flows when the CPU is powered on again. Therefore, in the embodiment of the present invention, in an implementation manner, when the CPU is powered on, the flag of the storage controller can be read to determine that the previous power-off process is normal power-off or abnormal power-off operation, and then select different processing according to the power-off state. Process. Therefore, after the CPU is powered on, the storage controller reports the flag for reflecting the abnormal power-off to the CPU.
  • the flag bit can be located in a register in the memory controller.
  • the driver in the memory controller can set the flag bit, for example, setting the flag bit flag to 1; Because the memory controller is powered off, the setting of the flag bit cannot be completed. Therefore, when the CPU is powered on again, the flag value read is a value (such as 0) during normal operation, instead of 1 When the CPU is powered off, it is abnormally powered off.
  • the manner of distinguishing whether the CPU is normally powered off is not limited to the implementation manner of the above-mentioned setting flag, and may be other operations that can be used to distinguish the CPU power-off state, and details are not described herein.
  • the method for reading the flag bit can be used to enable the storage controller to quickly and effectively distinguish whether the previous power-off is abnormally powered off. If the power-off is normal, the normal power-on process of the CPU is triggered. Otherwise, , triggers the above abnormal power-on process.
  • the normal power-on process of the CPU is: the CPU receives the drive controller to read the flag bit, invokes the algorithm initialization interface, and transmits the flag bit.
  • the algorithm normally calls the power-on process. That is, the algorithm reads the contents of the primary mapping table in the high-speed non-volatile memory through the driving logic, and according to the primary mapping The physical address of the secondary mapping table recorded in the table, find the location of the secondary mapping table in the flash, access the contents of the secondary mapping table, and save the content of the read secondary mapping table in the main storage, that is, in the In DRAM, and return the determination information to the driver.
  • the CPU When the CPU is powered on normally, the CPU can directly find the physical address of the secondary mapping table stored in the SSD according to the mapping relationship in the primary mapping table stored in the high-speed non-volatile memory, and then access the secondary mapping table, and Synchronizing the mapping relationship in the secondary mapping table to the DRAM, so that when the data is subsequently read, the physical address stored in the flash of the three-level mapping table can be determined according to the secondary mapping table in the DRAM, and The level mapping table determines the storage address of the data.
  • the storage controller may find the physical address of the secondary mapping table stored in the flash according to the mapping relationship in the primary mapping table, and then access the secondary mapping table, and find the storage in the flash according to the mapping relationship in the secondary mapping table. The physical address of the three-level mapping table, and the mapping relationship of the data stored in the three-level mapping table is read.
  • the log buffer in order to conveniently write the contents of the log buffer to the log area of the flash in batches, the log buffer may be divided into n queues, wherein n queues may be represented by Q0 to Qn. n is a positive integer greater than or equal to 1, the log area includes at least two blocks, and each block corresponds to a column in the log buffer.
  • the storage controller when a certain condition is met, the storage controller may write the content stored in the log buffer area to the log area according to the queue. Therefore, after the storage space in the log buffer reaches the first threshold, the storage controller reads the mapping relationship of the data in the log buffer from the log buffer and saves the data to the log area.
  • the storage controller After the storage space of the target column reaches the first threshold in the log buffer, the storage controller stores the mapping relationship of the data in the target column to the location corresponding to the target block in the log area, and the target block is the block corresponding to the target column.
  • the block can be regarded as an area corresponding to the queue.
  • the composition of the block is the same as the queue, and is an area composed of a plurality of entries.
  • the storage controller can write the mapping relationship in the Q0 to Qn queue of the log buffer to the log area of the flash, and in the log buffer area.
  • the content in the log area is flushed to the three-level mapping table, and the second-level mapping table and the first-level mapping table, that is, the mapping table index area in the MRAM is finally refreshed.
  • the process of flushing the contents of the three-level mapping table to the second-level mapping table and the first-level mapping table step by step will be proposed later, and will not be described here.
  • the status table area in the figure corresponds to each block in the log area of the flash. Therefore, when the three-level mapping table is updated, the status table area located in the MRAM is also updated.
  • the storage state of the log buffer area in the MRAM in order to write the already generated mapping relationship to the corresponding queue in the MRAM, the storage state of the log buffer area in the MRAM.
  • the mapping relationship of the data stored in the at least one queue is written in the log area of the flash, and then according to The mapping relationship that has been written to the log area of the flash updates the status table area.
  • the storage state of the high-speed non-volatile memory is as shown in FIG. 6, that is, the data in the Q0 to Qn queue of the log buffer area is written to the log area of the flash, and after the write operation is completed, Clear All the contents of the log buffer.
  • the storage state of the MRAM is any one as shown in Figures 3 to 5. status. At this time, the content in the MRAM does not perform any operation, and the flag bit is not changed, that is, the CPU is powered off abnormally.
  • the memory controller When the CPU is powered on again, the memory controller reads the flag bit and reports it to the CPU. This determines that the CPU is powered up abnormally. At this time, the latest or newer mapping information is stored in the Q0 to Qn queue and the log area, and some parts of the mapping table in each level are non-latest mapping information.
  • the storage controller can read the contents stored in the Q0 to Qn queue, the log area, and the three-level mapping table by the partition block, and compare them.
  • the new and old mapping relationships are in the order of Q0 to Qn queues, log areas, and tertiary mapping tables.
  • the storage controller can refresh the three-level mapping table according to the latest mapping information, so that the secondary mapping table and the primary mapping table are updated step by step after satisfying certain refreshing conditions, and then the Q0 to Qn queues and the log area are cleared. Thereby completing the restoration of the mapping relationship.
  • the process of refreshing the secondary mapping table and the primary mapping table step by step from the three-level mapping table may be implemented as shown in FIG. 7:
  • the storage controller refreshes the index information of the secondary mapping table according to the refreshed three-level mapping table.
  • the storage controller updates the index information of the primary mapping table according to the updated secondary mapping table.
  • the solution provided by the embodiment of the present invention is mainly introduced from the perspective of a storage controller in an electronic device.
  • the storage controller includes corresponding hardware structures and/or software modules for performing the respective functions in order to implement the above functions.
  • the present invention can be implemented in a combination of hardware or hardware and computer software in combination with the elements and algorithm steps of the various examples described in the embodiments disclosed herein. Whether a function is implemented in hardware or computer software to drive hardware depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
  • the embodiment of the present invention may divide a function module into a storage controller or the like according to the foregoing method example.
  • each function module may be divided according to each function, or two or more functions may be integrated into one processing module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of the module in the embodiment of the present invention is schematic, and is only a logical function division, and the actual implementation may have another division manner.
  • FIG. 8 shows a possible structural diagram of the memory controller involved in the above embodiment.
  • Storage controller 30 includes a determination module 31, an acquisition module 32, a transmission module 33, a processing module 34, and a storage module 35.
  • the determining module 31 is configured to execute the process 101 of FIG. 2;
  • the obtaining module 32 is configured to execute the process 102 of FIG. 2;
  • the sending module 33 is configured to execute the process 103 of FIG. 2;
  • the processing module 34 is configured to execute FIG. Process 104 and process 105, and process 201 and process 202 of FIG. 4; storage module 35 for storing program code and data of the storage controller. All the related content of the steps involved in the foregoing method embodiments may be referred to the functional descriptions of the corresponding functional modules, and details are not described herein again.
  • the determining module 31 and the processing module 34 may be integrated on the processor, and the processor may be a central processing unit (English: Central Processing Unit, CPU for short), a general-purpose processor, and a digital signal processor (English: Digital Signal Processor, Abbreviation: DSP), Application-Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA) or other programmable logic devices, transistor logic devices, Hardware components or any combination thereof. It is possible to implement or carry out the various illustrative logical blocks, modules and circuits described in connection with the present disclosure.
  • the processor may also be a combination of computing functions, for example, including one or more microprocessor combinations, a combination of a DSP and a microprocessor, and the like.
  • the obtaining module 32 and the sending module 33 may specifically be a transceiver, a transceiver circuit, a communication interface, or the like.
  • the storage module 35 can be a memory.
  • the storage controller may be the storage controller shown in FIG. 40.
  • the memory controller 40 includes a processor 41, a communication interface 42, a memory 43, and a bus 44.
  • the processor 41, the communication interface 42 and the memory 43 are mutually connected by a bus 44;
  • the bus 44 may be a Peripheral Component Interconnect (PCI) bus or an extended industry standard structure (English: Extended Industry) Standard Architecture, referred to as EISA) bus.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 9, but it does not mean that there is only one bus or one type of bus.
  • the steps of a method or algorithm described in connection with the present disclosure may be implemented in a hardware, or may be implemented by a processor executing software instructions.
  • the software instructions may be composed of corresponding software modules, and the software modules may be stored in a random access memory (English: Random Access Memory, RAM for short), flash memory, read only memory (English: Read Only Memory, referred to as: ROM), Erase programmable read-only memory (English: Erasable Programmable ROM, referred to as: EPROM), electrically erasable programmable read-only memory (English: Electrically EPROM, referred to as: EEPROM), registers, hard disk, mobile hard disk, read-only optical disk (referred to as : CD-ROM) or any other form of storage medium known in the art.
  • An exemplary storage medium is coupled to the processor to enable the processor to read information from, and write information to, the storage medium.
  • the storage medium can also be an integral part of the processor.
  • the processor and the storage medium can be located in an ASIC.
  • the functions described herein can be implemented in hardware, software, firmware, or any combination thereof.
  • the functions may be stored in a computer readable medium or transmitted as one or more instructions or code on a computer readable medium.
  • Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another.
  • the storage medium can be a general purpose or special meter Any available media that the computer can access.

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)

Abstract

A power down protection method for a storage system, a storage controller and an electronic device, relating to the technical field of communications, capable of solving the problem that a storage system needs to consume a large amount of time to perform mapping relationship recovery. The method comprises: when the last power down of a CPU was an abnormal power down, a storage controller determining index information about a second-level and third-level mapping table level by level according to index information about a first-level mapping table, and reading mapping relationships of all data in a log buffer area and mapping relationships of all data in a log area; sending the acquired mapping relationships to the CPU; and when at least one piece of data has a mapping relationship in the log buffer area or a mapping relationship in the log area different from a mapping relationship in the third-level mapping table, the storage controller replacing the mapping relationship in the third-level mapping table, and updating the index information about the second-level and first-level mapping tables level by level, and saving a mapping relationship in the updated second-level mapping table that has changed before and after the update to a DRAM. The method is applicable to a storage system.

Description

一种存储系统掉电保护方法、存储控制器及电子设备Storage system power failure protection method, storage controller and electronic device
本申请要求于2016年9月29日提交中国专利局、申请号为201610872062.0、发明名称为“一种存储系统掉电保护方法、存储控制器及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application filed on September 29, 2016, the Chinese Patent Office, the application number is 201610872062.0, and the invention name is "a storage system power failure protection method, storage controller and electronic equipment". The content is incorporated herein by reference.
技术领域Technical field
本发明涉及通信技术领域,尤其涉及一种存储系统掉电保护方法、存储控制器及电子设备。The present invention relates to the field of communications technologies, and in particular, to a storage system power failure protection method, a storage controller, and an electronic device.
背景技术Background technique
随着闪存技术的普及,基于flash(中文:闪存)的存储设备(如SSD,Solid State Drive,中文:固态硬盘)在开发、测试,以及用户使用过程中,可能由于终端产生异常掉电而造成闪存状态异常,从而导致数据被破坏,最终造成设备开机失败。With the popularity of flash memory technology, flash (Chinese: flash)-based storage devices (such as SSD, Solid State Drive, Chinese: SSD) may be caused by abnormal power failure during development, testing, and user use. The flash state is abnormal, causing data to be corrupted, eventually causing the device to fail to boot.
目前,为了实现终端产生异常掉电时的掉电保护,在写数据时,元数据存储模块,通常在每个块的每一页的OOB(英文:Out Of Band,中文:带外空间)区域,或是在最后一页的OOB区域记录数据的信息摘要,其中,信息摘要包括块上所有页的逻辑地址和物理地址的映射关系;由于在属于非易失性介质的SSD中的数据进行改写时,并不是在原有数据所存储的位置进行改写,而是将改写的内容存储在SSD中的其他位置,且当需要存储至SSD中的映射关系达到一定数量时,才能够下写至SSD中,因此,在发生掉电时,新的映射关系虽然已经生成,但考虑到SSD是以数据块为单位进行存储的,这样可能会导致新的映射关系还未下写到SSD中,及新的映射关系不能被及时存储在SSD中;当存储系统上电时,存储阵列扫描模块通过对整个SSD扫描每一页的OOB区域,或是扫描最后一页的OOB区域,来获取所有数据页的映射关系,之后根据所获取的所有数据页的映射关系的新旧程度,确定同一逻辑地址对应的最新的物理地址,从而确定最新的映射关系,以实现掉电保护。At present, in order to realize the power-down protection when the terminal generates abnormal power failure, when writing data, the metadata storage module is usually in the OOB (English: Out Of Band) area of each page of each block. Or a summary of the information of the data recorded in the OOB area of the last page, wherein the information digest includes the mapping relationship between the logical address and the physical address of all pages on the block; since the data in the SSD belonging to the non-volatile medium is rewritten When the original data is not rewritten, the rewritten content is stored in other locations in the SSD, and when the mapping relationship needs to be stored in the SSD reaches a certain number, the content can be written to the SSD. Therefore, when a power failure occurs, a new mapping relationship has been generated, but considering that the SSD is stored in units of data blocks, this may cause new mapping relationships to be written to the SSD, and new ones. The mapping relationship cannot be stored in the SSD in time; when the storage system is powered on, the storage array scanning module scans the OOB area of each page for the entire SSD, or scans the last page of the O. The OB area is used to obtain the mapping relationship of all the data pages, and then determines the latest physical address corresponding to the same logical address according to the degree of the old and new mappings of all the obtained data pages, thereby determining the latest mapping relationship to implement power-down protection. .
但是,由于SSD的容量很大,对SSD进行全盘扫描会耗费大量的时间。因此,采用上述方法来实现掉电保护,对于大容量的SSD,存储系统需要耗费大量时间进行映射关系的恢复。However, due to the large capacity of the SSD, it takes a lot of time to perform a full scan of the SSD. Therefore, the above method is used to implement power-down protection. For a large-capacity SSD, the storage system requires a large amount of time to restore the mapping relationship.
发明内容Summary of the invention
本发明提供一种存储系统掉电保护方法、存储控制器及电子设备,能够解决存储系统需要耗费大量时间进行映射关系恢复的问题。The present invention provides a storage system power failure protection method, a storage controller, and an electronic device, which can solve the problem that the storage system needs a large amount of time to restore the mapping relationship.
为达到上述目的,本发明实施例采用如下技术方案:To achieve the above objective, the embodiment of the present invention adopts the following technical solutions:
一方面,本发明提供一种存储系统掉电保护方法,该方法用于一种电子设备,电子设备中包括:中央处理器(英文:,简称:CPU)、存储控制器、flash、高速非易失性存储器和动态随机存取存储器(英文:,简称:DRAM),高速非易失性存储器中保存有一级映射表和日志缓存区,flash中保存有二级映射表、三级映射表和日志区,其中, In one aspect, the present invention provides a storage system power failure protection method, the method is used in an electronic device, and the electronic device includes: a central processing unit (English: abbreviated as: CPU), a storage controller, a flash, and a high speed non-easy Loss memory and dynamic random access memory (English: abbreviated as DRAM), high-speed non-volatile memory holds a first-level mapping table and a log buffer area, and a secondary mapping table, a three-level mapping table, and a log are stored in the flash. District, where
日志缓存区用于保存在电子设备正常工作时,CPU在将数据的映射关系写到DRAM的同时,通过存储控制器写到日志缓存区中数据的映射关系;The log buffer is used to save the mapping relationship between the data written by the storage controller and the data in the log buffer area when the CPU writes the data mapping relationship to the DRAM during normal operation of the electronic device.
日志区用于在若日志缓存区中的存储空间达到第一阈值后,保存存储控制器从日志缓存区中读取的数据的映射关系;The log area is used to save the mapping relationship between the data read by the storage controller from the log buffer area after the storage space in the log buffer area reaches the first threshold.
三级映射表的索引信息为数据的映射关系,三级映射表用于在日志区中的数据达到第二阈值时,三级映射表被刷新并保存日志区中数据的映射关系;The index information of the three-level mapping table is a data mapping relationship. When the data in the log area reaches the second threshold, the three-level mapping table is refreshed and the mapping relationship of the data in the log area is saved.
一级映射表的索引信息为二级映射表的映射关系;The index information of the primary mapping table is a mapping relationship of the secondary mapping table;
二级映射表的索引信息为三级映射表的映射关系;The index information of the secondary mapping table is a mapping relationship of the three-level mapping table;
映射关系为逻辑地址与物理地址的对应关系;The mapping relationship is a correspondence between a logical address and a physical address;
该方法包括:The method includes:
当CPU前次下电属于异常下电后,存储控制器根据一级映射表的索引信息确定二级映射表的物理地址,并根据二级映射表的物理地址找到二级映射表,通过访问二级映射表的索引信息来确定三级映射表的物理地址,之后根据三级映射表的物理地址找到三级映射表,确定三级映射表的索引信息;After the power-off of the CPU is abnormally powered off, the storage controller determines the physical address of the secondary mapping table according to the index information of the primary mapping table, and finds the secondary mapping table according to the physical address of the secondary mapping table, and accesses the second mapping table. The index information of the level mapping table is used to determine the physical address of the three-level mapping table, and then the three-level mapping table is found according to the physical address of the three-level mapping table, and the index information of the three-level mapping table is determined;
存储控制器读取日志缓存区中所有数据的映射关系,以及日志区中所有数据的映射关系;The storage controller reads the mapping relationship of all the data in the log buffer area, and the mapping relationship of all the data in the log area;
存储控制器向CPU发送三级映射表的索引信息、日志缓存区中所有数据的映射关系,以及日志区中所有数据的映射关系;The storage controller sends the index information of the three-level mapping table, the mapping relationship of all the data in the log buffer area, and the mapping relationship of all the data in the log area to the CPU;
当存储控制器在CPU根据三级映射表的索引信息、日志缓存区中所有数据的映射关系判断有至少一个数据在日志缓存区的映射关系或者在日志区中的映射关系与在三级映射表中的映射关系不一致时,使用至少一个数据在日志缓存区的映射关系或者在日志区中的映射关系替换掉在三级映射表中的映射关系,其中,在替换时,优先使用至少一个数据在日志缓存区的映射关系进行替换;When the storage controller determines, according to the index information of the three-level mapping table and the mapping relationship of all the data in the log buffer area, the mapping relationship between the at least one data in the log buffer area or the mapping relationship in the log area and the third-level mapping table are determined by the CPU. When the mapping relationship in the log is inconsistent, the mapping relationship in the log buffer area or the mapping relationship in the log area is used to replace the mapping relationship in the third-level mapping table, wherein, in the replacement, at least one data is preferentially used. Replace the mapping relationship of the log buffer area;
存储控制器根据刷新后的三级映射表更新二级映射表的索引信息,之后根据更新后的二级映射表更新一级映射表的索引信息,且将更新后的二级映射表中在更新前后发生改变的映射关系保存至DRAM。The storage controller updates the index information of the secondary mapping table according to the updated three-level mapping table, and then updates the index information of the primary mapping table according to the updated secondary mapping table, and updates the updated secondary mapping table. The mapping relationship that changes before and after is saved to the DRAM.
其中,本发明实施例中,高速非易失性存储器是指读写速度比flash更快,同时,每次可直接操作数据的粒度更小(例如,按字节进行操作而不像flash一样按块进行操作)的存储器,例如,MRAM(英文:Magnetic Random Access Memory,中文:磁性随机存取存储器)或者PCM(英文:Phase-change memory,中文:相变存储器)。但高速非易失性存储器通常成本比flash高,容量也比flash小,无法适合大规模使用。In the embodiment of the present invention, the high-speed non-volatile memory means that the read/write speed is faster than the flash, and at the same time, the granularity of the data that can be directly manipulated is smaller each time (for example, operating in bytes instead of pressing the flash) The memory in which the block operates is, for example, MRAM (English: Magnetic Random Access Memory, Chinese: Magnetic Random Access Memory) or PCM (English: Phase-change memory, Chinese: Phase Change Memory). However, high-speed non-volatile memory is usually more expensive than flash, and its capacity is smaller than that of flash, which is not suitable for large-scale use.
本实施例中,设置了各级映射表以及日志缓存区、日志区等多个位置来保存数据的映射关系,使得CPU断电后,存储控制器能够根据保存的各个映射关系进行恢复,在这过程中,由于是通过各级映射表一级一级地查找,而不是使用现有技术全盘扫描的方式,因此,在查找数据的映射关系的过程中提升了速度。In this embodiment, a plurality of locations, such as a mapping table, a log buffer, and a log area, are set to save data mapping relationships, so that after the CPU is powered off, the storage controller can recover according to the saved mapping relationships. In the process, since the search is performed one level at a time through the mapping tables of each level, instead of using the prior art full scan method, the speed is improved in the process of finding the mapping relationship of the data.
另一方面,在保存各个映射关系时,还充分利用了高速非易失性存储器以及flash的特点。具体的,以高速非易失性存储器为MRAM为例,由于MRAM速度快的特性,可以将日志缓存区放在MRAM中,由于CPU在将数据映射关系写到DRAM时,也会写到MRAM,这是个使用频率很高的操作,如果速度慢,会对整个系统造成影响,因 此,这里使用MRAM来保存日志缓存区的数据,能够最大程度保证系统的性能。On the other hand, when saving each mapping relationship, the characteristics of the high-speed nonvolatile memory and the flash are fully utilized. Specifically, taking the high-speed non-volatile memory as an example of the MRAM, the log buffer area can be placed in the MRAM due to the high speed of the MRAM. Since the CPU writes the data mapping relationship to the DRAM, it also writes to the MRAM. This is a very frequently used operation. If the speed is slow, it will affect the whole system. Therefore, MRAM is used here to save the data in the log buffer area to maximize the performance of the system.
同时,本实施例还将一级映射表也放置在MRAM中,由于一级映射表是用于查找二、三级映射表的,所以必须先知道一级映射表的地址,且这个地址需要固定。如果将一级映射表放置在flash一片固定地址中,由于flash本身的特性,不断读写这一块区域时,会产生过多磨损,最终导致flash发生故障。而MRAM并不存在这个问题,因此,可以在MRAM中专门开辟一块区域来进行一级映射表的放置。同时,由于一级映射表的容量也不会很大(仅保存二级表的索引信息),因此,也适合使用MRAM来保存映射表。而其他表(例如,二级映射表、三级映射表)占用空间相对较大,可以利用flash大容量的特性放置在flash当中,从而达到最优配置。In the meantime, the first mapping table is also placed in the MRAM. Since the primary mapping table is used to search the second and third mapping tables, the address of the primary mapping table must be known first, and the address needs to be fixed. . If the first-level mapping table is placed in a fixed address of the flash, due to the characteristics of the flash itself, when the area is continuously read and written, excessive wear and tear will occur, eventually causing the flash to malfunction. MRAM does not have this problem, so an area can be created in MRAM to place the first level mapping table. At the same time, since the capacity of the primary mapping table is not large (only the index information of the secondary table is saved), it is also suitable to use the MRAM to save the mapping table. Other tables (for example, the secondary mapping table and the tertiary mapping table) occupy a relatively large space, and can be placed in the flash by utilizing the large-capacity feature of the flash to achieve an optimal configuration.
在一种可能的设计中,在CPU上电之后,存储控制器需要向CPU上报用于反应异常下电的标志位,该标志位位于存储控制器的寄存器,使得CPU根据标志位判断前次下电是否属于异常下电。In a possible design, after the CPU is powered on, the storage controller needs to report to the CPU a flag for responding to abnormal power-off, and the flag is located in the register of the storage controller, so that the CPU judges the previous time according to the flag bit. Whether the power is abnormally powered off.
由此可见,采用上述上报标志位的方式,能够使CPU快速且有效区分前次下电是否属于异常下电,若属于正常下电,则触发正常上电流程,否则,则触发上述异常上电流程。It can be seen that the above-mentioned reporting flag can enable the CPU to quickly and effectively distinguish whether the previous power-off is abnormally powered off. If the power-off is normal, the normal power-on process is triggered. Otherwise, the abnormal power-on is triggered. Process.
在一种可能的设计中,日志缓存区被划分为n个队列,n个队列用Q1至Qn表示,其中,n为大于或等于1的正整数,日志区包括至少两个区块,且每个区块对应日志缓存区中的一个队列;在日志缓存区中的存储空间达到第一阈值后,存储控制器从日志缓存区中读取日志缓存区中的数据的映射关系,并保存到日志区,具体包括:在日志缓存区中目标列的存储空间达到第一阈值后,存储控制器将目标列中数据的映射关系存储至日志区中目标区块对应的位置,目标区块为目标列对应的区块。In one possible design, the log buffer is divided into n queues, n queues are represented by Q1 to Qn, where n is a positive integer greater than or equal to 1, and the log area includes at least two blocks, and each The block corresponds to a queue in the log buffer; after the storage space in the log buffer reaches the first threshold, the storage controller reads the mapping relationship of the data in the log buffer from the log buffer and saves it to the log. The area includes: after the storage space of the target column reaches the first threshold in the log buffer area, the storage controller stores the mapping relationship of the data in the target column to the position corresponding to the target block in the log area, and the target block is the target column. Corresponding block.
考虑到日志缓存区中的存储空间有限,这样一来不仅可以保证日志缓存区中存在足够的空闲存储资源,同时还可以保证,批量将数据的映射关系写到flash的日志区中,即满足了日志区对于数据的映射关系的存储要求。Considering that the storage space in the log buffer is limited, it is not only possible to ensure that there are enough free storage resources in the log buffer area, but also to ensure that the data mapping relationship is written to the flash log area in batches, that is, the content is satisfied. The storage requirement of the log area for the mapping relationship of data.
在一种可能的设计中,在电子设备正常工作时,若三级映射表在刷新后被修改条目的数量达到第三阈值,则存储控制器根据刷新后的三级映射表刷新二级映射表的索引信息;若二级映射表在刷新后被修改条目的数量达到第四阈值,则存储控制器根据刷新后的二级映射表更新一级映射表的索引信息。In a possible design, when the electronic device is working normally, if the number of modified entries of the three-level mapping table after the refresh reaches the third threshold, the storage controller refreshes the secondary mapping table according to the refreshed three-level mapping table. Index information; if the number of modified entries of the secondary mapping table after refreshing reaches a fourth threshold, the storage controller updates the index information of the primary mapping table according to the refreshed secondary mapping table.
在本发明中,索引信息是逐级刷新的,且根据三级映射表刷新二级映射表,以及根据二级映射表刷新一级映射表的过程,均是在映射表中被修改条目的数量达到一定阈值时,才进行刷新的。由此可见,采用上述批量刷新的方式,能够在尽可能确保映射表处于较新状态的前提条件下,减少映射表的刷新频次,同时,满足映射表对于刷新操作的需求。In the present invention, the index information is refreshed step by step, and the process of refreshing the secondary mapping table according to the three-level mapping table and refreshing the primary mapping table according to the secondary mapping table is the number of modified entries in the mapping table. Refresh is reached when a certain threshold is reached. It can be seen that the above-mentioned batch refreshing manner can reduce the refreshing frequency of the mapping table under the premise of ensuring that the mapping table is in a new state as much as possible, and at the same time, satisfy the requirement of the mapping table for the refresh operation.
另一方面,本发明提供一种存储控制器,该存储控制器可以实现上述方法示例中存储控制器所执行的功能,所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个上述功能相应的模块。In another aspect, the present invention provides a memory controller that can implement the functions performed by the memory controller in the above method examples, and the functions can be implemented by hardware or by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above functions.
又一方面,本发明提供一种电子设备,该电子设备中包括:CPU、上述存储控制器、flash、高速非易失性存储器和动态随机存取存储器(英文:Dynamic Random Access Memory,简称:DRAM),该存储控制器用于执行上述方法中存储控制器的相应功能。 该电子设备中还可以包括通信接口,用于与其他设备之间进行通信。In another aspect, the present invention provides an electronic device including: a CPU, the above memory controller, a flash, a high speed nonvolatile memory, and a dynamic random access memory (English: Dynamic Random Access Memory, DRAM for short) The memory controller is configured to perform the corresponding function of the memory controller in the above method. The electronic device can also include a communication interface for communicating with other devices.
又一方面,本发明提供了一种计算机存储介质,用于储存为上述存储控制器所用的计算机软件指令,其包含用于执行上述方面所设计的程序。In still another aspect, the present invention provides a computer storage medium for storing computer software instructions for use in the storage controller described above, including a program designed to perform the above aspects.
本发明提供的存储系统掉电保护方法、存储控制器及电子设备,高速非易失性存储器是指读写速度比flash更快,同时,每次可直接操作数据的粒度更小的存储器,例如,MRAM或者PCM。但高速非易失性存储器通常成本比flash高,容量也比flash小,无法适合大规模使用。在本发明中,设置了各级映射表以及日志缓存区、日志区等多个位置来保存数据的映射关系,使得CPU断电后,存储控制器能够根据保存的各个映射关系进行恢复,在这过程中,由于是通过各级映射表逐级地查找,而不是使用现有技术全盘扫描的方式,因此,在查找数据的映射关系的过程中提升了速度。并且,在保存各个映射关系时,还充分利用了高速非易失性存储器以及flash的特点。具体的,以高速非易失性存储器为MRAM为例,由于MRAM速度快的特性,可以将日志缓存区放在MRAM中,由于CPU在将数据映射关系写到DRAM时,也会写到MRAM,这是个使用频率很高的操作,如果速度慢,会对整个系统造成影响,因此,这里使用MRAM来保存日志缓存区的数据,能够最大程度保证系统的性能。同时,本发明还将一级映射表也放置在MRAM中,由于一级映射表是用于查找二、三级映射表的,所以必须先知道一级映射表的地址,且这个地址需要固定。如果将一级映射表放置在flash一片固定地址中,由于flash本身的特性,不断读写这一块区域时,会产生过多磨损,最终导致flash发生故障。而MRAM并不存在这个问题,因此,可以在MRAM中专门开辟一块区域来进行一级映射表的放置。同时,由于一级映射表的容量也不会很大,因此,也适合使用MRAM来保存映射表。而其他表占用空间相对较大,可以利用flash大容量的特性放置在flash当中,从而达到最优配置。The storage system power-down protection method, the storage controller and the electronic device provided by the invention, the high-speed non-volatile memory refers to a memory with a faster read/write speed than the flash, and at the same time, a smaller granularity of data can be directly manipulated each time, for example , MRAM or PCM. However, high-speed non-volatile memory is usually more expensive than flash, and its capacity is smaller than that of flash, which is not suitable for large-scale use. In the present invention, a plurality of locations such as a mapping table and a log buffer area and a log area are set to save data mapping relationships, so that after the CPU is powered off, the storage controller can recover according to the saved mapping relationships. In the process, since it is searched step by step through various levels of mapping tables, instead of using the prior art full-disk scanning method, the speed is improved in the process of finding the mapping relationship of data. Moreover, the characteristics of the high-speed nonvolatile memory and the flash are fully utilized when the respective mapping relationships are saved. Specifically, taking the high-speed non-volatile memory as an example of the MRAM, the log buffer area can be placed in the MRAM due to the high speed of the MRAM. Since the CPU writes the data mapping relationship to the DRAM, it also writes to the MRAM. This is a very frequently used operation. If the speed is slow, it will affect the whole system. Therefore, MRAM is used here to save the data in the log buffer area to ensure the performance of the system to the greatest extent. At the same time, the present invention also places the primary mapping table in the MRAM. Since the primary mapping table is used to search the secondary and tertiary mapping tables, the address of the primary mapping table must be known first, and this address needs to be fixed. If the first-level mapping table is placed in a fixed address of the flash, due to the characteristics of the flash itself, when the area is continuously read and written, excessive wear and tear will occur, eventually causing the flash to malfunction. MRAM does not have this problem, so an area can be created in MRAM to place the first level mapping table. At the same time, since the capacity of the primary mapping table is not large, it is also suitable to use MRAM to save the mapping table. Other tables occupy a relatively large space, and can be placed in the flash by utilizing the feature of flash large capacity, thereby achieving optimal configuration.
附图说明DRAWINGS
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings to be used in the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without any creative work.
图1为本发明实施例提供的一种电子设备的结构示意图;1 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
图2为本发明实施例提供的一种存储系统掉电保护方法流程图;2 is a flowchart of a method for powering down protection of a storage system according to an embodiment of the present invention;
图3至图6为本发明实施例提供的另一种MRAM的结构示意图;3 to FIG. 6 are schematic structural diagrams of another MRAM according to an embodiment of the present invention;
图7为本发明实施例提供的另一种存储系统掉电保护方法流程图;FIG. 7 is a flowchart of another method for powering down protection of a storage system according to an embodiment of the present invention;
图8为本发明实施例提供的一种存储控制器的结构示意图;FIG. 8 is a schematic structural diagram of a storage controller according to an embodiment of the present disclosure;
图9为本发明实施例提供的另一种存储控制器的结构示意图。FIG. 9 is a schematic structural diagram of another storage controller according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
参见图1,本发明适用于一种电子设备,该电子设备中包括CPU、存储控制器、 flash、高速非易失性存储器和DRAM。其中,DRAM具体可以为内存,高速非易失性存储器具体可以为MRAM,存储控制器可以用FPGA来实现。Referring to FIG. 1, the present invention is applicable to an electronic device including a CPU, a storage controller, and Flash, high speed non-volatile memory and DRAM. The DRAM can be specifically a memory, the high-speed non-volatile memory can be an MRAM, and the storage controller can be implemented by using an FPGA.
在本发明中,高速非易失性存储器中保存有一级映射表和日志缓存区,flash中保存有二级映射表、三级映射表和日志区,其中,日志缓存区用于保存在电子设备正常工作时,CPU在将数据的映射关系写到DRAM的同时,通过存储控制器写到日志缓存区中数据的映射关系;日志区用于在若日志缓存区中的存储空间达到第一阈值后,保存存储控制器从日志缓存区中读取的数据的映射关系;三级映射表的索引信息为数据的映射关系,三级映射表用于在日志区中的数据达到第二阈值时,三级映射表被刷新并保存日志区中数据的映射关系;一级映射表的索引信息为二级映射表的映射关系;二级映射表的索引信息为三级映射表的映射关系;映射关系为逻辑地址与物理地址的对应关系。In the present invention, the high-speed non-volatile memory stores a first-level mapping table and a log buffer area, and the flash stores a second-level mapping table, a three-level mapping table, and a log area, wherein the log buffer area is used to save the electronic device. During normal operation, the CPU writes the mapping relationship of the data in the log buffer area through the storage controller while writing the mapping relationship of the data to the DRAM; the log area is used after the storage space in the log buffer area reaches the first threshold. The mapping relationship between the data read by the storage controller from the log buffer area is saved; the index information of the three-level mapping table is a data mapping relationship, and the three-level mapping table is used when the data in the log area reaches a second threshold, The level mapping table is refreshed and saves the mapping relationship of the data in the log area; the index information of the primary mapping table is the mapping relationship of the secondary mapping table; the index information of the secondary mapping table is the mapping relationship of the tertiary mapping table; the mapping relationship is The correspondence between logical addresses and physical addresses.
需要说明的是,上述第一阈值,以及后文所提及的第二至第四阈值,在设定时,均可以依据经验值或是具体的应用场景来预先设定。其中,第一阈值的作用在于判别日志缓存区中存储的数据的映射关系是否需要写到flash的日志区中;第二阈值的作用在于判别日志区中存储的数据的映射关系是否需要写到flash的三级映射表中;第三阈值的作用在于判别刷新后的三级映射表中被修改的条目是否需要刷新到二级映射表中;第四阈值的作用在于判别刷新后的二级映射表中被修改的条目是否需要刷新到一级映射表中。还需要说明的是,第一、第二阈值均作为存储空间占用情况的参考值,比如,该第一阈值和/或该第二阈值可以被设置为100%,90%等用于表示存储空间占用情况的参数,其中,若将该第一阈值设置为100%,则表明在日志缓存区中的存储空间已满后,存储控制器将日志缓存区中的数据的映射关系写到flash的日志区中;第三、第四阈值均作为被修改条目的数量的参考值,比如,该第三阈值和/或该第四阈值可以被设置为50条,100条等用于表示修改条目的数量的参数,其中,若将该第三阈值设置为50条,则表明三级表在刷新后被修改的条目达到50条后,则存储控制器会根据刷新后的三级映射表刷新二级映射表的索引信息。另外,在本发明中,第一阈值与第二阈值的取值可以相同或不同,第三阈值与第四阈值的取值也可以相同或不同,在此不做限定,且上述阈值的设置方式以及参数类型也不做限制,比如,参数类型可以为百分数、整数等其他类型。It should be noted that the first threshold value and the second to fourth threshold values mentioned later may be preset according to an empirical value or a specific application scenario when setting. The function of the first threshold is to determine whether the mapping relationship of the data stored in the log buffer needs to be written into the log area of the flash; the role of the second threshold is to determine whether the mapping relationship of the data stored in the log area needs to be written to the flash. The third threshold is used to determine whether the modified entry in the refreshed three-level mapping table needs to be refreshed into the secondary mapping table; the fourth threshold is to determine the refreshed secondary mapping table. Whether the modified entry in the need to be refreshed into the primary mapping table. It should be noted that the first threshold and the second threshold are both used as reference values for the storage space occupation. For example, the first threshold and/or the second threshold may be set to 100%, 90%, etc., for indicating storage space. The parameter of the occupancy condition, wherein if the first threshold is set to 100%, it indicates that after the storage space in the log buffer is full, the storage controller writes the mapping relationship of the data in the log buffer to the flash log. In the zone, the third and fourth thresholds are all reference values of the number of modified entries, for example, the third threshold and/or the fourth threshold may be set to 50, 100, etc. are used to indicate the number of modified entries. The parameter, wherein if the third threshold is set to 50, it indicates that after the third table is modified to have 50 entries after the refresh, the storage controller refreshes the secondary mapping according to the refreshed three-level mapping table. Index information for the table. In addition, in the present invention, the values of the first threshold and the second threshold may be the same or different, and the values of the third threshold and the fourth threshold may be the same or different, which is not limited herein, and the threshold is set. And the parameter type is not limited. For example, the parameter type can be other types such as a percentage, an integer, and the like.
另外,若日志缓存区中的数据的映射关系已经写到flash的日志区中,那么为了节省存储空间,存储控制器可以直接将日志缓存区中已经写到日志区的内容删除,同时释放已删除内容所占用的空间,以确保党日志缓存区需要存储新的数据的映射关系时,该日志缓存区仍然能够为缓存过程提供足够的存储空间,即存储资源。或者,存储控制器不对日志缓存区中的内容进行删除,而是对该部分内容进行标记,并当新的数据的映射关系写到日志缓存区时,直接覆盖已被标记的那部分内容,这样一来,同样可以达到空间充分利用的效果。对于三级映射表而言,若日志区所存储的数据达到第二阈值后,存储控制器同样需要将日志区中的内容按区块写到三级映射表中,并且,为了节省flash的存储空间,也需要将日志区的内容进行删除。In addition, if the mapping relationship of the data in the log buffer area has been written in the log area of the flash, in order to save storage space, the storage controller can directly delete the content that has been written to the log area in the log buffer area, and the release is deleted. When the content occupies a space to ensure that the party log buffer needs to store a new data mapping relationship, the log buffer can still provide sufficient storage space for the caching process, that is, storage resources. Alternatively, the storage controller does not delete the content in the log buffer area, but marks the part of the content, and directly overwrites the part that has been marked when the mapping relationship of the new data is written to the log buffer. In the same way, the effect of full use of space can also be achieved. For the three-level mapping table, if the data stored in the log area reaches the second threshold, the storage controller also needs to write the contents of the log area into the three-level mapping table by the block, and, in order to save the flash storage. Space, you also need to delete the contents of the log area.
本发明实施例提供一种存储系统掉电保护方法,如图2所示,该方法均可以由上述存储控制器来执行。 Embodiments of the present invention provide a storage system power failure protection method. As shown in FIG. 2, the method may be performed by the foregoing storage controller.
需要说明的是,该存储控制器具体可以包括MRAM控制器和SSD控制器,其中,MRAM控制器可以用于监控MRAM中一级映射表和日志缓存区的状态,例如,判断日志缓存区的存储空间是否达到一定阈值,此外,MRAM控制器还可以根据MRAM的状态,通知SSD控制器执行相应操作;同理,SSD控制器可以用于监控flash中二级映射表、三级映射表和日志区的状态,例如,判断当前三级映射表中的数据的映射关系是否需要逐级刷新到二级映射表和一级映射表中,此外,SSD控制器还可以根据flash的状态,通知MRAM控制器执行相应操作。It should be noted that the storage controller may specifically include an MRAM controller and an SSD controller, wherein the MRAM controller may be used to monitor the status of the primary mapping table and the log buffer in the MRAM, for example, determining the storage of the log buffer. Whether the space reaches a certain threshold, in addition, the MRAM controller can also notify the SSD controller to perform corresponding operations according to the state of the MRAM; similarly, the SSD controller can be used to monitor the secondary mapping table, the tertiary mapping table and the log area in the flash. The state of the data, for example, whether the mapping relationship of the data in the current three-level mapping table needs to be refreshed step by step into the second-level mapping table and the first-level mapping table, in addition, the SSD controller can also notify the MRAM controller according to the state of the flash. Take the appropriate action.
另外,上述存储控制器的具体实现过程会在下文提出,在此不做赘述,且上述SSD控制器与MRAM控制器仅作为存储控制器的一种具体的实现方式,但并不仅限于上述实现方式。In addition, the specific implementation process of the foregoing storage controller is proposed below, and is not described herein again, and the foregoing SSD controller and the MRAM controller are only used as a specific implementation manner of the storage controller, but are not limited to the foregoing implementation manner. .
该方法流程包括:The method flow includes:
101、当CPU前次下电属于异常下电后,存储控制器根据一级映射表的索引信息确定二级映射表的物理地址,并根据二级映射表的物理地址找到二级映射表,通过访问二级映射表的索引信息来确定三级映射表的物理地址,之后根据三级映射表的物理地址找到三级映射表,确定三级映射表的索引信息。101. After the CPU is powered off for the previous time, the storage controller determines the physical address of the secondary mapping table according to the index information of the primary mapping table, and finds the secondary mapping table according to the physical address of the secondary mapping table. The index information of the secondary mapping table is accessed to determine the physical address of the tertiary mapping table, and then the tertiary mapping table is found according to the physical address of the tertiary mapping table, and the index information of the tertiary mapping table is determined.
102、存储控制器读取日志缓存区中所有数据的映射关系,以及日志区中所有数据的映射关系。102. The storage controller reads the mapping relationship of all the data in the log buffer area and the mapping relationship of all the data in the log area.
103、存储控制器向CPU发送三级映射表的索引信息、日志缓存区中所有数据的映射关系,以及日志区中所有数据的映射关系。103. The storage controller sends the index information of the three-level mapping table, the mapping relationship of all the data in the log buffer area, and the mapping relationship of all the data in the log area to the CPU.
104、当存储控制器在CPU根据三级映射表的索引信息、日志缓存区中所有数据的映射关系判断有至少一个数据在日志缓存区的映射关系或者在日志区中的映射关系与在三级映射表中的映射关系不一致时,使用至少一个数据在日志缓存区的映射关系或者在日志区中的映射关系替换掉在三级映射表中的映射关系。104. When the storage controller determines, according to the index information of the three-level mapping table and the mapping relationship of all the data in the log buffer area, the mapping relationship between the at least one data in the log buffer area or the mapping relationship in the log area is at the third level. If the mapping relationship in the mapping table is inconsistent, the mapping relationship in the log buffer area or the mapping relationship in the log area is used to replace the mapping relationship in the third-level mapping table.
其中,在替换时,优先使用至少一个数据在日志缓存区的映射关系进行替换。Wherein, in the replacement, the mapping relationship of at least one data in the log buffer area is preferentially replaced.
105、存储控制器根据刷新后的三级映射表更新二级映射表的索引信息,之后根据更新后的二级映射表更新一级映射表的索引信息,且将更新后的二级映射表中在更新前后发生改变的映射关系保存至DRAM。105. The storage controller updates the index information of the second mapping table according to the refreshed three-level mapping table, and then updates the index information of the primary mapping table according to the updated secondary mapping table, and the updated secondary mapping table is The mapping relationship that changes before and after the update is saved to the DRAM.
在本发明中,为了节省flash的存储资源,可以在DRAM保存了更新后的二级映射表之后,将flash中的二级映射表清空。In the present invention, in order to save flash storage resources, the secondary mapping table in the flash may be cleared after the DRAM saves the updated secondary mapping table.
需要说明的是,当CPU正常下电时,在软件层面,存储控制器的一些程序模块(例如,驱动)可以调用算法下电接口,通知算法进行正常下电操作;算法调用saveMap3inSSD函数,并通过驱动逻辑将DRAM中所有更新的三级映射表下写到flash中,并返回新写入flash中三级映射表的物理地址;根据返回的flash中新写入的三级映射表的物理地址来更新DRAM中二级映射表的内容;将更新后的DRAM中所有的有更新的二级映射表写到flash中,并返回新写入二级映射表的物理地址;将返回的二级映射表的物理地址保存到MRAM的一级映射表中;将flash中当前的日志区内所有块全部设置为垃圾块,并向驱动返回算法下电操作完成,同时驱动可以将存储控制器的寄存器中用于反应前次下电过程是否属于异常下电的标志位flag设置为1,即表示前次下电过程属于正常下电。 It should be noted that when the CPU is powered off normally, at the software level, some program modules (for example, drivers) of the storage controller may invoke the algorithm power-off interface to notify the algorithm to perform normal power-off operations; the algorithm calls the saveMap3inSSD function and passes The drive logic writes all updated three-level mapping tables in the DRAM to the flash, and returns the physical address of the newly-written three-level mapping table in the flash; according to the physical address of the newly written three-level mapping table in the returned flash Updating the contents of the secondary mapping table in the DRAM; writing all updated secondary mapping tables in the updated DRAM to the flash, and returning the physical address newly written to the secondary mapping table; the secondary mapping table to be returned The physical address is saved to the first-level mapping table of the MRAM; all the blocks in the current log area in the flash are all set as garbage blocks, and the power-off operation is completed to the drive return algorithm, and the driver can be used in the register of the storage controller. The flag flag of the abnormal power-off process in the previous power-off process is set to 1, which means that the previous power-off process is a normal power-off.
在本发明中,高速非易失性存储器是指读写速度比flash更快,同时,每次可直接操作数据的粒度更小(例如,按字节进行操作而不像flash一样按块进行操作)的存储器,例如,MRAM或者PCM。但高速非易失性存储器通常成本比flash高,容量也比flash小,无法适合大规模使用。In the present invention, the high-speed non-volatile memory means that the reading and writing speed is faster than that of the flash, and at the same time, the granularity of the data can be directly manipulated each time (for example, operating in bytes without operating in blocks like flash) Memory, for example, MRAM or PCM. However, high-speed non-volatile memory is usually more expensive than flash, and its capacity is smaller than that of flash, which is not suitable for large-scale use.
本实施例中,设置了各级映射表以及日志缓存区、日志区等多个位置来保存数据的映射关系,使得CPU断电后,存储控制器能够根据保存的各个映射关系进行恢复,在这过程中,由于是通过各级映射表一级一级地查找,而不是使用现有技术全盘扫描的方式,因此,在查找数据的映射关系的过程中提升了速度。In this embodiment, a plurality of locations, such as a mapping table, a log buffer, and a log area, are set to save data mapping relationships, so that after the CPU is powered off, the storage controller can recover according to the saved mapping relationships. In the process, since the search is performed one level at a time through the mapping tables of each level, instead of using the prior art full scan method, the speed is improved in the process of finding the mapping relationship of the data.
另一方面,在保存各个映射关系时,还充分利用了高速非易失性存储器以及flash的特点。具体的,以高速非易失性存储器为MRAM为例,由于MRAM速度快的特性,可以将日志缓存区放在MRAM中,由于CPU在将数据映射关系写到DRAM时,也会写到MRAM,这是个使用频率很高的操作,如果速度慢,会对整个系统造成影响,因此,这里使用MRAM来保存日志缓存区的数据,能够最大程度保证系统的性能。On the other hand, when saving each mapping relationship, the characteristics of the high-speed nonvolatile memory and the flash are fully utilized. Specifically, taking the high-speed non-volatile memory as an example of the MRAM, the log buffer area can be placed in the MRAM due to the high speed of the MRAM. Since the CPU writes the data mapping relationship to the DRAM, it also writes to the MRAM. This is a very frequently used operation. If the speed is slow, it will affect the whole system. Therefore, MRAM is used here to save the data in the log buffer area to ensure the performance of the system to the greatest extent.
同时,本实施例还将一级映射表也放置在MRAM中,由于一级映射表是用于查找二、三级映射表的,所以必须先知道一级映射表的地址,且这个地址需要固定。如果将一级映射表放置在flash一片固定地址中,由于flash本身的特性,不断读写这一块区域时,会产生过多磨损,最终导致flash发生故障。而MRAM并不存在这个问题,因此,可以在MRAM中专门开辟一块区域来进行一级映射表的放置。同时,由于一级映射表的容量也不会很大(仅保存二级表的索引信息),因此,也适合使用MRAM来保存映射表。而其他表(例如,二级映射表、三级映射表)占用空间相对较大,可以利用flash大容量的特性放置在flash当中,从而达到最优配置。In the meantime, the first mapping table is also placed in the MRAM. Since the primary mapping table is used to search the second and third mapping tables, the address of the primary mapping table must be known first, and the address needs to be fixed. . If the first-level mapping table is placed in a fixed address of the flash, due to the characteristics of the flash itself, when the area is continuously read and written, excessive wear and tear will occur, eventually causing the flash to malfunction. MRAM does not have this problem, so an area can be created in MRAM to place the first level mapping table. At the same time, since the capacity of the primary mapping table is not large (only the index information of the secondary table is saved), it is also suitable to use the MRAM to save the mapping table. Other tables (for example, the secondary mapping table and the tertiary mapping table) occupy a relatively large space, and can be placed in the flash by utilizing the large-capacity feature of the flash to achieve an optimal configuration.
由于在CPU这一次上电之前,CPU可能为正常下电或是异常下电,而不同的下电状态,会使CPU再一次上电时触发不同的处理流程,因此,在本发明实施例的一个实现方式中,当CPU上电时,可以通过读取存储控制器发送的标志位来确定此前的下电过程属于正常下电或是异常下电操作,之后根据下电状态来选择不同的处理流程。因此,在CPU上电之后,存储控制器向CPU上报用于反映异常下电的标志位。Since the CPU may be powered off or abnormally powered off before the CPU is powered on, the different power-off states may trigger different processing flows when the CPU is powered on again. Therefore, in the embodiment of the present invention, In an implementation manner, when the CPU is powered on, the flag of the storage controller can be read to determine that the previous power-off process is normal power-off or abnormal power-off operation, and then select different processing according to the power-off state. Process. Therefore, after the CPU is powered on, the storage controller reports the flag for reflecting the abnormal power-off to the CPU.
具体的,标志位可以位于存储控制器中的寄存器,在CPU正常下电时,存储控制器中的驱动可以对标志位进行设置,比如将标志位flag设置为1;而在CPU异常下电时,由于存储控制器断电,因此无法完成对标志位进行设置的操作,因此,当CPU再次上电时所读取到的flag值为在正常工作时的一个值(如0),而不是1时,表明上次CPU下电是异常下电。需要说明的是,对于区分CPU是否为正常下电的方式不仅限于上述设置标志位的实现方式,还可以为其他可以用于区分CPU下电状态的其他操作,在此不做赘述。Specifically, the flag bit can be located in a register in the memory controller. When the CPU is powered off normally, the driver in the memory controller can set the flag bit, for example, setting the flag bit flag to 1; Because the memory controller is powered off, the setting of the flag bit cannot be completed. Therefore, when the CPU is powered on again, the flag value read is a value (such as 0) during normal operation, instead of 1 When the CPU is powered off, it is abnormally powered off. It should be noted that the manner of distinguishing whether the CPU is normally powered off is not limited to the implementation manner of the above-mentioned setting flag, and may be other operations that can be used to distinguish the CPU power-off state, and details are not described herein.
在本实施中,采用上述读取标志位的方式,能够使存储控制器快速且有效的区分前次下电是否属于异常下电,若属于正常下电,则触发CPU的正常上电流程,否则,则触发上述异常上电流程。In this implementation, the method for reading the flag bit can be used to enable the storage controller to quickly and effectively distinguish whether the previous power-off is abnormally powered off. If the power-off is normal, the normal power-on process of the CPU is triggered. Otherwise, , triggers the above abnormal power-on process.
本实施例中,CPU正常上电流程为:CPU接收到存储控制器的驱动读取到标志位,调用算法初始化接口,传输标志位。当标志位flag=1时,算法正常调用上电流程。即算法通过驱动逻辑,读取高速非易失性存储器中一级映射表的内容,并根据一级映射 表中记载的二级映射表的物理地址,找到flash中二级映射表的位置,访问二级映射表的内容,将读取到的二级映射表的内容保存在主存中,即保存在DRAM中,并给驱动返回确定信息。In this embodiment, the normal power-on process of the CPU is: the CPU receives the drive controller to read the flag bit, invokes the algorithm initialization interface, and transmits the flag bit. When the flag bit flag=1, the algorithm normally calls the power-on process. That is, the algorithm reads the contents of the primary mapping table in the high-speed non-volatile memory through the driving logic, and according to the primary mapping The physical address of the secondary mapping table recorded in the table, find the location of the secondary mapping table in the flash, access the contents of the secondary mapping table, and save the content of the read secondary mapping table in the main storage, that is, in the In DRAM, and return the determination information to the driver.
当CPU为正常上电时,CPU可以直接根据高速非易失性存储器中存储的一级映射表中的映射关系找到存储在SSD的二级映射表的物理地址,之后访问二级映射表,并将二级映射表中的映射关系同步至DRAM中,以便于后续读取数据时,能够根据DRAM中的二级映射表,来确定三级映射表在flash中存储的物理地址,并通过访问三级映射表来确定数据的存储地址。When the CPU is powered on normally, the CPU can directly find the physical address of the secondary mapping table stored in the SSD according to the mapping relationship in the primary mapping table stored in the high-speed non-volatile memory, and then access the secondary mapping table, and Synchronizing the mapping relationship in the secondary mapping table to the DRAM, so that when the data is subsequently read, the physical address stored in the flash of the three-level mapping table can be determined according to the secondary mapping table in the DRAM, and The level mapping table determines the storage address of the data.
当CPU为异常上电时,即CPU的前次下电属于异常下电,存储介质还来不及执行任何操作就已经掉电了。这就意味着,存储在DRAM中的映射关系因异常下电而丢失,仅有具有非易失性特性的高速非易失性存储器和flash中存储的数据仍然保留。因此,存储控制器可以根据一级映射表中的映射关系找到存储在flash的二级映射表的物理地址,之后访问二级映射表,并根据二级映射表中的映射关系找到存储在flash的三级映射表的物理地址,并读取三级映射表中存储的数据的映射关系。When the CPU is powered off abnormally, that is, the previous power-down of the CPU is abnormally powered off, the storage medium has been powered off before it can perform any operation. This means that the mapping relationship stored in the DRAM is lost due to abnormal power-down, and only the high-speed non-volatile memory with non-volatile characteristics and the data stored in the flash are retained. Therefore, the storage controller may find the physical address of the secondary mapping table stored in the flash according to the mapping relationship in the primary mapping table, and then access the secondary mapping table, and find the storage in the flash according to the mapping relationship in the secondary mapping table. The physical address of the three-level mapping table, and the mapping relationship of the data stored in the three-level mapping table is read.
在另一实施例中,为了方便将日志缓存区中的内容批量下写到flash的日志区中,日志缓存区可以被划分为n个队列,其中,n个队列可以用Q0至Qn来表示,n为大于或等于1的正整数,日志区包括至少两个区块,且每个区块对应日志缓存区中的一列。在本发明实施例中,当满足一定条件时,存储控制器可以将日志缓存区中存储的内容按队列写到日志区。因此,在日志缓存区中的存储空间达到第一阈值后,存储控制器从日志缓存区中读取日志缓存区中的数据的映射关系,并保存到日志区,具体可以实现为:In another embodiment, in order to conveniently write the contents of the log buffer to the log area of the flash in batches, the log buffer may be divided into n queues, wherein n queues may be represented by Q0 to Qn. n is a positive integer greater than or equal to 1, the log area includes at least two blocks, and each block corresponds to a column in the log buffer. In the embodiment of the present invention, when a certain condition is met, the storage controller may write the content stored in the log buffer area to the log area according to the queue. Therefore, after the storage space in the log buffer reaches the first threshold, the storage controller reads the mapping relationship of the data in the log buffer from the log buffer and saves the data to the log area.
在日志缓存区中目标列的存储空间达到第一阈值后,存储控制器将目标列中数据的映射关系存储至日志区中目标区块对应的位置,目标区块为目标列对应的区块。After the storage space of the target column reaches the first threshold in the log buffer, the storage controller stores the mapping relationship of the data in the target column to the location corresponding to the target block in the log area, and the target block is the block corresponding to the target column.
需要说明的是,区块可以被视为与队列对应的一块区域。区块的构成与队列是相同的,均是由多个表项构成的一块区域。It should be noted that the block can be regarded as an area corresponding to the queue. The composition of the block is the same as the queue, and is an area composed of a plurality of entries.
例如:在MRAM处于如图3所示的状态时,若CPU正常下电,则存储控制器可以将日志缓存区的Q0至Qn队列中的映射关系写到flash的日志区,并在日志缓存区中的存储空间达到第一阈值后,将日志区中的内容刷新到三级映射表,以及二级映射表和一级映射表,即最终刷新MRAM中的映射表索引区。其中,将三级映射表中的内容逐级刷新到二级映射表和一级映射表的过程,会在后文提出,在此不做赘述。需要说明的是,图中状态表区对应flash的日志区中的各个区块,因此,当三级映射表更新时,位于MRAM中的状态表区也会更新。For example, when the MRAM is in the state shown in FIG. 3, if the CPU is powered off normally, the storage controller can write the mapping relationship in the Q0 to Qn queue of the log buffer to the log area of the flash, and in the log buffer area. After the storage space reaches the first threshold, the content in the log area is flushed to the three-level mapping table, and the second-level mapping table and the first-level mapping table, that is, the mapping table index area in the MRAM is finally refreshed. The process of flushing the contents of the three-level mapping table to the second-level mapping table and the first-level mapping table step by step will be proposed later, and will not be described here. It should be noted that the status table area in the figure corresponds to each block in the log area of the flash. Therefore, when the three-level mapping table is updated, the status table area located in the MRAM is also updated.
如图4所示,为将已经产生的映射关系写到MRAM中对应队列之后,MRAM中的日志缓存区的存储状态。As shown in FIG. 4, in order to write the already generated mapping relationship to the corresponding queue in the MRAM, the storage state of the log buffer area in the MRAM.
如图5所示,当Q0至Qn队列中存在至少一个队列的存储空间达到所述第一阈值后,则将该至少一个队列所存储的数据的映射关系写到flash的日志区中,之后根据已写到flash的日志区的映射关系更新状态表区。As shown in FIG. 5, after the storage space of the at least one queue in the Q0 to Qn queue reaches the first threshold, the mapping relationship of the data stored in the at least one queue is written in the log area of the flash, and then according to The mapping relationship that has been written to the log area of the flash updates the status table area.
在CPU进行正常下电之后,高速非易失性存储器的存储状态如图6所示,即日志缓存区的Q0至Qn队列中的数据已写到flash的日志区,并在完成写操作之后,清除 日志缓存区的所有内容。After the CPU is powered off normally, the storage state of the high-speed non-volatile memory is as shown in FIG. 6, that is, the data in the Q0 to Qn queue of the log buffer area is written to the log area of the flash, and after the write operation is completed, Clear All the contents of the log buffer.
当CPU在某个时刻异常下电时,也就是CPU发生异常掉电时,存储介质还来不及执行任何操作就已经掉电了,则MRAM的存储状态为如图3至5所示的任意一种状态。此时,MRAM中的内容没有执行任何操作,标志位也未被更改,即为CPU异常下电。When the CPU is powered off abnormally at a certain time, that is, when the CPU is abnormally powered down, the storage medium has not been able to perform any operation and has been powered down. The storage state of the MRAM is any one as shown in Figures 3 to 5. status. At this time, the content in the MRAM does not perform any operation, and the flag bit is not changed, that is, the CPU is powered off abnormally.
当CPU再次上电时,存储控制器先读取标志位并上报给CPU,这样可以确定CPU为异常上电。此时,Q0至Qn队列、日志区中均存储着最新或是较新的映射信息,各级映射表中的部分内容为非最新的映射信息。存储控制器可以分区块读取Q0至Qn队列、日志区以及三级映射表所存储的内容,并进行比较。其中,映射关系的新旧程度依次为Q0至Qn队列、日志区、三级映射表。通过比较后,存储控制器可以根据最新的映射信息刷新三级映射表,从而在满足一定刷新条件之后逐级更新二级映射表和一级映射表,之后清空Q0至Qn队列,以及日志区,从而完成映射关系的恢复。When the CPU is powered on again, the memory controller reads the flag bit and reports it to the CPU. This determines that the CPU is powered up abnormally. At this time, the latest or newer mapping information is stored in the Q0 to Qn queue and the log area, and some parts of the mapping table in each level are non-latest mapping information. The storage controller can read the contents stored in the Q0 to Qn queue, the log area, and the three-level mapping table by the partition block, and compare them. The new and old mapping relationships are in the order of Q0 to Qn queues, log areas, and tertiary mapping tables. After comparison, the storage controller can refresh the three-level mapping table according to the latest mapping information, so that the secondary mapping table and the primary mapping table are updated step by step after satisfying certain refreshing conditions, and then the Q0 to Qn queues and the log area are cleared. Thereby completing the restoration of the mapping relationship.
在本发明中,考虑到日志缓存区中的存储空间有限,这样一来不仅可以保证日志缓存区中存在足够的空闲存储资源,同时还可以保证,批量将数据的映射关系写到flash的日志区中,即满足了日志区对于数据的映射关系的存储要求。In the present invention, considering that the storage space in the log buffer area is limited, it is not only ensured that there are enough free storage resources in the log buffer area, but also ensures that the data mapping relationship is written to the log area of the flash in batches. Medium, that is, the storage requirement of the log area for the mapping relationship of data is satisfied.
在本发明实施例的一个实现方式中,在电子设备正常工作时,从三级映射表逐级刷新二级映射表与一级映射表的过程,可以实现为如图7所示的实现方式:In an implementation manner of the embodiment of the present invention, when the electronic device is working normally, the process of refreshing the secondary mapping table and the primary mapping table step by step from the three-level mapping table may be implemented as shown in FIG. 7:
201、若三级映射表在刷新后被修改条目的数量达到第三阈值,则存储控制器根据刷新后的三级映射表刷新二级映射表的索引信息。201. If the number of modified entries after the three-level mapping table reaches the third threshold, the storage controller refreshes the index information of the secondary mapping table according to the refreshed three-level mapping table.
202、若二级映射表在刷新后被修改条目的数量达到第四阈值,则存储控制器根据刷新后的二级映射表更新一级映射表的索引信息。202. If the number of the modified entries of the secondary mapping table after the refresh reaches the fourth threshold, the storage controller updates the index information of the primary mapping table according to the updated secondary mapping table.
由此可见,从三级映射表逐级刷新二级映射表与一级映射表的过程中,是依据映射表在刷新后被修改条目的数量来确定是否需要刷新到下一级映射表。采取上述刷新过程,不仅能够满足flash对于写操作的需求,同时,也能够减少为了刷新而进行写操作的次数。It can be seen that, in the process of refreshing the secondary mapping table and the primary mapping table step by step from the three-level mapping table, it is determined according to the number of modified entries of the mapping table after refreshing whether it needs to be refreshed to the next-level mapping table. By adopting the above refresh process, not only the flash can be satisfied for the write operation, but also the number of write operations for refreshing can be reduced.
上述主要从电子设备中存储控制器的角度对本发明实施例提供的方案进行了介绍。可以理解的是,存储控制器为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本发明能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。The solution provided by the embodiment of the present invention is mainly introduced from the perspective of a storage controller in an electronic device. It can be understood that the storage controller includes corresponding hardware structures and/or software modules for performing the respective functions in order to implement the above functions. Those skilled in the art will readily appreciate that the present invention can be implemented in a combination of hardware or hardware and computer software in combination with the elements and algorithm steps of the various examples described in the embodiments disclosed herein. Whether a function is implemented in hardware or computer software to drive hardware depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
本发明实施例可以根据上述方法示例对存储控制器等进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本发明实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The embodiment of the present invention may divide a function module into a storage controller or the like according to the foregoing method example. For example, each function module may be divided according to each function, or two or more functions may be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of the module in the embodiment of the present invention is schematic, and is only a logical function division, and the actual implementation may have another division manner.
在采用对应各个功能划分各个功能模块的情况下,或是采用集成的单元的情况下,图8示出了上述实施例中所涉及的存储控制器的一种可能的结构示意图。存储控制器 30包括:确定模块31、获取模块32、发送模块33、处理模块34和存储模块35。例如,确定模块31,用于执行图2的过程101;获取模块32,用于执行图2的过程102;发送模块33,用于执行图2的过程103;处理模块34,用于执行图2的过程104和过程105,以及图4的过程201和过程202;存储模块35,用于保存存储控制器的程序代码和数据。其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。In the case where each functional module is divided by corresponding functions, or in the case of an integrated unit, FIG. 8 shows a possible structural diagram of the memory controller involved in the above embodiment. Storage controller 30 includes a determination module 31, an acquisition module 32, a transmission module 33, a processing module 34, and a storage module 35. For example, the determining module 31 is configured to execute the process 101 of FIG. 2; the obtaining module 32 is configured to execute the process 102 of FIG. 2; the sending module 33 is configured to execute the process 103 of FIG. 2; and the processing module 34 is configured to execute FIG. Process 104 and process 105, and process 201 and process 202 of FIG. 4; storage module 35 for storing program code and data of the storage controller. All the related content of the steps involved in the foregoing method embodiments may be referred to the functional descriptions of the corresponding functional modules, and details are not described herein again.
上述确定模块31和处理模块34可以集成在处理器上,该处理器可以为中央处理器(英文:Central Processing Unit,简称:CPU),通用处理器,数字信号处理器(英文:Digital Signal Processor,简称:DSP),专用集成电路(英文:Application-Specific Integrated Circuit,简称:ASIC),现场可编程门阵列(英文:Field Programmable Gate Array,简称:FPGA)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本发明公开内容所描述的各种示例性的逻辑方框,模块和电路。所述处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。获取模块32与发送模块33具体可以为收发器、收发电路或通信接口等。存储模块35可以是存储器。The determining module 31 and the processing module 34 may be integrated on the processor, and the processor may be a central processing unit (English: Central Processing Unit, CPU for short), a general-purpose processor, and a digital signal processor (English: Digital Signal Processor, Abbreviation: DSP), Application-Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA) or other programmable logic devices, transistor logic devices, Hardware components or any combination thereof. It is possible to implement or carry out the various illustrative logical blocks, modules and circuits described in connection with the present disclosure. The processor may also be a combination of computing functions, for example, including one or more microprocessor combinations, a combination of a DSP and a microprocessor, and the like. The obtaining module 32 and the sending module 33 may specifically be a transceiver, a transceiver circuit, a communication interface, or the like. The storage module 35 can be a memory.
当确定模块31和处理模块34为处理器,获取模块32和发送模块33为通信接口,存储模块35为存储器时,本发明实施例所涉及的存储控制器可以为图9所示的存储控制器40。When the determining module 31 and the processing module 34 are processors, the obtaining module 32 and the sending module 33 are communication interfaces, and the storage module 35 is a memory, the storage controller according to the embodiment of the present invention may be the storage controller shown in FIG. 40.
参阅图9所示,该存储控制器40包括:处理器41、通信接口42、存储器43以及总线44。其中,处理器41、通信接口42和存储器43通过总线44相互连接;总线44可以是外设部件互连标准(英文:Peripheral Component Interconnect,简称:PCI)总线或扩展工业标准结构(英文:Extended Industry Standard Architecture,简称:EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图9中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。Referring to FIG. 9, the memory controller 40 includes a processor 41, a communication interface 42, a memory 43, and a bus 44. The processor 41, the communication interface 42 and the memory 43 are mutually connected by a bus 44; the bus 44 may be a Peripheral Component Interconnect (PCI) bus or an extended industry standard structure (English: Extended Industry) Standard Architecture, referred to as EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 9, but it does not mean that there is only one bus or one type of bus.
结合本发明公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器(英文:Random Access Memory,简称:RAM)、闪存、只读存储器(英文:Read Only Memory,简称:ROM)、可擦除可编程只读存储器(英文:Erasable Programmable ROM,简称:EPROM)、电可擦可编程只读存储器(英文:Electrically EPROM,简称:EEPROM)、寄存器、硬盘、移动硬盘、只读光盘(简称:CD-ROM)或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。The steps of a method or algorithm described in connection with the present disclosure may be implemented in a hardware, or may be implemented by a processor executing software instructions. The software instructions may be composed of corresponding software modules, and the software modules may be stored in a random access memory (English: Random Access Memory, RAM for short), flash memory, read only memory (English: Read Only Memory, referred to as: ROM), Erase programmable read-only memory (English: Erasable Programmable ROM, referred to as: EPROM), electrically erasable programmable read-only memory (English: Electrically EPROM, referred to as: EEPROM), registers, hard disk, mobile hard disk, read-only optical disk (referred to as : CD-ROM) or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor to enable the processor to read information from, and write information to, the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an ASIC.
本领域技术人员应该可以意识到,在上述一个或多个示例中,本发明所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计 算机能够存取的任何可用介质。Those skilled in the art will appreciate that in one or more examples described above, the functions described herein can be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored in a computer readable medium or transmitted as one or more instructions or code on a computer readable medium. Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another. The storage medium can be a general purpose or special meter Any available media that the computer can access.
以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本发明的保护范围之内。 The specific embodiments of the present invention have been described in detail with reference to the preferred embodiments of the present invention. The scope of the protection, any modifications, equivalent substitutions, improvements, etc., which are made on the basis of the technical solutions of the present invention, are included in the scope of the present invention.

Claims (9)

  1. 一种存储系统掉电保护方法,其特征在于,所述方法用于一种电子设备,所述电子设备中包括:中央处理器CPU、存储控制器、闪存flash、高速非易失性存储器和动态随机存取存储器DRAM,所述高速非易失性存储器中保存有一级映射表和日志缓存区,所述flash中保存有二级映射表、三级映射表和日志区,其中,A storage system power failure protection method is characterized in that the method is used in an electronic device, and the electronic device includes: a central processing unit CPU, a storage controller, a flash memory, a high speed nonvolatile memory, and a dynamic a random access memory DRAM, wherein the high-speed non-volatile memory stores a first-level mapping table and a log buffer area, wherein the flash stores a second-level mapping table, a three-level mapping table, and a log area, wherein
    所述日志缓存区用于保存在所述电子设备正常工作时,所述CPU在将数据的映射关系写到DRAM的同时,通过所述存储控制器写到所述日志缓存区中所述数据的映射关系;The log buffer area is configured to save, when the electronic device is working normally, the CPU writes the data in the log buffer area by using the storage controller while writing a mapping relationship of data to the DRAM. Mapping relations;
    所述日志区用于在若所述日志缓存区中的存储空间达到第一阈值后,保存所述存储控制器从所述日志缓存区中读取的数据的映射关系;The log area is configured to save a mapping relationship between data read by the storage controller from the log buffer area after the storage space in the log buffer area reaches a first threshold;
    所述三级映射表的索引信息为数据的映射关系,所述三级映射表用于在所述日志区中的数据达到第二阈值时,所述三级映射表被刷新并保存所述日志区中数据的映射关系;The index information of the three-level mapping table is a mapping relationship of data, and the three-level mapping table is configured to refresh and save the log when the data in the log area reaches a second threshold. The mapping relationship of data in the area;
    所述一级映射表的索引信息为所述二级映射表的映射关系;The index information of the primary mapping table is a mapping relationship of the secondary mapping table;
    所述二级映射表的索引信息为所述三级映射表的映射关系;The index information of the secondary mapping table is a mapping relationship of the tertiary mapping table;
    所述映射关系为逻辑地址与物理地址的对应关系;The mapping relationship is a correspondence between a logical address and a physical address;
    所述方法包括:The method includes:
    当所述CPU前次下电属于异常下电后,所述存储控制器根据一级映射表的索引信息确定二级映射表的物理地址,并根据二级映射表的物理地址找到二级映射表,通过访问二级映射表的索引信息来确定三级映射表的物理地址,之后根据三级映射表的物理地址找到三级映射表,确定三级映射表的索引信息;After the power-off of the CPU is abnormally powered off, the storage controller determines the physical address of the secondary mapping table according to the index information of the primary mapping table, and finds the secondary mapping table according to the physical address of the secondary mapping table. The physical address of the tertiary mapping table is determined by accessing the index information of the secondary mapping table, and then the tertiary mapping table is found according to the physical address of the tertiary mapping table, and the index information of the tertiary mapping table is determined;
    所述存储控制器读取所述日志缓存区中所有数据的映射关系,以及所述日志区中所有数据的映射关系;The storage controller reads a mapping relationship of all data in the log buffer area, and a mapping relationship of all data in the log area;
    所述存储控制器向所述CPU发送所述三级映射表的索引信息、所述日志缓存区中所有数据的映射关系,以及所述日志区中所有数据的映射关系;The storage controller sends, to the CPU, index information of the three-level mapping table, a mapping relationship of all data in the log buffer area, and a mapping relationship of all data in the log area;
    当所述存储控制器在所述CPU根据所述三级映射表的索引信息、所述日志缓存区中所有数据的映射关系判断有至少一个数据在所述日志缓存区的映射关系或者在所述日志区中的映射关系与在所述三级映射表中的映射关系不一致时,使用所述至少一个数据在所述日志缓存区的映射关系或者在所述日志区中的映射关系替换掉在所述三级映射表中的映射关系,其中,在替换时,优先使用所述至少一个数据在所述日志缓存区的映射关系进行替换;When the storage controller determines, according to the index information of the three-level mapping table, the mapping relationship of all the data in the log buffer area, that the mapping relationship between the at least one data in the log buffer area is When the mapping relationship in the log area is inconsistent with the mapping relationship in the three-level mapping table, the mapping relationship of the at least one data in the log buffer area or the mapping relationship in the log area is replaced with the mapping relationship in the log area. a mapping relationship in the three-level mapping table, wherein, when replacing, preferentially replacing the mapping relationship of the at least one data in the log buffer area;
    所述存储控制器根据刷新后的三级映射表更新二级映射表的索引信息,之后根据更新后的二级映射表更新一级映射表的索引信息,且将更新后的二级映射表中在更新前后发生改变的映射关系保存至所述DRAM。The storage controller updates the index information of the secondary mapping table according to the updated three-level mapping table, and then updates the index information of the primary mapping table according to the updated secondary mapping table, and the updated secondary mapping table is A mapping relationship that changes before and after the update is saved to the DRAM.
  2. 根据权利要求1所述的方法,其特征在于,在所述CPU上电之后,所述方法还包括:The method according to claim 1, wherein after the CPU is powered on, the method further comprises:
    所述存储控制器向所述CPU上报用于反映异常下电的标志位,所述标志位位于所述存储控制器的寄存器,使得所述CPU根据所述标志位判断前次下电是否属于异常下 电。The storage controller reports, to the CPU, a flag bit for reflecting an abnormal power-off, and the flag bit is located in a register of the storage controller, so that the CPU determines, according to the flag bit, whether the previous power-off is abnormal. Under Electricity.
  3. 根据权利要求1或2所述的方法,其特征在于,所述日志缓存区被划分为n个队列,所述n个队列用Q1至Qn表示,其中,n为大于或等于1的正整数,所述日志区包括至少两个区块,且每个区块对应所述日志缓存区中的一个队列;The method according to claim 1 or 2, wherein the log buffer is divided into n queues, and the n queues are represented by Q1 to Qn, where n is a positive integer greater than or equal to 1. The log area includes at least two blocks, and each block corresponds to one queue in the log buffer area;
    在所述日志缓存区中的存储空间达到第一阈值后,所述存储控制器从所述日志缓存区中读取所述日志缓存区中的数据的映射关系,并保存到所述日志区,具体包括:After the storage space in the log buffer reaches the first threshold, the storage controller reads the mapping relationship between the data in the log buffer from the log buffer, and saves the data to the log area. Specifically include:
    在所述日志缓存区中目标列的存储空间达到所述第一阈值后,所述存储控制器将所述目标列中数据的映射关系存储至所述日志区中目标区块对应的位置,所述目标区块为所述目标列对应的区块。After the storage space of the target column in the log buffer reaches the first threshold, the storage controller stores the mapping relationship of the data in the target column to a location corresponding to the target block in the log area. The target block is a block corresponding to the target column.
  4. 根据权利要求1所述的方法,其特征在于,在所述电子设备正常工作时,所述方法还包括:The method of claim 1, wherein when the electronic device is in normal operation, the method further comprises:
    若所述三级映射表在刷新后被修改条目的数量达到第三阈值,则所述存储控制器根据刷新后的三级映射表刷新二级映射表的索引信息;If the number of the modified entries of the three-level mapping table reaches a third threshold after the refresh, the storage controller refreshes the index information of the secondary mapping table according to the updated three-level mapping table;
    若所述二级映射表在刷新后被修改条目的数量达到第四阈值,则所述存储控制器根据刷新后的二级映射表更新一级映射表的索引信息。If the number of the modified entries of the secondary mapping table after the refresh reaches the fourth threshold, the storage controller updates the index information of the primary mapping table according to the refreshed secondary mapping table.
  5. 一种存储控制器,其特征在于,所述存储控制器用于一种电子设备,所述电子设备中还包括:中央处理器CPU、闪存flash、高速非易失性存储器和动态随机存取存储器DRAM,所述高速非易失性存储器中保存有一级映射表和日志缓存区,所述flash中保存有二级映射表、三级映射表和日志区,其中,A storage controller, wherein the storage controller is used in an electronic device, and the electronic device further includes: a central processing unit CPU, a flash memory, a high speed nonvolatile memory, and a dynamic random access memory (DRAM) The high-speed non-volatile memory stores a first-level mapping table and a log buffer area, where the flash stores a second-level mapping table, a three-level mapping table, and a log area, where
    所述日志缓存区用于保存在所述电子设备正常工作时,所述CPU在将数据的映射关系写到DRAM的同时,通过所述存储控制器写到所述日志缓存区中所述数据的映射关系;The log buffer area is configured to save, when the electronic device is working normally, the CPU writes the data in the log buffer area by using the storage controller while writing a mapping relationship of data to the DRAM. Mapping relations;
    所述日志区用于在若所述日志缓存区中的存储空间达到第一阈值后,保存所述存储控制器从所述日志缓存区中读取的数据的映射关系;The log area is configured to save a mapping relationship between data read by the storage controller from the log buffer area after the storage space in the log buffer area reaches a first threshold;
    所述三级映射表的索引信息为数据的映射关系,,所述三级映射表用于在所述日志区中的数据达到第二阈值时,所述三级映射表被刷新并保存所述日志区中数据的映射关系;The index information of the three-level mapping table is a mapping relationship of data, and the three-level mapping table is configured to refresh and save the third-level mapping table when the data in the log area reaches a second threshold. Mapping of data in the log area;
    所述一级映射表的索引信息为所述二级映射表的映射关系;The index information of the primary mapping table is a mapping relationship of the secondary mapping table;
    所述二级映射表的索引信息为所述三级映射表的映射关系;The index information of the secondary mapping table is a mapping relationship of the tertiary mapping table;
    所述映射关系为逻辑地址与物理地址的对应关系;The mapping relationship is a correspondence between a logical address and a physical address;
    所述存储控制器包括:The storage controller includes:
    确定模块,用于当所述CPU前次下电属于异常下电后,根据一级映射表的索引信息确定二级映射表的物理地址,并根据二级映射表的物理地址找到二级映射表,通过访问二级映射表的索引信息来确定三级映射表的物理地址,之后根据三级映射表的物理地址找到三级映射表,确定三级映射表的索引信息;a determining module, configured to determine a physical address of the secondary mapping table according to the index information of the primary mapping table, and find the secondary mapping table according to the physical address of the secondary mapping table, after the CPU is powered off for the previous time. The physical address of the tertiary mapping table is determined by accessing the index information of the secondary mapping table, and then the tertiary mapping table is found according to the physical address of the tertiary mapping table, and the index information of the tertiary mapping table is determined;
    获取模块,用于读取所述日志缓存区中所有数据的映射关系,以及所述日志区中 所有数据的映射关系;An obtaining module, configured to read a mapping relationship of all data in the log buffer, and in the log area Mapping of all data;
    发送模块,用于向所述CPU发送所述三级映射表的索引信息、所述日志缓存区中所有数据的映射关系,以及所述日志区中所有数据的映射关系;a sending module, configured to send, to the CPU, index information of the three-level mapping table, a mapping relationship of all data in the log buffer area, and a mapping relationship of all data in the log area;
    处理模块,用于当所述存储控制器在所述CPU根据所述三级映射表的索引信息、所述日志缓存区中所有数据的映射关系判断有至少一个数据在所述日志缓存区的映射关系或者在所述日志区中的映射关系与在所述三级映射表中的映射关系不一致时,使用所述至少一个数据在所述日志缓存区的映射关系或者在所述日志区中的映射关系替换掉在所述三级映射表中的映射关系,其中,在替换时,优先使用所述至少一个数据在所述日志缓存区的映射关系进行替换;a processing module, configured to: when the storage controller determines, according to the index information of the three-level mapping table, the mapping relationship of all data in the log buffer area, that the mapping of the at least one data in the log buffer area When the relationship or the mapping relationship in the log area is inconsistent with the mapping relationship in the three-level mapping table, the mapping relationship of the at least one data in the log buffer or the mapping in the log area is used. The relationship replaces the mapping relationship in the three-level mapping table, wherein, in the replacement, the mapping relationship of the at least one data in the log buffer area is preferentially replaced;
    所述处理模块,还用于根据刷新后的三级映射表更新二级映射表的索引信息,之后根据更新后的二级映射表更新一级映射表的索引信息,且将更新后的二级映射表中在更新前后发生改变的映射关系保存至所述DRAM。The processing module is further configured to update the index information of the second mapping table according to the updated three-level mapping table, and then update the index information of the primary mapping table according to the updated secondary mapping table, and the updated secondary level A mapping relationship in the mapping table that changes before and after the update is saved to the DRAM.
  6. 根据权利要求5所述的存储控制器,其特征在于,在所述CPU上电之后,所述发送模块,还用于向所述CPU上报用于反映异常下电的标志位,所述标志位位于所述存储控制器的寄存器,使得所述CPU根据所述标志位判断前次下电是否属于异常下电。The memory controller according to claim 5, wherein after the CPU is powered on, the sending module is further configured to report, to the CPU, a flag bit for reflecting abnormal power-off, the flag bit And a register located in the storage controller, so that the CPU determines, according to the flag bit, whether the previous power-off is abnormally powered off.
  7. 根据权利要求5或6所述的存储控制器,其特征在于,所述日志缓存区被划分为n个队列,所述n个队列用Q0至Qn表示,其中,n为大于或等于1的正整数,所述日志区包括至少两个区块,且每个区块对应所述日志缓存区中的一列;The memory controller according to claim 5 or 6, wherein the log buffer area is divided into n queues, and the n queues are represented by Q0 to Qn, wherein n is greater than or equal to 1 An integer, the log area includes at least two blocks, and each block corresponds to a column in the log buffer area;
    所述存储控制器还包括:The storage controller further includes:
    存储模块,用于若所述日志缓存区中目标列的存储空间达到所述第一阈值,则将所述目标列中数据的映射关系存储至所述日志区中目标区块对应的位置,所述目标区块为所述目标列对应的区块。a storage module, configured to: if a storage space of the target column in the log buffer reaches the first threshold, store a mapping relationship of data in the target column to a location corresponding to the target block in the log area, where The target block is a block corresponding to the target column.
  8. 根据权利要求5所述的方法,其特征在于,在所述电子设备正常工作时,所述处理模块,还用于:The method according to claim 5, wherein when the electronic device is in normal operation, the processing module is further configured to:
    若所述三级映射表在刷新后被修改条目的数量达到第三阈值,则根据刷新后的三级映射表刷新二级映射表的索引信息;If the number of modified entries after the refreshing of the three-level mapping table reaches a third threshold, refreshing the index information of the secondary mapping table according to the updated tertiary mapping table;
    若所述二级映射表在刷新后被修改条目的数量达到第四阈值,则根据刷新后的二级映射表更新一级映射表的索引信息。If the number of the modified entries after the refreshing of the secondary mapping table reaches the fourth threshold, the index information of the primary mapping table is updated according to the refreshed secondary mapping table.
  9. 一种电子设备,其特征在于,所述电子设备中包括:中央处理器CPU、如权利要求5至8中任意一项所述的存储控制器、闪存flash、高速非易失性存储器和动态随机存取存储器DRAM,所述高速非易失性存储器中保存有一级映射表和日志缓存区,所述flash中保存有二级映射表、三级映射表和日志区,其中,An electronic device, comprising: a central processing unit CPU, the storage controller according to any one of claims 5 to 8, a flash memory, a high speed nonvolatile memory, and a dynamic random Accessing a memory DRAM, wherein the high-speed non-volatile memory stores a first-level mapping table and a log buffer area, where the flash stores a second-level mapping table, a three-level mapping table, and a log area, where
    所述日志缓存区用于保存在所述电子设备正常工作时,所述CPU在将数据的映射关系写到DRAM的同时,通过所述存储控制器写到所述日志缓存区中所述数据的映射 关系;The log buffer area is configured to save, when the electronic device is working normally, the CPU writes the data in the log buffer area by using the storage controller while writing a mapping relationship of data to the DRAM. Mapping relationship;
    所述日志区用于在若所述日志缓存区中的存储空间达到第一阈值后,保存所述存储控制器从所述日志缓存区中读取的数据的映射关系;The log area is configured to save a mapping relationship between data read by the storage controller from the log buffer area after the storage space in the log buffer area reaches a first threshold;
    所述三级映射表的索引信息为数据的映射关系,所述三级映射表用于在所述日志区中的数据达到第二阈值时,所述三级映射表被刷新并保存所述日志区中数据的映射关系;The index information of the three-level mapping table is a mapping relationship of data, and the three-level mapping table is configured to refresh and save the log when the data in the log area reaches a second threshold. The mapping relationship of data in the area;
    所述一级映射表的索引信息为所述二级映射表的映射关系;The index information of the primary mapping table is a mapping relationship of the secondary mapping table;
    所述二级映射表的索引信息为所述三级映射表的映射关系;The index information of the secondary mapping table is a mapping relationship of the tertiary mapping table;
    所述映射关系为逻辑地址与物理地址的对应关系。 The mapping relationship is a correspondence between a logical address and a physical address.
PCT/CN2017/103249 2016-09-29 2017-09-25 Power down protection method for storage system, storage controller, and electronic device WO2018059361A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610872062.0A CN106502928B (en) 2016-09-29 2016-09-29 A kind of storage system power-off protection method, storage control and electronic equipment
CN201610872062.0 2016-09-29

Publications (1)

Publication Number Publication Date
WO2018059361A1 true WO2018059361A1 (en) 2018-04-05

Family

ID=58291240

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/103249 WO2018059361A1 (en) 2016-09-29 2017-09-25 Power down protection method for storage system, storage controller, and electronic device

Country Status (2)

Country Link
CN (1) CN106502928B (en)
WO (1) WO2018059361A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109086222A (en) * 2018-07-24 2018-12-25 浪潮电子信息产业股份有限公司 The data reconstruction method and solid state hard disk of solid state hard disk
CN111142792A (en) * 2019-12-17 2020-05-12 尧云科技(西安)有限公司 Power-down protection method of storage device
CN111858508A (en) * 2020-06-17 2020-10-30 远光软件股份有限公司 Regulation and control method and device of log system, storage medium and electronic equipment
CN112083883A (en) * 2020-04-30 2020-12-15 杭州华澜微电子股份有限公司 Storage system and method for use in storage system
CN112346647A (en) * 2019-08-06 2021-02-09 浙江宇视科技有限公司 Data storage method, device, equipment and medium
CN116909493A (en) * 2023-09-12 2023-10-20 合肥康芯威存储技术有限公司 Memory and control method thereof

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106502928B (en) * 2016-09-29 2019-08-20 华为技术有限公司 A kind of storage system power-off protection method, storage control and electronic equipment
CN107168888B (en) * 2017-05-19 2020-06-02 惠州佰维存储科技有限公司 Mapping table management method and system of Nand flash memory
KR102430791B1 (en) * 2017-07-19 2022-08-10 에스케이하이닉스 주식회사 Controller and operation method thereof
CN107506311B (en) * 2017-08-30 2020-10-20 苏州浪潮智能科技有限公司 Method and device for flashing FTL (flash translation layer) table of solid state disk
CN108228376A (en) * 2017-12-29 2018-06-29 北京联想核芯科技有限公司 A kind of data processing method and device of SSD hard disks
CN108647157B (en) * 2018-03-14 2021-10-01 深圳忆联信息系统有限公司 Mapping management method based on phase change memory and solid state disk
CN108804026B (en) * 2018-03-27 2022-02-18 深圳忆联信息系统有限公司 Solid state disk full-disk scanning method and solid state disk
CN108804033B (en) * 2018-05-18 2021-04-20 记忆科技(深圳)有限公司 Full-disk scanning method and device based on power-off continuation, computer equipment and medium
CN108959589B (en) * 2018-07-11 2021-08-10 中电海康集团有限公司 STT-MRAM-based method for accelerating log file saving and recovery of solid-state memory device
CN109059913B (en) * 2018-08-27 2021-08-03 立得空间信息技术股份有限公司 Zero-delay integrated navigation initialization method for vehicle-mounted navigation system
CN109213690A (en) * 2018-09-21 2019-01-15 浪潮电子信息产业股份有限公司 A kind of method for reconstructing and relevant apparatus of L2P table
CN109684238A (en) * 2018-12-19 2019-04-26 湖南国科微电子股份有限公司 A kind of storage method, read method and the solid state hard disk of solid state hard disk mapping relations
CN110502452B (en) * 2019-07-12 2022-03-29 华为技术有限公司 Method and device for accessing mixed cache in electronic equipment
CN110543434B (en) * 2019-09-05 2022-07-01 北京兆易创新科技股份有限公司 NAND flash device, memory table management method, device and storage medium
CN111832088B (en) * 2020-07-13 2024-02-13 深圳忆联信息系统有限公司 Method and device for protecting data in low-power-consumption mode of solid state disk, computer equipment and storage medium
CN112395215B (en) * 2020-12-03 2024-02-13 深圳忆联信息系统有限公司 DRAM-less solid state disk mapping table management method and device, computer equipment and storage medium
JP2022114726A (en) 2021-01-27 2022-08-08 キオクシア株式会社 Memory system and control method
CN113568579B (en) * 2021-07-28 2022-05-03 深圳市高川自动化技术有限公司 Memory, data storage method and data reading method
CN114168076A (en) * 2021-12-06 2022-03-11 陕西空天动力研究院有限公司 Data storage method, device and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011091761A1 (en) * 2010-01-29 2011-08-04 成都市华为赛门铁克科技有限公司 Storage device and data storage method
CN103136116A (en) * 2011-12-05 2013-06-05 财团法人工业技术研究院 Memory storage system and central control device, management method and blackout recovery method thereof
CN105511583A (en) * 2015-12-02 2016-04-20 福建星网锐捷网络有限公司 Power-fail protection circuit and method for storage device
CN105760313A (en) * 2015-08-07 2016-07-13 深圳市证通金信科技有限公司 Data processing method and device for SPI-Flash-based (Serial Peripheral Interface-Flash-based) file system
CN106502928A (en) * 2016-09-29 2017-03-15 华为技术有限公司 A kind of storage system power-off protection method, storage control and electronic equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103294607A (en) * 2012-02-27 2013-09-11 北京华虹集成电路设计有限责任公司 Memory management method
CN102981963B (en) * 2012-10-30 2015-12-02 华中科技大学 A kind of implementation method of flash translation layer (FTL) of solid-state disk

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011091761A1 (en) * 2010-01-29 2011-08-04 成都市华为赛门铁克科技有限公司 Storage device and data storage method
CN103136116A (en) * 2011-12-05 2013-06-05 财团法人工业技术研究院 Memory storage system and central control device, management method and blackout recovery method thereof
CN105760313A (en) * 2015-08-07 2016-07-13 深圳市证通金信科技有限公司 Data processing method and device for SPI-Flash-based (Serial Peripheral Interface-Flash-based) file system
CN105511583A (en) * 2015-12-02 2016-04-20 福建星网锐捷网络有限公司 Power-fail protection circuit and method for storage device
CN106502928A (en) * 2016-09-29 2017-03-15 华为技术有限公司 A kind of storage system power-off protection method, storage control and electronic equipment

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109086222A (en) * 2018-07-24 2018-12-25 浪潮电子信息产业股份有限公司 The data reconstruction method and solid state hard disk of solid state hard disk
CN109086222B (en) * 2018-07-24 2023-08-25 浪潮电子信息产业股份有限公司 Data recovery method of solid state disk and solid state disk
CN112346647A (en) * 2019-08-06 2021-02-09 浙江宇视科技有限公司 Data storage method, device, equipment and medium
CN112346647B (en) * 2019-08-06 2024-03-29 浙江宇视科技有限公司 Data storage method, device, equipment and medium
CN111142792A (en) * 2019-12-17 2020-05-12 尧云科技(西安)有限公司 Power-down protection method of storage device
CN111142792B (en) * 2019-12-17 2022-11-22 尧云科技(西安)有限公司 Power-down protection method of storage device
CN112083883A (en) * 2020-04-30 2020-12-15 杭州华澜微电子股份有限公司 Storage system and method for use in storage system
CN112083883B (en) * 2020-04-30 2022-10-28 杭州华澜微电子股份有限公司 Storage system and method for use in storage system
CN111858508A (en) * 2020-06-17 2020-10-30 远光软件股份有限公司 Regulation and control method and device of log system, storage medium and electronic equipment
CN111858508B (en) * 2020-06-17 2023-01-31 远光软件股份有限公司 Regulation and control method and device of log system, storage medium and electronic equipment
CN116909493A (en) * 2023-09-12 2023-10-20 合肥康芯威存储技术有限公司 Memory and control method thereof
CN116909493B (en) * 2023-09-12 2023-11-17 合肥康芯威存储技术有限公司 Memory and control method thereof

Also Published As

Publication number Publication date
CN106502928A (en) 2017-03-15
CN106502928B (en) 2019-08-20

Similar Documents

Publication Publication Date Title
WO2018059361A1 (en) Power down protection method for storage system, storage controller, and electronic device
JP6124366B2 (en) Method, processor, system, and program
CN108431783B (en) Access request processing method and device and computer system
US8612692B2 (en) Variable write back timing to nonvolatile semiconductor memory
US8347141B2 (en) Method and apparatus to maintain data integrity in disk cache memory during and after periods of cache inaccessibility
US20200117368A1 (en) Method for achieving data copying in ftl of solid state drive, system and solid state drive
JP5636034B2 (en) Mediation of mount times for data usage
US20150331624A1 (en) Host-controlled flash translation layer snapshot
US20190369892A1 (en) Method and Apparatus for Facilitating a Trim Process Using Auxiliary Tables
CN111338561B (en) Memory controller and memory page management method
JP2013137770A (en) Lba bitmap usage
Lee et al. Shortcut-JFS: A write efficient journaling file system for phase change memory
US11544093B2 (en) Virtual machine replication and migration
CN109952565B (en) Memory access techniques
TW201324154A (en) Memory storage system, and central control device, management method and recovery method
KR102374239B1 (en) Method and device for reducing read latency
US11016905B1 (en) Storage class memory access
US10339045B2 (en) Valid data management method and storage controller
CN108431784B (en) Access request processing method and device and computer system
CN108694101B (en) Persistent caching of memory-side cache contents
US9218294B1 (en) Multi-level logical block address (LBA) mapping table for solid state
US20100161934A1 (en) Preselect list using hidden pages
CN110928890A (en) Data storage method and device, electronic equipment and computer readable medium
CN114840452A (en) Control component
WO2020089589A1 (en) Persistent memory cleaning

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: 17854811

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: 17854811

Country of ref document: EP

Kind code of ref document: A1