A method and device for processing a key-value pair storage system

Through shared memory pool architecture and memory partitioning strategy optimization, the problem of insufficient performance of key-value storage systems under high-performance and high-capacity requirements is solved, and load balancing and performance improvement are achieved.

CN118227337BActive Publication Date: 2024-09-13INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410630987.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2024-09-13
Estimated Expiration
2044-05-21

AI Technical Summary

Technical Problem

Key-value storage database systems are difficult to adapt to when faced with high performance and high capacity requirements, and system access performance and capacity are insufficient.

Method used

Using a shared memory pool architecture, it receives storage tasks, determines task attribute information, establishes memory partitions, allocates target nodes and memory information, adjusts the memory partition strategy, optimizes memory resource usage, realizes data partition storage, and achieves load balancing.

Benefits of technology

It improves the system access performance and capacity of the key-value storage system, optimizes the memory partitioning strategy, and achieves load balancing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118227337B
    Figure CN118227337B
Patent Text Reader

Abstract

The embodiment of the present invention provides a processing method and device for a key-value pair storage system, which is applied to field storage technology, including: receiving multiple storage tasks and determining task attribute information of each storage task; establishing a memory partition for each storage task in a shared memory pool; determining a target node allocated to each memory partition and target memory information allocated to the memory partition in the target node according to the task attribute information, and obtaining a memory partition strategy for each memory partition; adjusting the target node allocated to the memory partition and the target memory information allocated to the memory partition in the target node to obtain an adjusted memory partition strategy; under the adjusted memory partition strategy, determining the overall memory resource utilization rate of the nodes in the shared memory pool; determining a target memory partition strategy from all memory partition strategies according to the overall memory resource utilization rate, performing partition storage, and realizing partition storage of data in the key-value pair storage system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of storage technology, and in particular to a processing method and device for a key-value pair storage system. Background Art

[0002] In data-intensive application scenarios, large-scale distributed heterogeneous computing systems need to meet the requirements of collaborative computing of heterogeneous devices, independent expansion of server and accelerator memory, multi-layer mixed media memory sharing, and real-time processing of multiple computing tasks. Since the data in the key-value storage database system is organized in the form of key-value pairs, it has the characteristics of high performance and easy expansion for large amounts of data, and has gradually become one of the mainstream system storage architectures. It is widely deployed in data centers to provide services for data-intensive applications.

[0003] However, as data-intensive applications place increasing demands on system access performance and capacity, key-value storage database systems are having difficulty adapting to the demands in terms of system access performance and capacity. Summary of the invention

[0004] In view of the above problems, a method and device for processing a key-value pair storage system is proposed to overcome the above problems or at least partially solve the above problems, including:

[0005] A processing method for a key-value pair storage system, wherein the key-value pair storage system has a shared memory pool, wherein the shared memory pool is composed of memories in multiple nodes, and each node has multiple types of memories, wherein the method comprises:

[0006] Receiving multiple storage tasks and determining task attribute information of each storage task;

[0007] Establishing a memory partition for each storage task in the shared memory pool;

[0008] According to the task attribute information, determine the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node, and obtain the memory partition strategy for each memory partition;

[0009] Adjust the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node to obtain an adjusted memory partition strategy;

[0010] Under the adjusted memory partitioning strategy, the memory resource utilization rate of each node is determined according to the allocated memory capacity and the total memory capacity in each node, and the overall memory resource utilization rate of the nodes in the shared memory pool is obtained according to the memory resource utilization rates of all nodes;

[0011] According to the overall memory resource usage rate, a target memory partition strategy is determined from all memory partition strategies, and data of the multiple storage tasks are partitioned and stored according to the target memory partition strategy.

[0012] Optionally, determining, according to the task attribute information, a target node allocated to each memory partition and target memory information allocated to the memory partition in the target node to obtain a memory partition strategy for each memory partition includes:

[0013] Determine memory allocation constraints;

[0014] On the basis of satisfying the memory allocation constraint condition, according to the task attribute information, the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node are determined to obtain the memory partition strategy of each memory partition.

[0015] Optionally, the memory allocation constraint condition includes a delay constraint condition of each storage task and a storage resource capacity constraint condition of each type of memory in the shared resource pool. On the basis of satisfying the memory allocation constraint condition, according to the task attribute information, a target node allocated to each memory partition and target memory information allocated to the memory partition in the target node are determined to obtain a memory partition strategy for each memory partition, including:

[0016] Determine, according to the task attribute information, candidate nodes allocated to each memory partition and candidate memory information allocated to the memory partition in the candidate nodes;

[0017] Determine the node path delay information of the candidate node and the storage medium delay information of the candidate memory corresponding to the candidate memory information, and determine the overall delay information of the memory partition by combining the node path delay information and the storage medium delay information;

[0018] Determining the allocated memory capacity of each type of memory in the shared resource pool;

[0019] If the overall delay information satisfies the delay constraint condition, and the allocated memory capacity of each type of memory in the shared resource pool satisfies the storage resource capacity constraint condition, determining the candidate node as the target node and the candidate memory information as the target memory information;

[0020] A memory partition strategy for each memory partition is obtained according to the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node.

[0021] Optionally, before determining that the candidate node is the target node and the candidate memory information is the target memory information if the overall delay information satisfies the delay constraint and the allocated memory capacity of each type of memory in the shared resource pool satisfies the storage resource capacity constraint, the method further includes:

[0022] Determining whether the delay value in the overall delay information is less than the delay upper limit in the delay constraint, and determining that the overall delay information satisfies the delay constraint when the delay value in the overall delay information is less than the delay upper limit in the delay constraint;

[0023] Determine whether the allocated memory capacity of each type of memory in the shared resource pool is less than the capacity upper limit value in the storage resource capacity constraint condition, and when the allocated memory capacity of each type of memory in the shared resource pool is less than the capacity upper limit value in the storage resource capacity constraint condition, determine that the allocated memory capacity of each type of memory in the shared resource pool satisfies the storage resource capacity constraint condition.

[0024] Optionally, the memory resource usage rate of each node is an average value of memory resource usage rates of all types of memory in each node, and determining the memory resource usage rate of each node according to the allocated memory capacity and the total memory capacity in each node includes:

[0025] For the current node, determine the memory capacity of each type of memory allocated to each memory partition;

[0026] According to the memory capacity of each type of memory allocated to all memory partitions, the allocated memory capacity of each type of memory is obtained, and the memory resource usage rate of each type of memory in the current node is obtained by combining the allocated memory capacity of each type of memory and the total memory capacity of each type of memory;

[0027] An average value of memory resource usage of all types of memory in the current node is determined, and the average value of memory resource usage of all types of memory in the current node is used as the memory resource usage of the current node.

[0028] Optionally, the memory resource usage of each type of memory in the current node is calculated using the following formula:

[0029]

[0030] Among them, σ d is the memory resource usage of the memory type d in the current node, c is the unit storage capacity, T i N dThe number of memory units of memory type d allocated to the i-th memory partition in the current node, DC is the total memory capacity of memory type d in the current node, and M is the number of memory partitions.

[0031] Optionally, the task attribute information includes any one or more of the following: the data volume of the storage task, and the data type of the storage task.

[0032] Optionally, it also includes:

[0033] In the process of data storage, a common feature template is established for multiple sets of data to be stored;

[0034] The multiple groups of data are stored according to the common feature template.

[0035] Optionally, storing the multiple groups of data according to the common feature template includes:

[0036] In the process of storing the first group of data, determining first difference information between the first group of data and the common feature template, and storing the serial number of the common feature template and the first difference information;

[0037] In the process of storing the Nth group of data, determining second difference information between the Nth group of data and the N-1th group of data, and storing the serial number of the common feature template and the second difference information;

[0038] Wherein, N is a positive integer greater than 1.

[0039] Optionally, it also includes:

[0040] During the data storage process, dynamic information in the data to be stored is determined;

[0041] In the case where the dynamic information meets the algorithm recovery condition, the key information of the dynamic information is stored so that the key information can be used to recover the dynamic information through the algorithm when it is used.

[0042] Optionally, when the dynamic information satisfies an algorithm recovery condition, storing key information of the dynamic information so as to recover the dynamic information by using the key information through an algorithm when in use, includes:

[0043] In the case where the dynamic information satisfies the algorithm recovery condition, determining a first resource amount occupied by the dynamic information and a second resource amount occupied by key information of the dynamic information; wherein the key information is information obtained after compressing the dynamic information;

[0044] Determine a resource occupancy difference between the first resource amount and the second resource amount;

[0045] Determine whether the resource occupancy difference is greater than a resource occupancy threshold;

[0046] In the case where the resource occupation difference is greater than the resource occupation threshold, key information of the dynamic information is stored so that the key information is used to restore the dynamic information through an algorithm when in use.

[0047] Optionally, when the resource occupation difference is greater than a resource occupation threshold, storing key information of the dynamic information so as to restore the dynamic information by using the key information through an algorithm when in use, includes:

[0048] In the case where the resource occupation difference is greater than the resource occupation threshold, determining the time overhead required to restore the dynamic information using the key information through an algorithm;

[0049] Determine whether the time cost is less than a time cost threshold;

[0050] When the time overhead is less than the time overhead threshold, the key information in the dynamic information is stored, so that the key information is used to restore the dynamic information through an algorithm when it is used.

[0051] Optionally, it also includes:

[0052] When the data stored in the current memory partition is greater than a first data threshold, the current memory partition is split, and when the data stored in the current memory partition is less than a second data threshold, the current memory partition and other memory partitions are merged.

[0053] Optionally, the key-value pair storage system is provided with multiple levels of processing nodes, and further includes:

[0054] For hotspot data, a first-level processing node among the multi-level processing nodes is used as a main processing node to copy the hotspot data to a second-level processing node among the multi-level processing nodes;

[0055] The second-level processing node is used as a main processing node to copy the hotspot data to a third-level processing node in the multi-level processing nodes;

[0056] The third-level processing node is a next-level processing node of the second-level processing node, and the second-level processing node is a next-level processing node of the first-level processing node.

[0057] Optionally, it also includes:

[0058] Providing a setting interface to a user, and receiving a key value classification combination set by the user through the setting interface; wherein the key value classification combination is obtained from a plurality of types of key value combinations;

[0059] Based on the key-value classification combination, data query is performed in the key-value pair storage system.

[0060] Optionally, the index in the key-value pair storage system adopts a combined index structure that combines a hash index with a log structure merge tree.

[0061] Optionally, the memory in the multiple nodes includes multiple levels of memory, and the multiple levels of memory include: local memory, far memory, and remote memory. The local memory is the memory located in the node where the processor is located, the far memory is the memory located in other nodes in the rack where the processor is located, the other nodes are nodes other than the node where the processor is located, and the remote memory is the memory located in nodes in other racks except the rack where the processor is located.

[0062] A processing device for a key-value pair storage system, wherein the key-value pair storage system has a shared memory pool, wherein the shared memory pool is composed of memories in multiple nodes, and each node has multiple types of memories, wherein the device comprises:

[0063] A task attribute information determination module, used to receive multiple storage tasks and determine task attribute information of each storage task;

[0064] A memory partition establishment module, used to establish a memory partition for each storage task in the shared memory pool;

[0065] A memory partition strategy obtaining module is used to determine the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node according to the task attribute information, and obtain the memory partition strategy for each memory partition;

[0066] A memory partition strategy adjustment module, used to adjust the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node to obtain an adjusted memory partition strategy;

[0067] The overall memory resource utilization rate obtaining module is used to determine the memory resource utilization rate of each node according to the allocated memory capacity and the total memory capacity in each node under the adjusted memory partitioning strategy, and obtain the overall memory resource utilization rate of the nodes in the shared memory pool according to the memory resource utilization rates of all nodes;

[0068] The partition storage module is used to determine a target memory partition strategy from all memory partition strategies according to the overall memory resource utilization rate, and partition the data of the multiple storage tasks according to the target memory partition strategy.

[0069] An electronic device comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the method described above when executed by the processor.

[0070] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0071] A computer program product comprises a computer program, wherein when the computer program is executed by a processor, the computer program implements the method as described above.

[0072] The embodiments of the present invention have the following advantages:

[0073] In an embodiment of the present invention, a key-value pair storage system has a shared memory pool, which is composed of memories in multiple nodes, each node having multiple types of memories, and receiving multiple storage tasks and determining task attribute information of each storage task; establishing a memory partition for each storage task in the shared memory pool; determining a target node assigned to each memory partition and target memory information assigned to the memory partition in the target node according to the task attribute information, and obtaining a memory partition strategy for each memory partition; adjusting the target node assigned to each memory partition and the target memory information assigned to the memory partition in the target node, and obtaining an adjusted memory partition strategy. Memory partitioning strategy; under the adjusted memory partitioning strategy, the memory resource utilization rate of each node is determined according to the allocated memory capacity and the total memory capacity in each node, and the overall memory resource utilization rate of the nodes in the shared memory pool is obtained according to the memory resource utilization rate of all nodes; according to the overall memory resource utilization rate, a target memory partitioning strategy is determined from all memory partitioning strategies, and according to the target memory partitioning strategy, the data of the multiple storage tasks are partitioned and stored, thereby realizing the partitioned storage of data in the key-value storage system, and optimizing the memory partitioning strategy to achieve load balancing, thereby improving the system access performance and capacity of the key-value storage system. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0075] Figure 1 is a flowchart of a method for processing a key-value pair storage system provided by some embodiments of the present invention;

[0076] Figure 2a is a schematic diagram of a system architecture provided by some embodiments of the present invention;

[0077] Figure 2b is a schematic diagram of a system architecture provided by some embodiments of the present invention;

[0078] Figure 2c is a schematic diagram of a memory partition provided by some embodiments of the present invention;

[0079] Figure 2d is a schematic diagram of a partition setting process provided by some embodiments of the present invention;

[0080] Figure 2e is a schematic diagram of a partition setting process provided by some embodiments of the present invention;

[0081] Figure 2f is a schematic diagram of data template storage provided by some embodiments of the present invention;

[0082] Figure 2g is a schematic diagram of information compression provided by some embodiments of the present invention;

[0083] Figure 2h is a schematic diagram of parallel reading and writing provided by some embodiments of the present invention;

[0084] Figure 3 is a structural block diagram of a processing device of a key-value pair storage system provided by some embodiments of the present invention;

[0085] Figure 4 is a structural block diagram of an electronic device provided by some embodiments of the present invention;

[0086] Figure 5 is a structural block diagram of a storage medium provided by some embodiments of the present invention;

[0087] Figure 6 It is a structural block diagram of a program product provided by some embodiments of the present invention. DETAILED DESCRIPTION

[0088] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0089] Reference Figure 1, showing a step flow chart of a processing method of a key-value pair storage system provided by some embodiments of the present invention, the key-value pair storage system has a shared memory pool, the shared memory pool is composed of memories in multiple nodes, and each node has multiple types of memory.

[0090] In some embodiments of the present invention, the memory in the multiple nodes includes multiple levels of memory, and the multiple levels of memory include: local memory, far memory, and remote memory.

[0091] Among them, the local memory is the memory located in the node where the processor is located, the far memory is the memory located in other nodes in the rack where the processor is located, the other nodes are nodes other than the node where the processor is located, and the remote memory is the memory located in nodes in other racks except the rack where the processor is located.

[0092] In an embodiment of the present invention, a multi-level distributed heterogeneous memory pool architecture is proposed to mix DRAM (Dynamic Random Access Memory), HBM (High Bandwidth Memory), PM (Persistent Memory), and accelerator memory, and to mix local memory with remote memory. Heterogeneous memory pool management and access optimization are achieved through hybrid management mechanisms, pooled memory dynamic scheduling strategies and other technologies. For a variety of computing power and memory resources, through an elastic expansion architecture, independent expansion of computing systems, memory resources and accelerator memory is supported, and cross-node expansion of memory is supported, realizing the transition from processor-centric to data-centric. The system gives full play to the computing power of computing, storage and communication terminals, reduces invalid data migration, achieves high-throughput data processing, supports applications such as databases and data analysis, and improves the efficiency and performance of data-intensive application scenarios.

[0093] like Figure 2a and Figure 2b In the multi-level distributed heterogeneous memory pooling architecture, different types of memories deployed on different nodes form a shared memory pool, such as memory 1 is DRAM, memory 2 is HBM, memory 3 is PM, memory 4 is accelerator memory, and memory 5 is other extended memory. According to the distance from the local processor, it is divided into three levels: local memory, far memory, and remote memory.

[0094] Among them, local memory: the memory of the node where the processor is located is called local memory, including: DRAM, HBM, PM connected to the processor through the memory bus, and accelerator memory mapped to the system memory space through the heterogeneous computing architecture consistency interconnection protocol, and memory used to expand capacity through the consistency interconnection protocol. Far memory: the memory inside the rack where the processor is located, which implements cross-node data access through the ultra-high-speed consistency bus protocol. Remote memory: the memory deployed in other remote racks, which implements cross-rack data access through the high-speed consistency network protocol.

[0095] like Figure 2a and Figure 2b In the multi-level distributed heterogeneous computing and memory node pooling architecture, various types of computing devices are included in local and remote nodes, such as CPU (Central Processing Unit) for computing 1, GPU (Graphics Processing Unit) for computing 2, NPU (Neural Processing Unit) for computing 3, and FPGA (Field Programmable Gate Array) for computing 4. It can also include various computing devices such as special or general accelerators, as well as various storage media. In a distributed system, the number and performance of these computing and storage devices are different. The multi-level hybrid memory pool architecture implements hybrid memory pool management, establishes data structure and log method, and improves the availability of heterogeneous memory pool. Through the consistent interconnection protocol, the pooled memory is efficiently managed, and the heterogeneous pooled memory is load-balanced and scheduled to improve the utilization of memory resources.

[0096] Specifically, the following steps may be included:

[0097] Step 101, receiving multiple storage tasks and determining task attribute information of each storage task;

[0098] In some embodiments of the present invention, the task attribute information includes any one or more of the following: the data volume of the storage task, the data type of the storage task.

[0099] Step 102, establishing a memory partition for each storage task in the shared memory pool;

[0100] In related technologies, based on the different access delays of different storage media, latency-insensitive tasks are placed in PM and extended memory, latency-sensitive tasks are placed in DRAM, and specific accelerator processing data is placed in accelerator memory. However, since there are usually multiple applications running concurrently, and the media with low access delays such as DDR and HBM are distributed differently on each node.

[0101] In order to improve the concurrent use efficiency of the system, combined with the distribution characteristics of multi-level distributed heterogeneous memory pools, hierarchical multi-level partitioning rules are set. For delay-sensitive key-value data, those with high access frequency and frequent queries are placed in one partition, and those that are not frequently queried are placed in another partition.

[0102] like Figure 2c , multiple memory partitions are set, such as partition 1, partition 2, and partition 3, where different types of memory are divided in each partition, such as memory 1 is DRAM, memory 2 is HBM, memory 3 is PM, memory 4 is accelerator memory, and memory 5 is other extended memory. Each partition is a flexible combination of storage media with different geographical locations and different access rates. The storage combination is determined according to the required data access latency and the required storage capacity, and the resource load is effectively balanced. A priority memory usage strategy is set. According to the LRU (Least Recently Used) Cache (memory) replacement strategy, the storage combination with high priority is migrated in and out as the access frequency changes (data hotness and coldness) to ensure efficient system concurrent processing efficiency; the storage partition combination for each group of data is an optimization problem, and reinforcement learning can be used to generate better partitioning results.

[0103] Step 103, determining the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node according to the task attribute information, and obtaining the memory partition strategy of each memory partition;

[0104] In some embodiments of the present invention, determining, according to the task attribute information, the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node to obtain the memory partition strategy for each memory partition includes:

[0105] Determine memory allocation constraints; on the basis of satisfying the memory allocation constraints, determine the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node according to the task attribute information, and obtain a memory partition strategy for each memory partition.

[0106] In some embodiments of the present invention, the memory allocation constraint condition includes a delay constraint condition of each storage task and a storage resource capacity constraint condition of each type of memory in the shared resource pool. On the basis of satisfying the memory allocation constraint condition, according to the task attribute information, a target node allocated to each memory partition and target memory information allocated to the memory partition in the target node are determined to obtain a memory partition strategy for each memory partition, including:

[0107] Sub-step 11, determining, according to the task attribute information, candidate nodes allocated to each memory partition and candidate memory information allocated to the memory partition in the candidate nodes;

[0108] Sub-step 12, determining the node path delay information of the candidate node and the storage medium delay information of the candidate memory corresponding to the candidate memory information, and determining the overall delay information of the memory partition by combining the node path delay information and the storage medium delay information;

[0109] Sub-step 13, determining the allocated memory capacity of each type of memory in the shared resource pool;

[0110] Sub-step 14: if the overall delay information satisfies the delay constraint condition, and the allocated memory capacity of each type of memory in the shared resource pool satisfies the storage resource capacity constraint condition, then determining the candidate node as the target node and the candidate memory information as the target memory information;

[0111] Sub-step 15, obtaining a memory partition strategy for each memory partition according to the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node.

[0112] In some embodiments of the present invention, before determining that the candidate node is the target node and the candidate memory information is the target memory information if the overall delay information satisfies the delay constraint and the allocated memory capacity of each type of memory in the shared resource pool satisfies the storage resource capacity constraint, the method further includes:

[0113] Determining whether the delay value in the overall delay information is less than the delay upper limit in the delay constraint, and determining that the overall delay information satisfies the delay constraint when the delay value in the overall delay information is less than the delay upper limit in the delay constraint;

[0114] Determine whether the allocated memory capacity of each type of memory in the shared resource pool is less than the capacity upper limit value in the storage resource capacity constraint condition, and when the allocated memory capacity of each type of memory in the shared resource pool is less than the capacity upper limit value in the storage resource capacity constraint condition, determine that the allocated memory capacity of each type of memory in the shared resource pool satisfies the storage resource capacity constraint condition.

[0115] Step 104, adjusting the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node to obtain an adjusted memory partition strategy;

[0116] Step 105, under the adjusted memory partitioning strategy, determine the memory resource utilization rate of each node according to the allocated memory capacity and the total memory capacity in each node, and obtain the overall memory resource utilization rate of the nodes in the shared memory pool according to the memory resource utilization rates of all nodes;

[0117] In some embodiments of the present invention, the memory resource usage rate of each node is the average value of the memory resource usage rates of all types of memory in each node, and the memory resource usage rate of each node is determined according to the allocated memory capacity and the total memory capacity in each node, including:

[0118] For the current node, determine the memory capacity of each type of memory allocated to each memory partition; obtain the allocated memory capacity of each type of memory based on the memory capacity of each type of memory allocated to all memory partitions, and obtain the memory resource utilization rate of each type of memory in the current node by combining the allocated memory capacity of each type of memory and the total memory capacity of each type of memory; determine the average value of the memory resource utilization rates of all types of memory in the current node, and use the average value of the memory resource utilization rates of all types of memory in the current node as the memory resource utilization rate of the current node.

[0119] In some embodiments of the present invention, the memory resource usage rate of each type of memory in the current node is calculated using the following formula:

[0120]

[0121] Among them, σ d is the memory resource usage of the memory type d in the current node, c is the unit storage capacity, T i N d The number of memory units of memory type d allocated to the i-th memory partition in the current node, DC is the total memory capacity of memory type d in the current node, and M is the number of memory partitions.

[0122] Step 106: determine a target memory partition strategy from all memory partition strategies according to the overall memory resource usage rate, and partition and store the data of the multiple storage tasks according to the target memory partition strategy.

[0123] Since the access delays of various storage media are different, assume that:

[0124] The memory access delays of DDR, HBM, accelerator memory, extended memory, and PM at the same location are Dd, Dh, Da, De, and Dp, respectively. From near to far, the increase in unit capacity path delay caused by network switching equipment, etc., for each level of memory passing through a node is Ds.

[0125] The types and quantities of storage distributed on each node are different, such as Figure 2c The figure is a schematic diagram of three partitions. Each partition is divided into different types of memory. Memory 1 is DRAM, memory 2 is HBM, memory 3 is PM, memory 4 is accelerator memory, and memory 5 is other extended memory. The first partition consists of DDR on node 1, accelerator memory on node 2, and PM on node 3; the second partition consists of HBM on node 1, extended memory and PM on node 2, and accelerator memory on node 3; the third partition consists of accelerator memory and PM on node 1, and HBM on node 2.

[0126] For a certain set of data, assuming that the unit storage capacity is c, the numbers of various memory units of node 1 used are: N1d, N1h, N1a, N1e and N1p (the number of memory units of DRAM, HBM, accelerator memory, extended memory, and PM, respectively). Assuming the number of nodes is L, the numbers of various memory units of node L are: NLd, NLh, NLa, NLe and NLp (the number of memory units of DRAM, HBM, accelerator memory, extended memory, and PM, respectively).

[0127] Assume that the total storage capacity is C_total and the total delay of each partition is D_total; the DDR, HBM, accelerator memory, extended memory, and PM storage capacities provided by node 1 are D1C, H1C, A1C, E1C, and P1C respectively; the DDR, HBM, accelerator memory, extended memory, and PM storage capacities provided by node L are DLC, HLC, ALC, ELC, and PLC respectively; the total DDR, HBM, accelerator memory, extended memory, and PM storage capacities provided by all nodes are DC, HC, AC, EC, and PC respectively; and the number of concurrent tasks is M. Then the following formula can be obtained:

[0128] Total storage capacity C_total = c*(N1d+N1h+......+NLd+NLh+NLa+NLe+NLp); Formula (1)

[0129] The total delay of each partition D_total = N1d + N1h +...... + Ds*(N2d + N2h +......) +...... + (L-1) * Ds*(NLd + NLh +......); Formula (2),

[0130] Formula (2) includes storage medium delay and node path delay.

[0131] The DDR resources used by the first task are:

[0132] T1Cd=c*(T1N1d+T1N2d+......+T1NLd); Formula (3)

[0133] The DDR resources used by the Mth task are:

[0134] TMCd=c*(TMN1d+TMN2d+...+TMNLd); Formula (4)

[0135] Other resources are expressed similarly, and the resource constraints are:

[0136] T1Cd+......+TMCd≤DC; formula (5)

[0137] T1Ch+......+TMCh≤HC; formula (6)

[0138] T1Ca+......+TMCa≤AC; formula (7)

[0139] T1Ce+......+TMCe≤EC; formula (8)

[0140] T1Cp+......+TMCp≤PC; formula (9)

[0141] Assume that the maximum allowable delays of the 1st to Mth tasks are T1AD, ..., TMAD.

[0142] D1_total=T1N1d+T1N1h+......+Ds*(T1N2d+T1N2h+......)+......+(L-1)*Ds*(T1NLd+T1NLh+......); Formula (10)

[0143] DM_total=TMN1d+TMN1h+…+Ds*(TMN2d+TMN2h+…)+…+(L-1)*Ds*(TMNLd+TMNLh+…); Formula (11)

[0144] Based on this, the delay constraint is:

[0145] D1_total≤T1AD; formula (12)

[0146] DM_total≤TMAD; Formula (13)

[0147] DDR resource ratio in node 1:

[0148] σ1d=c*(T1N1d+T2N1d+...+TMN1d) / D1C; formula (14)

[0149] The proportion of DDR resources in node L:

[0150] σLd=c*(T1NLd+T2NLd+...+TMNLd) / DLC; formula (15)

[0151] The formulas for other resource proportions are similar.

[0152] like Figure 2d , given the storage resource distribution of each node, the medium and path delay parameters, and the storage resource capacity constraints of each node; the initial configuration of the partition is given, the resource utilization of each node in the current configuration is tested, and the feedback is given to the agent. The agent then performs the operation and continuously improves the storage resource utilization of each node by adjusting the memory type, capacity and node location used by each group, and then tests again, and finally achieves the highest resource utilization of each node within the limited total resources and access delay range.

[0153] Among them, reinforcement learning (RL) is a machine learning method that uses trial and error and rewards to improve the performance of the model. The distribution of each group of data in the multi-node memory resource pool is optimized. Reinforcement learning needs to learn the number and location of each storage resource. What needs to be learned is discrete values, and an offline strategy algorithm needs to be adopted. The stable SAC (Soft Actor-Critic, offline strategy algorithm) is used to model this task as a reinforcement learning problem, and its system implementation method is proposed.

[0154] like Figure 2e As shown in the figure, the reinforcement learning system consists of a SAC agent, a policy, an action implementation, and an accelerator system. The SAC agent takes actions according to a specific policy based on the current state of the environment. Under the conditions of satisfying resource constraints (Formulas (5)-(9)) and task delay constraints (Formulas (12)-(13)), the type, quantity, and location of each node memory used by each data group are adjusted. The storage allocation system generates the corresponding memory allocation according to the configuration scheme and calculates the resource utilization rate of each node (Formulas (14)-(15)). The increase in resource utilization before and after the configuration adjustment is used as a reward and fed back to the SAC agent. Continuously adjust the configuration under the strategy (such as Figure 2e Configuration 1, configuration 2, configuration 3), and continuous iteration until the results converge, thereby obtaining the optimal configuration of each data storage location grouping that meets the resource and delay constraints.

[0155] In some embodiments of the present invention, it also includes:

[0156] During the data storage process, a common feature template is established for multiple groups of data to be stored; and the multiple groups of data are stored according to the common feature template.

[0157] In some embodiments of the present invention, storing the multiple groups of data according to the common feature template includes: in the process of storing the first group of data, determining the first difference information between the first group of data and the common feature template, and storing the number of the common feature template and the first difference information; in the process of storing the Nth group of data, determining the second difference information between the Nth group of data and the N-1th group of data, and storing the number of the common feature template and the second difference information;

[0158] Wherein, N is a positive integer greater than 1.

[0159] In practical applications, massive data are segmented and classified, and common features and similar fragments are extracted for each type of data. When writing data, multiple common feature models are established based on sample differentiation, and a threshold is set. When the key-value data written subsequently reaches the threshold, the model is used. In this way, each group of data can only record the corresponding model number and its difference with the model.

[0160] On this basis, if Figure 2f , generate common feature templates 1 to 4. If there is a batch of continuous data with small differences, two-level difference recording can be performed. First, check whether there is a common feature template. If there is, use it directly. If not, create a new one. Then use the template and the difference with itself to record one group of data. In this way, the first level of recording is completed. For other groups, only the differences with the previous group of data are recorded in turn. Due to the local distribution of data, data can be quickly stored and restored by recording the slight differences between each group in a batch of data. Combined with the use of common templates, data compression storage can be achieved. In summary, this method can deduplicate similar structures or partially identical data, reduce the storage of redundant data, and efficiently place massive data. Figure 2f The first group of data records the template type number used, and records the differences between the first group of data and the corresponding fragments of each template. It is also necessary to record the data outside the template, that is, the data that cannot be recorded using the template. For the second group of data, record the differences corresponding to each template in the first group of data and the data outside the template. For the third group of data, record the differences corresponding to each template in the second group of data and the data outside the template.

[0161] In some embodiments of the present invention, each set of data can also be compared with the common feature template, and then the difference information is recorded. For each set of data, the number of the common feature template and its difference value with the common feature template are stored separately without comparing with the previous set of data.

[0162] In some embodiments of the present invention, it also includes:

[0163] In the process of data storage, dynamic information in the data to be stored is determined; when the dynamic information meets the algorithm recovery condition, key information of the dynamic information is stored, so that the key information is used to restore the dynamic information through the algorithm when it is used.

[0164] In some embodiments of the present invention, when the dynamic information satisfies the algorithm recovery condition, the key information of the dynamic information is stored so as to recover the dynamic information by using the key information through the algorithm when in use, including:

[0165] In the case where the dynamic information meets the algorithm recovery condition, determine the first amount of resources occupied by the dynamic information and the second amount of resources occupied by the key information of the dynamic information; wherein the key information is information obtained after compressing the dynamic information; determine the resource occupancy difference between the first amount of resources and the second amount of resources; judge whether the resource occupancy difference is greater than the resource occupancy threshold; in the case where the resource occupancy difference is greater than the resource occupancy threshold, store the key information of the dynamic information so that the key information is used to restore the dynamic information through the algorithm when in use.

[0166] In some embodiments of the present invention, when the resource occupation difference is greater than the resource occupation threshold, storing the key information of the dynamic information so as to restore the dynamic information by using the key information through an algorithm when in use, includes:

[0167] When the resource occupancy difference is greater than the resource occupancy threshold, determine the time overhead required to restore the dynamic information by using the key information through an algorithm; judge whether the time overhead is less than the time overhead threshold; when the time overhead is less than the time overhead threshold, store the key information in the dynamic information so that the key information can be used to restore the dynamic information through an algorithm when used.

[0168] like Figure 2g , the static information and dynamic information of key-value data are stored separately, and the distribution and generation rules of dynamic information are counted. If its value can be generated using a certain type of algorithm, the storage resources occupied by the data before compression and the storage resources occupied by the small amount of information represented by the original data restored by the available algorithm are compared. If the occupied storage resources are significantly reduced, and the time overhead of the computing resources required for algorithm recovery is within a certain range, the storage and retrieval process can be generated in real time by calling computing resources, and lightweight and efficient storage is performed. By setting the comprehensive resource overhead threshold of the two, a trade-off is made, such as Figure 2g, a trade-off is made by calculating the original dynamic information storage overhead, and calculating a small amount of necessary information storage overhead, real-time computing power overhead, and real-time computing time overhead.

[0169] In some embodiments of the present invention, it also includes:

[0170] When the data stored in the current memory partition is greater than a first data threshold, the current memory partition is split, and when the data stored in the current memory partition is less than a second data threshold, the current memory partition and other memory partitions are merged.

[0171] In actual applications, multi-level partitions are created dynamically according to the range of keys. The multi-level partition is a memory combination consisting of multiple memory media and near and far memory. When a partition grows beyond the configured size, it will be divided into two partitions, each of which occupies about half of the data. On the contrary, if a large amount of data is deleted and the partition shrinks below a certain threshold, it can be merged with the adjacent partition. This dynamic partitioning allows the number of partitions to adapt to the total amount of data. A small amount of data only requires a small number of partitions, with less overhead; if there is a large amount of data, the size of each partition needs to be limited to a configurable maximum value.

[0172] In some embodiments of the present invention, the key-value pair storage system is provided with multiple levels of processing nodes, and further includes: for hot data, the first level processing node among the multiple levels of processing nodes serves as the main processing node, and copies the hot data to the second level processing node among the multiple levels of processing nodes; the second level processing node serves as the main processing node, and copies the hot data to the third level processing node among the multiple levels of processing nodes; wherein the third level processing node is the next level processing node of the second level processing node, and the second level processing node is the next level processing node of the first level processing node.

[0173] In practical applications, read and write requests separated by read-write locks are used to improve the parallelism of the system; Figure 2hAs shown in the figure, the first-level processing node is the M (Master) node. Each M node has an S (Slaver) node under it. The S node is the second-level processing node. Each S node also has an S node, that is, the third-level processing node. By using a two-level tree-like master-slave structure, the slave node not only copies the master node data, but also continues to copy to the lower layer as the master node of other slave nodes. By introducing the replication intermediate layer, the master node load and the amount of data that needs to be transmitted to the slave node are effectively reduced, solving the problem of high pressure caused by the high number of pushes of the master node in the one-master-multiple-slave structure. When replicating, some hot data are replicated more according to the key-value retrieval bandwidth load, and data with less access volume are replicated less or not replicated; at the same time, considering that the read and write throughput of different types of master and slave nodes may be different, which will lead to inconsistent global load, when replicating the master and slave nodes, it is necessary to further check the current load of the area (rack, server). If the current area load exceeds the threshold, skip the area and continue to select other suitable areas. In this way, a compromise between memory resource usage and efficient retrieval is achieved, and system load balancing is sought.

[0174] In terms of improving key-value write performance, we use asynchronous message queues and caches. In the case of asynchronous message queues, the backend will throw the request into the message queue during processing, and respond to users quickly, avoiding the long-term blocking of synchronous calls under high concurrency, which may cause the overall system performance to degrade or even avalanche; through the advantage of low latency of multi-level hierarchical cache, more users can access the system at the same time in high concurrency scenarios. Here, multi-level hierarchical cache refers to any intermediate storage that reduces response time in a broad sense, including DRAM, HBM and accelerator cache and extended memory in the memory pool, from local nodes to nodes on remote racks, etc.

[0175] In some embodiments of the present invention, it also includes:

[0176] A setting interface is provided to the user, and a key value classification combination set by the user through the setting interface is received; wherein the key value classification combination is obtained from a plurality of types of key value combinations; and based on the key value classification combination, data query is performed in the key value pair storage system.

[0177] In an embodiment of the present invention, a convenient setting interface is provided to directly allow users to set key value classification combinations, such as classification by time range, type or custom, and a recommendation system is provided to form a variety of mode combinations based on user usage habits, short-term and long-term interests, and industry search examples, combined with retrieval efficiency, such as an expert recommendation system. Compared with the initial fixed key value index classification, it is closer to the user's actual usage needs and can therefore achieve the best user experience.

[0178] In some embodiments of the present invention, the index in the key-value pair storage system adopts a combined index structure that combines a hash index with a log structure merge tree.

[0179] In practical applications, a secondary classification index (secondary index) is established, which can select indexes of potential interest; a combined index structure design combining hash index and log structure merge tree is used. For example, different classifications have low correlation and can be stored in different partitions by hash, which is conducive to load balancing. For each classification, it can be stored in a single partition by time range, using log structure merge tree indexing; this facilitates parallel storage and retrieval between different classification information, and effectively retrieves all information of a specific object sorted by timestamp within a certain time interval.

[0180] By using the key-value separation method, during migration, only the key sorting is retained in the LSM-tree (Log-Structured Merge Tree), and the value is stored in a separate log; by decoupling keys and values, unnecessary value movement during sorting is avoided, significantly reducing write amplification. Keys are stored in DRAM, HBM, accelerator memory, or extended memory in multi-level memory groups, and values ​​are located in extended memory or PM. Due to the reduced size of the LSM-tree, fewer cross-heterogeneous computing nodes and local and remote memory pool reads and better cache are brought in during query, retaining the excellent insertion and search performance of the LSM-tree technology.

[0181] In an embodiment of the present invention, a key-value pair storage system has a shared memory pool, which is composed of memories in multiple nodes, each node having multiple types of memories, and receiving multiple storage tasks and determining task attribute information of each storage task; establishing a memory partition for each storage task in the shared memory pool; determining a target node assigned to each memory partition and target memory information assigned to the memory partition in the target node according to the task attribute information, and obtaining a memory partition strategy for each memory partition; adjusting the target node assigned to each memory partition and the target memory information assigned to the memory partition in the target node, and obtaining an adjusted memory partition strategy. Memory partitioning strategy; under the adjusted memory partitioning strategy, the memory resource utilization rate of each node is determined according to the allocated memory capacity and the total memory capacity in each node, and the overall memory resource utilization rate of the nodes in the shared memory pool is obtained according to the memory resource utilization rate of all nodes; according to the overall memory resource utilization rate, a target memory partitioning strategy is determined from all memory partitioning strategies, and according to the target memory partitioning strategy, the data of the multiple storage tasks are partitioned and stored, thereby realizing the partitioned storage of data in the key-value storage system, and optimizing the memory partitioning strategy to achieve load balancing, thereby improving the system access performance and capacity of the key-value storage system.

[0182] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0183] Reference Figure 3 , shows a schematic diagram of the structure of a processing device of a key-value pair storage system provided by some embodiments of the present invention, wherein the key-value pair storage system has a shared memory pool, which is composed of memories in multiple nodes, each node having multiple types of memories, and specifically may include the following modules:

[0184] The task attribute information determination module 301 is used to receive multiple storage tasks and determine the task attribute information of each storage task;

[0185] A memory partition establishment module 302, used to establish a memory partition for each storage task in the shared memory pool;

[0186] A memory partition strategy obtaining module 303 is used to determine the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node according to the task attribute information, and obtain the memory partition strategy for each memory partition;

[0187] A memory partition strategy adjustment module 304 is used to adjust the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node to obtain an adjusted memory partition strategy;

[0188] The overall memory resource utilization rate obtaining module 305 is used to determine the memory resource utilization rate of each node according to the allocated memory capacity and the total memory capacity in each node under the adjusted memory partitioning strategy, and obtain the overall memory resource utilization rate of the nodes in the shared memory pool according to the memory resource utilization rates of all nodes;

[0189] The partition storage module 306 is used to determine a target memory partition strategy from all memory partition strategies according to the overall memory resource usage rate, and partition and store the data of the multiple storage tasks according to the target memory partition strategy.

[0190] In some embodiments of the present invention, determining, according to the task attribute information, the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node to obtain the memory partition strategy for each memory partition includes:

[0191] Determine memory allocation constraints;

[0192] On the basis of satisfying the memory allocation constraint condition, according to the task attribute information, the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node are determined to obtain the memory partition strategy of each memory partition.

[0193] In some embodiments of the present invention, the memory allocation constraint condition includes a delay constraint condition of each storage task and a storage resource capacity constraint condition of each type of memory in the shared resource pool. On the basis of satisfying the memory allocation constraint condition, according to the task attribute information, a target node allocated to each memory partition and target memory information allocated to the memory partition in the target node are determined to obtain a memory partition strategy for each memory partition, including:

[0194] Determine, according to the task attribute information, candidate nodes allocated to each memory partition and candidate memory information allocated to the memory partition in the candidate nodes;

[0195] Determine the node path delay information of the candidate node and the storage medium delay information of the candidate memory corresponding to the candidate memory information, and determine the overall delay information of the memory partition by combining the node path delay information and the storage medium delay information;

[0196] Determining the allocated memory capacity of each type of memory in the shared resource pool;

[0197] If the overall delay information satisfies the delay constraint condition, and the allocated memory capacity of each type of memory in the shared resource pool satisfies the storage resource capacity constraint condition, determining the candidate node as the target node and the candidate memory information as the target memory information;

[0198] A memory partition strategy for each memory partition is obtained according to the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node.

[0199] In some embodiments of the present invention, before determining that the candidate node is the target node and the candidate memory information is the target memory information if the overall delay information satisfies the delay constraint and the allocated memory capacity of each type of memory in the shared resource pool satisfies the storage resource capacity constraint, the method further includes:

[0200] Determining whether the delay value in the overall delay information is less than the delay upper limit in the delay constraint, and determining that the overall delay information satisfies the delay constraint when the delay value in the overall delay information is less than the delay upper limit in the delay constraint;

[0201] Determine whether the allocated memory capacity of each type of memory in the shared resource pool is less than the capacity upper limit value in the storage resource capacity constraint condition, and when the allocated memory capacity of each type of memory in the shared resource pool is less than the capacity upper limit value in the storage resource capacity constraint condition, determine that the allocated memory capacity of each type of memory in the shared resource pool satisfies the storage resource capacity constraint condition.

[0202] In some embodiments of the present invention, the memory resource usage rate of each node is the average value of the memory resource usage rates of all types of memory in each node, and the memory resource usage rate of each node is determined according to the allocated memory capacity and the total memory capacity in each node, including:

[0203] For the current node, determine the memory capacity of each type of memory allocated to each memory partition;

[0204] According to the memory capacity of each type of memory allocated to all memory partitions, the allocated memory capacity of each type of memory is obtained, and the memory resource usage rate of each type of memory in the current node is obtained by combining the allocated memory capacity of each type of memory and the total memory capacity of each type of memory;

[0205] An average value of memory resource usage of all types of memory in the current node is determined, and the average value of memory resource usage of all types of memory in the current node is used as the memory resource usage of the current node.

[0206] In some embodiments of the present invention, the memory resource usage rate of each type of memory in the current node is calculated using the following formula:

[0207]

[0208] Among them, σ d is the memory resource usage of the memory type d in the current node, c is the unit storage capacity, T i N d The number of memory units of memory type d allocated to the i-th memory partition in the current node, DC is the total memory capacity of memory type d in the current node, and M is the number of memory partitions.

[0209] In some embodiments of the present invention, the task attribute information includes any one or more of the following: the data volume of the storage task, the data type of the storage task.

[0210] In some embodiments of the present invention, it also includes:

[0211] In the process of data storage, a common feature template is established for multiple sets of data to be stored;

[0212] The multiple groups of data are stored according to the common feature template.

[0213] In some embodiments of the present invention, storing the plurality of groups of data according to the common feature template includes:

[0214] In the process of storing the first group of data, determining first difference information between the first group of data and the common feature template, and storing the serial number of the common feature template and the first difference information;

[0215] In the process of storing the Nth group of data, determining second difference information between the Nth group of data and the N-1th group of data, and storing the serial number of the common feature template and the second difference information;

[0216] Wherein, N is a positive integer greater than 1.

[0217] In some embodiments of the present invention, it also includes:

[0218] During the data storage process, dynamic information in the data to be stored is determined;

[0219] In the case where the dynamic information meets the algorithm recovery condition, the key information of the dynamic information is stored so that the key information can be used to recover the dynamic information through the algorithm when it is used.

[0220] In some embodiments of the present invention, when the dynamic information satisfies the algorithm recovery condition, the key information of the dynamic information is stored so as to recover the dynamic information by using the key information through the algorithm when in use, including:

[0221] In the case where the dynamic information satisfies the algorithm recovery condition, determining a first resource amount occupied by the dynamic information and a second resource amount occupied by key information of the dynamic information; wherein the key information is information obtained after compressing the dynamic information;

[0222] Determine a resource occupancy difference between the first resource amount and the second resource amount;

[0223] Determine whether the resource occupancy difference is greater than a resource occupancy threshold;

[0224] In the case where the resource occupation difference is greater than the resource occupation threshold, key information of the dynamic information is stored so that the key information is used to restore the dynamic information through an algorithm when in use.

[0225] In some embodiments of the present invention, when the resource occupation difference is greater than the resource occupation threshold, storing the key information of the dynamic information so as to restore the dynamic information by using the key information through an algorithm when in use, includes:

[0226] In the case where the resource occupation difference is greater than the resource occupation threshold, determining the time overhead required to restore the dynamic information using the key information through an algorithm;

[0227] Determine whether the time cost is less than a time cost threshold;

[0228] When the time overhead is less than the time overhead threshold, the key information in the dynamic information is stored, so that the key information is used to restore the dynamic information through an algorithm when it is used.

[0229] In some embodiments of the present invention, it also includes:

[0230] When the data stored in the current memory partition is greater than a first data threshold, the current memory partition is split, and when the data stored in the current memory partition is less than a second data threshold, the current memory partition and other memory partitions are merged.

[0231] In some embodiments of the present invention, the key-value pair storage system is provided with multiple levels of processing nodes, and further includes:

[0232] For hotspot data, a first-level processing node among the multi-level processing nodes is used as a main processing node to copy the hotspot data to a second-level processing node among the multi-level processing nodes;

[0233] The second-level processing node is used as a main processing node to copy the hotspot data to a third-level processing node in the multi-level processing nodes;

[0234] The third-level processing node is a next-level processing node of the second-level processing node, and the second-level processing node is a next-level processing node of the first-level processing node.

[0235] In some embodiments of the present invention, it also includes:

[0236] Providing a setting interface to a user, and receiving a key value classification combination set by the user through the setting interface; wherein the key value classification combination is obtained from a plurality of types of key value combinations;

[0237] Based on the key-value classification combination, data query is performed in the key-value pair storage system.

[0238] In some embodiments of the present invention, the index in the key-value pair storage system adopts a combined index structure that combines a hash index with a log structure merge tree.

[0239] In some embodiments of the present invention, the memory in the multiple nodes includes multiple levels of memory, and the multiple levels of memory include: local memory, far memory, and remote memory. The local memory is the memory located in the node where the processor is located, the far memory is the memory located in other nodes in the rack where the processor is located, the other nodes are nodes other than the node where the processor is located, and the remote memory is the memory located in nodes in other racks except the rack where the processor is located.

[0240] Reference Figure 4 , shows an electronic device provided by some embodiments of the present invention, including a processor 401, a memory 402, and a computer program stored in the memory 402 and capable of running on the processor 401, and the computer program implements the above method when executed by the processor.

[0241] Reference Figure 5 , shows a computer-readable storage medium 500 provided in some embodiments of the present invention, on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented.

[0242] Reference Figure 6 , shows a computer program product 600 provided by some embodiments of the present invention, including a computer program, which implements the above method when executed by a processor.

[0243] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0244] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0245] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0246] Those skilled in the art will appreciate that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0247] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0248] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0249] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0250] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0251] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the above elements.

[0252] The above is a detailed introduction to a processing method and device for a key-value pair storage system. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for processing a key-value pair storage system, characterized in that: The key-value pair storage system has a shared memory pool, which is composed of memories in multiple nodes, and each node has multiple types of memories. The method includes: Receiving multiple storage tasks and determining task attribute information of each storage task; Establishing a memory partition for each storage task in the shared memory pool; According to the task attribute information, determine the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node, and obtain the memory partition strategy for each memory partition; Adjust the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node to obtain an adjusted memory partition strategy; Under the adjusted memory partitioning strategy, the memory resource utilization rate of each node is determined according to the allocated memory capacity and the total memory capacity in each node, and the overall memory resource utilization rate of the nodes in the shared memory pool is obtained according to the memory resource utilization rates of all nodes; According to the overall memory resource usage rate, a target memory partition strategy is determined from all memory partition strategies, and data of the multiple storage tasks are partitioned and stored according to the target memory partition strategy.

2. The method according to claim 1, characterized in that The step of determining, according to the task attribute information, a target node allocated to each memory partition and target memory information allocated to the memory partition in the target node, and obtaining a memory partition strategy for each memory partition includes: Determine memory allocation constraints; On the basis of satisfying the memory allocation constraint condition, according to the task attribute information, the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node are determined to obtain the memory partition strategy of each memory partition.

3. The method according to claim 2, characterized in that The memory allocation constraint condition includes a delay constraint condition for each storage task and a storage resource capacity constraint condition for each type of memory in the shared resource pool. On the basis of satisfying the memory allocation constraint condition, according to the task attribute information, a target node allocated to each memory partition and target memory information allocated to the memory partition in the target node are determined, and a memory partition strategy for each memory partition is obtained, including: Determine, according to the task attribute information, candidate nodes allocated to each memory partition and candidate memory information allocated to the memory partition in the candidate nodes; Determine the node path delay information of the candidate node and the storage medium delay information of the candidate memory corresponding to the candidate memory information, and determine the overall delay information of the memory partition by combining the node path delay information and the storage medium delay information; Determining the allocated memory capacity of each type of memory in the shared resource pool; If the overall delay information satisfies the delay constraint condition, and the allocated memory capacity of each type of memory in the shared resource pool satisfies the storage resource capacity constraint condition, determining the candidate node as the target node and the candidate memory information as the target memory information; A memory partition strategy for each memory partition is obtained according to the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node.

4. The method according to claim 3, characterized in that Before determining that the candidate node is the target node and the candidate memory information is the target memory information if the overall delay information satisfies the delay constraint and the allocated memory capacity of each type of memory in the shared resource pool satisfies the storage resource capacity constraint, the method further includes: Determining whether the delay value in the overall delay information is less than the delay upper limit in the delay constraint, and determining that the overall delay information satisfies the delay constraint when the delay value in the overall delay information is less than the delay upper limit in the delay constraint; Determine whether the allocated memory capacity of each type of memory in the shared resource pool is less than the capacity upper limit value in the storage resource capacity constraint condition, and when the allocated memory capacity of each type of memory in the shared resource pool is less than the capacity upper limit value in the storage resource capacity constraint condition, determine that the allocated memory capacity of each type of memory in the shared resource pool satisfies the storage resource capacity constraint condition.

5. The method according to claim 1, characterized in that The memory resource usage rate of each node is the average memory resource usage rate of all types of memory in each node. The memory resource usage rate of each node is determined according to the allocated memory capacity and the total memory capacity in each node, including: For the current node, determine the memory capacity of each type of memory allocated to each memory partition; According to the memory capacity of each type of memory allocated to all memory partitions, the allocated memory capacity of each type of memory is obtained, and the memory resource usage rate of each type of memory in the current node is obtained by combining the allocated memory capacity of each type of memory and the total memory capacity of each type of memory; An average value of memory resource usage of all types of memory in the current node is determined, and the average value of memory resource usage of all types of memory in the current node is used as the memory resource usage of the current node.

6. The method according to claim 5, characterized in that The memory resource usage of each type of memory in the current node is calculated using the following formula: Among them, σ d is the memory resource usage of the memory type d in the current node, c is the unit storage capacity, T i N d The number of memory units of memory type d allocated to the i-th memory partition in the current node, DC is the total memory capacity of memory type d in the current node, and M is the number of memory partitions.

7. The method according to any one of claims 1 to 6, characterized in that: The task attribute information includes any one or more of the following: the data volume of the storage task, and the data type of the storage task.

8. The method according to any one of claims 1 to 6, characterized in that: Also includes: In the process of data storage, a common feature template is established for multiple sets of data to be stored; The multiple groups of data are stored according to the common feature template.

9. The method according to claim 8, characterized in that The storing of the plurality of groups of data according to the common feature template comprises: In the process of storing the first group of data, determining first difference information between the first group of data and the common feature template, and storing the serial number of the common feature template and the first difference information; In the process of storing the Nth group of data, determining second difference information between the Nth group of data and the N-1th group of data, and storing the serial number of the common feature template and the second difference information; Wherein, N is a positive integer greater than 1.

10. The method according to any one of claims 1 to 6, characterized in that: Also includes: During the data storage process, dynamic information in the data to be stored is determined; In the case where the dynamic information meets the algorithm recovery condition, the key information of the dynamic information is stored so that the key information can be used to recover the dynamic information through the algorithm when it is used.

11. The method according to claim 10, characterized in that When the dynamic information satisfies the algorithm recovery condition, the key information of the dynamic information is stored so as to recover the dynamic information by using the key information through the algorithm when in use, including: In the case where the dynamic information satisfies the algorithm recovery condition, determining a first resource amount occupied by the dynamic information and a second resource amount occupied by key information of the dynamic information; wherein the key information is information obtained after compressing the dynamic information; Determine a resource occupancy difference between the first resource amount and the second resource amount; Determine whether the resource occupancy difference is greater than a resource occupancy threshold; In the case where the resource occupation difference is greater than the resource occupation threshold, key information of the dynamic information is stored so that the key information is used to restore the dynamic information through an algorithm when in use.

12. The method according to claim 11, characterized in that When the resource occupation difference is greater than the resource occupation threshold, storing the key information of the dynamic information so as to restore the dynamic information by using the key information through an algorithm when in use, includes: In the case where the resource occupation difference is greater than the resource occupation threshold, determining the time overhead required to restore the dynamic information using the key information through an algorithm; Determine whether the time cost is less than a time cost threshold; When the time overhead is less than the time overhead threshold, the key information in the dynamic information is stored, so that the key information is used to restore the dynamic information through an algorithm when it is used.

13. The method according to any one of claims 1 to 6, characterized in that: Also includes: When the data stored in the current memory partition is greater than a first data threshold, the current memory partition is split, and when the data stored in the current memory partition is less than a second data threshold, the current memory partition and other memory partitions are merged.

14. The method according to any one of claims 1 to 6, characterized in that: The key-value pair storage system is provided with multiple levels of processing nodes, and further includes: For hotspot data, a first-level processing node among the multi-level processing nodes is used as a main processing node to copy the hotspot data to a second-level processing node among the multi-level processing nodes; The second-level processing node is used as a main processing node to copy the hotspot data to a third-level processing node in the multi-level processing nodes; The third-level processing node is a next-level processing node of the second-level processing node, and the second-level processing node is a next-level processing node of the first-level processing node.

15. The method according to any one of claims 1 to 6, characterized in that: Also includes: Providing a setting interface to a user, and receiving a key value classification combination set by the user through the setting interface; wherein the key value classification combination is obtained from a plurality of types of key value combinations; Based on the key-value classification combination, data query is performed in the key-value pair storage system.

16. The method according to any one of claims 1 to 6, characterized in that: The index in the key-value pair storage system adopts a combined index structure that combines a hash index with a log structure merge tree.

17. The method according to any one of claims 1 to 6, characterized in that: The memory in the multiple nodes includes multiple levels of memory, and the multiple levels of memory include: local memory, far memory, and remote memory. The local memory is the memory located in the node where the processor is located, the far memory is the memory located in other nodes in the rack where the processor is located, the other nodes are nodes other than the node where the processor is located, and the remote memory is the memory located in nodes in other racks except the rack where the processor is located.

18. A processing device for a key-value pair storage system, characterized in that: The key-value pair storage system has a shared memory pool, which is composed of memories in multiple nodes, each node having multiple types of memories, and the device includes: A task attribute information determination module, used to receive multiple storage tasks and determine task attribute information of each storage task; A memory partition establishment module, used to establish a memory partition for each storage task in the shared memory pool; A memory partition strategy obtaining module is used to determine the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node according to the task attribute information, and obtain the memory partition strategy for each memory partition; A memory partition strategy adjustment module, used to adjust the target node allocated to each memory partition and the target memory information allocated to the memory partition in the target node to obtain an adjusted memory partition strategy; The overall memory resource utilization rate obtaining module is used to determine the memory resource utilization rate of each node according to the allocated memory capacity and the total memory capacity in each node under the adjusted memory partitioning strategy, and obtain the overall memory resource utilization rate of the nodes in the shared memory pool according to the memory resource utilization rates of all nodes; The partition storage module is used to determine a target memory partition strategy from all memory partition strategies according to the overall memory resource utilization rate, and partition the data of the multiple storage tasks according to the target memory partition strategy.

19. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the method according to any one of claims 1 to 17 when executed by the processor.

20. 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 method according to any one of claims 1 to 17 is implemented.

21. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 17.