WO2024103600A1 - Data management method and apparatus, electronic device, and nonvolatile readable storage medium - Google Patents

Data management method and apparatus, electronic device, and nonvolatile readable storage medium Download PDF

Info

Publication number
WO2024103600A1
WO2024103600A1 PCT/CN2023/085274 CN2023085274W WO2024103600A1 WO 2024103600 A1 WO2024103600 A1 WO 2024103600A1 CN 2023085274 W CN2023085274 W CN 2023085274W WO 2024103600 A1 WO2024103600 A1 WO 2024103600A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
target page
target
storage block
memory
Prior art date
Application number
PCT/CN2023/085274
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 WO2024103600A1 publication Critical patent/WO2024103600A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application relates to the technical field of data storage, and more specifically, to a data management method, a device, an electronic device, and a non-volatile readable storage medium.
  • NAND Flash is currently widely used in various storage scenarios.
  • An ideal flash memory should have the characteristics of small size, fast operation speed, low programming voltage, strong anti-erasure capability, and long retention time.
  • NAND Flash is composed of blocks, and blocks are composed of pages. Blocks are the smallest unit of erasure and page is the smallest unit of writing. During use, various types of information will be recorded, including bad block information, load balancing information, garbage collection information, etc. Therefore, the recording of such information is very important. Generally, several valid blocks are selected from the entire NAND as management blocks to record information.
  • management blocks can also make mistakes, which is generally not allowed to happen, because errors in management information recording will lead to abnormal use of NAND, information cannot be restored, and in serious cases, it will be scrapped, which means that the robustness of NAND has deteriorated. Therefore, how to effectively use block recording information to avoid errors as much as possible is a very important research topic.
  • the dual-block synchronous recording method is currently a commonly used recording method: it refers to selecting two valid blocks from the NAND bad block table to record information.
  • the recording method is to synchronously write from page 0 in order, and when all pages of the entire block are full, perform a crash erase action, and then proceed to the next round of recording.
  • This method can usually avoid UNC (an error in hard disk detection) in a single block, and can promptly synchronize and restore valid information from another block.
  • the purpose of the present application is to provide a data management method, device, electronic device and non-volatile readable storage medium to improve the accuracy of data recording.
  • the present application provides a data management method, comprising:
  • the target data is recorded to the first target page and the second target page in the first part, and the third target page and the fourth target page in the fourth part; wherein the offset of the first target page in the first part is the same as the offset of the third target page in the fourth part, and the offset of the second target page in the first part is the same as the offset of the fourth target page in the fourth part.
  • determining the first storage block and the second storage block in the memory includes:
  • a first memory block and a second memory block are determined in a memory using a high temperature technology screening method.
  • determining the first storage block and the second storage block in the memory by using the high temperature technology screening method includes:
  • the two storage blocks having the smallest difference between the first error rate and the second error rate are determined as the first storage block and the second storage block.
  • determining the first storage block and the second storage block in the memory by using the high temperature technology screening method includes:
  • the two storage blocks with the lowest error rates are determined as the first storage block and the second storage block.
  • the step of recording the target data to the first target page and the second target page in the first part and the third target page and the fourth target page in the fourth part includes:
  • the target data is recorded to the first target page and the second target page in the first part according to the page order in the first part, and the target data is recorded to the third target page and the fourth target page in the fourth part according to the page order in the fourth part; wherein the second target page is the next page of the first target page, and the fourth target page is the next page of the third target page.
  • the method further includes recording the target data to the first target page and the second target page in the first part according to the page sequence in the first part, and recording the target data to the third target page and the fourth target page in the fourth part according to the page sequence in the fourth part.
  • the last piece of data and the second to last piece of data in the first part are both read incorrectly, the last piece of data in the fourth part is read.
  • the target data is the management information of the memory, and the management information includes any one or a combination of any several of the bad block information, load balancing information, and garbage collection information.
  • the method further includes:
  • the method further includes recording the target data to the first target page and the second target page in the first part and recording the target data to the third target page and the fourth target page in the fourth part.
  • the last piece of data in the first part is synchronized to the fourth part after the second storage block is powered on.
  • a data management device comprising:
  • a determination module configured to determine a first storage block and a second storage block in a memory
  • a division module used for dividing the first storage block into a first part and a second part, and dividing the second storage block into a third part and a fourth part according to a preset division method
  • a recording module is used to record target data to a first target page and a second target page in a first part, and a third target page and a fourth target page in a fourth part; wherein an offset of the first target page in the first part is the same as an offset of the third target page in the fourth part, and an offset of the second target page in the first part is the same as an offset of the fourth target page in the fourth part.
  • the determination module is specifically used to determine the first storage block and the second storage block in the memory by using a high temperature technology screening method.
  • the determination module is specifically used to: write the same target content to all storage blocks in the memory; read the contents of all storage blocks, and determine the first error rate of each storage block by comparing the read content with the target content; perform a heating operation on the memory, read the contents of all storage blocks, and determine the second error rate of each storage block by comparing the read content with the target content; determine the two storage blocks with the smallest difference between the first error rate and the second error rate as the first storage block and the second storage block.
  • the determination module is specifically used to: write the same target content to all storage blocks in the memory; perform a heating operation on the memory, read the contents of all storage blocks, and determine the error rate of each storage block by comparing the read content with the target content; determine the two storage blocks with the lowest error rate as the first storage block and the second storage block.
  • the recording module is specifically used to: record the target data to the first target page and the second target page in the first part according to the page order in the first part, and record the target data to the third target page and the fourth target page in the fourth part according to the page order in the fourth part; wherein the second target page is the page after the first target page, and the fourth target page is the page after the third target page.
  • the first reading module is used to read the last piece of data in the first part when receiving a command to read the target data.
  • the second reading module is used to read the second to last piece of data in the first part if the last piece of data in the first part is read incorrectly.
  • the third reading module is used to read the last piece of data in the fourth part if both the last piece of data and the second to last piece of data in the first part are read incorrectly.
  • the fourth reading module is used to read the second to last piece of data in the fourth part if the last piece of data in the fourth part is read incorrectly.
  • the target data is the management information of the memory, and the management information includes any one or a combination of any several of the bad block information, load balancing information, and garbage collection information.
  • the erasing module is used to erase all data in the first part when the first part is full; read the last data in the fourth part and record the last data in the first part; erase all data in the fourth part and synchronize the last data in the first part to the fourth part.
  • the synchronization module is used for synchronizing the last piece of data in the first part to the fourth part after the second storage block is powered on if a power failure occurs in the second storage block.
  • an electronic device including:
  • a processor is used to implement the steps of the above-mentioned data management method when executing a computer program.
  • the present application provides a non-volatile readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above data management method are implemented.
  • a data management method includes: determining a first storage block and a second storage block in a memory; dividing the first storage block into a first part and a second part, and dividing the second storage block into a third part and a fourth part according to a preset division method; recording the target data to the first target page and the second target page in the first part, and the third target page and the fourth target page in the fourth part; wherein the offset of the first target page in the first part is the same as the offset of the third target page in the fourth part, and the offset of the second target page in the first part is the same as the offset of the fourth target page in the fourth part.
  • the data management method provided by the present application adopts a dual-block asynchronous recording method.
  • UNC appears simultaneously in pages with the same sequence number in different blocks, that is, when UNC appears simultaneously in the first part of the first storage block and the third part of the second storage block
  • data can be recorded based on the fourth part of the second storage block. Recording and reading. That is, the present application can ensure that important information can be accurately recorded and read, can repair NAND information in a timely manner to the greatest extent, and ensure that the NAND system will not be paralyzed due to information recording errors. It can be seen that the data management method provided by the present application improves the accuracy of data recording.
  • the present application also discloses a data management device, an electronic device, and a non-volatile readable storage medium, which can also achieve the above technical effects.
  • FIG1 is a flow chart of a data management method according to an exemplary embodiment
  • FIG2 is a flow chart of another data management method according to an exemplary embodiment
  • FIG3 is a structural diagram of a data management device according to an exemplary embodiment
  • Fig. 4 is a structural diagram of an electronic device according to an exemplary embodiment.
  • the embodiment of the present application discloses a data management method, which improves the accuracy of data recording.
  • FIG. 1 a flow chart of a data management method according to an exemplary embodiment is shown. As shown in FIG. 1 , the method includes:
  • S101 Determine a first storage block and a second storage block in a memory
  • the data storage blocks namely the first storage block blockA and the second storage block blockB
  • the memory in this embodiment may be specifically NAND.
  • this step may include: using a high temperature technology screening method to determine the first storage block and the second storage block in the memory.
  • a high temperature technology screening method is used to determine a first storage block and a second storage block in a memory, including: writing the same target content to all storage blocks in the memory; performing a heating operation on the memory, reading the contents of all storage blocks, and determining the error rate of each storage block by comparing the read content with the target content; and determining the two storage blocks with the lowest error rate as the first storage block and the second storage block.
  • the entire memory is erased and the same target content is written to all storage blocks in the memory, such as all 0s. All 1s are avoided as much as possible, because the NAND content after erasure is all 1s, and the voltage jump cannot be maximized at this time.
  • the memory is placed in a high-temperature box for several hours of heating operation, the memory is taken out, and the memory is read. The error rate of all storage blocks is counted, and the two storage blocks with the lowest error rate are selected as the first storage block and the second storage block, which are distributed on the parity block.
  • a high temperature technology screening method is used to determine a first storage block and a second storage block in a memory, including: writing the same target content to all storage blocks in the memory; reading the content of all storage blocks, and determining a first error rate of each storage block by comparing the read content with the target content; performing a heating operation on the memory, reading the content of all storage blocks, and determining a second error rate of each storage block by comparing the read content with the target content; and determining two storage blocks with the smallest difference between the first error rate and the second error rate as the first storage block and the second storage block.
  • the entire memory is erased and the same target content is written to all storage blocks in the memory, such as all 0s. All 1s are avoided as much as possible, because the NAND content after erasure is all 1s, and the voltage jump cannot be maximized at this time.
  • the entire memory is read to count the error rates of all storage blocks.
  • the memory is placed in a high-temperature box for several hours of heating operation, and the memory is taken out and read from the memory to count the error rates of all storage blocks.
  • the two storage blocks with the smallest error rate difference are selected as the first storage block and the second storage block, which are distributed on the parity block.
  • the first storage block and the second storage block are divided into two parts in the same way, that is, the first storage block is divided into the first part and the second part, and the second storage block is divided into the third part and the fourth part.
  • the first part, the second part, the third part and the fourth part all contain multiple pages, and the offset of the first part in the first storage block is the same as the offset of the third part in the second storage block.
  • the offset of the second part in the first storage block is the same as the offset of the fourth part in the second storage block, that is, the first part and the third part are prone to UNC at the same time, and the second part and the fourth part are prone to UNC at the same time.
  • S103 Record the target data to the first target page and the second target page in the first part, and the third target page and the fourth target page in the fourth part; wherein the offset of the first target page in the first part is the same as the offset of the third target page in the fourth part, and the offset of the second target page in the first part is the same as the offset of the fourth target page in the fourth part.
  • the target data is recorded to the first target page and the second target page in the first part according to the page order in the first part, and the target data is recorded to the third target page and the fourth target page in the fourth part according to the page order in the fourth part; wherein the second target page is the next page of the first target page, and the fourth target page is the next page of the third target page.
  • the target data in this embodiment may be management information of the memory, and the management information may include bad block information, load balancing information, garbage collection information, etc., which is not specifically limited in this embodiment.
  • the recording method generally starts from page0 and ends at page(N-1).
  • blockA is divided into the first part pageA and the second part pageB
  • blockB is divided into the third part pageA and the fourth part pageB.
  • all pageA are numbered from 0, and all pageB are also numbered from 0.
  • the i-th page is recorded as pageAi and pageBi respectively. Only pageA is written in the recording process in blockA, and only pageB is written in blockB. Moreover, in order to ensure the reliability of information, two pages are repeatedly written in each block during the information recording process.
  • the data management method provided in the embodiment of the present application adopts a dual-block asynchronous recording method, and UNC appears simultaneously in pages with the same sequence number in different blocks, that is, when UNC appears simultaneously in the first part of the first storage block and the third part of the second storage block, data can be recorded and read based on the fourth part of the second storage block. That is, the embodiment of the present application can ensure that important information can be accurately recorded and read, and can repair NAND information in a timely manner to the greatest extent, ensuring that the NAND system will not be paralyzed due to errors in information recording. It can be seen that the data management method provided in the embodiment of the present application improves the accuracy of data recording.
  • the method further includes: when a read command of the target data is received, reading the last data in the first part. If the last data in the first part is read incorrectly, the second to last data in the first part is read. If the last data in the first part and the second to last data in the fourth part are both read incorrectly, the last data in the fourth part is read. If the last data in the fourth part is read incorrectly, the second to last data in the fourth part is read.
  • the embodiment of the present application discloses a data management method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically:
  • FIG. 2 a flow chart of another data management method according to an exemplary embodiment is shown. As shown in FIG. 2 , the method includes:
  • S203 Erasing all data in the fourth part, and synchronizing the last piece of data in the first part to the fourth part.
  • pageA and pageB of different MLC (Multi-Level Cell) NAND are not consistent, and the total number will also be different.
  • pageA in blockA or pageB in blockB is full, the other block is often not full.
  • synchronization processing is required. For example, if blockA is full, it is necessary to perform an erase operation, read the last valid information of blockB, and update it to pageA0 and pageAl of blockA. At this time, blockB is erased, and then the valid information of blockA is synchronized to pageB0 and pageB1 of blockB.
  • it further includes: if a power failure occurs in the second storage block, after the second storage block is powered on, the last piece of data in the first part is synchronized to the fourth part.
  • block A has been recorded and block B has not been recorded, and a power outage occurs, the valid information of block A can be synchronized to block B. In other cases, if a power outage occurs, the last valid record of block A is read after restart.
  • L06B NAND which includes 512 blocks, and a single block has 256 pages.
  • Step 1 High-temperature filter blocks, write all blocks (except bad blocks and block0, block1) 0x00, read the BER (Bit Error Ratio) of each block at this time, put it in a high temperature box at about 85 degrees for about a day, re-read the BER of each block, and select the two blocks with lower error rate, namely blockA and blockB.
  • Block9 and block20 are selected in the test.
  • Step 2 blockA only writes pageA. When it encounters pageB, it fills it with all 1s. blockB only writes pageB. When it encounters pageA, it fills it with all 1s. Each valid information will be repeated twice for the two blocks, that is, the valid information is actually recorded four times.
  • Step 3 When blockA is full, erase blockA and synchronize the information of blockB to blockA. Then, erase blockB and synchronize the valid information of blockA to blockB.
  • the high-temperature block screening method, the dual-block asynchronous recording method, and the synchronization processing after the block is full used in this application are all to ensure that important information can be accurately recorded and read; in the event of data loss on either side, valid information can be extracted from the other block, and even in various abnormal situations such as power failure, the NAND information can be repaired in time to the greatest extent, ensuring that the NAND system will not be paralyzed due to information recording errors. From the block screening stage to the information recording process, the robustness of the block and the accuracy of the record are enhanced to the maximum extent. Not only does it solve the information recording errors caused by page synchronization errors, it also avoids problems such as information loss caused by power failure.
  • the above method can be used as a reference, and the horizontal recording method between blocks and the vertical recording method within the block can be selected to ensure that there are four valid records at the same time, and correct data can be obtained from one party or multiple parties.
  • a data management device provided in an embodiment of the present application is introduced below.
  • the data management device described below and the data management method described above can be referenced to each other.
  • FIG. 3 a structural diagram of a data management device according to an exemplary embodiment is shown. As shown in FIG. 3 , the device includes:
  • a determination module 301 configured to determine a first storage block and a second storage block in a memory
  • two storage blocks with lower error rates are determined in the memory as recording targets.
  • the data storage blocks namely the first storage block blockA and the second storage block blockB, the memory in this embodiment may be specifically NAND.
  • the first storage block and the second storage block are determined in the memory using a high temperature technology screening method.
  • the same target content is written to all storage blocks in the memory; the memory is heated, the contents of all storage blocks are read, and the error rate of each storage block is determined by comparing the read content with the target content; the two storage blocks with the lowest error rate are determined as the first storage block and the second storage block.
  • the entire memory is erased and the same target content is written to all storage blocks in the memory, such as all 0s. All 1s are avoided as much as possible, because the NAND content after erasure is all 1s, and the voltage jump cannot be maximized at this time.
  • the memory is placed in a high-temperature box for several hours of heating operation, the memory is taken out, and the memory is read. The error rate of all storage blocks is counted, and the two storage blocks with the lowest error rate are selected as the first storage block and the second storage block, which are distributed on the parity block.
  • the same target content is written to all storage blocks in the memory; the content of all storage blocks is read, and a first error rate of each storage block is determined by comparing the read content with the target content; a heating operation is performed on the memory, the content of all storage blocks is read, and a second error rate of each storage block is determined by comparing the read content with the target content; and the two storage blocks with the smallest difference between the first error rate and the second error rate are determined as the first storage block and the second storage block.
  • the entire memory is erased and the same target content is written to all storage blocks in the memory, such as all 0s. All 1s are avoided as much as possible, because the NAND content after erasure is all 1s, and the voltage jump cannot be maximized at this time.
  • the entire memory is read to count the error rates of all storage blocks.
  • the memory is placed in a high-temperature box for several hours of heating operation, and the memory is taken out and read from the memory to count the error rates of all storage blocks.
  • the two storage blocks with the smallest error rate difference are selected as the first storage block and the second storage block, which are distributed on the parity block.
  • a division module 302 configured to divide the first storage block into a first part and a second part, and divide the second storage block into a third part and a fourth part according to a preset division method
  • the first storage block and the second storage block are divided into two parts in the same way, that is, the first storage block is divided into the first part and the second part, and the second storage block is divided into the third part and the fourth part.
  • the first part, the second part, the third part and the fourth part all contain multiple pages, the offset of the first part in the first storage block is the same as the offset of the third part in the second storage block, and the offset of the second part in the first storage block is the same as the offset of the fourth part in the second storage block, that is, the first part and the third part are prone to have UNC at the same time, and the second part and the fourth part are prone to have UNC at the same time. Some UNCs also appear.
  • the recording module 303 is used to record the target data to the first target page and the second target page in the first part, and the third target page and the fourth target page in the fourth part; wherein the offset of the first target page in the first part is the same as the offset of the third target page in the fourth part, and the offset of the second target page in the first part is the same as the offset of the fourth target page in the fourth part.
  • the target data is recorded to the first target page and the second target page in the first part according to the page order in the first part, and the target data is recorded to the third target page and the fourth target page in the fourth part according to the page order in the fourth part; wherein the second target page is the next page of the first target page, and the fourth target page is the next page of the third target page.
  • the target data in this embodiment may be management information of the memory, and the management information may include bad block information, load balancing information, garbage collection information, etc., which is not specifically limited in this embodiment.
  • the recording method generally starts from page0 and ends at page(N-1).
  • blockA is divided into the first part pageA and the second part pageB
  • blockB is divided into the third part pageA and the fourth part pageB.
  • all pageA are numbered from 0, and all pageB are also numbered from 0.
  • the i-th page is recorded as pageAi and pageBi respectively. Only pageA is written in the recording process in blockA, and only pageB is written in blockB. Moreover, in order to ensure the reliability of information, two pages are repeatedly written in each block during the information recording process.
  • the data management device provided in the embodiment of the present application adopts a dual-block asynchronous recording method, and UNC appears simultaneously in pages with the same sequence number in different blocks, that is, when UNC appears simultaneously in the first part of the first storage block and the third part of the second storage block, data can be recorded and read based on the fourth part of the second storage block. That is, the embodiment of the present application can ensure that important information can be accurately recorded and read, and can repair NAND information in a timely manner to the greatest extent, ensuring that the NAND system will not be paralyzed due to errors in information recording. It can be seen that the data management device provided in the embodiment of the present application improves the accuracy of data recording.
  • the determination module 301 is specifically used to: determine the first storage block and the second storage block in the memory by using a high temperature technology screening method.
  • the determination module 301 is specifically used to: write the same target content to all storage blocks in the memory; read the content of all storage blocks, The first error rate of each storage block is determined by comparing the read content with the target content; a heating operation is performed on the memory to read the contents of all storage blocks, and the second error rate of each storage block is determined by comparing the read content with the target content; and two storage blocks with the smallest difference between the first error rate and the second error rate are determined as the first storage block and the second storage block.
  • the determination module 301 is specifically used to: write the same target content to all storage blocks in the memory; perform a heating operation on the memory, read the contents of all storage blocks, and determine the error rate of each storage block by comparing the read content with the target content; determine the two storage blocks with the lowest error rate as the first storage block and the second storage block.
  • the recording module 303 is specifically used to: record the target data to the first target page and the second target page in the first part according to the page order in the first part, and record the target data to the third target page and the fourth target page in the fourth part according to the page order in the fourth part; wherein the second target page is the page after the first target page, and the fourth target page is the page after the third target page.
  • the following further includes:
  • the first reading module is used to read the last piece of data in the first part when receiving a command to read the target data.
  • the following further includes:
  • the second reading module is used to read the second to last piece of data in the first part if the last piece of data in the first part is read incorrectly.
  • the following further includes:
  • the third reading module is used to read the last piece of data in the fourth part if both the last piece of data and the second to last piece of data in the first part are read incorrectly.
  • the following further includes:
  • the fourth reading module is used to read the second to last piece of data in the fourth part if the last piece of data in the fourth part is read incorrectly.
  • the target data is management information of the memory
  • the management information includes any one or any one of bad block information, load balancing information, and garbage collection information. A combination of several items.
  • the following further includes:
  • the erasing module is used to erase all data in the first part when the first part is full; read the last data in the fourth part and record the last data in the first part; erase all data in the fourth part and synchronize the last data in the first part to the fourth part.
  • pageA and pageB of different MLC NAND are not consistent, and the total number will also be different.
  • pageA in blockA or pageB in blockB is full, the other block is often not full.
  • synchronization processing is required. For example, if blockA is full, it is necessary to perform an erase operation, read the last valid information of blockB, and update it to pageA0 and pageA1 of blockA. At this time, blockB is erased, and then the valid information of blockA is synchronized to pageB0 and pageB1 of blockB.
  • the following further includes:
  • the synchronization module is used for synchronizing the last piece of data in the first part to the fourth part after the second storage block is powered on if a power failure occurs in the second storage block.
  • block A has been recorded and block B has not been recorded, and a power outage occurs, the valid information of block A can be synchronized to block B. In other cases, if a power outage occurs, the last valid record of block A is read after restart.
  • FIG4 is a structural diagram of an electronic device according to an exemplary embodiment. As shown in FIG4, the electronic device includes:
  • Communication interface 1 capable of exchanging information with other devices such as network devices;
  • the processor 2 is connected to the communication interface 1 to realize information exchange with other devices and is used to execute the data management method provided by one or more technical solutions when running the computer program.
  • the computer program is stored in the memory 3.
  • bus system 4 is used to realize the connection and communication between these components.
  • bus system 4 also includes a power bus, a control bus and a status signal bus.
  • various buses are marked as the bus system 4 in FIG. 4.
  • the memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program used to operate on the electronic device.
  • the memory 3 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories.
  • the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory.
  • the volatile memory can be a random access memory (RAM), which is used as an external cache.
  • RAM random access memory
  • SRAM static random access memory
  • SSRAM synchronous static random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous dynamic random access memory
  • DDRSDRAM double data rate synchronous dynamic random access memory
  • ESDRAM enhanced synchronous dynamic random access memory
  • SLDRAM synchronous link dynamic random access memory
  • DRRAM direct memory bus random access memory
  • Processor 2 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above-mentioned method can be completed by an integrated logic circuit of hardware in processor 2 or instructions in software form.
  • the above-mentioned processor 2 can be a general-purpose processor, DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • Processor 2 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application.
  • a general-purpose processor can be a microprocessor or any conventional processor, etc.
  • the steps of the method can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a non-volatile readable storage medium, which is located in the memory 3.
  • the processor 2 reads the program in the memory 3 and completes the steps of the aforementioned method in combination with its hardware.
  • the present application also provides a storage medium, namely a computer storage medium, specifically a non-volatile readable storage medium, for example, a memory 3 storing a computer program, and the above-mentioned computer program can be executed by a processor 2 to complete the above-mentioned method steps.
  • the non-volatile readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, CD-ROM, etc.
  • the aforementioned non-volatile readable storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
  • the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a non-volatile readable storage medium.
  • the computer software product is stored in a non-volatile readable storage medium, including a number of instructions to enable an electronic device (which can be a personal computer, server, network device, etc.) to execute all or part of the methods of each embodiment of the present application.
  • the aforementioned non-volatile readable storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

Landscapes

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

Abstract

The present application relates to the technical field of data storage and discloses a data management method and apparatus, an electronic device, and a nonvolatile readable storage medium. The method comprises: determining a first storage block and a second storage block in a memory; according to a preset division mode, dividing the first storage block into a first part and a second part, and dividing the second storage block into a third part and a fourth part; and recording target data to a first target page and a second target page in the first part and a third target page and a fourth target page in the fourth part, wherein the offset of the first target page in the first part is the same as the offset of the third target page in the fourth part, and the offset of the second target page in the first part is the same as the offset of the fourth target page in the fourth part. Therefore, the present application improves the accuracy of data recording.

Description

一种数据管理方法、装置及电子设备和非易失性可读存储介质A data management method, device, electronic device and non-volatile readable storage medium
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求于2022年11月17日提交中国专利局,申请号为202211461907.9,申请名称为“一种数据管理方法、装置及电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on November 17, 2022, with application number 202211461907.9, and application name “A data management method, device, electronic device and storage medium”, all contents of which are incorporated by reference in this application.
技术领域Technical Field
本申请涉及数据存储技术领域,更具体地说,涉及一种数据管理方法、装置及一种电子设备和一种非易失性可读存储介质。The present application relates to the technical field of data storage, and more specifically, to a data management method, a device, an electronic device, and a non-volatile readable storage medium.
背景技术Background technique
NAND Flash目前广泛应用于各种存储场合,理想的闪存存储器应该满足尺寸小,操作速度快,编程电压低,抗擦写能力强,保持时间久等特点。NAND Flash is currently widely used in various storage scenarios. An ideal flash memory should have the characteristics of small size, fast operation speed, low programming voltage, strong anti-erasure capability, and long retention time.
NAND Flash由块构成,而块又由页组成,块是擦写的最小单位,页是写入的最小单位,在使用过程中,会有各类记录信息,包括坏块信息,负载均衡信息,垃圾回收信息等,因此,这类信息的记录至关重要,一般会从整个NAND中选取若干有效块作为管理块进行信息的记录。NAND Flash is composed of blocks, and blocks are composed of pages. Blocks are the smallest unit of erasure and page is the smallest unit of writing. During use, various types of information will be recorded, including bad block information, load balancing information, garbage collection information, etc. Therefore, the recording of such information is very important. Generally, several valid blocks are selected from the entire NAND as management blocks to record information.
不可否认,管理块也是会出错的,这一般是不允许发生的,因为管理信息记录错误会导致NAND使用异常,信息无法恢复,严重者报废等,这都代表着NAND的稳健性变差。因此,如何有效地利用块记录信息,较大可能性地避免错误地发生,是非常重要的一项研究内容。It is undeniable that management blocks can also make mistakes, which is generally not allowed to happen, because errors in management information recording will lead to abnormal use of NAND, information cannot be restored, and in serious cases, it will be scrapped, which means that the robustness of NAND has deteriorated. Therefore, how to effectively use block recording information to avoid errors as much as possible is a very important research topic.
双块同步记录法是目前常用的记录方法:是指从NAND坏块表中选择两个有效block(块)进行信息的记录,记录方法是同步从page0开始按照顺序往下写,等到整个block的所有page(页)均被写满后,执行crase擦除动作,再进行下一轮的记录。这种方法通常可以避免单个block出现UNC(硬盘检测中的一个错误),可以及时从另一个block中将有效信息进行同步恢复。The dual-block synchronous recording method is currently a commonly used recording method: it refers to selecting two valid blocks from the NAND bad block table to record information. The recording method is to synchronously write from page 0 in order, and when all pages of the entire block are full, perform a crash erase action, and then proceed to the next round of recording. This method can usually avoid UNC (an error in hard disk detection) in a single block, and can promptly synchronize and restore valid information from another block.
如上所述,当某个block出现UNC的情况,可以通过信息同步的方法使用另一个block进行信息的恢复。但是,不同block同序号的page容易同时出现UNC,所以在记录过程中,两个页同时出现UNC的概率较大。另外。双 block记录过程中都写满,此时需要同时进行擦写动作,若此时发生掉电,则信息会全部丢失。As mentioned above, when a block has UNC, another block can be used to restore the information through information synchronization. However, pages with the same sequence number in different blocks are prone to UNC at the same time, so during the recording process, the probability of two pages having UNC at the same time is high. The block is filled during the recording process, and it needs to be erased and written at the same time. If power is lost at this time, all information will be lost.
因此,如何提高数据记录的准确性是本领域技术人员需要解决的技术问题。Therefore, how to improve the accuracy of data recording is a technical problem that those skilled in the art need to solve.
发明内容Summary of the invention
本申请的目的在于提供一种数据管理方法、装置及一种电子设备和一种非易失性可读存储介质,提高了数据记录的准确性。The purpose of the present application is to provide a data management method, device, electronic device and non-volatile readable storage medium to improve the accuracy of data recording.
为实现上述目的,本申请提供了一种数据管理方法,包括:To achieve the above objectives, the present application provides a data management method, comprising:
在存储器中确定第一存储块和第二存储块;Determining a first storage block and a second storage block in a memory;
按照预设划分方式将第一存储块划分为第一部分和第二部分、将第二存储块划分为第三部分和第四部分;Dividing the first storage block into a first part and a second part, and dividing the second storage block into a third part and a fourth part according to a preset division method;
将目标数据记录至第一部分中的第一目标页和第二目标页、第四部分的第三目标页和第四目标页;其中,第一目标页在第一部分中的偏移与第三目标页在第四部分中的偏移相同,第二目标页在第一部分中的偏移与第四目标页在第四部分中的偏移相同。The target data is recorded to the first target page and the second target page in the first part, and the third target page and the fourth target page in the fourth part; wherein the offset of the first target page in the first part is the same as the offset of the third target page in the fourth part, and the offset of the second target page in the first part is the same as the offset of the fourth target page in the fourth part.
其中,在存储器中确定第一存储块和第二存储块,包括:Wherein, determining the first storage block and the second storage block in the memory includes:
利用高温技术筛选法在存储器中确定第一存储块和第二存储块。A first memory block and a second memory block are determined in a memory using a high temperature technology screening method.
其中,利用高温技术筛选法在存储器中确定第一存储块和第二存储块,包括:Wherein, determining the first storage block and the second storage block in the memory by using the high temperature technology screening method includes:
向存储器中的所有存储块写入相同的目标内容;Writing the same target content to all storage blocks in the memory;
读取所有存储块的内容,通过对比读取到的内容与目标内容确定每个存储块的第一错误率;Reading the contents of all storage blocks, and determining a first error rate of each storage block by comparing the read contents with target contents;
对存储器进行加热操作,读取所有存储块的内容,通过对比读取到的内容与目标内容确定每个存储块的第二错误率;Performing a heating operation on the memory, reading the contents of all the memory blocks, and determining the second error rate of each memory block by comparing the read contents with the target contents;
将第一错误率与第二错误率相差最小的两个存储块确定为第一存储块和第二存储块。The two storage blocks having the smallest difference between the first error rate and the second error rate are determined as the first storage block and the second storage block.
其中,利用高温技术筛选法在存储器中确定第一存储块和第二存储块,包括:Wherein, determining the first storage block and the second storage block in the memory by using the high temperature technology screening method includes:
向存储器中的所有存储块写入相同的目标内容;Writing the same target content to all storage blocks in the memory;
对存储器进行加热操作,读取所有存储块的内容,通过对比读取到的内 容与目标内容确定每个存储块的错误率;Perform a warm-up operation on the memory, read the contents of all memory blocks, and compare the read contents. The error rate of each storage block is determined by the content of the target;
将错误率最低的两个存储块确定为第一存储块和第二存储块。The two storage blocks with the lowest error rates are determined as the first storage block and the second storage block.
其中,将目标数据记录至第一部分中的第一目标页和第二目标页、第四部分的第三目标页和第四目标页,包括:The step of recording the target data to the first target page and the second target page in the first part and the third target page and the fourth target page in the fourth part includes:
按照第一部分中的页顺序将目标数据记录至第一部分中的第一目标页和第二目标页,按照第四部分中的页顺序将目标数据记录至第四部分的第三目标页和第四目标页;其中,第二目标页为第一目标页的后一页,第四目标页为第三目标页的后一页。The target data is recorded to the first target page and the second target page in the first part according to the page order in the first part, and the target data is recorded to the third target page and the fourth target page in the fourth part according to the page order in the fourth part; wherein the second target page is the next page of the first target page, and the fourth target page is the next page of the third target page.
其中,按照第一部分中的页顺序将目标数据记录至第一部分中的第一目标页和第二目标页,按照第四部分中的页顺序将目标数据记录至第四部分的第三目标页和第四目标页之后,还包括:The method further includes recording the target data to the first target page and the second target page in the first part according to the page sequence in the first part, and recording the target data to the third target page and the fourth target page in the fourth part according to the page sequence in the fourth part.
当接收到目标数据的读取命令时,读取第一部分中的最后一条数据。When a read command of target data is received, the last piece of data in the first part is read.
其中,读取第一部分中的最后一条数据之后,还包括:After reading the last piece of data in the first part, it also includes:
若第一部分中的最后一条数据读取错误,则读取第一部分中的倒数第二条数据。If the last data in the first part is read incorrectly, the second to last data in the first part is read.
其中,读取第一部分中的倒数第二条数据之后,还包括:After reading the second to last piece of data in the first part, the following is also included:
若第一部分中的最后一条数据和倒数第二条数据均读取错误,则读取第四部分中的最后一条数据。If the last piece of data and the second to last piece of data in the first part are both read incorrectly, the last piece of data in the fourth part is read.
其中,读取第四部分中的最后一条数据之后,还包括:Among them, after reading the last piece of data in the fourth part, it also includes:
若第四部分中的最后一条数据读取错误,则读取第四部分中的倒数第二条数据。If the last data in the fourth part is read incorrectly, the second to last data in the fourth part is read.
其中,目标数据为存储器的管理信息,管理信息包括坏块信息、负载均衡信息、垃圾回收信息中任一项或任几项的组合。The target data is the management information of the memory, and the management information includes any one or a combination of any several of the bad block information, load balancing information, and garbage collection information.
其中,将目标数据记录至第一部分中的第一目标页和第二目标页、第四部分的第三目标页和第四目标页之后,还包括:After recording the target data to the first target page and the second target page in the first part and the third target page and the fourth target page in the fourth part, the method further includes:
当第一部分写满时,擦除第一部分中的所有数据;When the first part is full, all data in the first part is erased;
读取第四部分中最后一条数据,将最后一条数据记录至第一部分;Read the last piece of data in the fourth part and record the last piece of data in the first part;
擦除第四部分中的所有数据,并将第一部分中的最后一条数据同步至第四部分。Erase all data in the fourth part and synchronize the last data in the first part to the fourth part.
其中,将目标数据记录至第一部分中的第一目标页和第二目标页之后,将目标数据记录至第四部分的第三目标页和第四目标页之前,还包括: The method further includes recording the target data to the first target page and the second target page in the first part and recording the target data to the third target page and the fourth target page in the fourth part.
若第二存储块出现掉电异常,则在第二存储块上电后,将第一部分中的最后一条数据同步至第四部分。If a power failure exception occurs in the second storage block, the last piece of data in the first part is synchronized to the fourth part after the second storage block is powered on.
为实现上述目的,本申请提供了一种数据管理装置,包括:To achieve the above objectives, the present application provides a data management device, comprising:
确定模块,用于在存储器中确定第一存储块和第二存储块;A determination module, configured to determine a first storage block and a second storage block in a memory;
划分模块,用于按照预设划分方式将第一存储块划分为第一部分和第二部分、将第二存储块划分为第三部分和第四部分;A division module, used for dividing the first storage block into a first part and a second part, and dividing the second storage block into a third part and a fourth part according to a preset division method;
记录模块,用于将目标数据记录至第一部分中的第一目标页和第二目标页、第四部分的第三目标页和第四目标页;其中,第一目标页在第一部分中的偏移与第三目标页在第四部分中的偏移相同,第二目标页在第一部分中的偏移与第四目标页在第四部分中的偏移相同。A recording module is used to record target data to a first target page and a second target page in a first part, and a third target page and a fourth target page in a fourth part; wherein an offset of the first target page in the first part is the same as an offset of the third target page in the fourth part, and an offset of the second target page in the first part is the same as an offset of the fourth target page in the fourth part.
其中,确定模块具体用于:利用高温技术筛选法在存储器中确定第一存储块和第二存储块。The determination module is specifically used to determine the first storage block and the second storage block in the memory by using a high temperature technology screening method.
其中,确定模块具体用于:向存储器中的所有存储块写入相同的目标内容;读取所有存储块的内容,通过对比读取到的内容与目标内容确定每个存储块的第一错误率;对存储器进行加热操作,读取所有存储块的内容,通过对比读取到的内容与目标内容确定每个存储块的第二错误率;将第一错误率与第二错误率相差最小的两个存储块确定为第一存储块和第二存储块。Among them, the determination module is specifically used to: write the same target content to all storage blocks in the memory; read the contents of all storage blocks, and determine the first error rate of each storage block by comparing the read content with the target content; perform a heating operation on the memory, read the contents of all storage blocks, and determine the second error rate of each storage block by comparing the read content with the target content; determine the two storage blocks with the smallest difference between the first error rate and the second error rate as the first storage block and the second storage block.
其中,确定模块具体用于:向存储器中的所有存储块写入相同的目标内容;对存储器进行加热操作,读取所有存储块的内容,通过对比读取到的内容与目标内容确定每个存储块的错误率;将错误率最低的两个存储块确定为第一存储块和第二存储块。Among them, the determination module is specifically used to: write the same target content to all storage blocks in the memory; perform a heating operation on the memory, read the contents of all storage blocks, and determine the error rate of each storage block by comparing the read content with the target content; determine the two storage blocks with the lowest error rate as the first storage block and the second storage block.
其中,记录模块具体用于:按照第一部分中的页顺序将目标数据记录至第一部分中的第一目标页和第二目标页,按照第四部分中的页顺序将目标数据记录至第四部分的第三目标页和第四目标页;其中,第二目标页为第一目标页的后一页,第四目标页为第三目标页的后一页。Among them, the recording module is specifically used to: record the target data to the first target page and the second target page in the first part according to the page order in the first part, and record the target data to the third target page and the fourth target page in the fourth part according to the page order in the fourth part; wherein the second target page is the page after the first target page, and the fourth target page is the page after the third target page.
其中,还包括:Among them, it also includes:
第一读取模块,用于当接收到目标数据的读取命令时,读取第一部分中的最后一条数据。The first reading module is used to read the last piece of data in the first part when receiving a command to read the target data.
其中,还包括:Among them, it also includes:
第二读取模块,用于若第一部分中的最后一条数据读取错误,则读取第一部分中的倒数第二条数据。 The second reading module is used to read the second to last piece of data in the first part if the last piece of data in the first part is read incorrectly.
其中,还包括:Among them, it also includes:
第三读取模块,用于若第一部分中的最后一条数据和倒数第二条数据均读取错误,则读取第四部分中的最后一条数据。The third reading module is used to read the last piece of data in the fourth part if both the last piece of data and the second to last piece of data in the first part are read incorrectly.
其中,还包括:Among them, it also includes:
第四读取模块,用于若第四部分中的最后一条数据读取错误,则读取第四部分中的倒数第二条数据。The fourth reading module is used to read the second to last piece of data in the fourth part if the last piece of data in the fourth part is read incorrectly.
其中,目标数据为存储器的管理信息,管理信息包括坏块信息、负载均衡信息、垃圾回收信息中任一项或任几项的组合。The target data is the management information of the memory, and the management information includes any one or a combination of any several of the bad block information, load balancing information, and garbage collection information.
其中,还包括:Among them, it also includes:
擦除模块,用于当第一部分写满时,擦除第一部分中的所有数据;读取第四部分中最后一条数据,将最后一条数据记录至第一部分;擦除第四部分中的所有数据,并将第一部分中的最后一条数据同步至第四部分。The erasing module is used to erase all data in the first part when the first part is full; read the last data in the fourth part and record the last data in the first part; erase all data in the fourth part and synchronize the last data in the first part to the fourth part.
其中,还包括:Among them, it also includes:
同步模块,用于第二存储块出现掉电异常,则在第二存储块上电后,将第一部分中的最后一条数据同步至第四部分。The synchronization module is used for synchronizing the last piece of data in the first part to the fourth part after the second storage block is powered on if a power failure occurs in the second storage block.
为实现上述目的,本申请提供了一种电子设备,包括:To achieve the above objectives, the present application provides an electronic device, including:
存储器,用于存储计算机程序;Memory for storing computer programs;
处理器,用于执行计算机程序时实现如上述数据管理方法的步骤。A processor is used to implement the steps of the above-mentioned data management method when executing a computer program.
为实现上述目的,本申请提供了一种非易失性可读存储介质,非易失性可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上述数据管理方法的步骤。To achieve the above objectives, the present application provides a non-volatile readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above data management method are implemented.
通过以上方案可知,本申请提供的一种数据管理方法,包括:在存储器中确定第一存储块和第二存储块;按照预设划分方式将第一存储块划分为第一部分和第二部分、将第二存储块划分为第三部分和第四部分;将目标数据记录至第一部分中的第一目标页和第二目标页、第四部分的第三目标页和第四目标页;其中,第一目标页在第一部分中的偏移与第三目标页在第四部分中的偏移相同,第二目标页在第一部分中的偏移与第四目标页在第四部分中的偏移相同。It can be seen from the above scheme that a data management method provided by the present application includes: determining a first storage block and a second storage block in a memory; dividing the first storage block into a first part and a second part, and dividing the second storage block into a third part and a fourth part according to a preset division method; recording the target data to the first target page and the second target page in the first part, and the third target page and the fourth target page in the fourth part; wherein the offset of the first target page in the first part is the same as the offset of the third target page in the fourth part, and the offset of the second target page in the first part is the same as the offset of the fourth target page in the fourth part.
本申请提供的数据管理方法,采用双block的异步记录法,不同block同序号的page同时出现UNC,也即第一存储块中的第一部分和第二存储块中的第三部分同时出现UNC时,可以基于第二存储块中的第四部分进行数据的记 录和读取。也即本申请可以保证重要的信息能够被准确记录并读取,能够最大程度的使NAND的信息及时修复,保证NAND系统不会由于信息记录的错误而瘫痪。由此可见,本申请提供的数据管理方法,提高了数据记录的准确性。本申请还公开了一种数据管理装置及一种电子设备和一种非易失性可读存储介质,同样能实现上述技术效果。The data management method provided by the present application adopts a dual-block asynchronous recording method. When UNC appears simultaneously in pages with the same sequence number in different blocks, that is, when UNC appears simultaneously in the first part of the first storage block and the third part of the second storage block, data can be recorded based on the fourth part of the second storage block. Recording and reading. That is, the present application can ensure that important information can be accurately recorded and read, can repair NAND information in a timely manner to the greatest extent, and ensure that the NAND system will not be paralyzed due to information recording errors. It can be seen that the data management method provided by the present application improves the accuracy of data recording. The present application also discloses a data management device, an electronic device, and a non-volatile readable storage medium, which can also achieve the above technical effects.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性的,并不能限制本申请。It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。附图是用来提供对本公开的进一步理解,并且构成说明书的一部分,与下面的具体实施方式一起用于解释本公开,但并不构成对本公开的限制。在附图中:In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. The drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific implementation methods, they are used to explain the present disclosure, but do not constitute a limitation to the present disclosure. In the drawings:
图1为根据一示例性实施例示出的一种数据管理方法的流程图;FIG1 is a flow chart of a data management method according to an exemplary embodiment;
图2为根据一示例性实施例示出的另一种数据管理方法的流程图;FIG2 is a flow chart of another data management method according to an exemplary embodiment;
图3为根据一示例性实施例示出的一种数据管理装置的结构图;FIG3 is a structural diagram of a data management device according to an exemplary embodiment;
图4为根据一示例性实施例示出的一种电子设备的结构图。Fig. 4 is a structural diagram of an electronic device according to an exemplary embodiment.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。另外,在本申请实施例中,“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In addition, in the embodiments of the present application, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
本申请实施例公开了一种数据管理方法,提高了数据记录的准确性。The embodiment of the present application discloses a data management method, which improves the accuracy of data recording.
参见图1,根据一示例性实施例示出的一种数据管理方法的流程图,如图1所示,包括:Referring to FIG. 1 , a flow chart of a data management method according to an exemplary embodiment is shown. As shown in FIG. 1 , the method includes:
S101:在存储器中确定第一存储块和第二存储块;S101: Determine a first storage block and a second storage block in a memory;
在本实施例中,在存储器中确定错误率较低的两个存储块作为记录目标 数据的存储块,也即第一存储块blockA和第二存储块blockB,本实施例中的存储器可以具体为NAND。在一些实施方式中,本步骤可以包括:利用高温技术筛选法在存储器中确定第一存储块和第二存储块。In this embodiment, two storage blocks with lower error rates are determined in the memory as recording targets. The data storage blocks, namely the first storage block blockA and the second storage block blockB, the memory in this embodiment may be specifically NAND. In some implementations, this step may include: using a high temperature technology screening method to determine the first storage block and the second storage block in the memory.
作为一种可行的实施方式,利用高温技术筛选法在存储器中确定第一存储块和第二存储块,包括:向存储器中的所有存储块写入相同的目标内容;对存储器进行加热操作,读取所有存储块的内容,通过对比读取到的内容与目标内容确定每个存储块的错误率;将错误率最低的两个存储块确定为第一存储块和第二存储块。As a feasible implementation method, a high temperature technology screening method is used to determine a first storage block and a second storage block in a memory, including: writing the same target content to all storage blocks in the memory; performing a heating operation on the memory, reading the contents of all storage blocks, and determining the error rate of each storage block by comparing the read content with the target content; and determining the two storage blocks with the lowest error rate as the first storage block and the second storage block.
在具体实施中,擦写整个存储器,向存储器中的所有存储块写入相同的目标内容,例如全0,尽量不使用全1,因为擦写后的NAND内容为全1,此时无法保证电压跳变最大化。将存储器放入高温箱进行若干小时的加热操作,取出存储器,对存储器进行读取操作,统计所有存储块的错误率情况,选择错误率最低的两个存储块作为第一存储块和第二存储块,分布在奇偶block上。In the specific implementation, the entire memory is erased and the same target content is written to all storage blocks in the memory, such as all 0s. All 1s are avoided as much as possible, because the NAND content after erasure is all 1s, and the voltage jump cannot be maximized at this time. The memory is placed in a high-temperature box for several hours of heating operation, the memory is taken out, and the memory is read. The error rate of all storage blocks is counted, and the two storage blocks with the lowest error rate are selected as the first storage block and the second storage block, which are distributed on the parity block.
作为另一种可行的实施方式,利用高温技术筛选法在存储器中确定第一存储块和第二存储块,包括:向存储器中的所有存储块写入相同的目标内容;读取所有存储块的内容,通过对比读取到的内容与目标内容确定每个存储块的第一错误率;对存储器进行加热操作,读取所有存储块的内容,通过对比读取到的内容与目标内容确定每个存储块的第二错误率;将第一错误率与第二错误率相差最小的两个存储块确定为第一存储块和第二存储块。As another feasible implementation, a high temperature technology screening method is used to determine a first storage block and a second storage block in a memory, including: writing the same target content to all storage blocks in the memory; reading the content of all storage blocks, and determining a first error rate of each storage block by comparing the read content with the target content; performing a heating operation on the memory, reading the content of all storage blocks, and determining a second error rate of each storage block by comparing the read content with the target content; and determining two storage blocks with the smallest difference between the first error rate and the second error rate as the first storage block and the second storage block.
在具体实施中,擦写整个存储器,向存储器中的所有存储块写入相同的目标内容,例如全0,尽量不使用全1,因为擦写后的NAND内容为全1,此时无法保证电压跳变最大化。读取整个存储器统计所有存储块的错误率情况。存储器放入高温箱进行若干小时的加热操作,取出存储器,在此对存储器进行读取操作,统计所有存储块的错误率情况,选择错误率差值最小的两个存储块作为第一存储块和第二存储块,分布在奇偶block上。In the specific implementation, the entire memory is erased and the same target content is written to all storage blocks in the memory, such as all 0s. All 1s are avoided as much as possible, because the NAND content after erasure is all 1s, and the voltage jump cannot be maximized at this time. The entire memory is read to count the error rates of all storage blocks. The memory is placed in a high-temperature box for several hours of heating operation, and the memory is taken out and read from the memory to count the error rates of all storage blocks. The two storage blocks with the smallest error rate difference are selected as the first storage block and the second storage block, which are distributed on the parity block.
S102:按照预设划分方式将第一存储块划分为第一部分和第二部分、将第二存储块划分为第三部分和第四部分;S102: dividing the first storage block into a first part and a second part, and dividing the second storage block into a third part and a fourth part according to a preset division method;
在本步骤中,将第一存储块和第二存储块按照相同的划分方式划分为两个部分,也即将第一存储块划分为第一部分和第二部分、将第二存储块划分为第三部分和第四部分。其中,第一部分、第二部分、第三部分和第四部分均包含多个页,第一部分在第一存储块中的偏移与第三部分在第二存储块中 的偏移相同,第二部分在第一存储块中的偏移与第四部分在第二存储块中的偏移相同,也即第一部分和第三部分容易同时出现UNC,第二部分和第四部分同时出现UNC。In this step, the first storage block and the second storage block are divided into two parts in the same way, that is, the first storage block is divided into the first part and the second part, and the second storage block is divided into the third part and the fourth part. The first part, the second part, the third part and the fourth part all contain multiple pages, and the offset of the first part in the first storage block is the same as the offset of the third part in the second storage block. The offset of the second part in the first storage block is the same as the offset of the fourth part in the second storage block, that is, the first part and the third part are prone to UNC at the same time, and the second part and the fourth part are prone to UNC at the same time.
S103:将目标数据记录至第一部分中的第一目标页和第二目标页、第四部分的第三目标页和第四目标页;其中,第一目标页在第一部分中的偏移与第三目标页在第四部分中的偏移相同,第二目标页在第一部分中的偏移与第四目标页在第四部分中的偏移相同。S103: Record the target data to the first target page and the second target page in the first part, and the third target page and the fourth target page in the fourth part; wherein the offset of the first target page in the first part is the same as the offset of the third target page in the fourth part, and the offset of the second target page in the first part is the same as the offset of the fourth target page in the fourth part.
在具体实施中,按照第一部分中的页顺序将目标数据记录至第一部分中的第一目标页和第二目标页,按照第四部分中的页顺序将目标数据记录至第四部分的第三目标页和第四目标页;其中,第二目标页为第一目标页的后一页,第四目标页为第三目标页的后一页。本实施例中的目标数据可以为存储器的管理信息,该管理信息可以包括坏块信息、负载均衡信息、垃圾回收信息等,本实施例不进行具体限定。In a specific implementation, the target data is recorded to the first target page and the second target page in the first part according to the page order in the first part, and the target data is recorded to the third target page and the fourth target page in the fourth part according to the page order in the fourth part; wherein the second target page is the next page of the first target page, and the fourth target page is the next page of the third target page. The target data in this embodiment may be management information of the memory, and the management information may include bad block information, load balancing information, garbage collection information, etc., which is not specifically limited in this embodiment.
对于有N个page的block来说,记录方式一般从page0开始,到page(N-1)结束。例如,blockA划分为第一部分pageA和第二部分pageB,blockB划分为第三部分pageA和第四部分pageB。为了方便记录,将所有的pageA从0开始编号,所有的pageB也从0开始编号,第i个page分别记为pageAi和pageBi。blockA内记录过程中只写pageA,blockB内只写pageB。而且,为了保证信息的可靠性,每个block在信息记录过程中,都重复写两个page。blockA的pageA(x)记录的信息=blockA的pageA(x+1)记录的信息,x为偶数序列号,blockB的pageB(x)记录的信息=blockB的pageB(x+1)记录的信息,且有:blockA的pageAi记录的信息=blockB的pageBi记录的信息。For a block with N pages, the recording method generally starts from page0 and ends at page(N-1). For example, blockA is divided into the first part pageA and the second part pageB, and blockB is divided into the third part pageA and the fourth part pageB. For the convenience of recording, all pageA are numbered from 0, and all pageB are also numbered from 0. The i-th page is recorded as pageAi and pageBi respectively. Only pageA is written in the recording process in blockA, and only pageB is written in blockB. Moreover, in order to ensure the reliability of information, two pages are repeatedly written in each block during the information recording process. The information recorded by pageA(x) of blockA = the information recorded by pageA(x+1) of blockA, x is an even serial number, and the information recorded by pageB(x) of blockB = the information recorded by pageB(x+1) of blockB, and: the information recorded by pageAi of blockA = the information recorded by pageBi of blockB.
本申请实施例提供的数据管理方法,采用双block的异步记录法,不同block同序号的page同时出现UNC,也即第一存储块中的第一部分和第二存储块中的第三部分同时出现UNC时,可以基于第二存储块中的第四部分进行数据的记录和读取。也即本申请实施例可以保证重要的信息能够被准确记录并读取,能够最大程度的使NAND的信息及时修复,保证NAND系统不会由于信息记录的错误而瘫痪。由此可见,本申请实施例提供的数据管理方法,提高了数据记录的准确性。The data management method provided in the embodiment of the present application adopts a dual-block asynchronous recording method, and UNC appears simultaneously in pages with the same sequence number in different blocks, that is, when UNC appears simultaneously in the first part of the first storage block and the third part of the second storage block, data can be recorded and read based on the fourth part of the second storage block. That is, the embodiment of the present application can ensure that important information can be accurately recorded and read, and can repair NAND information in a timely manner to the greatest extent, ensuring that the NAND system will not be paralyzed due to errors in information recording. It can be seen that the data management method provided in the embodiment of the present application improves the accuracy of data recording.
在上述实施例的基础上,在一些实施方式中,还包括:当接收到目标数据的读取命令时,读取第一部分中的最后一条数据。若第一部分中的最后一 条数据读取错误,则读取第一部分中的倒数第二条数据。若第一部分中的最后一条数据和倒数第二条数据均读取错误,则读取第四部分中的最后一条数据。若第四部分中的最后一条数据读取错误,则读取第四部分中的倒数第二条数据。Based on the above embodiment, in some implementations, the method further includes: when a read command of the target data is received, reading the last data in the first part. If the last data in the first part is read incorrectly, the second to last data in the first part is read. If the last data in the first part and the second to last data in the fourth part are both read incorrectly, the last data in the fourth part is read. If the last data in the fourth part is read incorrectly, the second to last data in the fourth part is read.
在具体实施中,读blockA的最后一条有效记录,如果不产生UNC,有效信息被得到。读blockA的最后一条有效记录,有UNC,则读取倒数第二条有效信息,不产生UNC,则获得有效信息。读取pageA的最后两条记录均为UNC;则读取blockB的最后两条记录,直到找到非UNC的记录为止。In the specific implementation, read the last valid record of blockA. If UNC is not generated, valid information is obtained. Read the last valid record of blockA. If UNC is generated, read the penultimate valid information. If UNC is not generated, valid information is obtained. Read the last two records of pageA. If both are UNC, read the last two records of blockB until a non-UNC record is found.
本申请实施例公开了一种数据管理方法,相对于上一实施例,本实施例对技术方案作了进一步的说明和优化。具体的:The embodiment of the present application discloses a data management method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically:
参见图2,根据一示例性实施例示出的另一种数据管理方法的流程图,如图2所示,包括:Referring to FIG. 2 , a flow chart of another data management method according to an exemplary embodiment is shown. As shown in FIG. 2 , the method includes:
S201:当第一部分写满时,擦除第一部分中的所有数据;S201: When the first part is full, erase all data in the first part;
S202:读取第四部分中最后一条数据,将最后一条数据记录至第一部分;S202: Read the last piece of data in the fourth part, and record the last piece of data in the first part;
S203:擦除第四部分中的所有数据,并将第一部分中的最后一条数据同步至第四部分。S203: Erasing all data in the fourth part, and synchronizing the last piece of data in the first part to the fourth part.
可以理解的是,不同的MLC(Multi-LevelCell)NAND的pageA和pageB排列并不一致,总数也会不同。当blockA中的pageA或blockB中的pageB有一方写满时,另一个block往往还没有写满。此时便要进行同步处理。例如blockA写满,则需要进行擦除动作,读取blockB的最后一条有效信息,更新到blockA的pageA0和pageAl上,此时将blockB擦除,再将blockA的有效信息同步到blockB的pageB0和pageB1上。It is understandable that the arrangement of pageA and pageB of different MLC (Multi-Level Cell) NAND is not consistent, and the total number will also be different. When pageA in blockA or pageB in blockB is full, the other block is often not full. At this time, synchronization processing is required. For example, if blockA is full, it is necessary to perform an erase operation, read the last valid information of blockB, and update it to pageA0 and pageAl of blockA. At this time, blockB is erased, and then the valid information of blockA is synchronized to pageB0 and pageB1 of blockB.
在上述实施例的基础上,在一些实施方式中,还包括:若第二存储块出现掉电异常,则在第二存储块上电后,将第一部分中的最后一条数据同步至第四部分。Based on the above embodiment, in some implementation methods, it further includes: if a power failure occurs in the second storage block, after the second storage block is powered on, the last piece of data in the first part is synchronized to the fourth part.
在具体实施中,若block A已经记录完成,block B尚未记录,出现掉电,将blockA的有效信息同步给block B即可。其他情况下,如果发生掉电,重启后读取的均是block A的最后一条有效记录。In the specific implementation, if block A has been recorded and block B has not been recorded, and a power outage occurs, the valid information of block A can be synchronized to block B. In other cases, if a power outage occurs, the last valid record of block A is read after restart.
下面介绍本申请提供的一种应用实施例,以L06B NAND进行说明,其包括512个block,单个block有256个页。The following introduces an application embodiment provided by the present application, which is illustrated by L06B NAND, which includes 512 blocks, and a single block has 256 pages.
步骤一:高温筛选块,将所有的块(除去坏块和block0,block1)写入 0x00,读出此时每个block的BER(Bit Error Ratio,比特出错概率),放入高温箱85度左右大概一天的时间,重新读取每个block的BER,从中选出错误率较低的两个block,即blockA,blockB,测试中选取的是block9,block20。Step 1: High-temperature filter blocks, write all blocks (except bad blocks and block0, block1) 0x00, read the BER (Bit Error Ratio) of each block at this time, put it in a high temperature box at about 85 degrees for about a day, re-read the BER of each block, and select the two blocks with lower error rate, namely blockA and blockB. Block9 and block20 are selected in the test.
步骤二:blockA只写pageA,遇到PageB,便填充全1,blockB只写pageB,遇到pageA,填充全1;每一条有效信息对于两个block都会重复两次,即有效信息实际上记录了四次。Step 2: blockA only writes pageA. When it encounters pageB, it fills it with all 1s. blockB only writes pageB. When it encounters pageA, it fills it with all 1s. Each valid information will be repeated twice for the two blocks, that is, the valid information is actually recorded four times.
步骤三:blockA写满,擦除blockA,将blockB的信息同步给blockA,然后,擦blockB,同步blockA的有效信息到blockB上。Step 3: When blockA is full, erase blockA and synchronize the information of blockB to blockA. Then, erase blockB and synchronize the valid information of blockA to blockB.
进行以下几种情况的测试,保证能够得到准确数据:Conduct the following tests to ensure accurate data:
1、记录单条信息,读取blockA pageA0和pageA1,blockB pageB0和pageB1,对比内容,一致;1. Record a single piece of information, read blockA pageA0 and pageA1, blockB pageB0 and pageB1, compare the contents, and they are consistent;
2、进行数据读取,blockA的pageA1返回错误,则读pageA0获取记录。2. Read data. If pageA1 of blockA returns an error, read pageA0 to obtain the record.
3、blockA的两条记录均有错,从blockB的pageB0或者pageB1能读取有效记录。3. Both records in blockA are wrong. Valid records can be read from pageB0 or pageB1 of blockB.
4、掉电情况的异常处理。4. Exception handling of power failure.
本申请使用的高温块筛选法,双block的异步记录法,以及block写满后的同步化处理,都是为了保证重要的信息能够被准确记录,并读取;在任意一方数据丢失的情况下,能够从对方块提取有效信息,甚至是在出现掉电等各类异常情况下,能够最大程度的使NAND的信息及时修复,保证NAND系统不会由于信息记录的错误而瘫痪。从block的筛选阶段到信息的记录过程,都最大限度的增强block的健壮性和记录的准确性。不仅解决因页同步出错导致的信息记录错误,还会避免掉电导致的信息丢失等问题。在实际开发或者测试过程中,若需要进行信息实时记录,更新或者恢复,可以借鉴上述方法,选择块间横向,块内纵向记录法,保证同时有四条有效记录,可以从一方内或者多方中得到正确的数据。The high-temperature block screening method, the dual-block asynchronous recording method, and the synchronization processing after the block is full used in this application are all to ensure that important information can be accurately recorded and read; in the event of data loss on either side, valid information can be extracted from the other block, and even in various abnormal situations such as power failure, the NAND information can be repaired in time to the greatest extent, ensuring that the NAND system will not be paralyzed due to information recording errors. From the block screening stage to the information recording process, the robustness of the block and the accuracy of the record are enhanced to the maximum extent. Not only does it solve the information recording errors caused by page synchronization errors, it also avoids problems such as information loss caused by power failure. In the actual development or testing process, if real-time recording, updating or recovery of information is required, the above method can be used as a reference, and the horizontal recording method between blocks and the vertical recording method within the block can be selected to ensure that there are four valid records at the same time, and correct data can be obtained from one party or multiple parties.
下面对本申请实施例提供的一种数据管理装置进行介绍,下文描述的一种数据管理装置与上文描述的一种数据管理方法可以相互参照。A data management device provided in an embodiment of the present application is introduced below. The data management device described below and the data management method described above can be referenced to each other.
参见图3,根据一示例性实施例示出的一种数据管理装置的结构图,如图3所示,包括:Referring to FIG. 3 , a structural diagram of a data management device according to an exemplary embodiment is shown. As shown in FIG. 3 , the device includes:
确定模块301,用于在存储器中确定第一存储块和第二存储块;A determination module 301, configured to determine a first storage block and a second storage block in a memory;
在本实施例中,在存储器中确定错误率较低的两个存储块作为记录目标 数据的存储块,也即第一存储块blockA和第二存储块blockB,本实施例中的存储器可以具体为NAND。在一些实施方式中,利用高温技术筛选法在存储器中确定第一存储块和第二存储块。In this embodiment, two storage blocks with lower error rates are determined in the memory as recording targets. The data storage blocks, namely the first storage block blockA and the second storage block blockB, the memory in this embodiment may be specifically NAND. In some implementations, the first storage block and the second storage block are determined in the memory using a high temperature technology screening method.
作为一种可行的实施方式,向存储器中的所有存储块写入相同的目标内容;对存储器进行加热操作,读取所有存储块的内容,通过对比读取到的内容与目标内容确定每个存储块的错误率;将错误率最低的两个存储块确定为第一存储块和第二存储块。As a feasible implementation method, the same target content is written to all storage blocks in the memory; the memory is heated, the contents of all storage blocks are read, and the error rate of each storage block is determined by comparing the read content with the target content; the two storage blocks with the lowest error rate are determined as the first storage block and the second storage block.
在具体实施中,擦写整个存储器,向存储器中的所有存储块写入相同的目标内容,例如全0,尽量不使用全1,因为擦写后的NAND内容为全1,此时无法保证电压跳变最大化。将存储器放入高温箱进行若干小时的加热操作,取出存储器,对存储器进行读取操作,统计所有存储块的错误率情况,选择错误率最低的两个存储块作为第一存储块和第二存储块,分布在奇偶block上。In the specific implementation, the entire memory is erased and the same target content is written to all storage blocks in the memory, such as all 0s. All 1s are avoided as much as possible, because the NAND content after erasure is all 1s, and the voltage jump cannot be maximized at this time. The memory is placed in a high-temperature box for several hours of heating operation, the memory is taken out, and the memory is read. The error rate of all storage blocks is counted, and the two storage blocks with the lowest error rate are selected as the first storage block and the second storage block, which are distributed on the parity block.
作为另一种可行的实施方式,向存储器中的所有存储块写入相同的目标内容;读取所有存储块的内容,通过对比读取到的内容与目标内容确定每个存储块的第一错误率;对存储器进行加热操作,读取所有存储块的内容,通过对比读取到的内容与目标内容确定每个存储块的第二错误率;将第一错误率与第二错误率相差最小的两个存储块确定为第一存储块和第二存储块。As another feasible implementation, the same target content is written to all storage blocks in the memory; the content of all storage blocks is read, and a first error rate of each storage block is determined by comparing the read content with the target content; a heating operation is performed on the memory, the content of all storage blocks is read, and a second error rate of each storage block is determined by comparing the read content with the target content; and the two storage blocks with the smallest difference between the first error rate and the second error rate are determined as the first storage block and the second storage block.
在具体实施中,擦写整个存储器,向存储器中的所有存储块写入相同的目标内容,例如全0,尽量不使用全1,因为擦写后的NAND内容为全1,此时无法保证电压跳变最大化。读取整个存储器统计所有存储块的错误率情况。存储器放入高温箱进行若干小时的加热操作,取出存储器,在此对存储器进行读取操作,统计所有存储块的错误率情况,选择错误率差值最小的两个存储块作为第一存储块和第二存储块,分布在奇偶block上。In the specific implementation, the entire memory is erased and the same target content is written to all storage blocks in the memory, such as all 0s. All 1s are avoided as much as possible, because the NAND content after erasure is all 1s, and the voltage jump cannot be maximized at this time. The entire memory is read to count the error rates of all storage blocks. The memory is placed in a high-temperature box for several hours of heating operation, and the memory is taken out and read from the memory to count the error rates of all storage blocks. The two storage blocks with the smallest error rate difference are selected as the first storage block and the second storage block, which are distributed on the parity block.
划分模块302,用于按照预设划分方式将第一存储块划分为第一部分和第二部分、将第二存储块划分为第三部分和第四部分;A division module 302, configured to divide the first storage block into a first part and a second part, and divide the second storage block into a third part and a fourth part according to a preset division method;
在具体实施中,将第一存储块和第二存储块按照相同的划分方式划分为两个部分,也即将第一存储块划分为第一部分和第二部分、将第二存储块划分为第三部分和第四部分。其中,第一部分、第二部分、第三部分和第四部分均包含多个页,第一部分在第一存储块中的偏移与第三部分在第二存储块中的偏移相同,第二部分在第一存储块中的偏移与第四部分在第二存储块中的偏移相同,也即第一部分和第三部分容易同时出现UNC,第二部分和第四 部分同时出现UNC。In a specific implementation, the first storage block and the second storage block are divided into two parts in the same way, that is, the first storage block is divided into the first part and the second part, and the second storage block is divided into the third part and the fourth part. The first part, the second part, the third part and the fourth part all contain multiple pages, the offset of the first part in the first storage block is the same as the offset of the third part in the second storage block, and the offset of the second part in the first storage block is the same as the offset of the fourth part in the second storage block, that is, the first part and the third part are prone to have UNC at the same time, and the second part and the fourth part are prone to have UNC at the same time. Some UNCs also appear.
记录模块303,用于将目标数据记录至第一部分中的第一目标页和第二目标页、第四部分的第三目标页和第四目标页;其中,第一目标页在第一部分中的偏移与第三目标页在第四部分中的偏移相同,第二目标页在第一部分中的偏移与第四目标页在第四部分中的偏移相同。The recording module 303 is used to record the target data to the first target page and the second target page in the first part, and the third target page and the fourth target page in the fourth part; wherein the offset of the first target page in the first part is the same as the offset of the third target page in the fourth part, and the offset of the second target page in the first part is the same as the offset of the fourth target page in the fourth part.
在具体实施中,按照第一部分中的页顺序将目标数据记录至第一部分中的第一目标页和第二目标页,按照第四部分中的页顺序将目标数据记录至第四部分的第三目标页和第四目标页;其中,第二目标页为第一目标页的后一页,第四目标页为第三目标页的后一页。本实施例中的目标数据可以为存储器的管理信息,该管理信息可以包括坏块信息、负载均衡信息、垃圾回收信息等,本实施例不进行具体限定。In a specific implementation, the target data is recorded to the first target page and the second target page in the first part according to the page order in the first part, and the target data is recorded to the third target page and the fourth target page in the fourth part according to the page order in the fourth part; wherein the second target page is the next page of the first target page, and the fourth target page is the next page of the third target page. The target data in this embodiment may be management information of the memory, and the management information may include bad block information, load balancing information, garbage collection information, etc., which is not specifically limited in this embodiment.
对于有N个page的block来说,记录方式一般从page0开始,到page(N-1)结束。例如,blockA划分为第一部分pageA和第二部分pageB,blockB划分为第三部分pageA和第四部分pageB。为了方便记录,将所有的pageA从0开始编号,所有的pageB也从0开始编号,第i个page分别记为pageAi和pageBi。blockA内记录过程中只写pageA,blockB内只写pageB。而且,为了保证信息的可靠性,每个block在信息记录过程中,都重复写两个page。blockA的pageA(x)记录的信息=blockA的pageA(x+1)记录的信息,x为偶数序列号,blockB的pageB(x)记录的信息=blockB的pageB(x+1)记录的信息,且有:blockA的pageAi记录的信息=blockB的pageBi记录的信息。For a block with N pages, the recording method generally starts from page0 and ends at page(N-1). For example, blockA is divided into the first part pageA and the second part pageB, and blockB is divided into the third part pageA and the fourth part pageB. For the convenience of recording, all pageA are numbered from 0, and all pageB are also numbered from 0. The i-th page is recorded as pageAi and pageBi respectively. Only pageA is written in the recording process in blockA, and only pageB is written in blockB. Moreover, in order to ensure the reliability of information, two pages are repeatedly written in each block during the information recording process. The information recorded by pageA(x) of blockA = the information recorded by pageA(x+1) of blockA, x is an even serial number, and the information recorded by pageB(x) of blockB = the information recorded by pageB(x+1) of blockB, and: the information recorded by pageAi of blockA = the information recorded by pageBi of blockB.
本申请实施例提供的数据管理装置,采用双block的异步记录法,不同block同序号的page同时出现UNC,也即第一存储块中的第一部分和第二存储块中的第三部分同时出现UNC时,可以基于第二存储块中的第四部分进行数据的记录和读取。也即本申请实施例可以保证重要的信息能够被准确记录并读取,能够最大程度的使NAND的信息及时修复,保证NAND系统不会由于信息记录的错误而瘫痪。由此可见,本申请实施例提供的数据管理装置,提高了数据记录的准确性。The data management device provided in the embodiment of the present application adopts a dual-block asynchronous recording method, and UNC appears simultaneously in pages with the same sequence number in different blocks, that is, when UNC appears simultaneously in the first part of the first storage block and the third part of the second storage block, data can be recorded and read based on the fourth part of the second storage block. That is, the embodiment of the present application can ensure that important information can be accurately recorded and read, and can repair NAND information in a timely manner to the greatest extent, ensuring that the NAND system will not be paralyzed due to errors in information recording. It can be seen that the data management device provided in the embodiment of the present application improves the accuracy of data recording.
在上述实施例的基础上,在一些实施方式中,确定模块301具体用于:利用高温技术筛选法在存储器中确定第一存储块和第二存储块。Based on the above embodiment, in some implementation modes, the determination module 301 is specifically used to: determine the first storage block and the second storage block in the memory by using a high temperature technology screening method.
在上述实施例的基础上,在一些实施方式中,确定模块301具体用于:向存储器中的所有存储块写入相同的目标内容;读取所有存储块的内容,通 过对比读取到的内容与目标内容确定每个存储块的第一错误率;对存储器进行加热操作,读取所有存储块的内容,通过对比读取到的内容与目标内容确定每个存储块的第二错误率;将第一错误率与第二错误率相差最小的两个存储块确定为第一存储块和第二存储块。Based on the above embodiment, in some implementation modes, the determination module 301 is specifically used to: write the same target content to all storage blocks in the memory; read the content of all storage blocks, The first error rate of each storage block is determined by comparing the read content with the target content; a heating operation is performed on the memory to read the contents of all storage blocks, and the second error rate of each storage block is determined by comparing the read content with the target content; and two storage blocks with the smallest difference between the first error rate and the second error rate are determined as the first storage block and the second storage block.
在上述实施例的基础上,在一些实施方式中,确定模块301具体用于:向存储器中的所有存储块写入相同的目标内容;对存储器进行加热操作,读取所有存储块的内容,通过对比读取到的内容与目标内容确定每个存储块的错误率;将错误率最低的两个存储块确定为第一存储块和第二存储块。Based on the above embodiments, in some implementation schemes, the determination module 301 is specifically used to: write the same target content to all storage blocks in the memory; perform a heating operation on the memory, read the contents of all storage blocks, and determine the error rate of each storage block by comparing the read content with the target content; determine the two storage blocks with the lowest error rate as the first storage block and the second storage block.
在上述实施例的基础上,在一些实施方式中,记录模块303具体用于:按照第一部分中的页顺序将目标数据记录至第一部分中的第一目标页和第二目标页,按照第四部分中的页顺序将目标数据记录至第四部分的第三目标页和第四目标页;其中,第二目标页为第一目标页的后一页,第四目标页为第三目标页的后一页。Based on the above embodiments, in some implementations, the recording module 303 is specifically used to: record the target data to the first target page and the second target page in the first part according to the page order in the first part, and record the target data to the third target page and the fourth target page in the fourth part according to the page order in the fourth part; wherein the second target page is the page after the first target page, and the fourth target page is the page after the third target page.
在上述实施例的基础上,在一些实施方式中,还包括:Based on the above embodiments, in some implementations, the following further includes:
第一读取模块,用于当接收到目标数据的读取命令时,读取第一部分中的最后一条数据。The first reading module is used to read the last piece of data in the first part when receiving a command to read the target data.
在上述实施例的基础上,在一些实施方式中,还包括:Based on the above embodiments, in some implementations, the following further includes:
第二读取模块,用于若第一部分中的最后一条数据读取错误,则读取第一部分中的倒数第二条数据。The second reading module is used to read the second to last piece of data in the first part if the last piece of data in the first part is read incorrectly.
在上述实施例的基础上,在一些实施方式中,还包括:Based on the above embodiments, in some implementations, the following further includes:
第三读取模块,用于若第一部分中的最后一条数据和倒数第二条数据均读取错误,则读取第四部分中的最后一条数据。The third reading module is used to read the last piece of data in the fourth part if both the last piece of data and the second to last piece of data in the first part are read incorrectly.
在上述实施例的基础上,在一些实施方式中,还包括:Based on the above embodiments, in some implementations, the following further includes:
第四读取模块,用于若第四部分中的最后一条数据读取错误,则读取第四部分中的倒数第二条数据。The fourth reading module is used to read the second to last piece of data in the fourth part if the last piece of data in the fourth part is read incorrectly.
在具体实施中,读blockA的最后一条有效记录,如果不产生UNC,有效信息被得到。读blockA的最后一条有效记录,有UNC,则读取倒数第二条有效信息,不产生UNC,则获得有效信息。读取pageA的最后两条记录均为UNC;则读取blockB的最后两条记录,直到找到非UNC的记录为止。In the specific implementation, read the last valid record of blockA. If UNC is not generated, valid information is obtained. Read the last valid record of blockA. If UNC is generated, read the penultimate valid information. If UNC is not generated, valid information is obtained. Read the last two records of pageA. If both are UNC, read the last two records of blockB until a non-UNC record is found.
在上述实施例的基础上,在一些实施方式中,目标数据为存储器的管理信息,管理信息包括坏块信息、负载均衡信息、垃圾回收信息中任一项或任 几项的组合。Based on the above embodiments, in some implementations, the target data is management information of the memory, and the management information includes any one or any one of bad block information, load balancing information, and garbage collection information. A combination of several items.
在上述实施例的基础上,在一些实施方式中,还包括:Based on the above embodiments, in some implementations, the following further includes:
擦除模块,用于当第一部分写满时,擦除第一部分中的所有数据;读取第四部分中最后一条数据,将最后一条数据记录至第一部分;擦除第四部分中的所有数据,并将第一部分中的最后一条数据同步至第四部分。The erasing module is used to erase all data in the first part when the first part is full; read the last data in the fourth part and record the last data in the first part; erase all data in the fourth part and synchronize the last data in the first part to the fourth part.
可以理解的是,不同的MLC NAND的pageA和pageB排列并不一致,总数也会不同。当blockA中的pageA或blockB中的pageB有一方写满时,另一个block往往还没有写满。此时便要进行同步处理。例如blockA写满,则需要进行擦除动作,读取blockB的最后一条有效信息,更新到blockA的pageA0和pageA1上,此时将blockB擦除,再将blockA的有效信息同步到blockB的pageB0和pageB1上。It is understandable that the arrangement of pageA and pageB of different MLC NAND is not consistent, and the total number will also be different. When pageA in blockA or pageB in blockB is full, the other block is often not full. At this time, synchronization processing is required. For example, if blockA is full, it is necessary to perform an erase operation, read the last valid information of blockB, and update it to pageA0 and pageA1 of blockA. At this time, blockB is erased, and then the valid information of blockA is synchronized to pageB0 and pageB1 of blockB.
在上述实施例的基础上,在一些实施方式中,还包括:Based on the above embodiments, in some implementations, the following further includes:
同步模块,用于第二存储块出现掉电异常,则在第二存储块上电后,将第一部分中的最后一条数据同步至第四部分。The synchronization module is used for synchronizing the last piece of data in the first part to the fourth part after the second storage block is powered on if a power failure occurs in the second storage block.
在具体实施中,若blockA已经记录完成,block B尚未记录,出现掉电,将blockA的有效信息同步给block B即可。其他情况下,如果发生掉电,重启后读取的均是block A的最后一条有效记录。In the specific implementation, if block A has been recorded and block B has not been recorded, and a power outage occurs, the valid information of block A can be synchronized to block B. In other cases, if a power outage occurs, the last valid record of block A is read after restart.
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
基于上述程序模块的硬件实现,且为了实现本申请实施例的方法,本申请实施例还提供了一种电子设备,图4为根据一示例性实施例示出的一种电子设备的结构图,如图4所示,电子设备包括:Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiment of the present application, the embodiment of the present application further provides an electronic device. FIG4 is a structural diagram of an electronic device according to an exemplary embodiment. As shown in FIG4, the electronic device includes:
通信接口1,能够与其它设备比如网络设备等进行信息交互;Communication interface 1, capable of exchanging information with other devices such as network devices;
处理器2,与通信接口1连接,以实现与其它设备进行信息交互,用于运行计算机程序时,执行上述一个或多个技术方案提供的数据管理方法。而计算机程序存储在存储器3上。The processor 2 is connected to the communication interface 1 to realize information exchange with other devices and is used to execute the data management method provided by one or more technical solutions when running the computer program. The computer program is stored in the memory 3.
当然,实际应用时,电子设备中的各个组件通过总线系统4耦合在一起。可理解,总线系统4用于实现这些组件之间的连接通信。总线系统4除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图4中将各种总线都标为总线系统4。 Of course, in actual application, the various components in the electronic device are coupled together through the bus system 4. It can be understood that the bus system 4 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 4 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are marked as the bus system 4 in FIG. 4.
本申请实施例中的存储器3用于存储各种类型的数据以支持电子设备的操作。这些数据的示例包括:用于在电子设备上操作的任何计算机程序。The memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program used to operate on the electronic device.
可以理解,存储器3可以是易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(ROM,Read Only Memory)、可编程只读存储器(PROM,Programmable Read-Only Memory)、可擦除可编程只读存储器(EPROM,Erasable Programmable Read-Only Memory)、电可擦除可编程只读存储器(EEPROM,Electrically Erasable Programmable Read-Only Memory)、磁性随机存取存储器(FRAM,ferromagnetic random access memory)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory);磁表面存储器可以是磁盘存储器或磁带存储器。易失性存储器可以是随机存取存储器(RAM,Random Access Memory),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(SRAM,Static Random Access Memory)、同步静态随机存取存储器(SSRAM,Synchronous Static Random Access Memory)、动态随机存取存储器(DRAM,Dynamic Random Access Memory)、同步动态随机存取存储器(SDRAM,Synchronous Dynamic Random Access Memory)、双倍数据速率同步动态随机存取存储器(DDRSDRAM,Double Data Rate Synchronous Dynamic Random Access Memory)、增强型同步动态随机存取存储器(ESDRAM,Enhanced Synchronous Dynamic Random Access Memory)、同步连接动态随机存取存储器(SLDRAM,SyncLink Dynamic Random Access Memory)、直接内存总线随机存取存储器(DRRAM,Direct Rambus Random Access Memory)。本申请实施例描述的存储器3旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the memory 3 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), direct memory bus random access memory (DRRAM). The memory 3 described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memory.
上述本申请实施例揭示的方法可以应用于处理器2中,或者由处理器2实现。处理器2可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器2中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器2可以是通用处理器、DSP,或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。处理器2可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本申请实施例所公开的方 法的步骤,可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于非易失性可读存储介质中,该非易失性可读存储介质位于存储器3,处理器2读取存储器3中的程序,结合其硬件完成前述方法的步骤。The method disclosed in the above-mentioned embodiment of the present application can be applied to processor 2, or implemented by processor 2. Processor 2 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above-mentioned method can be completed by an integrated logic circuit of hardware in processor 2 or instructions in software form. The above-mentioned processor 2 can be a general-purpose processor, DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 2 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. In combination with the method disclosed in the embodiments of the present application The steps of the method can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a non-volatile readable storage medium, which is located in the memory 3. The processor 2 reads the program in the memory 3 and completes the steps of the aforementioned method in combination with its hardware.
处理器2执行程序时实现本申请实施例的各个方法中的相应流程,为了简洁,在此不再赘述。When the processor 2 executes the program, the corresponding processes in each method of the embodiment of the present application are implemented, which will not be described here for the sake of brevity.
在示例性实施例中,本申请实施例还提供了一种存储介质,即计算机存储介质,具体为非易失性可读存储介质,例如包括存储计算机程序的存储器3,上述计算机程序可由处理器2执行,以完成前述方法步骤。非易失性可读存储介质可以是FRAM、ROM、PROM、EPROM、EEPROM、Flash Memory、磁表面存储器、光盘、CD-ROM等存储器。In an exemplary embodiment, the present application also provides a storage medium, namely a computer storage medium, specifically a non-volatile readable storage medium, for example, a memory 3 storing a computer program, and the above-mentioned computer program can be executed by a processor 2 to complete the above-mentioned method steps. The non-volatile readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, CD-ROM, etc.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一非易失性可读存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的非易失性可读存储介质包括:移动存储设备、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a non-volatile readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned non-volatile readable storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
或者,本申请上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个非易失性可读存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个非易失性可读存储介质中,包括若干指令用以使得一台电子设备(可以是个人计算机、服务器、网络设备等)执行本申请各个实施例方法的全部或部分。而前述的非易失性可读存储介质包括:移动存储设备、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a non-volatile readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a non-volatile readable storage medium, including a number of instructions to enable an electronic device (which can be a personal computer, server, network device, etc.) to execute all or part of the methods of each embodiment of the present application. The aforementioned non-volatile readable storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
以上,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。 The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims (20)

  1. 一种数据管理方法,其中,包括:A data management method, comprising:
    在存储器中确定第一存储块和第二存储块;Determining a first storage block and a second storage block in a memory;
    按照预设划分方式将所述第一存储块划分为第一部分和第二部分、将所述第二存储块划分为第三部分和第四部分;Dividing the first storage block into a first part and a second part, and dividing the second storage block into a third part and a fourth part according to a preset division method;
    将目标数据记录至所述第一部分中的第一目标页和第二目标页、所述第四部分的第三目标页和第四目标页;其中,所述第一目标页在所述第一部分中的偏移与所述第三目标页在所述第四部分中的偏移相同,所述第二目标页在所述第一部分中的偏移与所述第四目标页在所述第四部分中的偏移相同。The target data is recorded to the first target page and the second target page in the first part, and the third target page and the fourth target page in the fourth part; wherein the offset of the first target page in the first part is the same as the offset of the third target page in the fourth part, and the offset of the second target page in the first part is the same as the offset of the fourth target page in the fourth part.
  2. 根据权利要求1所述数据管理方法,其中,所述在存储器中确定第一存储块和第二存储块,包括:The data management method according to claim 1, wherein determining the first storage block and the second storage block in the memory comprises:
    利用高温技术筛选法在存储器中确定第一存储块和第二存储块。A first memory block and a second memory block are determined in a memory using a high temperature technology screening method.
  3. 根据权利要求2所述数据管理方法,其中,所述利用高温技术筛选法在存储器中确定第一存储块和第二存储块,包括:According to the data management method of claim 2, wherein the step of determining the first storage block and the second storage block in the memory by using the high temperature technology screening method comprises:
    向存储器中的所有存储块写入相同的目标内容;Writing the same target content to all storage blocks in the memory;
    读取所述所有所述存储块的内容,通过对比读取到的内容与所述目标内容确定每个所述存储块的第一错误率;Reading the contents of all the storage blocks, and determining a first error rate of each storage block by comparing the read contents with the target contents;
    对所述存储器进行加热操作,读取所有所述存储块的内容,通过对比读取到的内容与所述目标内容确定每个所述存储块的第二错误率;Performing a heating operation on the memory, reading the contents of all the storage blocks, and determining a second error rate of each of the storage blocks by comparing the read contents with the target contents;
    将所述第一错误率与所述第二错误率相差最小的两个存储块确定为第一存储块和第二存储块。The two storage blocks having the smallest difference between the first error rate and the second error rate are determined as the first storage block and the second storage block.
  4. 根据权利要求2所述数据管理方法,其中,所述利用高温技术筛选法在存储器中确定第一存储块和第二存储块,包括:According to the data management method of claim 2, wherein the step of determining the first storage block and the second storage block in the memory by using the high temperature technology screening method comprises:
    向存储器中的所有存储块写入相同的目标内容;Writing the same target content to all storage blocks in the memory;
    对所述存储器进行加热操作,读取所有所述存储块的内容,通过对比读取到的内容与所述目标内容确定每个所述存储块的错误率;Performing a heating operation on the memory, reading the contents of all the storage blocks, and determining the error rate of each storage block by comparing the read contents with the target contents;
    将所述错误率最低的两个存储块确定为第一存储块和第二存储块。The two storage blocks with the lowest error rates are determined as the first storage block and the second storage block.
  5. 根据权利要求1所述数据管理方法,其中,所述第一部分、所述第二部分、所述第三部分和所述第四部分均包含多个页,所述第一部分在所述第一存储块中的偏移与所述第三部分在所述第二存储块中的偏移相同,所述第 二部分在所述第一存储块中的偏移与所述第四部分在所述第二存储块中的偏移相同。The data management method according to claim 1, wherein the first part, the second part, the third part and the fourth part each include multiple pages, the offset of the first part in the first storage block is the same as the offset of the third part in the second storage block, The offset of the second part in the first storage block is the same as the offset of the fourth part in the second storage block.
  6. 根据权利要求1所述数据管理方法,其中,所述将目标数据记录至所述第一部分中的第一目标页和第二目标页、所述第四部分的第三目标页和第四目标页,包括:According to the data management method of claim 1, wherein recording the target data to the first target page and the second target page in the first part and the third target page and the fourth target page in the fourth part comprises:
    按照所述第一部分中的页顺序将目标数据记录至所述第一部分中的第一目标页和第二目标页,按照所述第四部分中的页顺序将目标数据记录至所述第四部分的第三目标页和第四目标页;其中,所述第二目标页为所述第一目标页的后一页,所述第四目标页为所述第三目标页的后一页。The target data is recorded to the first target page and the second target page in the first part according to the page order in the first part, and the target data is recorded to the third target page and the fourth target page in the fourth part according to the page order in the fourth part; wherein the second target page is the next page of the first target page, and the fourth target page is the next page of the third target page.
  7. 根据权利要求6所述数据管理方法,其中,所述按照所述第一部分中的页顺序将目标数据记录至所述第一部分中的第一目标页和第二目标页,按照所述第四部分中的页顺序将目标数据记录至所述第四部分的第三目标页和第四目标页之后,还包括:The data management method according to claim 6, wherein the step of recording the target data to the first target page and the second target page in the first part according to the page order in the first part, and recording the target data to the third target page and the fourth target page in the fourth part according to the page order in the fourth part, further comprises:
    当接收到所述目标数据的读取命令时,读取所述第一部分中的最后一条数据。When a command to read the target data is received, the last piece of data in the first part is read.
  8. 根据权利要求7所述数据管理方法,其中,所述读取所述第一部分中的最后一条数据之后,还包括:The data management method according to claim 7, wherein after reading the last piece of data in the first part, the method further comprises:
    若所述第一部分中的最后一条数据读取错误,则读取所述第一部分中的倒数第二条数据。If the last piece of data in the first part is read incorrectly, the second to last piece of data in the first part is read.
  9. 根据权利要求8所述数据管理方法,其中,所述读取所述第一部分中的倒数第二条数据之后,还包括:The data management method according to claim 8, wherein after reading the second to last piece of data in the first part, the method further comprises:
    若所述第一部分中的最后一条数据和倒数第二条数据均读取错误,则读取所述第四部分中的最后一条数据。If both the last piece of data and the second to last piece of data in the first part are read incorrectly, the last piece of data in the fourth part is read.
  10. 根据权利要求9所述数据管理方法,其中,所述读取所述第四部分中的最后一条数据之后,还包括:The data management method according to claim 9, wherein after reading the last piece of data in the fourth part, the method further comprises:
    若所述第四部分中的最后一条数据读取错误,则读取所述第四部分中的倒数第二条数据。If the last piece of data in the fourth part is read incorrectly, the second to last piece of data in the fourth part is read.
  11. 根据权利要求1所述数据管理方法,其中,所述目标数据为所述存储器的管理信息,所述管理信息包括坏块信息、负载均衡信息、垃圾回收信息中任一项或任几项的组合。 According to the data management method of claim 1, wherein the target data is management information of the memory, and the management information includes any one or a combination of any several of bad block information, load balancing information, and garbage collection information.
  12. 根据权利要求1所述数据管理方法,其中,所述将目标数据记录至所述第一部分中的第一目标页和第二目标页、所述第四部分的第三目标页和第四目标页之后,还包括:According to the data management method of claim 1, wherein after recording the target data to the first target page and the second target page in the first part and the third target page and the fourth target page in the fourth part, it further comprises:
    当所述第一部分写满时,擦除所述第一部分中的所有数据;When the first part is full, erasing all data in the first part;
    读取所述第四部分中最后一条数据,将所述最后一条数据记录至所述第一部分;Read the last piece of data in the fourth part, and record the last piece of data in the first part;
    擦除所述第四部分中的所有数据,并将所述第一部分中的最后一条数据同步至所述第四部分。All data in the fourth part are erased, and the last piece of data in the first part is synchronized to the fourth part.
  13. 根据权利要求1所述数据管理方法,其中,将所述目标数据记录至所述第一部分中的第一目标页和第二目标页之后,将所述目标数据记录至所述第四部分的第三目标页和第四目标页之前,还包括:According to the data management method of claim 1, wherein after recording the target data to the first target page and the second target page in the first part and before recording the target data to the third target page and the fourth target page in the fourth part, the method further comprises:
    若所述第二存储块出现掉电异常,则在所述第二存储块上电后,将所述第一部分中的最后一条数据同步至所述第四部分。If a power failure exception occurs in the second storage block, after the second storage block is powered on, the last piece of data in the first part is synchronized to the fourth part.
  14. 根据权利要求1所述数据管理方法,其中,所述存储器为NAND。The data management method according to claim 1, wherein the memory is NAND.
  15. 根据权利要求1所述数据管理方法,其中,所述按照预设划分方式将所述第一存储块划分为第一部分和第二部分、将所述第二存储块划分为第三部分和第四部分,包括:According to the data management method of claim 1, wherein the step of dividing the first storage block into the first part and the second part and dividing the second storage block into the third part and the fourth part according to a preset division method comprises:
    所述第一存储块为blockA,所述第二存储块为blockB,将所述blockA划分为第一部分pageA和第二部分pageB,将所述blockB划分为第三部分pageA和第四部分pageB,其中,将所述第一部分pageA和所述第三部分pageA从0开始编号,所述第二部分pageB和所述第四部分pageB也从0开始编号,第i个page分别记为pageAi和pageBi,所述blockA内记录过程中只写pageA,所述blockB内只写pageB。The first storage block is blockA, the second storage block is blockB, blockA is divided into a first part pageA and a second part pageB, and blockB is divided into a third part pageA and a fourth part pageB, wherein the first part pageA and the third part pageA are numbered from 0, the second part pageB and the fourth part pageB are also numbered from 0, the i-th page is respectively recorded as pageAi and pageBi, only pageA is written in the recording process in blockA, and only pageB is written in blockB.
  16. 根据权利要求15所述数据管理方法,其中,所述blockA的pageA(x)记录的信息等于所述blockA的pageA(x+1)记录的信息,x为偶数序列号,所述blockB的pageB(x)记录的信息等于所述blockB的pageB(x+1)记录的信息,且有:所述blockA的pageAi记录的信息等于所述blockB的pageBi记录的信息。According to the data management method of claim 15, the information recorded in pageA(x) of blockA is equal to the information recorded in pageA(x+1) of blockA, x is an even serial number, the information recorded in pageB(x) of blockB is equal to the information recorded in pageB(x+1) of blockB, and: the information recorded in pageAi of blockA is equal to the information recorded in pageBi of blockB.
  17. 根据权利要求15所述数据管理方法,其中,所述将目标数据记录至所述第一部分中的第一目标页和第二目标页、所述第四部分的第三目标页和 第四目标页之后,还包括:The data management method according to claim 15, wherein the target data is recorded in the first target page and the second target page in the first part, the third target page and the After the fourth target page, it also includes:
    所述blockA写满,则进行擦除动作,读取所述blockB的最后一条有效信息,更新到所述blockA的pageA0和pageA1上,此时将所述blockB擦除,再将所述blockA的有效信息同步到所述blockB的pageB0和pageB1上。When blockA is full, an erase operation is performed, and the last valid information of blockB is read and updated to pageA0 and pageA1 of blockA. At this time, blockB is erased, and then the valid information of blockA is synchronized to pageB0 and pageB1 of blockB.
  18. 一种数据管理装置,其中,包括:A data management device, comprising:
    确定模块,用于在存储器中确定第一存储块和第二存储块;A determination module, configured to determine a first storage block and a second storage block in a memory;
    划分模块,用于按照预设划分方式将所述第一存储块划分为第一部分和第二部分、将所述第二存储块划分为第三部分和第四部分;a partitioning module, configured to partition the first storage block into a first part and a second part, and partition the second storage block into a third part and a fourth part according to a preset partitioning method;
    记录模块,用于将目标数据记录至所述第一部分中的第一目标页和第二目标页、所述第四部分的第三目标页和第四目标页;其中,所述第一目标页在所述第一部分中的偏移与所述第三目标页在所述第四部分中的偏移相同,所述第二目标页在所述第一部分中的偏移与所述第四目标页在所述第四部分中的偏移相同。A recording module, used for recording target data to a first target page and a second target page in the first part, and a third target page and a fourth target page in the fourth part; wherein the offset of the first target page in the first part is the same as the offset of the third target page in the fourth part, and the offset of the second target page in the first part is the same as the offset of the fourth target page in the fourth part.
  19. 一种电子设备,其中,包括:An electronic device, comprising:
    存储器,用于存储计算机程序;Memory for storing computer programs;
    处理器,用于执行所述计算机程序时实现如权利要求1至17任一项所述数据管理方法的步骤。A processor, configured to implement the steps of the data management method according to any one of claims 1 to 17 when executing the computer program.
  20. 一种非易失性可读存储介质,其中,所述非易失性可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至17任一项所述数据管理方法的步骤。 A non-volatile readable storage medium, wherein a computer program is stored on the non-volatile readable storage medium, and when the computer program is executed by a processor, the steps of the data management method according to any one of claims 1 to 17 are implemented.
PCT/CN2023/085274 2022-11-17 2023-03-30 Data management method and apparatus, electronic device, and nonvolatile readable storage medium WO2024103600A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211461907.9A CN115509466B (en) 2022-11-17 2022-11-17 Data management method and device, electronic equipment and storage medium
CN202211461907.9 2022-11-17

Publications (1)

Publication Number Publication Date
WO2024103600A1 true WO2024103600A1 (en) 2024-05-23

Family

ID=84525704

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/085274 WO2024103600A1 (en) 2022-11-17 2023-03-30 Data management method and apparatus, electronic device, and nonvolatile readable storage medium

Country Status (2)

Country Link
CN (1) CN115509466B (en)
WO (1) WO2024103600A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115509466B (en) * 2022-11-17 2023-03-28 苏州浪潮智能科技有限公司 Data management method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130132652A1 (en) * 2010-01-27 2013-05-23 Fusion-Io, Inc. Managing non-volatile media
CN112256462A (en) * 2020-10-29 2021-01-22 浪潮(北京)电子信息产业有限公司 Method, device and medium for estimating service life of NAND Flash memory
CN112764683A (en) * 2021-01-22 2021-05-07 苏州浪潮智能科技有限公司 Storage block management information synchronous recording method, system, terminal and storage medium
CN114930299A (en) * 2020-03-31 2022-08-19 华为技术有限公司 Method, device and storage medium for managing data storage array
CN115509466A (en) * 2022-11-17 2022-12-23 苏州浪潮智能科技有限公司 Data management method and device, electronic equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114415961B (en) * 2022-01-21 2023-10-27 珠海奔图电子有限公司 Bad block processing method of Nand flash memory, electronic equipment and storage medium
CN114420183A (en) * 2022-01-24 2022-04-29 珠海奔图电子有限公司 Data storage control method, electronic device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130132652A1 (en) * 2010-01-27 2013-05-23 Fusion-Io, Inc. Managing non-volatile media
CN114930299A (en) * 2020-03-31 2022-08-19 华为技术有限公司 Method, device and storage medium for managing data storage array
CN112256462A (en) * 2020-10-29 2021-01-22 浪潮(北京)电子信息产业有限公司 Method, device and medium for estimating service life of NAND Flash memory
CN112764683A (en) * 2021-01-22 2021-05-07 苏州浪潮智能科技有限公司 Storage block management information synchronous recording method, system, terminal and storage medium
CN115509466A (en) * 2022-11-17 2022-12-23 苏州浪潮智能科技有限公司 Data management method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN115509466B (en) 2023-03-28
CN115509466A (en) 2022-12-23

Similar Documents

Publication Publication Date Title
US8046528B2 (en) Data writing method for flash memory, and flash memory controller and storage device thereof
JP5585919B2 (en) Power shutdown management
TWI645404B (en) Data storage device and control method for non-volatile memory
TWI470431B (en) Data writing method, memory controller and memory storage apparatus
TWI479314B (en) Method of storing system data, and memory controller and memory storage apparatus using the same
TW201907287A (en) Data reading method and storage controller
JPWO2007119267A1 (en) Memory controller for flash memory
TWI545582B (en) Methods for accessing a storage unit of a flash memory and apparatuses using the same
TW200921360A (en) Data preserving method and data accessing method for non-volatile memory
KR20200032463A (en) Apparatus for diagnosing memory system or data processing system and operating method of memory system or data processing system based on diagnosis
WO2024103600A1 (en) Data management method and apparatus, electronic device, and nonvolatile readable storage medium
CN102981969A (en) Method for deleting repeated data and solid hard disc thereof
TW201942906A (en) Decoding method and storage controller
CN112802530A (en) NAND testing method and device, readable storage medium and electronic equipment
TW202027085A (en) Method for improving read retry of flash memory and related controller and storage device
US20090164869A1 (en) Memory architecture and configuration method thereof
CN111737165A (en) Memory control method, memory storage device and memory control circuit unit
WO2023070842A1 (en) Flash memory, flash memory erase/write counting method, electronic device, and computer storage medium
CN100364013C (en) Method for storing check code in memory and its device
TW201820114A (en) Data writing method and storage controller
CN115512757B (en) Error reproduction and repair method, device, equipment and storage medium
US20200242026A1 (en) Method for managing flash memory module and associated flash memory controller and electronic device
US8832358B2 (en) Data writing method, memory controller and memory storage apparatus
US9262264B2 (en) Error correction code seeding
CN111949198A (en) Bad block management method and device and storage equipment

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

Country of ref document: EP

Kind code of ref document: A1