SSD metadata storage optimization method and device and related medium
By sharding, compressing and merging SSD metadata, the problem of excessive SSD metadata area occupation is solved, and the effect of improving user data redundant space and extending the service life of SSD is achieved.
Patent Information
- Application Number
- CN202510151098.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-05-30
AI Technical Summary
The SSD metadata area in the prior art occupies too much space, compresses the redundant space of user data, resulting in a reduced service life of the SSD.
By receiving the metadata operation request initiated by the metadata management module of the SSD, it is determined whether it is a write request. If so, the metadata to be written will be sliced and compressed through the metadata compression module. Finally, the compression result will be merged into a physical page and written to the NAND memory through the metadata merging module.
It reduces the physical space occupation of metadata, improves the available redundant space of user data, extends the service life of SSDs, and improves storage efficiency.
Smart Images

Figure CN120066412A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and particularly relates to an SSD metadata storage optimization method, device and related medium. Background Art
[0002] As a high-performance storage device, a solid-state drive (SSD) uses NAND flash memory as the storage medium, and its data cannot be directly overwritten and modified after being written. The mapping table of the SSD is stored in the metadata area and is continuously updated during the operation of the SSD. Taking a 1TB-capacity SSD as an example, the mapping table requires about 1GB of storage space, and due to the random rewrite feature, its actual storage requirement reaches 3 times. In addition, to improve reliability, the mapping table is usually stored in the single-level cell (SLC) mode, and its physical overhead is 3 to 4 times that of the multi-level cell (TLC) or the quad-level cell (QLC), resulting in the metadata area accounting for more than 1%.
[0003] Therefore, the metadata area of the SSD in the prior art occupies too much space, significantly compresses the redundant space (OP) of user data, and further reduces the service life of the SSD. Summary of the Invention
[0004] Embodiments of the present invention provide an SSD metadata storage optimization method, device and related medium, aiming to solve the problem that the metadata area of the SSD in the prior art occupies too much space and compresses the redundant space of user data.
[0005] In a first aspect, an embodiment of the present invention provides an SSD metadata storage optimization method, including:
[0006] Receiving a metadata operation request initiated by a metadata management module of the SSD;
[0007] Judging whether the metadata operation request is a write request. If not, jumping to the read process. If so, fragmenting the metadata to be written according to a predetermined size to obtain a metadata fragmentation result;
[0008] Using a metadata compression module of the SSD to perform compression processing on the metadata fragmentation result to obtain a metadata compression result;
[0009] Merging the metadata compression result into physical pages through a metadata merging module of the SSD;
[0010] Sending the merged physical pages to the NAND memory to complete the write operation.
[0011] In a second aspect, an embodiment of the present invention provides an SSD metadata storage optimization device, including:
[0012] A data request unit, configured to receive a metadata operation request initiated by a metadata management module of an SSD;
[0013] A data judgment unit, configured to judge whether the metadata operation request is a write request. If not, it jumps to the read process. If so, it slices the metadata to be written into predetermined sizes to obtain a metadata slicing result;
[0014] A data compression unit, configured to use a metadata compression module of the SSD to perform compression processing on the metadata slicing result to obtain a metadata compression result;
[0015] A data merging unit, configured to merge the metadata compression result into physical pages through a metadata merging module of the SSD;
[0016] A data writing unit, configured to send the merged physical pages to a NAND memory to complete the writing operation.
[0017] In a third aspect, an embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the SSD metadata storage optimization method of the first aspect is implemented.
[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the SSD metadata storage optimization method of the first aspect is implemented.
[0019] An embodiment of the present invention provides an SSD metadata storage optimization method, including receiving a metadata operation request initiated by a metadata management module of an SSD; judging whether the metadata operation request is a write request. If not, it jumps to the read process. If so, it slices the metadata to be written into predetermined sizes to obtain a metadata slicing result; using a metadata compression module of the SSD to perform compression processing on the metadata slicing result to obtain a metadata compression result; merging the metadata compression result into physical pages through a metadata merging module of the SSD; sending the merged physical pages to a NAND memory to complete the writing operation. The present invention merges the metadata compression result into physical pages through the metadata merging module of the SSD, and then sends the merged physical pages to the NAND memory. In this way, the physical space occupied by the metadata is reduced, the available redundant space of user data is increased, and the service life of the SSD is improved.
[0020] An embodiment of the present invention also provides an SSD metadata storage optimization device, a computer device, and a storage medium, which also have the above beneficial effects. Description of the Drawings
[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.
[0022] Figure 1 It is a schematic flowchart of a method for optimizing SSD metadata storage provided by an embodiment of the present invention;
[0023] Figure 2 It is a schematic framework diagram of a method for optimizing SSD metadata storage provided by an embodiment of the present invention;
[0024] Figure 3 It is another schematic flowchart of a method for optimizing SSD metadata storage provided by an embodiment of the present invention;
[0025] Figure 4 It is a schematic block diagram of an apparatus for optimizing SSD metadata storage provided by an embodiment of the present invention. Detailed implementation manners
[0026] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the protection scope of the present invention.
[0027] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprise" indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0028] 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 this 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 the plural forms.
[0029] It should be further understood that the term "and / or" used in this specification of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0030] Please refer to the following Figure 1 ,Figure 1 The figure is a schematic flowchart of an SSD metadata storage optimization method provided by an embodiment of the present invention, specifically including steps S101 to S105.
[0031] S101. Receive a metadata operation request initiated by the metadata management module of the SSD;
[0032] S102. Determine whether the metadata operation request is a write request. If not, jump to the read process. If so, slice the metadata to be written into predetermined sizes to obtain a metadata slicing result;
[0033] S103. Use the metadata compression module of the SSD to perform compression processing on the metadata slicing result to obtain a metadata compression result;
[0034] S104. Merge the metadata compression result into physical pages through the metadata merging module of the SSD;
[0035] S105. Send the merged physical pages to the NAND memory to complete the write operation.
[0036] Combined with Figure 2 and Figure 3 As shown, in step S101, a metadata operation request initiated by the metadata management module is received. The metadata management module of the SSD coordinates operations such as writing and reading of metadata. When the SSD initiates an operation requirement, the metadata management module generates a corresponding operation request and sends it to the control unit of the SSD.
[0037] In step S102, it is determined whether the metadata operation request is a write request. If the operation request is a write request, enter the write process; otherwise, jump to the read process. In the write process, the system slices the metadata to be processed into predetermined sizes. For example, the SSD can slice the metadata into multiple parts of a fixed size (such as 4KB) for subsequent compression and storage operations.
[0038] In one embodiment, step S102 includes:
[0039] Obtain the metadata index in the metadata compression result;
[0040] Send a read request to the NAND memory according to the metadata index to obtain the system data area in the compressed physical page;
[0041] Use the metadata splitting module of the SSD to parse the system data area to obtain metadata fragments;
[0042] Use the metadata decompression module of the SSD to perform decompression processing on the metadata fragments and return the decompression result to the metadata management module.
[0043] In this embodiment, the metadata management module determines the logical address of the target metadata according to the read request of the SSD, and obtains the metadata index corresponding to the logical address by querying the mapping table. The metadata index identifies the position and status information of the target metadata in the physical page, and is used for subsequent storage access and parsing operations. The metadata reading module determines the storage address of the target physical page through the metadata index, and sends a read request to the NAND memory. The NAND memory reads the data of the target physical page according to the request and returns it to the metadata reading module. The data in the physical page includes the stored metadata segment and the content of its related system data area.
[0044] Further, the metadata splitting module extracts the content of the system data area from the read physical page and parses the following key information:
[0045] Metadata index list: Records the indexes of all metadata segments stored in the current physical page;
[0046] Metadata offset list: Identifies the starting storage position of each metadata segment in the physical page;
[0047] Metadata length list: Records the storage length of each metadata segment;
[0048] Compression flag list: Indicates whether each metadata segment has been compressed.
[0049] Using the metadata index list, the metadata splitting module can locate the storage position and status information of the metadata segment.
[0050] Further, if the compression flag of the metadata segment indicates that the shard has been compressed, the decompression module performs a decompression operation on it to restore it to the original data content; if the compression flag indicates that the shard has not been compressed, the metadata segment is directly output. After the processing is completed, the decompressed metadata content is returned to the metadata management module and further responds to the read request of the SSD. This embodiment realizes the efficient reading and processing of SSD metadata, quickly locates the target data using the index information in the system data area, and combines compression and decompression strategies, which not only optimizes the storage efficiency, but also ensures the integrity and availability of the data. This method greatly improves the reading performance of the SSD, reduces the operation latency, and provides a more efficient storage service for the host.
[0051] In one embodiment, the use of the metadata splitting module of the SSD to parse the system data area to obtain metadata segments includes:
[0052] Using the metadata splitting module to compare the metadata index with the index array stored in the system data area to obtain offset data;
[0053] Find the corresponding metadata offset and metadata length according to the offset data;
[0054] Calculate the starting position and storage length of the metadata using the metadata offset and metadata length;
[0055] Calculate the metadata segment according to the starting position and storage length of the metadata.
[0056] In this embodiment, the system data area stores the management information of all metadata segments within the current physical page, including the metadata index array (Meta_Index[N]). The metadata splitting module determines the position of the target index in the index array by comparing it one by one with the target metadata index requested by the SSD, so as to obtain the offset data (Offset). This offset data is the identifier of the metadata segment within the physical page, indicating its specific storage location. The system data area also stores the metadata offset array (Meta_Offset[N]) and the metadata length array (Meta_Len[N]). According to the obtained offset data, the metadata splitting module reads the starting storage position of the target metadata from Meta_Offset[N] and reads the storage length of the target metadata from Meta_Len[N]. These information are the basis for calculating the position and range of the metadata segment.
[0057] Furthermore, according to the read metadata offset (Meta_Offset) and metadata length (Meta_Len), the metadata splitting module calculates the actual storage range of the metadata segment in the physical page. Specifically, the starting position of the target metadata is the physical page base address plus the value of Meta_Offset, and its storage range is determined by the value of Meta_Len. The metadata splitting module extracts the metadata segment from the user data area of the physical page according to the calculated starting position and storage range. During the extraction process, it also checks whether the target metadata has been compressed. If the compression flag array (Compressed[N]) in the system data area indicates that the target metadata has been compressed, this information is recorded for subsequent decompression.
[0058] In one embodiment, the using the metadata decompression module of the SSD to perform decompression processing on the metadata segment and returning the decompression result to the metadata management module includes:
[0059] Find the corresponding compression flag using the offset data;
[0060] Judge whether the metadata segment has been compressed according to the compression flag. If the metadata segment has been compressed, perform decompression processing on the metadata segment and return the decompression result to the metadata management module;
[0061] If the metadata segment is not compressed, directly return the metadata segment to the metadata management module to complete the read operation.
[0062] In this embodiment, the system data area includes a compression flag array (Compressed[N]) for indicating whether each metadata segment stored in the current physical page has been compressed. The metadata decompression module looks up the compression flag information of the corresponding metadata segment from Compressed[N] according to the previously parsed offset data (Offset). This flag is used to judge the storage state of the metadata segment. According to the obtained compression flag, the metadata decompression module judges whether the metadata segment has been compressed:
[0063] If the compression flag is true, it means that the metadata segment has been compressed and stored;
[0064] If the compression flag is false, it means that the metadata segment is uncompressed original data.
[0065] When the compression flag is true, the metadata decompression module calls the decompression algorithm to decompress the metadata segment. The decompression algorithm decodes the data according to the preset compression method (such as LZ4 or Zstandard, etc.) and restores the compressed data to the original data content. After decompression is completed, the decompression module stores the decompression result in the intermediate cache for subsequent operations. When the compression flag is false, no decompression operation is required. The metadata decompression module directly reads the content of the metadata segment from the physical page and returns it to the metadata management module. Regardless of whether the metadata segment has been decompressed, the final processing result will be returned to the metadata management module. After the metadata management module verifies the returned data, it sends it to the SSD to complete the read operation.
[0066] In one embodiment, step S102 further includes:
[0067] Divide the metadata to be written into multiple shards according to a predetermined size;
[0068] Generate metadata indexes corresponding to the multiple shards respectively;
[0069] Associate the metadata content of each shard with the corresponding metadata index to obtain the metadata sharding result.
[0070] In this embodiment, after the metadata management module receives a metadata write request initiated by the SSD, it divides the metadata to be written according to a preset shard size (e.g., 4KB). Each shard is an independent storage unit with a fixed size for subsequent compression, merging, and storage operations. The design of the shard size is based on the physical page storage structure of the SSD, aiming to make full use of the storage space of physical pages, reduce storage waste, and optimize the write performance. For each generated metadata shard, the metadata management module creates a unique metadata index to identify the position of the shard in the entire metadata storage structure. The index is usually a logical identifier representing the sequence number or logical address of the metadata shard. For example, for a 1MB metadata, sharded by 4KB, 256 shards can be generated, and each shard is numbered from 0, 1, 2, up to 255 in sequence.
[0071] Further, the metadata management module binds the actual content of each metadata shard with the generated metadata index to form a complete metadata shard result. The associated metadata shard result includes the following information:
[0072] Metadata index: uniquely identifies the logical position of the shard;
[0073] Metadata content: the actual data content after sharding;
[0074] Timestamp: records the time when the shard is generated or updated, for version management;
[0075] Check information: the checksum generated for the shard content, for subsequent data integrity verification.
[0076] In step S103, the metadata compression module performs compression processing on the metadata shard result to obtain a metadata compression result.
[0077] In one embodiment, step S103 includes:
[0078] Determine whether the compression ratio of the metadata shard result is greater than a predetermined compression threshold. If the compression ratio is greater than the predetermined compression threshold, do not perform compression processing on the metadata shard result and directly pass the metadata shard result to the metadata merging module;
[0079] If the compression ratio is less than or equal to the predetermined compression threshold, perform compression processing on the metadata shard result to obtain the metadata compression result.
[0080] In this embodiment, after receiving the metadata sharding result, the metadata compression module first calculates the compression ratio of each shard. The compression ratio is defined as the ratio of the size of the compressed shard data to the size of the uncompressed data, and is used to evaluate whether the shard is suitable for compressed storage. The system presets a compression threshold (e.g., 1 / 2) as a reference standard for determining whether to compress the shard. If the compression ratio is greater than the predetermined compression threshold, it means that the storage space saved after compressing the metadata shard is limited, and the benefit of the compression process is not sufficient to offset the computational overhead brought by the compression operation. At this time, the metadata compression module skips the compression process and directly passes the metadata sharding result (raw data) to the metadata merging module for subsequent processing. If the compression ratio is less than or equal to the predetermined compression threshold, it means that the compression operation can reduce the storage space occupied by the shard and has an obvious storage optimization effect. At this time, the metadata compression module compresses the shard data to generate a compressed data result, and simultaneously records the following information: the actual storage size of the shard data after the compression process is completed, marks whether the shard has been compressed, and records the type of compression algorithm used (e.g., LZ4 or Zstandard) so as to select the corresponding decompression method during subsequent decompression operations.
[0081] Furthermore, for the compressed shards, the metadata compression module encapsulates the compressed data content, data size, compression flag, etc. information together to form a complete metadata compression result. For the uncompressed shards, the raw data content and related information are directly used as the compression result. The metadata compression result is then passed to the metadata merging module for further processing. Through the above steps, the metadata compression module can dynamically select to compress or skip the compression process according to the compression ratio of the shards, thereby maximizing the storage space utilization rate of the SSD while ensuring the computational efficiency.
[0082] In step S104, the metadata merging module splices the metadata compression results according to the storage capacity of the physical page (e.g., 16KB) to ensure that each physical page stores as many metadata shards as possible. Inside the physical page, system management information can be stored simultaneously, including: the index of each metadata shard, compression status, storage offset, storage length, check data, etc.
[0083] In one embodiment, the step S104 includes:
[0084] Determine whether the compression length of the metadata compression result is less than the length of the physical page. If not, splice the metadata compression results in sequence until the storage unit of the physical page is filled to obtain the physical page;
[0085] If so, after filling the metadata compression result, continue to fill with a new metadata compression result to obtain the physical page.
[0086] In this embodiment, after receiving the metadata compression result from the compression module, the metadata merging module first checks whether the length of each compressed metadata shard is less than the storage capacity of a physical page (e.g., 16KB). If the compressed length is less than the physical page length, it indicates that the current compression result will not fill the physical page, and new compression results can continue to be added. If the compressed length is equal to or greater than the physical page length, it means that the current compression result just fills or exceeds the physical page capacity, and physical page splicing needs to be completed and a new physical page generated. For the compression results that meet the physical page capacity requirements, the metadata merging module sequentially splices the shard data into the storage unit of the physical page until the storage capacity of the physical page is filled. If the current physical page is not completely filled, the metadata merging module selects a new shard from the unprocessed metadata compression results for filling until the storage unit of the physical page reaches the capacity limit. For the physical pages that are not completely filled, a certain amount of placeholder data (DummyData) will be filled to ensure the integrity of the in-page data format.
[0087] Furthermore, after the storage unit of the physical page is filled, the metadata merging module packs the spliced physical page data and appends the content of the system data area to form a complete physical page. The complete physical page is then transferred to the NAND storage module and written to the physical storage medium to complete the storage operation. Through the above steps, the metadata merging module provided by the present invention can efficiently organize the metadata compression results, maximize the utilization of the storage space of the physical page, and at the same time ensure the structured management of the metadata. This method fully considers the storage characteristics of the physical page and the compression characteristics of the metadata, improving the storage efficiency while ensuring the read and write performance of the SSD and the reliability of data management.
[0088] In step S105, the merged physical page is written to the corresponding storage location through the NAND interface, and the writing operation of the metadata ends here.
[0089] The present invention improves the performance and reliability of the SSD in multiple aspects by introducing an SSD metadata storage optimization method. First, by fragmenting and compressing the metadata, the physical storage occupancy of the metadata is effectively reduced, thereby releasing more storage space for user data and increasing the available redundant space (OP) of the SSD. The increased OP not only improves the garbage collection efficiency but also reduces the write amplification effect, thereby reducing the number of writes to the NAND and extending the service life of the SSD. In addition, the optimized storage method also improves the bad block tolerance. By releasing more spare space for bad block management, the stability of the device and the guarantee of data integrity are enhanced. In specific operations, this method dynamically determines whether to perform compression processing by judging the compression ratio, avoiding compression operations on unnecessary data and improving the storage efficiency.
[0090] Combined Figure 4 as shown Figure 4Schematic block diagram of an SSD metadata storage optimization device provided by an embodiment of the present invention. The SSD metadata storage optimization device 400 includes:
[0091] A data request unit 401, configured to receive a metadata operation request initiated by a metadata management module of the SSD;
[0092] A data judgment unit 402, configured to judge whether the metadata operation request is a write request. If not, it jumps to the read process. If so, it slices the metadata to be written according to a predetermined size to obtain a metadata slicing result;
[0093] A data compression unit 403, configured to use a metadata compression module of the SSD to perform compression processing on the metadata slicing result to obtain a metadata compression result;
[0094] A data merging unit 404, configured to merge the metadata compression result into physical pages through a metadata merging module of the SSD;
[0095] A data writing unit 405, configured to send the merged physical pages to a NAND memory to complete the writing operation.
[0096] In this embodiment, the data request unit 401 receives a metadata operation request initiated by a metadata management module of the SSD; the data judgment unit 402 judges whether the metadata operation request is a write request. If not, it jumps to the read process. If so, it slices the metadata to be written according to a predetermined size to obtain a metadata slicing result; the data compression unit 403 uses a metadata compression module of the SSD to perform compression processing on the metadata slicing result to obtain a metadata compression result; the data merging unit 404 merges the metadata compression result into physical pages through a metadata merging module of the SSD; the data writing unit 405 sends the merged physical pages to a NAND memory to complete the writing operation.
[0097] In one embodiment, in one embodiment, the data judgment unit 402 includes:
[0098] An index acquisition unit, configured to acquire a metadata index in the metadata compression result;
[0099] A read request unit, configured to send a read request to the NAND memory according to the metadata index to obtain a system data area in the compressed physical page;
[0100] A data parsing unit, configured to use a metadata splitting module of the SSD to parse the system data area to obtain metadata segments;
[0101] A data decompression unit, configured to use the metadata decompression module of the SSD to decompress the metadata fragment, and return the decompression result to the metadata management module.
[0102] In one embodiment, the data parsing unit includes:
[0103] A data comparison unit, configured to use the metadata splitting module to compare the metadata index with the index array stored in the system data area to obtain offset data;
[0104] An offset search unit, configured to search for corresponding metadata offset and metadata length according to the offset data;
[0105] An offset calculation unit, configured to calculate the starting position and storage length of the metadata by using the metadata offset and metadata length;
[0106] A fragment obtaining unit, configured to calculate the metadata fragment according to the starting position and storage length of the metadata.
[0107] In one embodiment, the data decompression unit includes:
[0108] A marker search unit, configured to search for a corresponding compression marker by using the offset data;
[0109] A first judgment unit, configured to judge whether the metadata fragment has been compressed according to the compression marker. If the metadata fragment has been compressed, decompress the metadata fragment, and return the decompression result to the metadata management module;
[0110] A read operation unit, configured to directly return the metadata fragment to the metadata management module to complete the read operation if the metadata fragment has not been compressed.
[0111] In one embodiment, the data judgment unit 402 further includes:
[0112] A data splitting unit, configured to split the metadata to be written into multiple shards according to a predetermined size;
[0113] An index generation unit, configured to generate metadata indexes corresponding to the multiple shards respectively;
[0114] An index association unit, configured to associate the metadata content of each shard with the corresponding metadata index to obtain the metadata sharding result.
[0115] In one embodiment, the data compression unit 403 includes:
[0116] A second judgment unit, configured to judge whether the compression ratio of the metadata sharding result is greater than a predetermined compression threshold. If the compression ratio is greater than the predetermined compression threshold, the metadata sharding result is not subjected to compression processing, and the metadata sharding result is directly transmitted to the metadata merging module;
[0117] A compression processing unit, configured to perform compression processing on the metadata sharding result to obtain the metadata compression result if the compression ratio is less than or equal to the predetermined compression threshold.
[0118] In one embodiment, the data merging unit 404 includes:
[0119] A third judgment unit, configured to judge whether the compression length of the metadata compression result is less than the length of the physical page. If not, the metadata compression results are spliced in sequence until the storage units of the physical page are filled to obtain the physical page;
[0120] A data filling unit, configured to, if so, continue to fill new metadata compression results after filling the metadata compression result to obtain the physical page.
[0121] Since the embodiments of the device part correspond to the embodiments of the method part, for the embodiments of the device part, please refer to the description of the embodiments of the method part, which will not be elaborated here.
[0122] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed, the steps provided in the above embodiments can be implemented. The storage medium may include: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc that can store program codes.
[0123] An embodiment of the present invention further provides a computer device, which may include a memory and a processor. When the processor calls the computer program stored in the memory, the steps provided in the above embodiments can be implemented. Of course, the computer device may further include various network interfaces, power supplies and other components.
[0124] The various embodiments in the specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts among the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method part. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
[0125] It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.
Claims
1. A method for optimizing SSD metadata storage, characterized in that: include: Receive a metadata operation request initiated by a metadata management module of the SSD; Determine whether the metadata operation request is a write request, if not, jump to the read process, if yes, slice the metadata to be written according to a predetermined size to obtain a metadata slice result; Using the metadata compression module of the SSD to compress the metadata sharding result to obtain a metadata compression result; Merging the metadata compression results into physical pages through a metadata merging module of the SSD; The merged physical page is sent to the NAND memory to complete the write operation.
2. The SSD metadata storage optimization method according to claim 1, characterized in that: The jump to the reading process includes: Obtaining a metadata index in the metadata compression result; Sending a read request to the NAND memory according to the metadata index to obtain a system data area in a compressed physical page; Utilizing the metadata splitting module of the SSD to parse the system data area, and obtain metadata fragments; The metadata decompression module of the SSD is used to decompress the metadata fragment, and the decompression result is returned to the metadata management module.
3. The SSD metadata storage optimization method according to claim 2, characterized in that: The method of using the metadata splitting module of the SSD to parse the system data area to obtain metadata segments includes: Using the metadata splitting module, the metadata index is compared with the index array stored in the system data area to obtain offset data; Searching for a corresponding metadata offset and metadata length according to the offset data; The metadata offset and the metadata length are used to calculate the starting position and storage length of the metadata; The metadata segment is obtained by calculation according to the starting position and storage length of the metadata.
4. The SSD metadata storage optimization method according to claim 3, characterized in that: The step of utilizing the metadata decompression module of the SSD to decompress the metadata segment and returning the decompression result to the metadata management module includes: Using the offset data to find the corresponding compression mark; Determining whether the metadata segment has been compressed according to the compression mark, and if the metadata segment has been compressed, decompressing the metadata segment and returning the decompression result to the metadata management module; If the metadata segment is not compressed, the metadata segment is directly returned to the metadata management module to complete the reading operation.
5. The SSD metadata storage optimization method according to claim 1, characterized in that: The step of slicing the metadata to be written according to a predetermined size to obtain a metadata slicing result includes: The metadata to be written is divided into multiple shards according to a predetermined size; Generating metadata indexes corresponding to the plurality of shards respectively; The metadata content of each of the slices is associated with the corresponding metadata index to obtain the metadata slice result.
6. The SSD metadata storage optimization method according to claim 1, characterized in that: The step of merging the metadata compression results into physical pages by the metadata merging module of the SSD includes: Determine whether the compression length of the metadata compression result is less than the length of the physical page, and if not, concatenate the metadata compression results in sequence until the storage units of the physical page are filled to obtain the physical page; If so, after filling the metadata compression result, continue to fill in the new metadata compression result to obtain the physical page.
7. The SSD metadata storage optimization method according to claim 1, characterized in that: The metadata compression module of the SSD is used to compress the metadata slicing result to obtain the metadata compression result, including: Determine whether the compression ratio of the metadata fragmentation result is greater than a predetermined compression threshold; if the compression ratio is greater than the predetermined compression threshold, do not compress the metadata fragmentation result, and directly pass the metadata fragmentation result to the metadata merging module; If the compression ratio is less than or equal to the predetermined compression threshold, the metadata segmentation result is compressed to obtain the metadata compression result.
8. A SSD metadata storage optimization device, characterized in that: include: A data request unit, used to receive a metadata operation request initiated by a metadata management module of the SSD; A data judgment unit, used to judge whether the metadata operation request is a write request, if not, jump to the read process, if yes, slice the metadata to be written according to a predetermined size, and obtain a metadata slice result; A data compression unit, used to compress the metadata slicing result using a metadata compression module of the SSD to obtain a metadata compression result; A data merging unit, configured to merge the metadata compression results into physical pages through a metadata merging module of the SSD; The data writing unit is used to send the merged physical page to the NAND memory to complete the writing operation.
9. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the SSD metadata storage optimization method as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the SSD metadata storage optimization method according to any one of claims 1 to 7 is implemented.