SSD data simulation processing method and device, computer device, and storage medium
By dividing the SSD's LBA into multiple LPAs and performing compression and data rearrangement, the problem of high SSD hardware dependency is solved, improving firmware development efficiency and data verification accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUZHOU UNIONMEMORY INFORMATION SYST LTD
- Filing Date
- 2023-04-24
- Publication Date
- 2026-06-23
AI Technical Summary
Existing SSDs rely heavily on hardware when implementing data compression, resulting in low firmware development efficiency.
By dividing the SSD's LBA into multiple LPAs of the same length, performing length compression, and rearranging the data in the compressed LPAs to generate header information, the dependence on hardware is reduced.
This enables firmware development and verification without an actual compression engine, improving firmware development efficiency and ensuring the correctness of host read and write data.
Smart Images

Figure CN116450047B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to solid-state drives, and more specifically to SSD data emulation processing methods, apparatus, computer equipment, and storage media. Background Technology
[0002] Solid-state drives (SSDs) have been widely used in various applications and are gradually replacing traditional HDDs in the PC market, providing users with a better experience in terms of reliability and performance. With the evolution of SSD technology, more and more features are being introduced, including data compression. Currently, such complex functions require hardware support; if the hardware is not ready during SSD firmware development, the corresponding firmware cannot be developed.
[0003] Therefore, it is necessary to design a compression processing method that can reduce the dependence on hardware when implementing compression functions on SSDs, in order to meet firmware development needs and improve firmware development efficiency. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide an SSD data simulation processing method, apparatus, computer equipment and storage medium.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] In a first aspect, the present invention provides an SSD data simulation processing method, comprising:
[0007] Constrain user data validation fields;
[0008] The SSD's LBA is divided into multiple LPAs, each with the same length;
[0009] Each LPA is length-compressed to obtain a compressed LPA;
[0010] Perform data rearrangement on all compressed LPAs.
[0011] The further technical solution is as follows: the data corresponding to each LPA includes user data, system data and verification data, wherein the user data includes fill data.
[0012] The further technical solution is as follows: the length compression process for each LPA to obtain a compressed LPA includes:
[0013] Configure the compression range of LPA;
[0014] The compression ratio is randomly generated based on the compression range;
[0015] The padding data of each LPA is compressed according to the compression ratio to obtain the compressed LPA.
[0016] The further technical solution is as follows: the data rearrangement process for all compressed LPAs includes:
[0017] Based on the length of each compressed LPA, select one or more compressed LPAs and merge them to form a compressed storage set;
[0018] Generate the header information for the corresponding compressed storage set.
[0019] The further technical solution is as follows: the Header information includes the number of LPA combinations, the starting address of each LPA, and the length of each LPA.
[0020] Secondly, the present invention also provides an SSD data simulation processing device, including a constraint unit, a partitioning unit, a compression processing unit, and a data rearrangement processing unit;
[0021] The constraint unit is used to constrain the user data validation field;
[0022] The partitioning unit is used to divide the LBA of the SSD into multiple LPAs, each LPA having the same length.
[0023] The compression processing unit is used to perform length compression processing on each LPA to obtain a compressed LPA;
[0024] The data rearrangement processing unit is used to perform data rearrangement processing on all compressed LPAs.
[0025] The further technical solution is as follows: the compression processing unit includes a configuration module, a compression ratio generation module, and a compression processing module;
[0026] The configuration module is used to configure the compression range of LPA;
[0027] The compression ratio generation module is used to randomly generate a compression ratio based on the compression range;
[0028] The compression processing module is used to compress the fill data of each LPA according to the compression ratio to obtain the compressed LPA.
[0029] The further technical solution is as follows: the data rearrangement processing unit includes a compression storage module and a header information generation module;
[0030] The compression storage module is used to select one or more compressed LPAs and merge them into a compressed storage set according to the length of each compressed LPA.
[0031] The Header information generation module is used to generate the Header information for the corresponding compressed storage set.
[0032] Thirdly, the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the SSD data emulation processing method as described above.
[0033] Fourthly, the present invention also provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, cause the processor to perform the SSD data emulation processing method described above.
[0034] The advantages of this invention compared to existing technologies are as follows: This invention constrains the user data verification field; divides the SSD's LBA into multiple LPAs of equal length; performs length compression on each LPA to obtain a compressed LPA; and performs data rearrangement on all compressed LPAs. During the compression process, by retaining the agreed-upon user data verification field while removing padding information, the requirement for host read / write comparison and verification of data correctness is met, while also achieving rapid compression. Furthermore, using this compression simulation processing method allows for firmware development and verification even without an actual compression engine, thereby improving firmware development efficiency.
[0035] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other objectives, features and advantages of the present invention more obvious and understandable, preferred embodiments are described in detail below. Attached Figure Description
[0036] 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.
[0037] Figure 1 The flowchart of the SSD data simulation processing method provided in a specific embodiment of the present invention Figure 1 ;
[0038] Figure 2 The flowchart of the SSD data simulation processing method provided in a specific embodiment of the present invention Figure 2 ;
[0039] Figure 3The flowchart of the SSD data simulation processing method provided in a specific embodiment of the present invention Figure 3 ;
[0040] Figure 4 A schematic diagram of an SSD data simulation processing device provided in a specific embodiment of the present invention. Figure 1 ;
[0041] Figure 5 A schematic diagram of an SSD data simulation processing device provided in a specific embodiment of the present invention. Figure 2 ;
[0042] Figure 6 A schematic diagram of an SSD data simulation processing device provided in a specific embodiment of the present invention. Figure 3 ;
[0043] Figure 7 This is a schematic block diagram of a computer device provided for a specific embodiment of the present invention. Detailed Implementation
[0044] 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.
[0045] 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.
[0046] 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.
[0047] 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.
[0048] Please see Figure 1 This invention provides an SSD data simulation processing method, including the following steps: S10-S40.
[0049] S10, Constrain user data validation fields.
[0050] Agree on user data validation fields with the host testing tool.
[0051] S20. Divide the SSD's LBA into multiple LPAs, with each LPA having the same length.
[0052] In solid-state drives (SSDs), LPA stands for Logical Page Address, while LBA stands for Logical Block Address. LPA is the smallest unit for accessing NAND flash memory, while LBA is the smallest unit for managing host data.
[0053] Dividing an LBA into multiple LPAs means further dividing a single logical block into multiple logical pages.
[0054] Each LPA corresponds to user data, system data, and verification data. User data consists of data written by the host to the corresponding LBA. This written LBA data includes padding data, which is generally generated from random data or all-zero data. It is not the actual useful data in the user data. Therefore, when performing subsequent compression processing, compressing the LBA padding data is more beneficial for the correctness of the host's read and write comparison verification data process, and can also achieve fast compression.
[0055] S30. Perform length compression on each LPA to obtain a compressed LPA.
[0056] like Figure 2 As shown, in one embodiment, step S30 specifically includes the following steps: S301-S303.
[0057] S301, Configure the compression range of LPA.
[0058] During the compression process, configure the compression ratio range according to the actual situation. For example, you can customize the compression ratio range as 1 / 32–1 / 8.
[0059] S302. Randomly generate compression ratios based on the compression range.
[0060] Compression ratio is the ratio of the length of the compressed data to the length of the original data.
[0061] S303. Compress the filling data of each LPA according to the compression ratio to obtain the compressed LPA.
[0062] The object of compression is the padding data of LPA. By compressing all or part of the padding data, the total data length after compression is divided by the initial data length to meet the compression ratio.
[0063] During the compression process, by retaining the agreed-upon user data verification fields while removing padding information, the host's requirement to verify the correctness of read and write data is met, while also achieving rapid compression. Furthermore, using this compression simulation method allows for firmware development and verification even without an actual compression engine, thereby improving firmware development efficiency.
[0064] S40. Perform data rearrangement on all compressed LPAs.
[0065] like Figure 3 As shown, in one embodiment, step S40 specifically includes the following steps: S401-S402.
[0066] S401. Based on the length of each compressed LPA, select one or more compressed LPAs and merge them to form a compressed storage set.
[0067] A compressed storage set is equivalent to a storage unit. The size of the storage unit can be pre-configured. The number of compressed LPAs to be selected needs to be determined based on the size of the storage unit. For example, if the size of the storage unit is 4KB, then two compressed LPAs of 2KB each should be selected to be combined.
[0068] S402. Generate the header information for the corresponding compressed storage set.
[0069] The header information includes the number of LPA combinations, the starting address of each LPA, and the length of each LPA.
[0070] All compressed LPAs were rearranged to optimize the data storage layout, thereby improving the efficiency of firmware development.
[0071] After rearranging the data for all compressed LPAs, the SSD internally allocates physical storage locations for each compressed storage set, updates the L2P table based on the LPA information stored in that compressed storage set, performs ECC encoding, and writes the data into the NAND flash memory. If subsequent verification of the read / write data's correctness is required, it is handled as follows.
[0072] The processing method is as follows: The host issues a command to read data from the specified logical address. The SSD further divides the LBA into multiple LPAs. Based on the corresponding LPA, it queries the corresponding physical address and then initiates the corresponding read based on the physical address. By parsing the header information of the compressed storage set, it queries the composition of the LPAs in the compressed storage set. Based on the LPA to be read, it obtains its offset and length within the compressed storage set, extracts the corresponding data, decompresses it, and then returns the corresponding decompressed data to the host. The host compares the read data with the previously written data (only comparing the agreed user data verification fields) to verify the correctness of the data.
[0073] Corresponding to the above-described SSD data simulation processing method, this embodiment of the invention also provides an SSD data simulation processing device.
[0074] like Figure 4 As shown, the SSD data simulation processing device 100 includes a constraint unit 110, a partitioning unit 120, a compression processing unit 130, and a data rearrangement processing unit 140. The constraint unit 110 is used to constrain the user data verification field. The partitioning unit 120 is used to divide the SSD's LBA into multiple LPAs, each LPA having the same length. The compression processing unit 130 is used to perform length compression processing on each LPA to obtain a compressed LPA. The data rearrangement processing unit 140 is used to perform data rearrangement processing on all the compressed LPAs.
[0075] It should be noted that the data corresponding to each LPA includes user data, system data, and verification data, where user data includes populated data.
[0076] like Figure 5 As shown, in one embodiment, the compression processing unit 130 includes a configuration module 131, a compression ratio generation module 132, and a compression processing module 133. The configuration module 131 is used to configure the compression range of the LPA. The compression ratio generation module 132 is used to randomly generate a compression ratio based on the compression range. The compression processing module 133 is used to compress the fill data of each LPA according to the compression ratio to obtain a compressed LPA.
[0077] like Figure 6 As shown, in one embodiment, the data rearrangement processing unit 140 includes a compression storage module 141 and a header information generation module 142. The compression storage module 141 is used to select one or more compressed LPAs and merge them to form a compressed storage set based on the length of each compressed LPA. The header information generation module 142 is used to generate header information for the corresponding compressed storage set. The header information includes the number of LPA combinations, the starting address of each LPA, and the length of each LPA.
[0078] The above-described SSD data simulation processing method can be implemented as a computer program, which can be used in, for example... Figure 7 It runs on the computer device shown.
[0079] Please see Figure 7 , Figure 7 This is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device 700 can be a server, wherein the server can be a standalone server or a server cluster composed of multiple servers.
[0080] like Figure 7 As shown, the computer device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the SSD data emulation processing method described above.
[0081] The computer device 700 can be a terminal or a server. The computer device 700 includes a processor 720, a memory, and a network interface 750 connected via a system bus 710, wherein the memory may include a non-volatile storage medium 730 and internal memory 740.
[0082] The non-volatile storage medium 730 can store an operating system 731 and a computer program 732. When the computer program 732 is executed, it enables the processor 720 to perform any SSD data emulation processing method.
[0083] The processor 720 provides computing and control capabilities to support the operation of the entire computer device 700.
[0084] The internal memory 740 provides an environment for the execution of the computer program 732 in the non-volatile storage medium 730. When the computer program 732 is executed by the processor 720, the processor 720 can execute any SSD data emulation processing method.
[0085] This network interface 750 is used for network communication, such as sending assigned tasks. 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 application and does not constitute a limitation on the computer device 700 to which the present application is applied. The specific computer device 700 may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements. The processor 720 is used to run program code stored in memory to implement the following steps:
[0086] An SSD data simulation processing method, comprising:
[0087] Constrain user data validation fields;
[0088] The SSD's LBA is divided into multiple LPAs, each with the same length;
[0089] Each LPA is length-compressed to obtain a compressed LPA;
[0090] Perform data rearrangement on all compressed LPAs.
[0091] In one embodiment, the data corresponding to each LPA includes user data, system data, and verification data, wherein the user data includes padding data.
[0092] In one embodiment, the length compression process for each LPA to obtain a compressed LPA includes:
[0093] Configure the compression range of LPA;
[0094] The compression ratio is randomly generated based on the compression range;
[0095] The padding data of each LPA is compressed according to the compression ratio to obtain the compressed LPA.
[0096] In one embodiment, the data rearrangement process for all compressed LPAs includes:
[0097] Based on the length of each compressed LPA, select one or more compressed LPAs and merge them to form a compressed storage set;
[0098] Generate the header information for the corresponding compressed storage set.
[0099] In one embodiment, the Header information includes the number of LPA combinations, the starting address of each LPA, and the length of each LPA.
[0100] It should be understood that in the embodiments of this application, the processor 720 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.
[0101] Those skilled in the art will understand that Figure 7 The structure of the computer device 700 shown does not constitute a limitation on the computer device 700, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0102] In another embodiment of the present invention, a computer-readable storage medium is provided. This computer-readable storage medium may be a non-volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, wherein when executed by a processor, the computer program implements the SSD data emulation processing method disclosed in the embodiments of the present invention.
[0103] Those skilled in the art will readily understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. 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 composition and steps of each example have been generally described in terms of function 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 implementation should not be considered beyond the scope of this invention.
[0104] In the embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Units with the same function may be grouped into one unit. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, or it may be an electrical, mechanical, or other form of connection.
[0105] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention, depending on actual needs.
[0106] Furthermore, 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. The integrated unit can be implemented in hardware or as a software functional unit.
[0107] 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 computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks.
[0108] 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. An SSD data simulation processing method, characterized in that, include: Agree on user data validation fields with the host testing tool; The SSD's LBA is divided into multiple LPAs, each with the same length; Each LPA is length-compressed to obtain a compressed LPA; Perform data rearrangement on all compressed LPAs; Each LPA corresponds to data including user data, system data, and verification data, where user data includes population data; The length compression process for each LPA to obtain a compressed LPA includes: Configure the compression range of LPA; The compression ratio is randomly generated based on the compression range; The padding data for each LPA is compressed according to the compression ratio to obtain the compressed LPA; The data rearrangement process for all compressed LPAs includes: Based on the length of each compressed LPA, select one or more compressed LPAs and merge them to form a compressed storage set; Generate the header information for the corresponding compressed storage set; The header information includes the number of LPA combinations, the starting address of each LPA, and the length of each LPA.
2. An SSD data simulation processing device, which, when running, executes the SSD data simulation processing method according to claim 1, characterized in that, It includes constraint units, partitioning units, compression processing units, and data rearrangement processing units; The constraint unit is used to agree on user data verification fields with the host testing tool; The partitioning unit is used to divide the LBA of the SSD into multiple LPAs, each LPA having the same length. The compression processing unit is used to perform length compression processing on each LPA to obtain a compressed LPA; The data rearrangement processing unit is used to perform data rearrangement processing on all compressed LPAs.
3. The SSD data simulation processing device according to claim 2, characterized in that, The compression processing unit includes a configuration module, a compression ratio generation module, and a compression processing module; The configuration module is used to configure the compression range of LPA; The compression ratio generation module is used to randomly generate a compression ratio based on the compression range; The compression processing module is used to compress the fill data of each LPA according to the compression ratio to obtain the compressed LPA.
4. The SSD data simulation processing device according to claim 2, characterized in that, The data rearrangement processing unit includes a compression storage module and a header information generation module. The compression storage module is used to select one or more compressed LPAs and merge them into a compressed storage set according to the length of each compressed LPA. The Header information generation module is used to generate the Header information for the corresponding compressed storage set.
5. A computer device, characterized in that, It includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the SSD data emulation processing method as described in claim 1.
6. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor, the processor performs the SSD data emulation processing method as described in claim 1.