Method and device for increasing starting speed after abnormal power failure of solid state disk, equipment and medium

By reading and updating the mapping table of the solid-state drive, scanning and recording the relocation source location, and skipping invalid areas, it solves the problems of slow startup speed and short service life of traditional solid-state drives, achieving a faster recovery process and longer use. life.

CN118778901APending Publication Date: 2024-10-15SUZHOU UNIONMEMORY INFORMATION SYST LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410927959.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

Traditional solid-state drives are slow to start up after abnormal power outages, and repeated data movement reduces their service life.

Method used

By reading the last saved mapping table in NAND, scanning QLC blocks and Wordline cache SLC blocks, recording the move source location information, skipping invalid areas, and updating the mapping table to speed up the recovery process.

Benefits of technology

It reduces the power-on recovery time, reduces repeated data movement, and improves the service life and startup speed of the solid-state drive.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118778901A_ABST
    Figure CN118778901A_ABST
Patent Text Reader

Abstract

The invention relates to a method, a device, equipment and a medium for improving the starting speed after abnormal power failure of a solid state disk, and the method comprises the following steps: reading a mapping table stored at the last time in an NAND to obtain a read mapping table; scanning the QLC block to obtain a first mapping relation set, merging the first mapping relation set into the read mapping table to obtain a first merged read mapping table, and recording the latest moving source position information in the process of scanning the QLC block; executing cache SLC block scanning, and judging whether a scanning position is in front of a latest moving source position or not page by page; scanning to obtain a mapping relation that all scanning positions in the cache SLC block are not located in front of the latest moving source position, and merging the mapping relation into the first merged read mapping table to obtain a second merged read mapping table; and updating the second combined read mapping table to end mapping recovery scanning. According to the method, the position information of data migration is recorded in the standby area, and the invalid area is skipped when the SLC block is mapped and scanned in the power-on recovery process, so that the power-on recovery time is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of abnormal power failure of solid state hard disks, and in particular to a method, device, equipment and medium for improving the startup speed of a solid state hard disk after abnormal power failure. Background Art

[0002] SSD (Solid State Drive) is widely used in various occasions. At present, it has gradually replaced the traditional HDD (Mechanical Hard Drive) in the PC market, providing users with a better experience in terms of reliability and performance. With the evolution of NAND technology, it has evolved from the early 1bit / cell (SLC) to 2bit / cell (MLC), 3bit / cell (TLC), and 4bit / cell (QLC). The data storage capacity is getting larger and larger, but due to the increase in the number of bits in each cell, its programming model is becoming more and more complex. Typical NAND such as SLC / MLC / TLC only needs one programming to complete data storage, and then it can be read normally. However, due to the complex voltage distribution of QLC NANDCell, it requires multiple programming to truly complete data storage for subsequent data reading.

[0003] In addition, since the influence between adjacent Wordlines (a wordline can contain multiple NAND pages) needs to be eliminated, this multiple programming needs to be interleaved between multiple Wordlines, resulting in a large number of Wordlines in an unstable state. Since they cannot be read out, the corresponding data needs to be cached in other places where they can be read correctly. For consumer-grade SSDs with limited memory and power conservation capabilities, SLC blocks are generally used to cache these data, which is called Wordline cache. When the actual user writes data, the actual data will be written alternately to the SLC blocks and QLC blocks used as Wordline caches.

[0004] When the SSD is running, the mapping table data will be saved on the NAND regularly. After an abnormal power outage, when it is restarted, the user data written after the last mapping table data is saved will be scanned to restore the complete mapping table data before the power outage to avoid data loss.

[0005] The traditional avionics data mapping recovery solution will first scan the QLC block and then scan the Wordline cache SLC block to recover the complete mapping data. However, before the power failure, some data in the Wordline cache SLC block may have been moved to the QLC block. The traditional scanning method will cause the mapping of this part of the data to be restored to the Wordline cache SLC block, resulting in a long power-on scan time and subsequent repeated migration, which reduces the service life of the SSD. Summary of the invention

[0006] The purpose of the present invention is to overcome the deficiencies of the prior art and to provide a method, device, equipment and medium for improving the startup speed of a solid state hard disk after abnormal power failure.

[0007] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0008] In a first aspect, this embodiment provides a method for improving the startup speed of a solid state drive after abnormal power failure, comprising the following steps:

[0009] Read the mapping table saved last time in NAND to obtain a read mapping table;

[0010] Scan the QLC block starting from the write position of the read mapping table to obtain a mapping relationship between the LPA and the PPA, that is, a first mapping relationship set, merge the first mapping relationship set into the read mapping table to obtain a first merged read mapping table, and in the process of scanning the QLC block, obtain and record the latest migration source location information from the spare area;

[0011] Perform a Wordline cache SLC block scan, and determine page by page whether the scan position is before the latest move source position;

[0012] If the scan position is not before the latest move source position, the mapping relationship between LPA and PPA is obtained by scanning, and then the next page scan of the Wordline cache SLC block is continued to be executed until the scan of the Wordline cache SLC block is completed, so as to obtain the mapping relationship between LPA and PPA of all scan positions in the Wordline cache SLC block that are not before the latest move source position, that is, the second mapping relationship set, and then merge the second mapping relationship set into the first merged read mapping table to obtain the second merged read mapping table;

[0013] The second merge read mapping table is updated in the NAND to end the mapping recovery scan, that is, the startup of the solid state drive after abnormal power failure is completed.

[0014] A further technical solution is: after the step of performing the Wordline cache SLC block scan and determining page by page whether the scan position is located before the latest migration source position, it also includes:

[0015] If the scan position is before the latest move source position, the scan is skipped, and then the next page scan of the Wordline cache SLC block is continued until the Wordline cache SLC block scan is completed.

[0016] A further technical solution is: before the step of reading the mapping table last saved in the NAND to obtain the reading mapping table, it also includes:

[0017] Read data from the Wordline cache SLC block to obtain read data;

[0018] Query the mapping according to the logical address of the read data;

[0019] If the physical address of the query mapping is the same as the read address, the read data is valid, the read data is moved to the QLC block, and the location information of the read data is recorded in the spare area.

[0020] A further technical solution is: after the step of querying the mapping according to the logical address of the read data, it also includes:

[0021] If the physical address of the query mapping is different from the read address, the read data is invalid and the move of the read data is skipped.

[0022] In a second aspect, the present embodiment provides a device for improving the startup speed of a solid state hard disk after abnormal power failure, comprising: a first reading unit, a scan merging and recording unit, a scan judgment unit, a scan merging unit, and an updating unit;

[0023] The first reading unit is used to read the mapping table last saved in the NAND to obtain a read mapping table;

[0024] The scanning and merging recording unit is used to scan the QLC block starting from the write position of the read mapping table to obtain a mapping relationship between the LPA and the PPA, that is, a first mapping relationship set, merge the first mapping relationship set into the read mapping table to obtain a first merged read mapping table, and in the process of scanning the QLC block, obtain and record the latest migration source position information from the spare area;

[0025] The scanning judgment unit is used to perform Wordline cache SLC block scanning and judge page by page whether the scanning position is located before the latest migration source position;

[0026] The scan merging unit is used for, if the scan position is not located before the latest move source position, scanning to obtain the mapping relationship between LPA and PPA, and then returning to continue to perform the next page scan of the Wordline cache SLC block until the Wordline cache SLC block scan is completed, so as to obtain the mapping relationship between LPA and PPA of all scan positions in the Wordline cache SLC block that are not located before the latest move source position, that is, the second mapping relationship set, and then merging the second mapping relationship set into the first merged read mapping table to obtain the second merged read mapping table;

[0027] The updating unit is used to update the second merged read mapping table in the NAND to end the mapping recovery scan, that is, the startup of the solid state drive after abnormal power failure is completed.

[0028] Its further technical solution is: the device also includes: a skip return unit, which is used to skip the scan if the scan position is before the latest move source position, and then return to continue scanning the next page of the Wordline cache SLC block until the Wordline cache SLC block scan is completed.

[0029] A further technical solution is: the device further comprises: a second reading unit, a query unit and a moving record unit;

[0030] The second reading unit is used to read data from the Wordline cache SLC block to obtain read data;

[0031] The query unit is used to query the mapping according to the logical address of the read data;

[0032] The migration recording unit is used to migrate the read data to the QLC block and record the location information of the read data in the spare area if the physical address of the query mapping is the same as the read address, and the read data is valid.

[0033] A further technical solution is that the device further comprises a skip unit, which is used to skip moving the read data if the physical address of the query mapping is different from the read address, then the read data is invalid.

[0034] In a third aspect, this embodiment provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the method for improving the startup speed of a solid-state hard disk after abnormal power failure as described above.

[0035] In a fourth aspect, this embodiment provides a storage medium storing a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the method for improving the startup speed of a solid-state hard disk after abnormal power failure as described above can be implemented.

[0036] Compared with the prior art, the present invention has the following advantages: by recording the location information of data movement in the spare area and then skipping the invalid area when scanning the Wordline cache SLC block during power-on recovery mapping, the power-on recovery time can be reduced and repeated data movement can be reduced to increase the service life of the SSD.

[0037] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0039] Figure 1 A flow chart of a method for improving the startup speed of a solid state hard disk after abnormal power failure provided by an embodiment of the present invention;

[0040] Figure 2 A schematic block diagram of a device for improving the startup speed of a solid state hard disk after abnormal power failure provided by an embodiment of the present invention;

[0041] Figure 3 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0044] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0045] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0046] See also Figure 1 In the specific embodiment shown, the present invention discloses a method for improving the startup speed of a solid state hard disk after abnormal power failure, comprising the following steps:

[0047] S1, read the mapping table saved last time in NAND to obtain a read mapping table;

[0048] Specifically, in NAND Flash storage technology, the mapping table is the key bridge between the logical address (LPA) and the physical address (PPA). It records the actual storage location of each logical block or logical page in NAND Flash, so that the file system or upper-layer application can access the data efficiently. When the SSD restarts after an abnormal power failure, directly reading the mapping table saved last time in NAND can quickly obtain the latest address mapping information, thereby avoiding the time consumption caused by building the mapping table from scratch, which helps the SSD to quickly recover to a normal working state and reduce the user's waiting time. In addition, through the mapping table, the SSD can directly locate the physical location of the data in the NAND Flash, thereby reducing the addressing time when accessing the data, which is crucial to improving the overall performance of the SSD. The mapping table can also help the SSD optimize the physical layout of the data, such as distributing the data to different physical blocks through the wear leveling technology to extend the service life of the SSD. In addition, in the event of an abnormal power outage, if the SSD does not save the mapping table information in time, some data may not be correctly accessed or recovered. By reading the last saved mapping table in the NAND, the risk of data loss can be minimized. This technology is also an important part of the SSD power-off recovery mechanism. By saving and reading the mapping table information, the SSD can quickly recover to the previous working state when restarting after a power outage, ensuring the continuity and integrity of the data.

[0049] S2, scanning the QLC block from the write position of the read mapping table to obtain a mapping relationship between the LPA and the PPA, that is, a first mapping relationship set, merging the first mapping relationship set into the read mapping table to obtain a first merged read mapping table, and in the process of scanning the QLC block, obtaining and recording the latest migration source location information from the spare area;

[0050] Specifically, by scanning the QLC block (quad-level cell NAND Flash, which has a higher storage density but relatively slow write performance), the mapping relationship between the logical address (LPA) and the physical address (PPA) can be obtained, which is the basis for ensuring that the data can be correctly accessed and recovered. The mapping relationship obtained by scanning (i.e., the first mapping relationship set) is merged into the original read mapping table to form the first merged read mapping table. This process ensures the integrity and accuracy of the mapping table, allowing the SSD to more accurately recover data after an abnormal power failure. In addition, scanning starts from the write position of the read mapping table to avoid the time consumption and performance loss caused by scanning the entire NAND Flash from scratch. At the same time, by recording the latest move source location information, the SSD can skip those areas that have been moved or invalid during the scanning process, further reducing invalid scanning and repeated scanning.

[0051] S3, execute the Wordline cache SLC block scan, and determine page by page whether the scan position is before the latest migration source position;

[0052] Specifically, in SSDs, data migration is a common operation used to optimize the physical layout of data, balance the degree of wear of each block, etc. By scanning the Wordline in the SLC cache block and determining whether its scan position is before the latest migration source position page by page, it can be ensured that no data is lost or disordered during the data migration process. That is, for the LPA->PPA mapping relationship restored by scanning the Wordline cache SLC block, the one before the latest migration source position is skipped, thereby achieving the purpose of acceleration.

[0053] S4, if the scan position is not before the latest move source position, scan to obtain the mapping relationship between LPA and PPA, and then return to continue to execute the next page scan of the Wordline cache SLC block until the Wordline cache SLC block scan is completed, so as to obtain the mapping relationship between LPA and PPA of all scan positions in the Wordline cache SLC block that are not before the latest move source position, that is, the second mapping relationship set, and then merge the second mapping relationship set into the first merged read mapping table to obtain the second merged read mapping table;

[0054] Specifically, when data in the SSD needs to be moved (for example, from the SLC cache to storage areas such as TLC), it is necessary to ensure that the mapping relationship between the physical location and the logical location of the data is the latest. By scanning the Wordline in the SLC cache block and checking each Page to see if its scan position is before the latest migration source position, the LPA and PPA mapping relationships of these Pages are collected. This helps ensure that after the data is moved, the data mapping table inside the SSD can accurately reflect the actual physical location of the data. In addition, by collecting and sorting out the mapping relationship of the data to be moved in advance (i.e., the second mapping relationship set), unnecessary read and write operations can be reduced during the data migration process, thereby optimizing the performance of the migration process; at the same time, the second mapping relationship set is merged into the first merged read mapping table to obtain the second merged read mapping table, which can further simplify the subsequent data access and reading process and improve the overall performance of the SSD. In addition, the updated merged read mapping table (second merged read mapping table) contains the latest data mapping information, which helps the SSD to locate the actual physical location of the data more quickly and perform efficient read operations when receiving a data read request, thereby improving the response speed and efficiency of data access and enhancing the user experience.

[0055] S5, updating the second merge read mapping table in the NAND to end the mapping recovery scan, that is, the solid state drive is started up after abnormal power failure.

[0056] Specifically, after an abnormal power failure of the SSD, important data such as the mapping table stored in its internal RAM (random access memory) may be lost. By scanning the data blocks in the NAND Flash and building or restoring the mapping table, it can be ensured that the SSD can accurately know the physical location of the data after restarting, thereby restoring the integrity of the data. Updating the second merge read mapping table is the last step of this recovery process, which ensures the integrity and accuracy of the mapping table. That is, through mapping recovery scanning and updating the mapping table, the SSD can minimize the data loss caused by abnormal power failure, which is crucial to protecting the security and integrity of user data. In addition, the SSD can automatically perform mapping recovery scanning and update the mapping table after an abnormal power failure, which enhances the fault tolerance of the SSD. Even if an unexpected situation occurs, the SSD can quickly recover and continue to work normally, thereby improving the stability and reliability of the system. By updating the mapping table, the SSD can identify and resolve potential mapping errors or inconsistencies and prevent possible errors and failures in the future.

[0057] In one embodiment, after the step of performing a Wordline cache SLC block scan and determining page by page whether the scan position is located before the latest migration source position, the step further includes:

[0058] S6, if the scan position is before the latest move source position, skip the scan and then return to continue scanning the next page of the Wordline cache SLC block until the Wordline cache SLC block scan is completed.

[0059] Specifically, during the Wordline cache SLC block scan, if a certain scan position is located before the latest migration source position, then this means that the data at this position has been moved or is about to be moved to a new position. Therefore, it is unnecessary to continue scanning the data at this position because it will not reflect the current latest data status. By skipping the scan of these positions, the time and resources required for scanning can be significantly reduced, thereby improving the efficiency of the scanning process. In addition, by accurately determining the relationship between the scan position and the migration source position, the data migration process is optimized to ensure that only data that has not been moved or needs to be updated is scanned and processed, thereby avoiding duplication of work and unnecessary resource consumption. In addition, by reducing unnecessary scans and optimizing the data migration process, it helps to improve the overall performance of the SSD, reduce the time required for scanning and data migration, enable the SSD to respond to read and write requests faster, and improve data access speed and system responsiveness.

[0060] In one embodiment, before the step of reading the mapping table last saved in the NAND to obtain the read mapping table, the step further includes:

[0061] Read data from the Wordline cache SLC block to obtain read data;

[0062] Specifically, by configuring a portion of the NAND Flash area to SLC mode as a cache (i.e., Wordline cache SLC blocks), the SSD can give priority to reading data from these SLC cache blocks when receiving a read command. Due to the speed advantage of the SLC mode, this can significantly increase the data reading speed and improve the user experience. In addition, when the SSD restarts after encountering an abnormal situation (such as a sudden power outage, firmware error, etc.), reading data from the Wordline cache SLC blocks can restore data mapping relationships and data integrity more quickly, reducing data loss and recovery time.

[0063] Query the mapping according to the logical address of the read data;

[0064] Specifically, when a storage device such as an SSD encounters an abnormal situation (such as a sudden power outage, firmware error, etc.), the system can restore the data mapping relationship and data integrity by querying the mapping table, which helps reduce data loss and recovery time and improve system reliability and stability.

[0065] If the physical address of the query mapping is the same as the read address, the read data is valid, the read data is moved to the QLC block, and the location information of the read data is recorded in the spare area.

[0066] Specifically, querying the mapping table to verify whether the physical address corresponding to the logical address matches the actual read address is an important step to ensure data integrity and consistency. If the mapped physical address is the same as the read address, it indicates that the data block has not been damaged or tampered with in the storage medium, so the read data is valid. In storage devices such as SSDs, data may be damaged due to various reasons (such as circuit failure, read and write errors, etc.). By verifying the consistency of the physical address and the read address, the erroneous reading caused by data damage can be reduced to a certain extent, thereby improving the reliability of the data. In addition, moving the verified valid read data from the original location (which may be an SLC cache or other type of cache block) to the QLC block is a strategy to optimize the data storage layout. Although the QLC block has low write performance and short life, it has large storage capacity and low cost, and is suitable for storing infrequently accessed data. This migration helps balance the performance and cost of SSDs. In addition, recording the location information of the read data in the spare area (i.e., its physical address in the QLC block) is a key step to ensure data accessibility and manageability. This location information is crucial for subsequent data reading, updating, and deletion operations.

[0067] In one embodiment, after the step of querying the mapping according to the logical address of the read data, the method further includes:

[0068] If the physical address of the query mapping is different from the read address, the read data is invalid and the move of the read data is skipped.

[0069] Specifically, when the mapped physical address queried does not match the expected read address, this usually means that some form of error (such as write error, address mapping error, etc.) has occurred in the data storage process. In this case, if the data continues to be moved and processed, it may cause the propagation of erroneous data, thereby affecting the data consistency and reliability of the entire system. Therefore, by judging whether the physical address is the same as the read address, the propagation of erroneous data can be discovered and avoided in time. In addition, if the read data is determined to be invalid, there is no need to perform subsequent move operations, which can save the bandwidth and processor resources of the storage device and avoid unnecessary power consumption and wear. Especially when processing large amounts of data, this optimization can significantly improve the overall performance and efficiency of the system. In addition, by timely identifying and skipping invalid data, the technology can reduce the delay and error rate when the system processes data, which helps to improve the user experience and enable users to obtain the required data and services faster; in the eyes of users, the system's ability to timely discover and process erroneous data is a manifestation of reliability and stability, which helps to enhance users' trust and satisfaction with the system.

[0070] The present invention records the location information of data migration in the spare area and then skips the invalid area when powering on to restore the mapping scan Wordline cache SLC block, thereby reducing the power-on recovery time and reducing repeated data migration to increase the service life of the SSD.

[0071] See also Figure 2 As shown, the present invention also discloses a device for improving the startup speed of a solid state hard disk after abnormal power failure, comprising: a first reading unit 10, a scanning merging and recording unit 20, a scanning judgment unit 30, a scanning merging unit 40 and an updating unit 50;

[0072] The first reading unit 10 is used to read the mapping table last saved in the NAND to obtain a read mapping table;

[0073] The scanning and merging recording unit 20 is used to scan the QLC block starting from the write position of the read mapping table to obtain the mapping relationship between the LPA and the PPA, that is, the first mapping relationship set, merge the first mapping relationship set into the read mapping table to obtain the first merged read mapping table, and in the process of scanning the QLC block, obtain and record the latest migration source position information from the spare area;

[0074] The scanning judgment unit 30 is used to perform Wordline cache SLC block scanning and judge page by page whether the scanning position is located before the latest migration source position;

[0075] The scan merging unit 40 is used to scan and obtain the mapping relationship between LPA and PPA if the scan position is not located before the latest move source position, and then return to continue to perform the next page scan of the Wordline cache SLC block until the Wordline cache SLC block scan is completed, so as to obtain the mapping relationship between LPA and PPA of all scan positions in the Wordline cache SLC block that are not located before the latest move source position, that is, the second mapping relationship set, and then merge the second mapping relationship set into the first merged read mapping table to obtain the second merged read mapping table;

[0076] The updating unit 50 is used to update the second merged read mapping table in the NAND to end the mapping recovery scan, that is, the startup of the solid state drive after abnormal power failure is completed.

[0077] In one embodiment, the device further includes: a skip return unit, which is used to skip the scan if the scan position is before the latest move source position, and then return to continue scanning the next page of the Wordline cache SLC block until the Wordline cache SLC block scan is completed.

[0078] In one embodiment, the device further comprises: a second reading unit, a query unit and a moving record unit;

[0079] The second reading unit is used to read data from the Wordline cache SLC block to obtain read data;

[0080] The query unit is used to query the mapping according to the logical address of the read data;

[0081] The migration recording unit is used to migrate the read data to the QLC block and record the location information of the read data in the spare area if the physical address of the query mapping is the same as the read address, and the read data is valid.

[0082] In one embodiment, the device further comprises: a skipping unit, configured to skip moving the read data if the physical address of the query mapping is different from the read address, then the read data is invalid.

[0083] It should be noted that technicians in the relevant field can clearly understand that the specific implementation process of the above-mentioned device for improving the startup speed of the solid-state hard disk after abnormal power failure and each unit can refer to the corresponding description in the aforementioned method embodiment. For the convenience and conciseness of the description, it will not be repeated here.

[0084] The above-mentioned device for improving the startup speed of the solid state hard disk after abnormal power failure can be implemented in the form of a computer program. The computer program can be used in a computer program such as Figure 3 Runs on the computer device shown.

[0085] See also Figure 3 , Figure 3 is a schematic block diagram of a computer device provided in an embodiment of the present application; the computer device 500 may be a terminal or a server, wherein the terminal may be an electronic device with communication functions such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster composed of multiple servers.

[0086] See also Figure 3 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .

[0087] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 can execute a method for improving the startup speed of the solid state drive after abnormal power failure.

[0088] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .

[0089] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a method for improving the startup speed of the solid state drive after abnormal power failure.

[0090] The network interface 505 is used to communicate with other devices over the network. Figure 3 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0091] The processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps:

[0092] Read the mapping table saved last time in the NAND to obtain a read mapping table; start scanning the QLC block from the write position of the read mapping table to obtain a mapping relationship between LPA and PPA, that is, a first mapping relationship set, merge the first mapping relationship set into the read mapping table to obtain a first merged read mapping table, and in the process of scanning the QLC block, obtain and record the latest migration source position information from the spare area; perform a Wordline cache SLC block scan, and determine page by page whether the scan position is located before the latest migration source position; if the scan position is not located before the latest migration source position, scan to obtain a mapping relationship between LPA and PPA, and then return to continue to perform the next page scan of the Wordline cache SLC block until the Wordline cache SLC block scan is completed, so as to obtain the mapping relationship between LPA and PPA of all scan positions in the Wordline cache SLC block that are not located before the latest migration source position, that is, a second mapping relationship set, and then merge the second mapping relationship set into the first merged read mapping table to obtain a second merged read mapping table; update the second merged read mapping table in the NAND to end the mapping recovery scan, that is, the startup of the solid-state hard disk after abnormal power failure is completed.

[0093] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0094] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0095] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the method for improving the startup speed of a solid-state hard disk after abnormal power failure can be implemented. The storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the method can be implemented. The program instructions include the following steps:

[0096] Read the mapping table saved last time in the NAND to obtain a read mapping table; start scanning the QLC block from the write position of the read mapping table to obtain a mapping relationship between LPA and PPA, that is, a first mapping relationship set, merge the first mapping relationship set into the read mapping table to obtain a first merged read mapping table, and in the process of scanning the QLC block, obtain and record the latest migration source position information from the spare area; perform a Wordline cache SLC block scan, and determine page by page whether the scan position is located before the latest migration source position; if the scan position is not located before the latest migration source position, scan to obtain a mapping relationship between LPA and PPA, and then return to continue to perform the next page scan of the Wordline cache SLC block until the Wordline cache SLC block scan is completed, so as to obtain the mapping relationship between LPA and PPA of all scan positions in the Wordline cache SLC block that are not located before the latest migration source position, that is, a second mapping relationship set, and then merge the second mapping relationship set into the first merged read mapping table to obtain a second merged read mapping table; update the second merged read mapping table in the NAND to end the mapping recovery scan, that is, the startup of the solid-state hard disk after abnormal power failure is completed.

[0097] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.

[0098] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0099] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or skipped.

[0100] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0101] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.

[0102] The above embodiments are preferred implementation schemes of the present invention. In addition, the present invention may also be implemented in other ways. Any obvious replacement without departing from the concept of the present technical solution is within the protection scope of the present invention.

Claims

1. A method for improving the startup speed of a solid state hard disk after abnormal power failure, characterized in that: The following steps are involved: Read the mapping table saved last time in NAND to obtain a read mapping table; Scan the QLC block starting from the write position of the read mapping table to obtain a mapping relationship between the LPA and the PPA, that is, a first mapping relationship set, merge the first mapping relationship set into the read mapping table to obtain a first merged read mapping table, and in the process of scanning the QLC block, obtain and record the latest migration source location information from the spare area; Perform a Wordline cache SLC block scan, and determine page by page whether the scan position is before the latest move source position; If the scan position is not before the latest move source position, the mapping relationship between LPA and PPA is obtained by scanning, and then the next page scan of the Wordline cache SLC block is continued to be executed until the scan of the Wordline cache SLC block is completed, so as to obtain the mapping relationship between LPA and PPA of all scan positions in the Wordline cache SLC block that are not before the latest move source position, that is, the second mapping relationship set, and then the second mapping relationship set is merged into the first merged read mapping table to obtain the second merged read mapping table; The second merge read mapping table is updated in the NAND to end the mapping recovery scan, that is, the startup of the solid state drive after abnormal power failure is completed.

2. The method for improving the startup speed of a solid state hard disk after abnormal power failure according to claim 1, characterized in that: After the step of performing the Wordline cache SLC block scan and determining page by page whether the scan position is located before the latest migration source position, the step further includes: If the scan position is before the latest move source position, the scan is skipped, and then the scan of the next page of the Wordline cache SLC block is returned to continue until the scan of the Wordline cache SLC block is completed.

3. The method for improving the startup speed of a solid state hard disk after abnormal power failure according to claim 1, characterized in that: Before the step of reading the mapping table last saved in the NAND to obtain the reading mapping table, the step further includes: Read data from the Wordline cache SLC block to obtain read data; Query the mapping according to the logical address of the read data; If the physical address of the query mapping is the same as the read address, the read data is valid, the read data is moved to the QLC block, and the location information of the read data is recorded in the spare area.

4. The method for improving the startup speed of a solid state hard disk after abnormal power failure according to claim 3, characterized in that: After the step of querying the mapping according to the logical address of the read data, the method further includes: If the physical address of the query mapping is different from the read address, the read data is invalid and the move of the read data is skipped.

5. A device for improving the startup speed of a solid state hard disk after abnormal power failure, characterized in that: include: A first reading unit, a scan merging and recording unit, a scan judging unit, a scan merging unit and an updating unit; The first reading unit is used to read the mapping table last saved in the NAND to obtain a read mapping table; The scanning and merging recording unit is used to scan the QLC block starting from the write position of the read mapping table to obtain a mapping relationship between the LPA and the PPA, that is, a first mapping relationship set, merge the first mapping relationship set into the read mapping table to obtain a first merged read mapping table, and in the process of scanning the QLC block, obtain and record the latest migration source position information from the spare area; The scanning judgment unit is used to perform Wordline cache SLC block scanning and judge page by page whether the scanning position is located before the latest migration source position; The scanning and merging unit is used for scanning to obtain the mapping relationship between LPA and PPA if the scanning position is not located before the latest moving source position, and then returning to continue to perform the next page scanning of the Wordline cache SLC block until the scanning of the Wordline cache SLC block is completed, so as to obtain the mapping relationship between LPA and PPA of all scanning positions in the Wordline cache SLC block that are not located before the latest moving source position, that is, the second mapping relationship set, and then merge the second mapping relationship set into the first merged read mapping table to obtain the second merged read mapping table; The updating unit is used to update the second merged read mapping table in the NAND to end the mapping recovery scan, that is, the startup of the solid state drive after abnormal power failure is completed.

6. The device for improving the startup speed of a solid state hard disk after abnormal power failure according to claim 5, characterized in that: The device also includes: a skip return unit, which is used to skip the scan if the scan position is located before the latest move source position, and then return to continue to perform the next page scan of the Wordline cache SLC block until the Wordline cache SLC block scan is completed.

7. The device for improving the startup speed of a solid state hard disk after abnormal power failure according to claim 5, characterized in that: The device further comprises: a second reading unit, a query unit and a moving record unit; The second reading unit is used to read data from the Wordline cache SLC block to obtain read data; The query unit is used to query the mapping according to the logical address of the read data; The migration recording unit is used to migrate the read data to the QLC block and record the location information of the read data in the spare area if the physical address of the query mapping is the same as the read address, and the read data is valid.

8. The device for improving the startup speed of a solid state hard disk after abnormal power failure according to claim 7, characterized in that: The device further comprises: a skipping unit, which is used for skipping the moving of the read data if the physical address of the query mapping is different from the read address, then the read data is invalid.

9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the method for improving the startup speed of a solid state hard disk after abnormal power failure as described in any one of claims 1 to 4 when executing the computer program.

10. A storage medium, characterized in that: The storage medium stores a computer program, which includes program instructions. When the program instructions are executed by the processor, the method for improving the startup speed of a solid state drive after abnormal power failure according to any one of claims 1 to 4 is implemented.

Citation Information

Cited By

  • Mapping table reconstruction method and device, electronic equipment and computer readable storage medium

    CN120973701A