A LSM data organization method and device for sparsely distributed metadata

Through dynamic partition organization and cluster analysis, key-value pair partitions are formed, and independent merge and sorting are solved, and the problem of repeated participation of high-level sorting string tables in the LSM database is solved, resulting in the sparse distribution of metadata in the LSM database, improving the read and write performance of the system.

CN118051643BActive Publication Date: 2024-11-05INSTITUTE OF INFORMATION ENGINEERING CHINESE ACADEMY OF SCIENCES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410203154.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-23
Publication Date
2024-11-05
Estimated Expiration
2044-02-23

AI Technical Summary

Technical Problem

In LSM-based databases, sparse distribution of metadata results in a small volume of low-level sorted string tables, resulting in high-level sorted string tables repeatedly participating in merged sorting, occupying a large amount of disk bandwidth and CPU resources, affecting the system's read and write performance.

Method used

Organize the sorting string table through dynamic partitioning, first cluster analysis of the key names of the key value pair data, form key value pair partitions, and each partition is independently merged and sorted, reducing the number of participations of the high-level sorting string table, and passing the key Value-to-partition accelerates data retrieval.

Benefits of technology

It effectively reduces the number of times that high-level sorting string tables participate in merge sorting, improves the system's read and write performance, and reduces resource usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118051643B_ABST
    Figure CN118051643B_ABST
Patent Text Reader

Abstract

The present invention discloses an LSM data organization method and device for sparsely distributed metadata. The present invention uses dynamic partitioning to organize a sorted string table, specifically first clustering analysis is performed on the key names of key-value pair data to obtain key name groups, then the key name groups are pruned to form key-value pair partitions, the key-value pair data are flushed into the corresponding key-value pair partitions to form a sorted string table, and each key-value pair partition independently performs a merge sort operation, thereby effectively limiting the formation of a sorted string table with sparsely distributed metadata, thereby greatly reducing the number of high-level sorted string tables participating in the merge sort process, reducing the number of times that the high-level sorted string tables repeatedly participate in the merge sort operation, and when retrieving key-value pair data, the key-value pair partitions further speed up the positioning of the key-value pair data, thereby achieving an improvement in the read and write performance of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data storage, and in particular relates to a log structured merge (Log Structured Merge, hereinafter referred to as: LSM) data organization method and device for sparsely distributed metadata. Background Art

[0002] The LSM-based database implements random reading and writing of massive key-value pairs as random reading and writing of memory, sequential flushing to disk, and periodic merging, making full use of the fact that the sequential write performance of the disk is higher than the random write performance. When the Mutable MemTable (hereinafter referred to as the mutable memory table) in the memory reaches the threshold, it will be converted to the Immutable MemTable (hereinafter referred to as the immutable memory table) state and then flushed to the disk.

[0003] When the key-value pair data is flushed to disk, it is first flushed to form a sorted string table and placed in the lower level, and then the key-value pair data is migrated upward layer by layer with the merge sort operation. Among them, the merge sort operation will first select a sorted string table from the lower level as the input of the low-level sorted string table, and then select a sorted string table with an intersection between the key control range and the key control range of the low-level sorted string table in the adjacent high-level, and use it as the input of the high-level sorted string table, complete the merge sort of the key-value pair data in memory, and flush it to the high-level again. If the write speed of the key-value pair data is greater than the speed of the merge sort operation, the low-level will be delayed in completing the migration of the sorted string table, delaying the release of space, and thus blocking the write. Therefore, the speed of the merge sort operation directly affects the write speed of the system. However, when faced with a low-level sorting string table with sparsely distributed metadata, that is, the low-level sorting string table contains fewer key-value pair data, but the key names of the key-value pair data are distributed over a wider range, in this case, the small-volume low-level sorting string table will cause a large number of high-level sorting string tables to participate in the merge sort operation. As the number of levels increases, the number of high-level sorting string tables that repeatedly participate in the merge sort process will increase and the volume will be larger, which will occupy a large amount of disk bandwidth, CPU and other system resources, greatly affecting the read and write performance of the system. Summary of the invention

[0004] In view of the problems existing in the prior art, the purpose of the present invention is to provide an LSM data organization method and device for sparsely distributed metadata, so as to improve the read and write performance of the LSM-based database, and alleviate the problem in the prior art that the sorting string table with sparse distribution of metadata under the LSM data structure causes a large number of high-level sorting string tables to repeatedly participate in the merge sorting process, occupying a large amount of system resources and reducing the system read and write performance.

[0005] The present invention uses dynamic partitioning to organize a sorted string table. Specifically, a cluster analysis is first performed on the key names of key-value pair data to obtain key name groups, and then the key name groups are pruned to form key-value pair partitions. The key-value pair data are flushed into the corresponding key-value pair partitions to form a sorted string table. Each key-value pair partition independently performs a merge sort operation, thereby effectively limiting the formation of a sorted string table with sparsely distributed metadata, thereby greatly reducing the number of high-level sorted string tables participating in the merge sort process, and reducing the number of times that the high-level sorted string tables repeatedly participate in the merge sort operation. When retrieving key-value pair data, the key-value pair partitions further speed up the positioning of the key-value pair data, thereby achieving an improvement in the read and write performance of the system.

[0006] The specific technical solutions provided by the present invention are as follows:

[0007] First, a LSM data organization method for sparsely distributed metadata is proposed, comprising the following steps:

[0008] 1) When the key-value pair data is flushed to the disk, when the mutable memory table is first triggered to be converted to an immutable memory table, the key names of the key-value pair data in the immutable memory table are clustered and analyzed based on the key name distance to obtain several key name groups;

[0009] 2) trimming each of the key name groups to obtain a key-value pair partition, and flushing the key-value pair data in the key-value pair partition to form a sorted string table;

[0010] 3) A partition pre-divided in the memory is used as a temporary storage area for key-value pair data; the key-value pair data outside the key-value pair partition is uniformly stored in the temporary storage area for key-value pair data located in the memory area;

[0011] 4) When the key-value pair data is flushed to the disk, if it is not the first time to convert the mutable memory table into the immutable memory table, all key-value pair partitions are sorted by key control range size and listed, and information of the key-value pair partitions is obtained, including: the key control range of the key-value pair partition is recorded as [A, B], the expansion coefficient of the key-value pair partition is recorded as T, the key control range size threshold of the key-value pair partition is recorded as R, etc.;

[0012] 5) Retrieve the key-value pair data in the immutable memory table, filter out the key-value pair data whose key name is in the interval [AT, B+T], and write them to the corresponding key-value pair partition to form a sorted string table, and update the key control range and other information of the key-value pair partition;

[0013] 6) Obtain the key names of the key-value pair data remaining after the above screening and the key-value pair data in the key-value pair data temporary storage area, and perform a cluster analysis operation to obtain a new key name group again;

[0014] 7) Pruning the new key name group to obtain a new key-value pair partition, and flushing the key-value pair data in the new key-value pair partition to form a sorted string table.

[0015] Furthermore, in step 2), a key-value pair partition is obtained by pruning according to the key name group, wherein the left boundary value of the key control range of the key-value pair partition is the smallest key in the key name group, and the right boundary value of the key control range of the key-value pair partition is the largest key in the key name group. If the absolute difference between the right boundary value and the left boundary value of the key control range of the key-value pair partition exceeds the key control range size threshold R of the key-value pair partition, the key control range of the key-value pair partition is pruned according to the key control range size threshold R of the key-value pair partition, and the pruning method is to eliminate the smallest key in turn according to the key size until the absolute difference between the right boundary value and the left boundary value of the key control range of the key-value pair partition remains within the key control range size threshold R of the key-value pair partition.

[0016] Furthermore, in step 7), the new key-value pair partition is obtained by pruning according to the new key name group, wherein not only the above processing needs to be performed so that the absolute difference between the right boundary value and the left boundary value of the key control range of the new key-value pair partition remains within the key control range size threshold R of the key-value pair partition, but also it is necessary to determine that there is no intersection between the key control ranges of the new key-value pair partition and the existing key-value pair partition. The key control range size threshold R of each of the key-value pair partitions is the same.

[0017] Furthermore, the key-value data temporary storage area located in the memory area in step 3) is implemented using an efficient retrieval data structure, such as a hash table. There is no need to consider the scenario of frequent element updates, and it is only necessary to support fast retrieval. At the same time, the key-value data temporary storage area needs to provide the external module with an interface F for quickly obtaining all the key-value pair data in the temporary storage area and an interface G for obtaining all the key names in the temporary storage area. The F interface only needs to return a list of all the key-value pair data sorted by key names stored in the temporary storage area, and the G interface only needs to return a list of all the key names stored in the temporary storage area.

[0018] Furthermore, in step 5), the key-value pair data whose key names are in the interval [AT, B+T] are filtered out, wherein the left and right boundary values ​​of the interval [AT, B+T] need to be adjusted as appropriate. If the key-value pair partition i where the key name of the currently filtered key-value pair is located has a previous key-value pair partition j, then the left boundary value AT of the interval needs to be greater than the right boundary value of the key control range of the key-value pair partition j; if the key-value pair partition i has a subsequent key-value pair partition k, then the right boundary value B+T of the interval needs to be less than the left boundary value of the key control range of the key-value pair partition k, and the size of the interval B-A+2*T needs to be kept within the key control range size threshold R of the key-value pair partition.

[0019] In the second aspect, an LSM data organization device for sparsely distributed metadata is proposed, comprising:

[0020] A key name acquisition module, used to obtain the key names of the key-value pair data in the immutable memory table, or obtain the key names of a given batch of key-value pair data, including obtaining the key names of the key-value pair data in the immutable memory table described in step 1), obtaining the key names of the remaining key-value pair data screened in step 6), and obtaining the key names of the key-value pair data in the key-value pair data temporary storage area described in step 6);

[0021] The key name clustering analysis module is used to perform clustering analysis on batch key names to obtain key name groups, and further process them to obtain key-value pair partitions. Specifically, the key name groups will be pruned according to the key control range size threshold R of the key-value pair partition and the existing key-value pair partitions, so that they meet the following requirements: 1) the absolute difference between the right boundary value and the left boundary value of the key control range of the key-value pair partition is kept within the key control range size threshold R of the key-value pair partition; 2) there is no intersection between the key control range of the key-value pair partition and the existing key-value pair partition. At the same time, the module supports the definition of key name distance metrics that meet business needs, and supports the configuration of efficient and accurate clustering analysis algorithms.

[0022] The key-value partition management module is used to store and manage key-value partition information, including key control range, expansion coefficient, key control range size threshold, number of sorted string tables, etc. At the same time, it supports multiple operations on the key-value partition, including adding a new key-value partition, updating key-value partition information, listing key-value partitions, etc.

[0023] The key-value data temporary storage area module is used to store the key-value data outside the key name group during the operation of the system. The module is located in the memory and mainly consists of a data structure that supports efficient retrieval. At the same time, the module is configured with a related log recording mechanism to ensure the consistency, persistence and reliability of the key-value data in the module;

[0024] The key-value pair data flushing module is used to coordinate the key-value pair data flushing process. First, the key-value pair partition list is obtained from the key-value pair partition management module. If the key-value pair partition list is empty, the key name acquisition module is used to obtain the key names of all key-value pair data in the immutable memory table, and transmit them to the key-value pair clustering analysis module for clustering analysis to obtain the key-value pair partition, and the key-value pair data located in the key-value pair partition is flushed, and the key-value pair data located outside the key-value pair partition is stored in the key-value pair data temporary storage area module. At the same time, the key-value pair partition management module manages the key-value pair data. For partitions, if the key-value pair partition list is not empty, the key-value pair data is flushed to the corresponding key-value pair partition to form a sorted string table, the remaining key-value pair data and the key name of the key-value pair data in the key-value pair data temporary storage area module are transmitted to the key-value pair clustering analysis module for clustering analysis to obtain a new key-value pair partition, and the key-value pair data in the new key-value pair partition is flushed. At the same time, the key-value pair partition management module takes over the new key-value pair partition, and overwrites the key-value pair data outside the new key-value pair partition and stores it in the key-value pair data temporary storage area.

[0025] The present invention also provides a server, characterized in that it includes a memory and a processor, the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program includes instructions for each step in the above method.

[0026] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0027] The advantages of the present invention are as follows:

[0028] The present invention organizes the sorted string table through dynamic partitioning, determines the key-value pair partition based on cluster analysis, and each key-value pair partition independently performs merge sorting of the sorted string table, thereby effectively limiting the formation of the sorted string table with sparse distribution of metadata, greatly reducing the number of high-level sorted string tables involved in merge sorting, and at the same time, the key-value pair partition further accelerates the retrieval and positioning of key-value pair data, thereby improving the read and write performance of the system.

[0029] This method has strong practicality and application scope in the field of Internet data storage and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A schematic diagram of an LSM data organization method for sparsely distributed metadata provided by the present invention.

[0031] Figure 2 A flowchart of LSM data flushing processing for sparsely distributed metadata provided by the present invention.

[0032] Figure 3 A schematic diagram of an LSM data organization device for sparsely distributed metadata provided by the present invention. DETAILED DESCRIPTION

[0033] The present invention is further described in detail below in conjunction with the accompanying drawings. The examples given are only used to explain the present invention but not to limit the scope of the present invention.

[0034] Figure 1 Schematic diagram of an LSM data organization method for sparsely distributed metadata proposed by the present invention, such as Figure 1 As shown, the mutable memory table in the memory is used to receive key-value pair data written at high speed. When the size of the mutable memory table exceeds the threshold, it will be converted into an immutable memory table. There can be multiple immutable memory tables, which are managed using a flush queue.

[0035] When the key-value data is flushed to disk, when the mutable memory table is first triggered to be converted to an immutable memory table, the key name clustering analysis function will be used to perform clustering analysis on all key names in the mutable memory table to obtain several key name groups. Each key name group will be pruned to obtain a key-value partition, and the key-value data in the key-value partition will be flushed to form a sorted string table. At the same time, the key-value data outside the key-value partition will be stored in the key-value data temporary storage area. In the subsequent process of flushing the key-value data to disk, the key-value data will be flushed to the corresponding key-value partition, and the key names of the remaining key-value data and the key-value data in the key-value data temporary storage area will be obtained, and clustering analysis will be performed to detect whether a new key-value partition is generated.

[0036] Each key-value pair partition performs a merge sort operation on the sorted string table independently.

[0037] When obtaining key-value pair data based on the key name query, the system will query the mutable memory table, immutable memory table and key-value pair data temporary storage area in sequence based on the key name. If the target key name does not exist in any of the above areas, the key-value pair partition to which it belongs is determined based on the key name, and the target key name is further queried in the key-value pair partition to obtain the key-value pair data.

[0038] Figure 2 This is a flowchart of LSM data flushing processing for sparsely distributed metadata provided by the present invention, such as Figure 2 As shown, the data flushing process of this embodiment includes:

[0039] S101: Triggering the transformation of a mutable memory table into an immutable memory table.

[0040] S102: List key-value pair partitions.

[0041] Specifically, the key-value pair partition management module is requested to obtain all established key-value pair partitions. The key-value pair partition information includes: the left boundary value of the key control range, the right boundary value of the key control range, the expansion coefficient, the key control range size threshold, the number of sorting string tables, etc. All key-value pair partitions are listed in order of the key control range size.

[0042] S103: Determine whether the key-value pair partition is empty; if it is empty, execute S104; if it is not empty, execute S109.

[0043] S104: Obtain the full key name in the variable memory table.

[0044] S105: Perform cluster analysis on the batch key names to obtain a number of key name groups.

[0045] Specifically, the Levenshtein distance is used to measure the distance between key names, or a distance measurement standard is selected according to business needs, and a clustering analysis algorithm such as K-Means is used to perform clustering analysis on batch key names to obtain key name groups.

[0046] S106: Determine whether the key name group is not empty; if it is not empty, execute S107; if it is empty, execute S108.

[0047] S107: Prune each key name group to form a new key-value pair partition and manage it. When the immutable memory table is flushed to the disk, the key-value pair data is flushed to the corresponding key-value pair partition.

[0048] Specifically, the key name group is pruned according to the key control range size threshold R of the key value pair partition and the existing key value pair partition, so that the target key value pair partition satisfies: 1) the absolute difference between the right boundary value and the left boundary value of the key control range is kept within the key control range size threshold R; 2) the key control range and the key control range of the existing key value pair partition do not have an intersection. After pruning the key name group to obtain the key value pair partition, the key value pair data in the key value pair partition is flushed to form a sorted string table. At the same time, the key value pair partition information is managed.

[0049] S108: storing the remaining key-value pair data after the above flashing into the key-value pair data temporary storage area.

[0050] Specifically, after the key-value pair data located in the key-value pair partition is flushed, if there is any remaining key-value pair data, it will be stored in the key-value pair data temporary storage area. The key-value pair data temporary storage area uses a data structure that supports fast retrieval, such as a hash table to manage key-value pair data. At the same time, the key-value pair data temporary storage area provides a full key name and full key-value pair data acquisition interface to the outside world. The external module can quickly obtain all key-value pair data and their key names in the key-value pair data temporary storage area through this interface.

[0051] S109: When the immutable memory table is flushed to the disk, the key-value pair data is flushed to the corresponding key-value pair partition.

[0052] Specifically, the key-value pair data whose key names are in the interval [AT, B+T] are filtered and written to the corresponding key-value pair partition to form a sorted string table, wherein the left and right boundary values ​​of the interval are adjusted as appropriate. If the key-value pair partition i where the key name of the currently filtered key-value pair is located has a previous key-value pair partition j, then the left boundary value AT of the interval needs to be greater than the right boundary value of the key control range of the key-value pair partition j; if the key-value pair partition i has a subsequent key-value pair partition k, then the right boundary value B+T of the interval needs to be less than the left boundary value of the key control range of the key-value pair partition k, and the size of the interval B-A+2*T needs to be kept within the key control range size threshold R of the key-value pair partition.

[0053] S110: Update information such as the key control range of the key-value pair partition.

[0054] S111: Obtain the key-value pair data remaining after the above-mentioned flashing and the key names of the key-value pair data in the key-value pair data temporary storage area.

[0055] Specifically, the full key name acquisition interface provided by the immutable memory table is accessed to quickly obtain the key name list of the key-value pair data remaining after the flush, and the full key name acquisition interface provided by the key-value pair data temporary storage area is accessed to quickly obtain the key names of all key-value pair data in the temporary storage area.

[0056] Figure 3 Schematic diagram of an LSM data organization device for sparsely distributed metadata provided by the present invention, such as Figure 3 As shown, the device of this embodiment includes: a key name acquisition module, a key name clustering analysis module, a key-value pair partition management module, a key-value pair data temporary storage area module and a key-value pair data flushing module.

[0057] The key name acquisition module is specifically used to obtain the key names of key-value pair data in a mutable memory table or an immutable memory table, or to obtain the key names of key-value pair data in a key-value pair data temporary storage area. The module encapsulates the above-mentioned multiple operations for obtaining key names of key-value pair data, and provides a unified key name acquisition interface externally.

[0058] The key name clustering analysis module is specifically used to perform clustering analysis on batch key names and return key-value pair partitions. The module includes a module interaction unit, a clustering analysis algorithm unit, a key name group pruning unit, etc. The module interaction unit is responsible for receiving batch key names and feeding back the key-value pair partition results to the calling module; the clustering analysis algorithm unit uses the Levenshtein distance to measure the distance between key names, and uses clustering analysis algorithms such as K-Means to process batch key names to obtain key name groups; the key name group pruning unit further prunes the key name groups according to the key control range size threshold R of the key value pair partition and the existing key value pair partition to obtain the key value pair partition, so that it satisfies in sequence: the key control range and the key control range of the existing key value pair partition do not have an intersection, and the absolute difference between the right boundary value and the left boundary value of the key control range remains within the key control range size threshold R.

[0059] The key-value partition management module is specifically used to store and manage key-value partition information. A data table is used to store key-value partition information. The table fields include: number, key control range left boundary value, key control range right boundary value, expansion coefficient, key control range size threshold, number of sorted string tables, etc. At the same time, the key-value partition information is managed by operating the data table records, including: adding a new key-value partition, updating key-value partition information, and listing key-value partitions, etc. The atomicity of the operation needs to be guaranteed.

[0060] The key-value data temporary storage area module is specifically used to store key-value data outside the key-value partition during system operation. The module is located in the memory and is mainly composed of a data structure that supports fast retrieval, a list of full key-value data sorted by key name, and a list of full key names. The data structure that supports fast retrieval can be implemented by, for example, a hash table. At the same time, the module is configured with a related logging mechanism, such as a WAL (write-ahead log) mechanism, so as to achieve consistency, persistence and reliability of key-value data in the module.

[0061] The key-value data flushing module is specifically used to integrate various modules to complete the key-value data flushing. After receiving the command to convert the mutable memory table into the immutable memory table, the module initiates a key-value partition list acquisition request to the key-value partition management module, queries the key-value partition data table and returns the full record package. If the key-value partition list is empty, a key name acquisition request is initiated to the key name acquisition module, and the key name acquisition module uniformly obtains the full key name of the key-value data in the mutable memory table, and transmits it to the key name clustering analysis module for clustering analysis to obtain the key-value partition, flushes the key-value data within the key-value partition, and stores the key-value data outside the key-value partition in the key-value data temporary storage area module. The zone management module manages the key-value pair partitions. If the key-value pair partition list is not empty, when the immutable memory table is flushed to the disk, the key-value pair data in the immutable memory table is flushed to the corresponding key-value pair partition to obtain the remaining key-value pair data M, and again initiates a key name acquisition request to the key name acquisition module to obtain the full key name of the key-value pair data N and the key name of M in the key-value pair data temporary storage area module, and merges and transmits them to the key name clustering analysis module for clustering analysis. If a new key-value pair partition is obtained, M and N are flushed to the corresponding key-value pair partition again, the key-value pair data temporary storage area is reset and the key-value pair data outside the new key-value pair partition is stored, and the key-value pair partition management module manages the new key-value pair partition.

[0062] Although the specific embodiments of the present invention are disclosed for the purpose of illustration, the purpose is to help understand the content of the present invention and implement it accordingly, those skilled in the art will understand that various substitutions, changes and modifications are possible without departing from the spirit and scope of the present invention and the appended claims. Therefore, the present invention should not be limited to the content disclosed in the best embodiment, and the scope of the present invention is subject to the scope defined in the claims.

Claims

1. A LSM data organization method for sparsely distributed metadata, the steps comprising: When the key-value pair data is flushed to the disk, when the mutable memory table is first triggered to be converted to an immutable memory table, the key names of the key-value pair data in the immutable memory table are clustered and analyzed according to the key name distance to obtain a number of key name groups; each of the key name groups is then pruned to obtain a key-value pair partition; the key-value pair data in the key-value pair partition is then flushed to form a sorted string table, and the key-value pair data outside the key-value pair partition is uniformly stored in the key-value pair data temporary storage area in the memory area; wherein the method for pruning each of the key name groups is: the minimum key in the key name group is used as the left boundary value of the key control range of the corresponding key-value pair partition; , taking the maximum key in the key name group as the right boundary value of the key control range of the key-value pair partition; if the absolute difference between the right boundary value and the left boundary value of the key control range of the key-value pair partition exceeds the key control range size threshold R of the key-value pair partition, then pruning the key control range of the key-value pair partition according to the key control range size threshold R of the key-value pair partition, the pruning method is to eliminate the smallest key in turn according to the key size, until the absolute difference between the right boundary value and the left boundary value of the key control range of the key-value pair partition remains within the key control range size threshold R of the key-value pair partition; the key-value pair partition information includes the key control range, the expansion coefficient, the key control range size threshold, and the number of sorted string tables; When the key-value pair data is written to the disk, if it is not the first time to trigger the conversion of the mutable memory table into the immutable memory table, the key-value pair partitions are listed in order according to the key control range size, and the information of each key-value pair partition is obtained, including the key control range [A, B] of the key-value pair partition, the expansion coefficient T of the key-value pair partition and the key control range size threshold R of the key-value pair partition; then when the immutable memory table is written to the disk, the key-value pair data in the immutable memory table is retrieved, the key-value pair data with the key name in the interval [AT, B+T] is filtered out, and is written to the corresponding key-value pair partition to form a sorted string table, and then the key control range of the key-value pair partition is updated; then the key names of the remaining key-value pair data and the key-value pair data in the key-value pair data temporary storage area are obtained, and clustered to obtain a new key name group again; then a new key-value pair partition is obtained by pruning according to the new key name group, and the key-value pair data in the new key-value pair partition is written to form a sorted string table.

2. The method according to claim 1, characterized in that The absolute difference between the right boundary value and the left boundary value of the key control range of the new key-value pair partition remains within the key control range size threshold R of the key-value pair partition, and there is no intersection between the key control ranges of the new key-value pair partition and the existing key-value pair partition.

3. The method according to claim 1, characterized in that The key-value pair data temporary storage area is implemented using a set retrieval data structure, and the application supports fast retrieval; the key-value pair data temporary storage area provides an interface for external modules to obtain the full amount of key-value pair data and full amount of key names in the temporary storage area.

4. The method according to claim 1, characterized in that: In the process of filtering out key-value pair data whose key names are in the interval [AT, B+T], if the key-value pair partition i where the key name of the currently filtered key-value pair is located has a previous key-value pair partition j, then the left boundary value AT of the interval needs to be greater than the right boundary value of the key control range of the key-value pair partition j; if the key-value pair partition i has a subsequent key-value pair partition k, then the right boundary value B+T of the interval needs to be less than the left boundary value of the key control range of the key-value pair partition k, and the size of the interval B-A+2*T needs to be kept within the key control range size threshold R of the key-value pair partition.

5. The method according to claim 1, characterized in that When there are multiple immutable memory tables, a flush queue is used to manage the immutable memory tables.

6. An LSM data organization device for sparsely distributed metadata, characterized in that: include Key name acquisition module, used to obtain the key name of key-value pair data; A key name clustering analysis module is used to perform clustering analysis on the key names of the key-value pair data in the immutable memory table according to the key name distance when the mutable memory table is first triggered to be converted into the immutable memory table during the process of flushing the key-value pair data to the disk, to obtain a plurality of key name groups; and then prune each of the key name groups to obtain a key-value pair partition; and When the key-value pair data is written to the disk, if it is not the first time to trigger the conversion of the mutable memory table into the immutable memory table, the key-value pair partitions are listed in order of the key control range size, and the information of each key-value pair partition is obtained, including the key control range [A, B] of the key-value pair partition, the expansion coefficient T of the key-value pair partition and the key control range size threshold R of the key-value pair partition; then when the immutable memory table is written to the disk, the key-value pair data in the immutable memory table is retrieved, the key-value pair data with the key name in the interval [AT, B+T] is filtered out, and written to the corresponding key-value pair partition to form a sorted string table, and then the key control range of the key-value pair partition is updated; then the key names of the remaining key-value pair data and the key-value pair data in the key-value pair data temporary storage area are obtained, and clustered to obtain a new key name group; then prune the new key-value pair partition according to the new key name group; wherein the method for pruning each of the key name groups is: taking the minimum key in the key name group as the left boundary value of the key control range of the corresponding key-value pair partition, and taking the maximum key in the key name group as the right boundary value of the key control range of the key-value pair partition; if the absolute difference between the right boundary value and the left boundary value of the key control range of the key-value pair partition exceeds the key control range size threshold R of the key-value pair partition, pruning the key control range of the key-value pair partition according to the key control range size threshold R of the key-value pair partition, and the pruning method is to eliminate the minimum key in turn according to the key size, until the absolute difference between the right boundary value and the left boundary value of the key control range of the key-value pair partition remains within the key control range size threshold R of the key-value pair partition; A key-value pair partition management module is used to store and manage key-value pair partition information. If the key-value pair partition list is not empty, the key-value pair data is flushed to the corresponding key-value pair partition to form a sorted string table, and the remaining key-value pair data and the key name of the key-value pair data in the key-value pair data temporary storage area module are transmitted to the key-value pair clustering analysis module, and the key-value pair data in the new key-value pair partition is flushed; the key-value pair partition information includes a key control range, an amplification coefficient, a key control range size threshold, and the number of sorted string tables; A key-value pair data temporary storage area module, used for storing key-value pair data outside the key-value pair partition; The key-value pair data flushing module is used to coordinate the key-value pair data flushing process. First, it obtains the key-value pair partition list from the key-value pair partition management module. If the key-value pair partition list is empty, it obtains the key names of all key-value pair data in the variable memory table from the key name acquisition module and transmits them to the key-value pair clustering analysis module; the key-value pair data located outside the key-value pair partition is stored in the key-value pair data temporary storage area module.

7. A server, characterized in that: The invention comprises a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing the method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.