QLC solid state disk writing method and device, QLC solid state disk and medium
Patent Information
- Application Number
- CN202610850458.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-12
- Publication Date
- 2026-08-18
AI Technical Summary
[0005]本发明实施例提供了一种QLC固态硬盘写入方法、装置、QLC固态硬盘及介质,旨在解决现有QLC固态硬盘写入性能较低的问题
[0010]This invention provides a method, apparatus, QLC solid-state drive (SSD) writing method, and medium. The method includes: before writing to the SLC cache, allocating a local valid page bitmap for the SLC cache, the local valid page bitmap being stored in RAM, wherein each bit of the local valid page bitmap corresponds to a physical page in the SLC cache; during the SLC cache writing process, setting the corresponding bits in the local valid page bitmap according to the data writing status of the physical pages in the SLC cache; and after the SLC cache is full, traversing the local valid page bitmap and migrating valid data with preset bit values from the SLC cache to the QLC storage area. This invention's technical solution, by allocating a local valid page bitmap before writing to the SLC cache, setting the corresponding bit status in real time according to the data writing status during the writing process, and directly traversing the bitmap to migrate valid data to the QLC storage area after the SLC cache is full, quickly identifies valid data without querying a mapping table, avoids time-consuming mapping table lookup operations, reduces data migration time, and effectively improves the writing performance of the QLC SSD.
Smart Images

Figure CN122593705A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of solid-state drive technology, and in particular to a QLC solid-state drive writing method, apparatus, QLC solid-state drive and medium. Background Technology
[0002] With the continuous development of flash memory storage technology, solid state drives (SSDs) have been widely used in various electronic devices such as personal computers, servers, and data centers. Among them, quad-level cell (QLC) flash memory has advantages such as high storage density, low cost, and large capacity because each storage cell can store 4 bits of data. However, QLC flash memory also has disadvantages such as slow read and write speeds, short erase and write lifespan, and low reliability.
[0003] To compensate for the performance deficiencies of QLC flash memory, existing QLC solid-state drives typically employ an SLC caching strategy to improve write performance. This means that when data is written, it is first temporarily stored in a high-speed SLC cache. After the SLC cache accumulates a certain amount of data, the data is then moved to the QLC storage area for long-term storage. During the process of moving data from the SLC cache to the QLC storage area, the validity of the data in the SLC cache needs to be checked to ensure that only valid data is migrated. Existing technical solutions typically determine the validity of the data in each physical page of the SLC cache by querying a mapping table.
[0004] However, the aforementioned existing technical solutions have the following drawbacks: During the SLC cache data migration process, it is necessary to traverse all physical pages in the SLC cache and query the mapping table for each physical page to confirm its data validity. When the SLC cache capacity is large, the number of mapping table queries is numerous, resulting in a long data migration process. Furthermore, the mapping table is usually stored in NAND flash memory, and querying the mapping table requires reading data from NAND, which has a relatively slow read speed. As the SSD is used for a long time, the amount of data in the mapping table continues to increase, further increasing the time overhead of mapping table queries. In addition, when the host performs multiple writes to the same logical address, data overwriting may occur in the SLC cache. Existing technologies need to use mapping table queries during the migration process to identify which physical pages have had their data overwritten and invalidated. This process further increases the complexity and time cost of data migration. In summary, the write performance of existing QLC SSDs is relatively low. Summary of the Invention
[0005] This invention provides a QLC solid-state drive writing method, apparatus, QLC solid-state drive, and medium, aiming to solve the problem of low writing performance of existing QLC solid-state drives.
[0006] In a first aspect, embodiments of the present invention provide a QLC solid-state drive writing method, including: Before writing to the SLC cache, a local valid page bitmap is allocated for the SLC cache. The local valid page bitmap is stored in RAM, wherein each bit of the local valid page bitmap corresponds to a physical page in the SLC cache. During the SLC cache writing process, the corresponding bits in the local valid page bitmap are set according to the data writing status of the physical pages in the SLC cache; After the SLC cache is full, the local valid page bitmap is traversed, and valid data with preset bit values are migrated from the SLC cache to the QLC storage area.
[0007] Secondly, embodiments of the present invention also provide a QLC solid-state drive writing device, comprising: An allocation unit is used to allocate a segment of local valid page bitmap for the SLC cache before writing to the SLC cache. The local valid page bitmap is stored in RAM, wherein each bit of the local valid page bitmap corresponds to a physical page in the SLC cache. The setting unit is used to set the corresponding bits in the local valid page bitmap according to the data writing status of the physical pages in the SLC cache during the SLC cache writing process; The migration write unit is used to traverse the local valid page bitmap after the SLC cache is full, and migrate the valid data with a preset bit value from the SLC cache to the QLC storage area.
[0008] Thirdly, embodiments of the present invention also provide a QLC solid-state drive, the QLC solid-state drive including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the above-described method.
[0009] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the above-described method.
[0010] This invention provides a method, apparatus, QLC solid-state drive (SSD) writing method, and medium. The method includes: before writing to the SLC cache, allocating a local valid page bitmap for the SLC cache, the local valid page bitmap being stored in RAM, wherein each bit of the local valid page bitmap corresponds to a physical page in the SLC cache; during the SLC cache writing process, setting the corresponding bits in the local valid page bitmap according to the data writing status of the physical pages in the SLC cache; and after the SLC cache is full, traversing the local valid page bitmap and migrating valid data with preset bit values from the SLC cache to the QLC storage area. This invention's technical solution, by allocating a local valid page bitmap before writing to the SLC cache, setting the corresponding bit status in real time according to the data writing status during the writing process, and directly traversing the bitmap to migrate valid data to the QLC storage area after the SLC cache is full, quickly identifies valid data without querying a mapping table, avoids time-consuming mapping table lookup operations, reduces data migration time, and effectively improves the writing performance of the QLC SSD. Attached Figure Description
[0011] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a flowchart illustrating a QLC solid-state drive writing method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a partially valid page bitmap of an SLC cache mapping provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of a sub-process of a QLC solid-state drive writing method according to an embodiment of the present invention; Figure 4 This is a schematic diagram of another sub-process of a QLC solid-state drive writing method provided in an embodiment of the present invention; Figure 5 A flowchart illustrating a QLC solid-state drive writing method according to another embodiment of the present invention; Figure 6 This is a schematic block diagram of a QLC solid-state drive writing device provided in an embodiment of the present invention; Figure 7 This is a schematic block diagram of a QLC solid-state drive provided in an embodiment of the present invention. Detailed Implementation
[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0014] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0015] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0016] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0017] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."
[0018] Currently, in the field of solid-state drive (SSD) technology, existing QLC SSDs have relatively low write performance. To address this issue, this invention proposes a QLC SSD writing method. This method allocates a local valid page bitmap before writing to the SLC cache. During the writing process, the corresponding bit status is set in real time according to the data writing status. Once the bitmap is full, valid data is directly migrated to the QLC storage area by traversing the bitmap. This eliminates the need to query a mapping table, allowing for rapid identification of valid data, avoiding time-consuming mapping table lookup operations, reducing data migration time, and effectively improving the write performance of the QLC SSD. The invention will be described in detail below through specific embodiments.
[0019] Please see Figure 1 , Figure 1This is a flowchart illustrating a QLC solid-state drive writing method according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps S110-S130.
[0020] S110. Before writing to the SLC cache, allocate a local valid page bitmap for the SLC cache. The local valid page bitmap is stored in RAM, wherein each bit of the local valid page bitmap corresponds to a physical page in the SLC cache.
[0021] In this embodiment of the invention, before the SLC cache formally receives data write operations, a local valid page bitmap needs to be pre-allocated to the SLC cache. This local valid page bitmap is stored in the random access memory (RAM) to enable high-speed access and real-time updates. The local valid page bitmap is constructed using a bit-map mapping method, where each bit in the bitmap corresponds one-to-one with a physical page in the SLC cache. That is, the state change of a single bit directly reflects the data validity state of the corresponding physical page.
[0022] Please refer to Figure 2 ,like Figure 2 As shown, Figure 2 The top center section shows the NAND flash memory physical page matrix, arranged by page number and plane, containing a total of 4096 pages. Figure 2 Below is a partial valid page bitmap, 512 bits in size, with a starting page offset of 32, corresponding to the range of physical pages covered by the SLC cache. The partial valid page bitmap uses a bit mapping mechanism, with each bit corresponding to a physical page in the SLC cache. A bit of 1 indicates that the physical page contains valid data, while a bit of 0 indicates that the physical page contains invalid or empty data. Figure 2 Lines 31 and 32 display markers such as X, Y, Z, W, and M, representing data writes to different logical addresses. X, Y, and W are overwritten multiple times within the same SLC cache cycle, meaning the same logical address corresponds to multiple physical pages, with only the last written data being valid. Therefore, the bits corresponding to the previously written pages in the partial valid page bitmap are set to 0, and the bits corresponding to the most recently written page are set to 1. Compared to the valid page bitmap of a complete NAND block, a complete bitmap requiring 64KB of storage space when a single block contains 4096 pages requires only 512 bits, reducing space usage by approximately 99%. This allows for high-speed access by storing the bitmap in RAM, significantly reducing hardware costs while improving data validity checking efficiency.
[0023] S120. During the SLC cache writing process, the corresponding bit in the local valid page bitmap is set according to the data writing status of the physical page in the SLC cache.
[0024] In embodiments of the present invention, such as Figure 3 As shown, step S120 specifically includes steps S121-S122: S121, when the physical page in the SLC cache is written with the valid data, the corresponding bit in the local valid page bitmap is set to the preset bit value; S122, when the physical page in the SLC cache is overwritten by new data, the bit in the local valid page bitmap corresponding to the overwritten physical page is set to the preset overwrite bit value. It's important to note that during SLC cache writes, when valid data is successfully written to a physical page in the SLC cache, the corresponding bit in the local valid page bitmap for that physical page is set to a preset value. A preset value of 1 indicates that the data currently stored on this physical page is valid and needs to be migrated to the QLC storage area. When the same logical address is written to multiple times by the host, data overwriting occurs in the SLC cache, meaning new data overwrites old data. In this case, the bitmap state needs to be updated to reflect the change in data validity: the bit corresponding to the overwritten physical page in the local valid page bitmap is set to a preset overwrite value. A preset overwrite value of 0 indicates that the old data stored on this physical page is invalid and does not need to be migrated to the QLC storage area. Simultaneously, the bit corresponding to the physical page where new data is written is marked as 1, ensuring that only valid data participates in subsequent migration operations. Understandably, through this bitmap state maintenance mechanism, it's possible to quickly identify which physical pages in the SLC cache contain valid data without querying the mapping table, avoiding time-consuming mapping table lookups and significantly improving data migration efficiency. The local effective page bitmap is stored in RAM, which allows for fast access and occupies far less space than a complete mapping table, reducing hardware costs while improving the write performance of QLC solid-state drives.
[0025] In one embodiment, such as this embodiment, step S121 includes: receiving a user data write request and its corresponding logical address, wherein the data corresponding to the user data write request is the valid data; allocating a page address of the SLC cache to the valid data, the page address corresponding to the currently written physical page; and setting the bit corresponding to the page address in the local valid page bitmap to the preset bit value. It should be noted that when the solid-state drive controller receives a user data write request, it simultaneously obtains the logical address associated with the request. The data carried by the user data write request is the valid data that needs to be stored, and this data needs to be temporarily stored in the SLC cache. A page address in the SLC cache is allocated to the valid data, and this page address directly corresponds to the currently written physical page. Each physical page has a unique location identifier in the SLC cache, and the data storage location can be accurately located through the page address. After page address allocation is complete, the state of the local valid page bitmap is updated: the bit corresponding to the current page address in the local valid page bitmap is set to a preset value. This operation indicates that valid data has been successfully written to the physical page, and this page data needs to be processed when migrating data from the SLC cache to the QLC storage area. Understandably, each data write operation updates the state of the local valid page bitmap in real time, ensuring that the local valid page bitmap accurately reflects the data validity of each physical page in the SLC cache. The bitmap is stored in RAM, and the update operation is fast and efficient, without needing to access the mapping table in the NAND flash memory, significantly improving write response speed. This real-time maintenance mechanism provides an accurate basis for subsequent data migration, avoids invalid data migration, and optimizes overall write performance.
[0026] In one embodiment, such as this embodiment, step S122 includes: obtaining the old NAND address corresponding to the logical address, wherein the old NAND address is the page address that has been allocated to the logical address; determining whether the old NAND address is within the range of the local valid page bitmap to confirm whether the physical page has been overwritten by new data; if so, determining that the physical page has been overwritten by new data, and setting the bit corresponding to the old NAND address in the local valid page bitmap to the preset overwrite bit value. Specifically, when the same logical address is sent multiple times with write requests, it is necessary to handle the data overwrite situation. First, obtain the old NAND address that previously corresponded to the logical address. This old address is actually the SLC cache page address that was previously allocated to the same logical address, representing the physical page location storing the old data.
[0027] After obtaining the old address, it is determined whether the old address falls within the coverage area of the current local valid page bitmap. This determination step is used to confirm whether the physical page being overwritten belongs to the space allocated within the current SLC cache cycle. If the old address is within the bitmap range, it means that the physical page was written again within the current cache cycle, i.e., a data overwrite operation has occurred. After confirming the overwrite, the bit corresponding to the old address in the local valid page bitmap is set to the preset overwrite bit value. This operation indicates that the old data stored in the physical page has become invalid, and when migrating data from the SLC cache to the QLC storage area, the data in this page will be skipped, and no migration operation is required. Through the above overwrite identification and local valid page bitmap update mechanism, multiple writes to the same logical address can be accurately tracked, ensuring that only the latest data is marked as valid.
[0028] In one embodiment, such as this embodiment, after the step of setting the bit corresponding to the old NAND address in the local valid page bitmap to the preset overwrite bit value, the method further includes: modifying the mapping relationship of the logical address to the page address; after the step of determining whether the old NAND address is within the range of the local valid page bitmap to confirm whether the physical page has been overwritten by new data, the method further includes: if not, then performing the step of modifying the mapping relationship of the logical address to the page address. It should be noted that after updating the state of the bit corresponding to the old address in the local valid page bitmap, the mapping relationship of the logical address needs to be pointed to the newly allocated page address to ensure that subsequent read operations can correctly locate the latest written data position and ensure the accuracy of data access. When it is determined that the old address is not within the range of the local valid page bitmap, it indicates that the physical page previously mapped to the logical address does not belong to the current SLC cache cycle, and there is no need to update the state of the local valid page bitmap. However, the mapping relationship update operation still needs to be performed to rebind the logical address to the newly allocated page address to ensure the correct data path. Understandably, regardless of whether the old address is within the bitmap range, logical address mapping update is a necessary step. This mechanism ensures that the correspondence between logical addresses and physical addresses remains up-to-date after each write operation, providing accurate address mapping information for data reading and subsequent migration operations, and maintaining the integrity and consistency of solid-state drive data management.
[0029] S130. After the SLC cache is full, traverse the local valid page bitmap and migrate the valid data with a preset bit value from the SLC cache to the QLC storage area.
[0030] In embodiments of the present invention, such as Figure 4As shown, step S130 specifically includes steps S131-S133: S131, obtaining the position offsets of all bit values in the local valid page bitmap; S132, calculating the corresponding physical address of the SLC cache based on the position offsets; S133, reading the valid data from the physical address and writing it to the QLC storage area. It should be noted that when the SLC cache is full, a data migration operation is initiated. First, the local valid page bitmap is traversed to obtain the position offsets of all bit values, which correspond to the physical pages storing valid data. Based on the obtained position offsets, the corresponding SLC cache physical address is calculated. There is a fixed mapping relationship between the offset and the physical address, allowing for quick location of the target physical page through simple calculation. After location, valid data is read from the physical address and written to the QLC storage area for long-term storage. Read and write operations are performed sequentially according to the valid bits marked in the local valid page bitmap, ensuring that all valid data is migrated. It should also be noted that this process only processes data pages marked as valid in the local valid page bitmap, skipping invalid data pages to avoid moving invalid data. Local effective page bitmap traversal is completed in RAM, which is much faster than traditional mapping table lookups, significantly improving migration efficiency and overall write performance.
[0031] Figure 5 This is a flowchart illustrating a QLC solid-state drive writing method according to another embodiment of the present invention, as shown below. Figure 5 As shown, in this embodiment, the method includes steps S210-S240. Steps S210-S230 are the same as steps S110-S130. In this embodiment, after step S230, step S240 is also included.
[0032] S240. After completing the data migration, release the space occupied by the local effective page bitmap.
[0033] In this embodiment of the invention, after the SLC cache is completely migrated to the QLC storage area, the memory space occupied by the local valid page bitmap in RAM is immediately released, and RAM resources are reclaimed for reallocation during the next data write.
[0034] In summary, the QLC solid-state drive writing method of this invention allocates a local valid page bitmap and maintains its status in real time before writing to the SLC cache. During data migration, it directly traverses the local valid page bitmap to identify valid data without querying the mapping table, significantly reducing data migration time and improving QLC writing performance. The local valid page bitmap only covers the current SLC cache range, occupying far less space than the complete mapping table, and can be stored in RAM for high-speed access, reducing costs. When writing to the same logical address multiple times, the old data can be marked as invalid by updating the corresponding bits of the local valid page bitmap, making the rewrite process simple and efficient. After data migration is completed, the space of the local valid page bitmap is released, which can avoid memory leaks.
[0035] Figure 6 This is a schematic block diagram of a QLC solid-state drive writing device 200 provided in an embodiment of the present invention. Figure 6 As shown, corresponding to the above QLC solid-state drive writing method, the present invention also provides a QLC solid-state drive writing apparatus 200. This QLC solid-state drive writing apparatus 200 includes a unit for performing the above-described QLC solid-state drive writing method, and the apparatus can be configured on a QLC solid-state drive. Specifically, please refer to... Figure 6 The QLC solid-state drive writing device 200 includes an allocation unit 201, a setting unit 202, and a migration writing unit 203. Detailed descriptions of each functional module are as follows: Allocation unit 201 is used to allocate a local valid page bitmap for the SLC cache before writing to the SLC cache. The local valid page bitmap is stored in RAM, wherein each bit of the local valid page bitmap corresponds to a physical page in the SLC cache. Setting unit 202 is used to set the corresponding bit in the local valid page bitmap according to the data writing status of the physical page in the SLC cache during the SLC cache writing process; The migration and writing unit 203 is used to traverse the local valid page bitmap after the SLC cache is full, and migrate the valid data with a preset bit value from the SLC cache to the QLC storage area.
[0036] In some embodiments, such as this one, the setting unit 202 is specifically used for: When valid data is written to the physical page in the SLC cache, the corresponding bit in the local valid page bitmap is set to the preset bit value; When a physical page in the SLC cache is overwritten by new data, the bit corresponding to the overwritten physical page in the local valid page bitmap is set to a preset overwrite bit value.
[0037] In some embodiments, such as this one, the setting unit 202 is further configured to: Receive user data write request and corresponding logical address, wherein the data corresponding to the user data write request is the valid data; Allocate a page address of the SLC cache to the valid data, the page address corresponding to the physical page currently being written; Set the bit corresponding to the page address in the local valid page bitmap to the preset bit value.
[0038] In some embodiments, such as this one, the setting unit 202 is further configured to: Obtain the old NAND address corresponding to the logical address, wherein the old NAND address is the page address that has been allocated to the logical address; Determine whether the old NAND address is within the range of the local valid page bitmap to confirm whether the physical page has been overwritten by new data; If so, it is determined that the physical page has been overwritten by new data, the bit corresponding to the old NAND address in the local valid page bitmap is set to the preset overwrite bit value, and the mapping relationship of the logical address is modified to the page address; If not, then perform the step of modifying the mapping relationship of the logical address to the page address.
[0039] In some embodiments, such as this one, the migration writing unit 203 is specifically used for: Obtain the position offset of all bits in the local valid page bitmap that have the preset bit value; The physical address of the corresponding SLC cache is calculated based on the location offset; The valid data is read from the physical address and written to the QLC storage area.
[0040] In some embodiments, such as this one, the QLC solid-state drive writing device 200 further includes: The release unit is used to release the space occupied by the local valid page bitmap after the data migration is completed.
[0041] The aforementioned QLC solid-state drive writing device can be implemented as a computer program, which can, for example... Figure 7 It runs on the QLC solid-state drive shown.
[0042] Please see Figure 7 , Figure 7 This is a schematic block diagram of a QLC solid-state drive provided in an embodiment of the present invention. The QLC solid-state drive 300 is a device capable of personnel detection.
[0043] See Figure 7The QLC solid-state drive 300 includes a processor 302, a memory, and a network interface 305 connected via a system bus 301. The memory may include a non-volatile storage medium 303 and internal memory 304.
[0044] The non-volatile storage medium 303 can store an operating system 3031 and a computer program 3032. When the computer program 3032 is executed, it causes the processor 302 to perform a QLC solid-state drive writing method.
[0045] The processor 302 provides computing and control capabilities to support the operation of the entire QLC solid-state drive 300.
[0046] The internal memory 304 provides an environment for the execution of the computer program 3032 in the non-volatile storage medium 303. When the computer program 3032 is executed by the processor 302, the processor 302 can execute a QLC solid-state drive writing method.
[0047] This network interface 305 is used for network communication with other devices. Those skilled in the art will understand that... Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the QLC solid-state drive 300 to which the present invention is applied. The specific QLC solid-state drive 300 may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0048] The processor 302 is used to run a computer program 3032 stored in the memory to implement any embodiment of the QLC solid-state drive writing method described above.
[0049] It should be understood that, in this embodiment of the invention, the processor 302 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0050] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by a processor in the computer system to implement the process steps of the embodiments of the above methods.
[0051] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program. When executed by a processor, the computer program causes the processor to perform any embodiment of the QLC solid-state drive writing method described above.
[0052] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.
[0053] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0054] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0055] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this 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.
[0056] If the integrated unit is implemented as 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, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a QLC solid-state drive to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0057] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0058] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Since these modifications and variations fall within the scope of the claims and their equivalents, this invention also intends to include these modifications and variations.
[0059] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for writing to a QLC solid-state drive, characterized in that, include: Before writing to the SLC cache, a local valid page bitmap is allocated for the SLC cache. The local valid page bitmap is stored in RAM, wherein each bit of the local valid page bitmap corresponds to a physical page in the SLC cache. During the SLC cache writing process, the corresponding bits in the local valid page bitmap are set according to the data writing status of the physical pages in the SLC cache; After the SLC cache is full, the local valid page bitmap is traversed, and valid data with preset bit values are migrated from the SLC cache to the QLC storage area.
2. The method according to claim 1, characterized in that, The step of setting the corresponding bit in the local valid page bitmap according to the data write status of the physical page in the SLC cache includes: When valid data is written to the physical page in the SLC cache, the corresponding bit in the local valid page bitmap is set to the preset bit value; When a physical page in the SLC cache is overwritten by new data, the bit corresponding to the overwritten physical page in the local valid page bitmap is set to a preset overwrite bit value.
3. The method according to claim 2, characterized in that, The step of setting the corresponding bit in the local valid page bitmap to the preset bit value when the physical page in the SLC cache is written with valid data includes: Receive user data write request and corresponding logical address, wherein the data corresponding to the user data write request is the valid data; Allocate a page address of the SLC cache to the valid data, the page address corresponding to the physical page currently being written; Set the bit corresponding to the page address in the local valid page bitmap to the preset bit value.
4. The method according to claim 3, characterized in that, The step of setting the bit corresponding to the overwritten physical page in the local valid page bitmap to a preset overwrite bit value when the physical page in the SLC cache is overwritten by new data includes: Obtain the old NAND address corresponding to the logical address, wherein the old NAND address is the page address that has been allocated to the logical address; Determine whether the old NAND address is within the range of the local valid page bitmap to confirm whether the physical page has been overwritten by new data; If so, it is determined that the physical page has been overwritten by new data, and the bit corresponding to the old NAND address in the local valid page bitmap is set to the preset overwrite bit value.
5. The method according to claim 4, characterized in that, After the step of setting the bit corresponding to the old NAND address in the local valid page bitmap to the preset overwrite bit value, the method further includes: Modify the mapping relationship of the logical address to the page address; After the step of determining whether the old NAND address is within the range of the local valid page bitmap to confirm whether the physical page has been overwritten by new data, the method further includes: If not, then perform the step of modifying the mapping relationship of the logical address to the page address.
6. The method according to claim 1, characterized in that, The step of traversing the local valid page bitmap and migrating valid data with preset bit values from the SLC cache to the QLC storage area includes: Obtain the position offset of all bits in the local valid page bitmap that have the preset bit value; The physical address of the corresponding SLC cache is calculated based on the location offset; The valid data is read from the physical address and written to the QLC storage area.
7. The method according to claim 1, characterized in that, After the step of migrating valid data with a preset bit value from the SLC cache to the QLC storage area, the method further includes: After the data migration is complete, release the space occupied by the local valid page bitmap.
8. A QLC solid-state drive writing device, characterized in that, include: An allocation unit is used to allocate a segment of local valid page bitmap for the SLC cache before writing to the SLC cache. The local valid page bitmap is stored in RAM, wherein each bit of the local valid page bitmap corresponds to a physical page in the SLC cache. The setting unit is used to set the corresponding bits in the local valid page bitmap according to the data writing status of the physical pages in the SLC cache during the SLC cache writing process; The migration write unit is used to traverse the local valid page bitmap after the SLC cache is full, and migrate the valid data with a preset bit value from the SLC cache to the QLC storage area.
9. A QLC solid-state drive, characterized in that, The QLC solid-state drive includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, can implement the method as described in any one of claims 1-7.