Tail data page searching method and device, equipment and readable storage medium
By employing binary search and superpage scan technology in solid-state drives (SSDs), the true tail data page is identified, solving the problem of repeatedly reading empty storage pages and improving the SSD's response speed and user experience.
Patent Information
- Application Number
- CN202111342309.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-12
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2041-11-12
AI Technical Summary
Existing technologies require repeatedly reading empty storage pages when searching for tail data pages, resulting in a long time for the solid-state drive to return to normal operation after power-on, which affects the user experience.
The binary search method is used to determine the tail data page of the first available flash memory die. By detecting the page number and scanning the superpage, combined with marking empty storage locations, the actual tail data page is found, reducing the number of times empty storage pages are read repeatedly.
It effectively reduces the number of times blank storage pages are read repeatedly, improves the universality of the search method, and shortens the time it takes for the solid-state drive to return to normal working status after power-on.
Smart Images

Figure CN114168496B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data processing, in particular to a tail data page searching method, device, equipment and readable storage medium. BACKGROUND
[0002] With the increase of the capacity of solid state disk, the number of internal flash dies is also increasing, which puts forward higher requirements for searching tail data pages on the solid state disk. The current method for searching tail data pages is generally the bisection search method. When the storage page in the empty state is read by using the method, the system constantly changes the reference voltage to find the voltage point at which the data can be read out until the data is read out. However, such processing method increases the number of repeated reading of empty storage pages, so that after the chip is powered on again, a certain time is consumed to recover to the normal working state, which cannot immediately respond to the related instructions of the user, and affects the user experience. SUMMARY
[0003] The main purpose of the present application is to provide a tail data page searching method, device, equipment and readable storage medium, which aims to reduce the number of repeated reading of empty storage pages, so that the solid state disk spends less time to start writing data again after being powered on again, and recovers to the normal working state.
[0004] In a first aspect, the present application provides a tail data page searching method, which comprises:
[0005] Step S10, determining the available flash dies;
[0006] Step S20, finding the tail data page of the first flash die in the available flash dies by the bisection search method;
[0007] Step S30, detecting whether the page number of the tail data page is the maximum page number;
[0008] Step S40, if yes, recording the page number of the tail data page, and executing step S50;
[0009] Step S60, if no, scanning a super page backward, and detecting whether the state of the super page is all empty;
[0010] Step S70, if not all empty, determining the tail data page of the next flash die, and returning to step S30;
[0011] Step S80, if all empty, recording the page number of the tail data page, and executing step S50;
[0012] Step S50, searching the target flash die with data existing in the page number from the available flash dies, and taking the tail data page of the flash die with the maximum label in the target flash die as the true tail data page.
[0013] Optionally, step S10 comprises:
[0014] scanning the whole flash chip in the unit of the matrix of memory blocks to determine the available flash chips.
[0015] Optionally, step S70 comprises:
[0016] if not all empty, marking the memory location as empty for skipping the empty memory location in the subsequent scanning, determining the tail data page of the next flash chip, and returning to step S30.
[0017] Optionally, step S50 comprises:
[0018] checking the available flash chips in turn according to the rule that the label is in descending order to find the first available flash chip having data in the page number;
[0019] determining the tail data page of the first available flash chip having data in the page number as the real tail data page.
[0020] In a second aspect, the present application further provides a tail data page finding device, which comprises:
[0021] a first control module 10, configured to:
[0022] determine the available flash chips;
[0023] a step S20 of finding the tail data page of the first flash chip in the available flash chips by the dichotomy method;
[0024] a first detection module 20, configured to:
[0025] a step S30 of detecting whether the page number of the tail data page is the maximum page number;
[0026] a step S40 of, if yes, recording the page number of the tail data page and executing step S50;
[0027] a step S60 of, if no, scanning one super page backward to detect whether the state of the super page is all empty;
[0028] a second detection module 30, configured to:
[0029] a step S70 of, if not all empty, determining the tail data page of the next flash chip and returning to step S30;
[0030] a step S80 of, if all empty, recording the page number of the tail data page and executing step S50;
[0031] a second control module 40, configured to:
[0032] Step S50, finding the target flash die with the page number existing data from the available flash dies, and taking the tail data page of the flash die with the largest label in the target flash die as the true tail data page.
[0033] Optionally, the first control module 10 is used for:
[0034] Scanning the total flash dies in the unit of storage block matrix, and determining the available flash dies;
[0035] Optionally, the first detection module 20 is used for:
[0036] If not all empty, marking the empty storage position for skipping the empty storage position in the subsequent scanning, determining the tail data page of the next flash die, and returning to step S30.
[0037] Optionally, the second control module 40 is used for:
[0038] According to the rule that the label is from large to small, sequentially checking each available flash die, and finding the first available flash die with the page number existing data;
[0039] Determining the tail data page of the first available flash die with the page number existing data as the true tail data page.
[0040] In a third aspect, the present application further provides a tail data page finding device, which comprises a processor, a memory, and a tail data page finding program stored in the memory and executable by the processor, wherein the tail data page finding program is executed by the processor to implement the steps of the tail data page finding method.
[0041] In a fourth aspect, the present application further provides a readable storage medium, which stores a tail data page finding program, wherein the tail data page finding program is executed by a processor to implement the steps of the tail data page finding method.
[0042] The tail data page finding method provided by the present application can effectively reduce the number of repeated reading of blank storage pages, and reduce the probability of reading blank data pages. Meanwhile, the universality of the finding method is enhanced, and the complexity of subsequent operations is reduced. In the case of abnormal power failure, the time for the solid state disk to re-write data and recover to the normal working state after re-powering is effectively shortened. BRIEF DESCRIPTION OF DRAWINGS
[0043] Figure 1 The tail data page finding method embodiment flowchart involved in the embodiment scheme of the present application;
[0044] Figure 2A functional module schematic diagram of the tail data page searching device according to the embodiment of the present application is shown in the figure;
[0045] Figure 3 A hardware structure schematic diagram of the tail data page searching device according to the embodiment of the present application is shown in the figure.
[0046] The implementation, functional features and advantages of the present application will be further explained with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0047] It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
[0048] In a first aspect, the embodiment of the present application provides a tail data page searching method.
[0049] In an embodiment, referring to Figure 1 , Figure 1 An embodiment flow chart of the tail data page searching method according to the present application is shown in the figure. Figure 1 The tail data page searching method includes:
[0050] Step S10, determining available flash memory dies;
[0051] In the embodiment, the available flash memory dies need to be found out first, and then the tail data page searching operation can be performed. First, all the flash memory dies on the solid state disk are detected, because some of the flash memory dies are unusable, that is, there are bad flash memory dies in the solid state disk, specifically, some bad memory blocks appear in the flash memory dies. The bad blocks mainly include factory bad blocks and growth bad blocks. The factory bad blocks refer to some bad memory blocks that already exist in the flash memory dies after they are produced from the factory. The growth bad blocks refer to some originally good memory blocks in the flash memory dies that will appear wear-out conditions with the increase of the use times and use time, which will cause the originally good memory blocks in the flash memory dies to become bad memory blocks.
[0052] Before the tail data page searching method starts to execute, the flash memory die management algorithm is needed to check the states of all the flash memory dies on the solid state disk, and the purpose is to check whether the flash memory dies are available. Specifically, the state of the flash memory die to be queried is obtained through the bad block table saved in the flash memory die management algorithm.
[0053] When the flash memory dies are produced, the manufacturer of the flash memory dies will mark the factory bad blocks. When the flash memory die management algorithm is used, all the memory blocks need to be scanned according to the flash memory document, the bad memory blocks are removed, and a bad block table is established. The flash memory document is edited in advance by the manufacturer of the flash memory dies when the flash memory dies are produced. The state of the flash memory dies is recorded in the bad block table.
[0054] For the growing bad block in the flash memory die, it is usually found by reading data, writing data or erasing data. When the storage block appears the symptoms of reading out unrecoverable data, erasing data failure or writing data failure, the growing bad block in the flash memory die is determined by the symptoms of these bad storage blocks. When using the flash memory die management algorithm, these bad storage blocks are added to the bad block table and are no longer used in the subsequent work. For example, when writing data, the bad storage block is skipped and the next storage block is directly written.
[0055] When there is a bad storage block in the flash memory die, the state of the flash memory die is marked as unusable. The state of the flash memory die without a bad storage block is marked as usable and is prepared for the subsequent steps.
[0056] In step S20, the last data page of the first flash memory die in the available flash memory die is found by the binary search method.
[0057] In this embodiment, the first available flash memory die needs to be determined. The rule for determination is to select the flash memory die with the smallest label among all available flash memory dies, and the available flash memory die with the smallest label is determined as the first available flash memory die.
[0058] The binary search method is also called dichotomy, which is a search method for finding a specific element in an ordered array. The specific search process is as follows: first, the middle element of the array is searched, if the middle element is the element to be searched, the search process is ended. If the specific element to be searched is greater than or less than the middle element, the search is performed in the region greater than or less than the middle element, and the comparison is also started from the middle element in the region. This search method will reduce the search range by half each time. The advantage of the binary search method is that the number of comparisons is less and the search speed is faster. The disadvantage of the binary search method is that the object of search must be ordered. Therefore, the binary search method is not suitable for ordered list which often changes and is frequently searched.
[0059] The last data page refers to the last storage page recording data on the flash memory die. The step of using the binary search method to search the last data page is performed on the first available flash memory die, and the binary search method is only used once in the entire last data page search method execution process.
[0060] In step S30, it is detected whether the page number of the last data page is the maximum page number.
[0061] In this embodiment, the number of storage pages of all flash dies in the solid state disk is the same, specifically, the number of storage pages in each flash die is the same. In the detection process, the page number of the tail data page is mainly compared with the page number of the last storage page of the flash die.
[0062] In step S40, if yes, the page number of the tail data page is recorded, and step S50 is executed.
[0063] In this embodiment, after detecting whether the page number of the tail data page is the maximum page number, if it is the maximum page number, the last storage page with data before the power-off of the solid state disk is the last page of the storage page of the flash die. Because the last page of the storage page of the flash die has been read at this time, there is no extra storage page behind, and there is no data on the storage page. For this case, the system locks the page number of the tail data page found in the previous step, in order to prepare for the subsequent finding of the real tail data page.
[0064] In step S60, if no, one super page is scanned backward, and it is detected whether the state of the super page is all empty.
[0065] In this embodiment, after detecting whether the page number of the tail data page is the maximum page number, if it is not the maximum page number, it indicates that the position of the first available flash die for reading data is not on the last storage page. However, at this time, only the storage condition of the data on the first flash die can be known, and the storage condition of the data on the subsequent flash dies cannot be judged. Because the page number of the tail data page found at this time is not the last one, it is indicated that the storage page after the found tail data page may also have data in the subsequent flash dies, and further detection and judgment are needed, otherwise the real tail data page may be missed.
[0066] The super page refers to a unit composed of a plurality of flash dies with the same storage page code in the flash dies. Specifically, it refers to a unit composed of the storage pages on the same position of all available flash dies on the solid state disk. Scanning one super page backward specifically refers to locking the page number of the next page of the tail data page of the first available flash die, and scanning all the flash dies on this position.
[0067] After the step of scanning one super page backward is completed, the state of the super page needs to be detected. On the storage page of the specific position, some flash dies have data on the storage page of the specific position, and some flash dies have no data on the storage page of the specific position. In this embodiment, these information is obtained by scanning one super page backward in this step, in order to prepare for different operations according to different detection results.
[0068] Step S70, if not all empty, determine the next flash die tail data page, return to step S30;
[0069] In this embodiment, after scanning a super page, if there is data on the storage page at the specific position corresponding to the super page, it is determined that the scanned super page is not all empty. This situation indicates that the first available flash die found previously is not a real tail data page, and there is data in the flash die after the first available flash die, and the page number of the storage page where the data is located is larger. At this time, since a tail data page with a page number larger than the previous tail data page appears, the tail data page of the next flash die after the first available flash die needs to be determined,
[0070] Step S80, if all empty, record the page number of the tail data page, and execute step S50;
[0071] In this embodiment, after scanning a super page, if all the flash dies do not have data on the storage page at the specific position, it is determined that the scanned super page is all empty. This situation indicates that the other available flash dies do not store data at a position with a larger page number. At this time, the tail data page found by using the binary search method on the first available flash die is correct in terms of the page number, and the correct flash die label needs to be determined to finally find the real tail data page.
[0072] Step S50, find the target flash die with data at the page number from the available flash dies, and use the tail data page of the flash die with the largest label in the target flash die as the real tail data page.
[0073] In this embodiment, the storage page number of the real tail data page that needs to be found has been determined in the above steps, but the tail data page found at this time may not be the real tail data page. For example, there may be many available flash dies that have data on the storage page number found above. However, for a solid state disk, the position where data is last written before the last power failure is unique. In this case, the last flash die with data on the previously determined storage page number needs to be selected to ensure that writing data from this position will not overwrite the data already written into the flash die.
[0074] The finding method used when finding the target flash die is the reverse order method, which specifically refers to finding the first flash die with data on the storage page corresponding to the previously determined storage page number from the last flash die. The target flash die refers to all flash dies with data on the storage page corresponding to the previously determined storage page number.
[0075] After the real tail data page is found, the system locks the position of the real tail data page, preparing for subsequent re-writing of data into the flash memory chip of the solid state disk.
[0076] Further, in an embodiment, step S10 comprises:
[0077] The whole flash memory chip is scanned in units of storage block matrix to determine the available flash memory chip.
[0078] In this embodiment, the available flash memory chip is determined by scanning in units of storage block matrix instead of units of flash memory chip. The storage block matrix refers to a flash memory chip storage block matrix composed of multiple storage blocks. The storage block refers to the basic unit of the flash memory chip for performing an erase operation composed of multiple storage pages. The reason for scanning in units of storage block matrix is to balance the read-write performance in the best state.
[0079] Further, in an embodiment, step S70 comprises:
[0080] If not all empty, mark the empty storage location for skipping the empty storage location in subsequent scanning, determine the tail data page of the next flash memory chip, and return to step S30.
[0081] In this embodiment, when scanning a super page, some flash memory chips have data in the storage page corresponding to the storage page number locked by the super page, while some flash memory chips have no data in the storage page corresponding to the storage page number locked by the super page. These data-free locations will be marked as empty storage locations, preparing for subsequent searching for the tail data page of the next flash memory chip.
[0082] Further, in an embodiment, step S50 comprises:
[0083] According to the rule of descending order of the label, each available flash memory chip is checked in sequence to find the first available flash memory chip with data in the page number;
[0084] The tail data page of the first available flash memory chip with data in the page number is determined as the real tail data page.
[0085] In this embodiment, for the tail data page with the determined storage page number, the label of the flash memory chip needs to be determined. The real tail data page needs to be determined by two identifiers, one is the page number of the storage page, and the other is the label of the flash memory chip where the storage page is located. The real tail data page specifically refers to the tail data page under the flash memory chip with the largest label in the entire solid state disk that has the tail data page page number.
[0086] Further, in an embodiment, step S50 further comprises:
[0087] Write data from the true tail data page, and restore the normal working state.
[0088] In this embodiment, after the true tail data page is found, the position of the true tail data page is determined as the position of the last data written before the last power-off. When the flash dies are abnormally interrupted during the last power-off, the operation of writing data will be stopped at a special position, and this position is the position to be determined when the data is continued to be written next time. After the solid state disk is powered on again, the data will be written into the storage page in the flash dies in the solid state disk again. After the true tail data page is found, the system determines that the position of the true tail data page is the position of the last data written before the last power-off. At this time, the data will be written from this position backward to restore the normal working state and respond to the user's instructions in time.
[0089] In a second aspect, the embodiment of the present application also provides a tail data page finding device.
[0090] Referring to Figure 2 , the function module schematic diagram of the first embodiment of the tail data page finding device.
[0091] In this embodiment, the tail data page finding device comprises:
[0092] The first control module 10 is used for:
[0093] Step S10, determining the available flash dies;
[0094] Step S20, finding the tail data page of the first flash die in the available flash dies by the dichotomy method;
[0095] The first detection module 20 is used for:
[0096] Step S30, detecting whether the page number of the tail data page is the maximum page number;
[0097] Step S40, if yes, recording the page number of the tail data page, and executing step S50;
[0098] Step S60, if no, scanning a super page backward, and detecting whether the state of the super page is all empty;
[0099] The second detection module 30 is used for:
[0100] Step S70, if not all empty, determining the tail data page of the next flash die, and returning to step S30;
[0101] Step S80, if all empty, recording the page number of the tail data page, and executing step S50;
[0102] The second control module 40 is used for:
[0103] Step S50, searching the target flash die with the page number existing data from the available flash dies, taking the tail data page of the flash die with the largest label in the target flash die as the true tail data page.
[0104] Further, in an embodiment, the first control module 10 is configured to:
[0105] scan the total flash dies in the unit of storage block matrix, and determine the available flash dies;
[0106] Further, in an embodiment, the first detection module 20 is configured to:
[0107] if not all empty, mark the empty storage location, so as to skip the empty storage location in the subsequent scanning, determine the tail data page of the next flash die, and return to step S30.
[0108] Further, in an embodiment, the second control module 40 is configured to:
[0109] check each available flash die according to the rule that the label is from large to small, and find the first available flash die with data existing on the page number;
[0110] determine the tail data page of the first available flash die with data existing on the page number as the true tail data page.
[0111] Correspondingly, the functions of each module in the tail data page searching device are the same as the steps in the tail data page searching method, and the functions and implementation processes will not be repeated here.
[0112] In a third aspect, an embodiment of the present application provides a tail data page searching device.
[0113] Reference Figure 3 , Figure 3Fig. 1 is a schematic diagram of a hardware structure of the tail data page searching device according to an embodiment of the present application. The tail data page searching device according to the embodiment of the present application can include a processor 1001 (for example, a central processing unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication among the components; the user interface 1003 can include a display and an input unit such as a keyboard; the network interface 1004 can optionally include a standard wired interface, a wireless interface (for example, a WI-FI interface); the memory 1005 can be a high-speed random access memory (RAM) or a stable memory (for example, a disk memory), and can optionally be a storage device independent of the processor 1001. Those skilled in the art can understand that the hardware structure shown in Fig. 1 does not constitute a limitation on the present application, and can include more or fewer components than those shown in the figure, or combine some components, or arrange different components. Figure 3 The hardware structure shown in Fig. 1 does not constitute a limitation on the present application, and can include more or fewer components than those shown in the figure, or combine some components, or arrange different components.
[0114] With reference to the foregoing description of the tail data page searching method, the tail data page searching device according to the embodiment of the present application can be used to implement the tail data page searching method. Figure 3 Figure 1 The memory 1005 as a computer storage medium according to the embodiment of the present application can include an operating system, a network communication module, a user interface module, and a tail data page searching program. The processor 1001 can call the tail data page searching program stored in the memory 1005, and execute the tail data page searching method according to the embodiment of the present application.
[0115] In a fourth aspect, the embodiment of the present application further provides a readable storage medium.
[0116] The readable storage medium according to the embodiment of the present application stores a tail data page searching program, and when the tail data page searching program is executed by a processor, the steps of the tail data page searching method according to the foregoing description are realized.
[0117] The method realized when the tail data page searching program is executed can refer to the embodiments of the tail data page searching method according to the present application, and will not be described herein.
[0118] It should be noted that, in this document, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0119] The above-mentioned embodiment numbers of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0120] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and necessary general hardware platforms, and of course can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk) as described above, and includes a number of instructions for causing a terminal device to execute the methods described in the various embodiments of the present application.
[0121] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent flow transformation made by using the content of the specification and drawings, or directly or indirectly applied to other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for searching tail data pages, characterized in that, The tail data page lookup method includes: Step S10: Determine the available flash memory dies; Step S20: Find the tail data page of the first available flash memory die using a binary search method; Step S30: Check if the page number of the last data page is the maximum page number; Step S40: If yes, record the page number of the tail data page and execute step S50. Step S60: If not, scan one superpage and check if the superpage is completely empty; In step S70, if the data is not completely empty, determine the last data page of the next flash memory die and return to step S30. Step S80: If the data is completely empty, record the page number of the last data page and execute step S50. Step S50: Locate the target flash memory die containing the page number from the available flash memory dies, and use the last data page of the flash memory die with the largest number in the target flash memory die as the true last data page; Step S50 includes: According to the rule of checking each available flash memory die in descending order of the number, find the first available flash memory die with data at the page number; The first available flash memory die with data at the page number is identified as the true tail data page.
2. The tail data page lookup method as described in claim 1, characterized in that, Step S10 includes: Scan all flash memory dies in units of the storage block matrix to identify usable flash memory dies.
3. The tail data page lookup method as described in claim 1, characterized in that, Step S70 includes: If not completely empty, mark the empty storage location so that it can be skipped during subsequent scans, determine the last data page of the next flash memory die, and return to step S30.
4. The tail data page lookup method as described in claim 1, characterized in that, The step S50 is followed by: Start writing data from the true tail data page to restore normal working status.
5. A tail data page lookup device, characterized in that, The tail data page lookup device includes: The first control module is used to execute: Step S10: Determine the available flash memory dies; Step S20: Find the tail data page of the first available flash memory die using a binary search method; The first detection module is used for: Step S30: Check if the page number of the last data page is the maximum page number; Step S40: If yes, record the page number of the tail data page and execute step S50. Step S60: If not, scan one superpage and check if the superpage is completely empty; The second detection module is used for: In step S70, if the data is not completely empty, determine the last data page of the next flash memory die and return to step S30. Step S80: If the data is completely empty, record the page number of the last data page and execute step S50. The second control module is used for: Step S50: Locate the target flash memory die containing the page number from the available flash memory dies, and use the last data page of the flash memory die with the largest number in the target flash memory die as the true last data page; The second control module is also used for: According to the rule of checking each available flash memory die in descending order of the number, find the first available flash memory die with data at the page number; The first available flash memory die with data at the page number is identified as the true tail data page.
6. The tail data page lookup device as described in claim 5, characterized in that, The first control module is also used to scan all flash memory dies in units of storage block matrix to determine available flash memory dies; The first detection module is further configured to mark empty storage locations if they are not completely empty, so that the empty storage locations can be skipped during subsequent scanning, the tail data page of the next flash memory die can be determined, and the process can return to step S30.
7. A tail data page lookup device, characterized in that, The tail data page lookup device includes a processor, a memory, and a tail data page lookup program stored in the memory and executable by the processor, wherein when the tail data page lookup program is executed by the processor, it implements the steps of the tail data page lookup method as described in any one of claims 1 to 4.
8. A readable storage medium, characterized in that, The readable storage medium stores a tail data page lookup program, wherein when the tail data page lookup program is executed by a processor, it implements the steps of the tail data page lookup method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
System and method for realizing power-off continuous storage function by FPGA
CN110362417A
Method and device for searching last write-in page
CN110908928A