Data storage method and device, storage medium and electronic equipment

By implementing distributed data storage across hosts in a virtual machine cluster environment, using shared memory and priority allocation strategies, the data processing bottleneck caused by insufficient memory of a single host is solved, data storage efficiency and flexibility are improved, and data loss risk is reduced.

CN119668879APending Publication Date: 2025-03-21INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411849894.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

In a virtual machine environment, when facing large-scale incremental data storage, insufficient memory of a single host leads to a bottleneck in data processing, affecting data recording efficiency, which may lead to data backlog and delay, and even the risk of data loss.

Method used

By implementing distributed storage of data across hosts in a cluster environment, using preset memory shared by each host, a suitable storage area is determined from other hosts for data storage based on the allocation priority of excessive data and the storage priority of other hosts in the cluster.

Benefits of technology

It improves the flexibility and response speed of data storage, avoids data processing bottlenecks caused by insufficient memory on a single host, realizes more efficient data storage, and reduces the risk of data loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119668879A_ABST
    Figure CN119668879A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data storage method and device, a storage medium and electronic equipment, and relates to the field of computers.The data storage method comprises the steps that a data storage request initiated by a first host is obtained, the first host is a host in a cluster, and all hosts in the cluster share a preset memory; the preset memory is jointly provided by each host, and the data storage request is used for requesting to store excessive data generated by the first host in the preset memory; determining at least one second host from other hosts based on the distribution priority of the excessive data and the storage priorities of the other hosts in the cluster; the excess data is stored in at least one second host. By adopting the scheme, the problem of relatively low data storage efficiency in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the computer field, and more specifically, to a data storage method and device, a storage medium, and an electronic device. Background Art

[0002] As an important form of computing resource carrier, the security and integrity of virtual machine data are directly related to the stable operation of the entire system. Using CDP (continuous data protection) to record the incremental data of virtual machines is a common and effective method.

[0003] In actual applications, the IO data to be transmitted generated by the virtual machine is generally stored in the local shared memory. Although this can meet the needs of data storage to a certain extent, it has obvious limitations. When faced with large-scale virtual machine incremental data, it is easy to run out of storage space. This limitation will affect the efficiency of data recording, leading to data backlog and delay, and may also cause the risk of data loss due to the inability to store key data in time.

[0004] Therefore, there is a technical problem of low data storage efficiency in the related technology. Summary of the invention

[0005] The embodiments of the present application provide a data storage method and device, a storage medium, and an electronic device to at least solve the technical problem of low data storage efficiency in the related art.

[0006] According to one embodiment of the present application, a data storage method is provided, including: obtaining a data storage request initiated by a first host, wherein the first host is a host in a cluster, the hosts in the cluster share a preset memory, the preset memory is jointly provided by the hosts, and the data storage request is used to request storage of excess data generated by the first host in the preset memory; based on the allocation priority of the excess data and the storage priority of other hosts in the cluster, determining at least one second host from the other hosts; and storing the excess data in the at least one second host.

[0007] According to another embodiment of the present application, a data storage device is provided, including: an acquisition unit, used to acquire a data storage request initiated by a first host, wherein the first host is a host in a cluster, each host in the cluster shares a preset memory, the preset memory is jointly provided by each host, and the data storage request is used to request to store excess data generated by the first host in the preset memory; a determination unit, used to determine at least one second host from other hosts based on the allocation priority of the excess data and the storage priority of other hosts in the cluster; and a storage unit, used to store the excess data in at least one second host.

[0008] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0009] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0010] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method in each embodiment of the present application are implemented.

[0011] Through the embodiments provided by the present application, a data storage request is initiated by a first host, wherein the first host is a host in a cluster, and each host in the cluster shares a preset memory, and the data storage request is used to request to store the excess data generated by the first host in the preset memory; based on the allocation priority of the excess data and the storage priority of other hosts in the cluster, at least one second host is determined from other hosts. In this way, based on the preset memory jointly provided by each host in a cluster environment, for each host, when it generates excess data that is difficult to store in its own storage space, a suitable storage area is determined from other hosts for storage, thereby avoiding the data processing bottleneck caused by insufficient memory of a single host, thereby improving the flexibility and response speed of data storage, thereby achieving the technical effect of improving data storage efficiency and solving the technical problem of low data storage efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 is a hardware structure block diagram of a data storage method according to an embodiment of the present application;

[0013] Figure 2 is a flow chart of a data storage method according to the present application;

[0014] Figure 3 is a schematic diagram of a distributed memory system across hosts according to the present application;

[0015] Figure 4 It is a structural block diagram of a data storage device according to an embodiment of the present application. DETAILED DESCRIPTION

[0016] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0017] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or precedence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0018] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure block diagram of a computer terminal of a data storage method according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 The computer terminal includes a processor 102 (only one is shown) (the processor 102 may include but is not limited to a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, wherein the computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components shown in the figure, or with different Figure 1 Different configurations are shown.

[0019] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for determining the mapping relationship in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0020] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0021] As an alternative, Figure 2 As shown, a data storage method, the specific steps include:

[0022] S202, creating a first virtual router for the virtual machine;

[0023] S204, obtaining a data storage request initiated by a first host, wherein the first host is a host in a cluster, each host in the cluster shares a preset memory, the preset memory is jointly provided by each host, and the data storage request is used to request to store excess data generated by the first host in the preset memory;

[0024] S206, determining at least one second host from the other hosts based on the allocation priority of the excess data and the storage priority of the other hosts in the cluster;

[0025] S208, storing the excess data in at least one second host.

[0026] Optionally, in this embodiment, the data storage method can be applied to, but is not limited to, site disaster recovery scenarios. In today's digital age, site disaster recovery has become a key link in ensuring the continued operation of services. With the rapid development of information technology and the increasing reliance of services on data, it is particularly important to ensure that data and business functions can be quickly and effectively restored in the event of various unexpected situations, such as natural disasters, hardware failures, and human errors.

[0027] In site disaster recovery scenarios, virtual machines are an important form of computing resource carrier, and the security and integrity of their data are directly related to the stable operation of the entire system. Using CDP (continuous data protection) to record the incremental data of virtual machines is a common and effective method.

[0028] In actual applications, the IO data to be transmitted generated by the virtual machine is generally stored in the local shared memory. Although this can meet the needs of data storage to a certain extent, it has obvious limitations. When faced with large-scale virtual machine incremental data, it is easy to run out of storage space. This limitation will affect the efficiency of data recording, leading to data backlog and delay, and may also cause the risk of data loss due to the inability to store key data in time.

[0029] For the above problems, the data storage method provided in this embodiment is based on the preset memory jointly provided by each host in a cluster environment. For each host, when it generates excessive data that is difficult to store in its own storage space, a suitable storage area is determined from other hosts for storage, thereby avoiding the data processing bottleneck caused by insufficient memory of a single host, thereby improving the flexibility and response speed of data storage, thereby achieving the technical effect of improving data storage efficiency and being able to solve the above problems.

[0030] Optionally, in this embodiment, the first host may be but is not limited to being a host that has pre-joined the cluster, wherein the first host may be but is not limited to sending a registration request to the management node, the request including relevant information of the memory area of ​​the first host, such as the total memory size, available memory size, location, etc., as well as the operating load information of the first host, such as CPU and memory usage over a period of time.

[0031] Optionally, in this embodiment, after receiving the registration request of the first host, the management node verifies the legitimacy of the request and records the registration information of the host in the management data structure of the distributed memory mapping table. The management node plans a shared memory area of ​​appropriate size for the first host according to the load and system resource status of the first host, and returns the planning suggestion to the first host. After receiving the planning suggestion, the first host allocates specific shared memory according to the planning suggestion, and performs corresponding configuration and initialization on the shared memory area information so that it can correctly allocate and use the shared memory.

[0032] It should be noted that the above-mentioned distributed shared memory mapping table maintained on the management node is used to record the usage and location information of all memory blocks in the entire cluster. When the CDP service of a host node uses insufficient local memory and needs to apply for additional host memory, the management node will allocate it according to the situation in the memory mapping table.

[0033] It is understandable that, when a data storage request initiated by the first host is received, it is determined that the excess data generated in the first host does not use enough memory of the first host, and a shared memory provided by other hosts in the cluster in the preset memory is applied.

[0034] Optionally, in this embodiment, based on the allocation priority of the excess data and the storage priority of other hosts in the cluster, at least one second host is determined from the other hosts; and the excess data is stored in the at least one second host.

[0035] It can be understood that the allocation priority of the excess data is obtained by comprehensively calculating the data characteristics of the excess data sent by the host, and the storage priority of the host is obtained by comprehensively calculating the working characteristics of the host, and a reasonable target memory storage location is allocated to the excess data according to the allocation priority of the excess data and the storage priority of the host.

[0036] Optionally, in this embodiment, the allocation priority of the excess data is obtained by performing a comprehensive calculation based on the data characteristics of the excess data sent by the host, which may include, but is not limited to, performing a comprehensive consideration calculation based on the following data characteristics:

[0037] (1) Business priority: By setting the business priority for each virtual machine in advance, the data it sends will be set with a clear priority level. For example, data can be divided into high, medium, and low priority, and the allocation order is determined based on the priority. High-priority data will be allocated to the target memory location first to ensure that it is processed in a timely manner.

[0038] (2) Data size priority: Larger data may require more storage space and processing time. When allocating, the size of the data can be considered and the target memory location of smaller data can be prioritized to improve storage and processing efficiency.

[0039] (3) Data timeliness priority: Data with high real-time requirements (such as real-time sensor data) has a higher priority, while some non-critical data (such as cached data) has a lower priority.

[0040] Optionally, in this embodiment, the storage priority of the host is obtained by performing a comprehensive calculation according to the working characteristics of the host, which may include but is not limited to performing a comprehensive calculation based on the following working characteristics:

[0041] (1) Host workload: The real-time workload of each host is detected and data is preferentially allocated to hosts with lower memory loads to balance the load and improve overall performance.

[0042] (2) Host performance: Consider the performance differences of each host, such as CPU usage, memory usage, total memory, etc., and distribute data to hosts with better performance to improve data processing efficiency.

[0043] Through the embodiments provided by the present application, based on the preset memory jointly provided by each host in a cluster environment, for each host, when it generates excessive data that is difficult to store in its own storage space, a suitable storage area is determined from other hosts for storage, thereby avoiding the data processing bottleneck caused by insufficient memory of a single host, thereby improving the flexibility and response speed of data storage, thereby achieving the technical effect of improving data storage efficiency and solving the technical problem of low data storage efficiency.

[0044] As an optional solution, based on the allocation priority of the excess data and the storage priority of other hosts in the cluster, at least one second host is determined from other hosts, including:

[0045] determining the current excess data with the highest allocation priority from the excess data in turn;

[0046] A current host with the highest storage priority and capable of storing the current excess data is determined from other hosts, wherein the current host is used to store the current excess data and at least one second host includes the current host.

[0047] Optionally, in this embodiment, the excess data may include but is not limited to multiple IO data generated by the first host, and the IO data with the highest allocation priority (current excess data) is first determined for processing, and a host that can store and has the highest storage priority is determined from other hosts, and then the IO data is stored.

[0048] It should be noted that after determining the above-mentioned IO data and its matching host, the IO data with the highest allocation priority is determined from the remaining IO data in the excess data and processed as the current excess data, and the host that can store and has the highest storage priority is determined from other hosts, and then the IO data is stored.

[0049] Through the embodiments provided in the present application, reasonable target memory storage locations are allocated to excess data according to the allocation priority of the excess data and the storage priority of the host, thereby ensuring that the excess data can be stored in the most reasonable and efficient way and fully utilizing the resources of the entire distributed memory.

[0050] As an optional solution, before determining at least one second host from other hosts based on the allocation priority of the excess data and the storage priority of other hosts in the cluster, the method also includes:

[0051] Obtaining host performance parameters and host load parameters associated with other hosts, wherein the host performance parameters are used to indicate the performance priority of other hosts, and the host load parameters are used to indicate the workload priority of other hosts;

[0052] Based on the accumulated values ​​of the host performance parameter and the host load parameter, the allocation priority of the excess data is determined.

[0053] Optionally, in this embodiment, the storage priority of the host is obtained by performing a comprehensive calculation according to the working characteristics of the host, which may include but is not limited to performing a comprehensive calculation based on the following working characteristics:

[0054] (1) Host workload: The real-time workload of each host is detected and data is preferentially allocated to hosts with lower memory loads to balance the load and improve overall performance.

[0055] (2) Host performance: Consider the performance differences of each host, such as CPU usage, memory usage, total memory, etc., and distribute data to hosts with better performance to improve data processing efficiency.

[0056] Through the embodiments provided by the present application, the allocation priority of excess data is determined based on the accumulated values ​​of host performance parameters and host load parameters. It can ensure that excess data can be stored in the most reasonable and effective way, making full use of the resources of the entire distributed memory. The advantages of cross-host distributed memory are fully utilized to achieve efficient storage and synchronization of data.

[0057] As an optional solution, obtain host performance parameters associated with other hosts, including:

[0058] Get CPU usage information and memory usage information of other hosts within a preset time period;

[0059] The CPU usage information and the memory usage information are integrated and calculated over a preset time period to obtain host performance parameters associated with other hosts.

[0060] Optionally, in this embodiment, the CPU usage and enhanced memory usage (multiplied by the square of the total memory) of the host over a period of time are integrated to comprehensively consider their performance in the time dimension to obtain the host performance parameters of the host.

[0061] Let's take a further example, as shown in the formula:

[0062]

[0063] in, Indicates the workload of the host over a period of time, corresponding to the host load parameters of the host.

[0064] Host performance parameters of the corresponding host.

[0065] Indicates the CPU usage and enhanced memory usage of the host over a period of time. It means that the average effect over time is obtained by dividing by the length of time. This means that the memory usage factor is increased by 2 to make it more weighted relative to the CPU usage, and then the average is taken and the exponential operation is performed to further emphasize its impact on the evaluation value. It indicates that an exponential function is used to reflect the unique impact of memory usage on the overall evaluation value. Its value will increase exponentially with the increase of memory usage, thus highlighting the relatively more important position of memory usage.

[0066] It should be noted that in actual applications, these parameters need to be adjusted according to specific business requirements, data characteristics, system environment and other factors to ensure that the formula can accurately reflect the priority requirements of data allocation.

[0067] Through the embodiments provided in this application, the advantages of cross-host distributed memory are fully utilized, efficient storage and synchronization of data are achieved, and solid technical support and guarantee are provided to ensure the stable operation of the business and the security and reliability of data.

[0068] As an optional solution, before determining at least one second host from other hosts based on the allocation priority of the excess data and the storage priority of other hosts in the cluster, the method also includes:

[0069] Obtaining data service parameters, data size parameters, and data aging parameters associated with the excess data, wherein the data service parameters are used to indicate the service priority of the excess data, the data size parameters are used to indicate the memory allocation priority of the excess data, and the data aging parameters are used to indicate the data aging priority of the excess data;

[0070] The allocation priority of the excess data is calculated based on the data service parameters, data size parameters and data timeliness parameters in combination with the weight coefficients corresponding to the various parameters.

[0071] Optionally, in this embodiment, the allocation priority of the excess data is obtained by performing a comprehensive calculation based on the data characteristics of the excess data sent by the host, which may include, but is not limited to, performing a comprehensive consideration calculation based on the following data characteristics:

[0072] (1) Business priority: By setting the business priority for each virtual machine in advance, the data it sends will be set with a clear priority level. For example, data can be divided into high, medium, and low priority, and the allocation order is determined based on the priority. High-priority data will be allocated to the target memory location first to ensure that it is processed in a timely manner.

[0073] (2) Data size priority: Larger data may require more storage space and processing time. When allocating, the size of the data can be considered and the target memory location of smaller data can be prioritized to improve storage and processing efficiency.

[0074] (3) Data timeliness priority: Data with high real-time requirements (such as real-time sensor data) has a higher priority, while some non-critical data (such as cached data) has a lower priority.

[0075] Let's take a further example, as shown in the following formula:

[0076]

[0077] Among them, a i is the weight coefficient corresponding to the data service parameter, Prio i is the data service parameter, b i is the weight coefficient corresponding to the data size parameter, Size i is the data size parameter, c i is the weight coefficient corresponding to the data timeliness parameter, is the data timeliness parameter, Prioriy IO The data is assigned priority.

[0078] Through the embodiments provided in this application, it is ensured that the excessive data can be stored in the most reasonable and effective way, and the resources of the entire distributed memory are fully utilized. The advantages of cross-host distributed memory are fully utilized to achieve efficient storage and synchronization of data.

[0079] As an optional solution, before obtaining the data storage request initiated by the first host, the method also includes:

[0080] Obtain a cluster registration request initiated by the first host, wherein the cluster registration request is used to request to join the cluster, and the cluster registration request carries memory information of the first host;

[0081] In response to the cluster registration request, a sharing plan is performed on the memory information of the first host to obtain first shared memory information of the first host, wherein the first shared memory information is used to indicate a first shared memory provided by the first host in a preset memory;

[0082] Storing the first shared memory information in a shared memory mapping table, wherein the shared memory mapping table is used to store the shared memory information of each host;

[0083] Returning the shared memory information of the first host to the first host, wherein after receiving the shared memory information of the first host, the first host determines to join the cluster and performs the shared memory configuration provided by the first host;

[0084] After storing the excess data on at least one second host, the method further comprises:

[0085] Obtain a cluster deregistration request initiated by the first host, wherein the cluster registration request is used to request to leave the cluster;

[0086] In response to the cluster deregistration request, the first shared memory information is deleted from the shared memory mapping table, and the first shared memory is released in the preset memory;

[0087] The deregistration result is returned to the first host, wherein after receiving the deregistration result, the first host releases the data stored in the other hosts in the first shared memory.

[0088] Optionally, in this embodiment, the first host may be but is not limited to being a host that has pre-joined the cluster, wherein the first host may be but is not limited to sending a cluster registration request to the management node, and the memory information of the first host carried in the cluster registration request may be but is not limited to including the total memory size, available memory size, location, etc. of the first host, and may also be but is not limited to being accompanied by the operating load information of the first host, such as CPU and memory usage over a period of time.

[0089] Optionally, in this embodiment, after receiving the cluster registration request from the first host, the management node verifies the legitimacy of the request, and after the verification is passed, the management node plans a shared memory area of ​​appropriate size for the first host according to the load and system resource status of the first host, and returns the planning suggestion (i.e., the first shared memory information) to the first host, and records the first shared memory information of the first host in the management data structure of the distributed memory mapping table. After receiving the first shared memory information, the first host allocates specific shared memory according to the planning suggestion, and performs corresponding configuration and initialization on the shared memory area information so that it can correctly allocate and use the shared memory.

[0090] Optionally, in this embodiment, after receiving the cluster deregistration request of the first host, the legitimacy of the request is verified, and after the verification is passed, the registration information of the first host is deleted in the distributed memory mapping table management data structure. The management node reclaims the shared memory area according to the system resource status and returns the reclaim result to the host. After receiving the reclaim result, the host releases the resources related to the shared memory area and completes the deregistration operation.

[0091] Through the embodiments provided by the present application, when a host joins a cluster, it automatically registers a shared memory area; when a host leaves a cluster, it automatically notifies the management node to deregister the shared memory area, thereby realizing the functions of automatically registering and deregistering shared memory, improving the flexibility and scalability of the system, and ensuring the stability and reliability of the system. Through the unified automatic management of the cluster and the real-time recording of the information of the shared memory mapping table, data coordination storage between different hosts can be realized efficiently and flexibly.

[0092] As an optional solution, after returning the shared memory information of the first host to the first host, the method also includes one of the following:

[0093] Obtaining a first memory update request initiated by the first host, wherein the first memory update is triggered by the first host when detecting that the workload increases by a first preset threshold, and is used to request that a first shared memory provided in a preset memory be adjusted to a second shared memory, wherein a storage space of the second shared memory is smaller than a storage space of the first shared memory;

[0094] Obtain a second memory update request initiated by the first host, wherein the second memory update is triggered by the first host when detecting that the workload is reduced by a second preset threshold, and is used to request that a first shared memory provided in a preset memory be adjusted to a third shared memory, wherein a storage space of the third shared memory is larger than a storage space of the first shared memory.

[0095] Optionally, in this embodiment, the first host can automatically adjust the size of the shared memory provided in the preset memory according to the running workload. For example, when the workload of the first host is high, the size of the shared memory is reduced to ensure the running memory of other applications of the host; when the workload of the first host is low, the size of the shared memory is increased to provide additional shared memory resources for the CDP services of the local host and other hosts.

[0096] It should be noted that in order to realize the function of automatically adjusting the shared memory size, the first host needs to monitor its own workload in real time and calculate the appropriate shared memory size according to the load. Then the first host sends an adjustment request to the management node, and the request includes new shared memory information.

[0097] After receiving the adjustment request, the management node verifies the legitimacy of the request and decides whether to approve the adjustment request based on the host system resource status and the needs of other hosts. If the request is approved, the management node will update the host registration information in the shared memory area management data structure and notify the first host of the adjustment result. After receiving the adjustment result, the first host performs corresponding configuration and initialization based on the adjustment result so that it can correctly allocate and use the new shared memory.

[0098] It should be noted that in order to ensure the stability and reliability of the system, it is necessary to set a minimum capacity and a maximum limit capacity for the shared memory. The minimum value ensures that the host reserves at least a certain amount of shared memory for the CDP service under high load to ensure the performance of the CDP service. The maximum limit capacity prevents the host from over-allocating and occupying shared memory, squeezing out the memory usage of other applications on the local machine. When the host automatically adjusts the shared memory size, it needs to ensure that the adjusted size is not less than the minimum value and does not exceed the maximum limit value.

[0099] Through the embodiments provided in the present application, the memory area is globally and dynamically adjusted according to the host workload and the host overall performance to store the host's excess data, thereby improving the flexibility and scalability of the system while ensuring the stability and reliability of the system.

[0100] As an optional solution, the above data storage method is applied to the memory management scenario of site disaster recovery. In this scenario, site disaster recovery has become a key link to ensure the continuous operation of the business. With the rapid development of information technology and the increasing dependence of business on data, it is particularly important to ensure that data and business functions can be quickly and effectively restored in various unexpected situations, such as natural disasters, hardware failures, and human errors.

[0101] In site disaster recovery scenarios, virtual machines are an important form of computing resource carrier, and the security and integrity of their data are directly related to the stable operation of the entire system. Using CDP (continuous data protection) to record the incremental data of virtual machines is a common and effective method.

[0102] In actual applications, the IO data to be transmitted generated by the virtual machine is generally stored in the local shared memory. Although the traditional shared memory can meet the needs of data storage to a certain extent, it has obvious limitations. The size of the shared memory is usually fixed, which means that when facing large-scale virtual machine incremental data, it is easy to run out of storage space. This limitation not only affects the efficiency of data recording, resulting in data backlog and delay, but also may cause the risk of data loss due to the inability to store key data in time.

[0103] In order to solve the above defects, this embodiment constructs a cross-host distributed memory system, which integrates the memory resources of multiple hosts to form a flexible and scalable distributed memory pool. When a large amount of virtual machine IO data is generated, an IO log is formed through an intelligent allocation strategy according to the characteristics of the IO data block, such as the priority level of the data, the real-time requirements, etc., and the real-time usage status of each host memory, including the remaining available memory, memory read and write speed, memory load and other key parameters, to accurately and reasonably allocate the target memory storage location. For those IO data blocks with critical business significance or those with high real-time requirements, they will be preferentially allocated to the host memory area with better performance and more available memory to ensure that they can be stored quickly, safely and completely, and for some relatively less critical IO data blocks, they will be flexibly allocated to other host memory areas according to actual conditions, so as to achieve optimal utilization of resources.

[0104] In terms of data transmission, the efficient and reliable RDMA network communication protocol is used to ensure that IO data can be transmitted quickly, stably and securely between hosts, avoiding problems such as data loss, delay or transmission errors, and ensuring the timeliness and accuracy of data synchronization.

[0105] The system has dynamic expansion and adjustment capabilities. When the business scale in the site disaster recovery scenario continues to expand, the data volume continues to grow, or the demand changes, the number of participating hosts and memory allocation can be flexibly increased or adjusted to adapt to new business requirements and data processing challenges. Through this flexible expansion and adjustment mechanism, it is ensured that the present invention can exert the best performance and effect under various complex environments and requirements.

[0106] Through the above invention content design, the close combination and synergy of cross-host distributed memory and CDP technology are utilized to greatly improve the storage capacity and reliability of IO data, thereby better ensuring the effect and efficiency of site disaster recovery, and providing solid technical support and guarantee for the continuous and stable operation of the business.

[0107] Specifically, in the process of building the disaster recovery system architecture, a cross-host distributed memory RDMA network is constructed, and detailed evaluation and analysis are performed on each host participating in the site disaster recovery, including its hardware performance, memory capacity, network connection status and other factors. Based on these evaluation results, suitable hosts are reasonably selected and configured to form a distributed memory network.

[0108] Let's take an example to illustrate a distributed memory system across hosts based on a data storage method. Figure 3 As shown, the management node is responsible for the (shared) memory registration / deregistration management of each host. It can be understood that Figure 3Host 1, Host 2, Host 3, and Host 4 in the table are all hosts that have been registered through the management node and joined the cluster.

[0109] Next, taking host 1 as an example, the virtual machine, qemu and other modules included in host 1 generate multiple IO data blocks, among which IO data blocks 1, 2, 3 and 4 are normally stored in the shared memory on host 1, and IO data blocks 5, 6, 7 and 8 are excess data. After the allocation priority of the data block itself is matched with the storage priority of other hosts (host 2, host 3 and host 4), IO data blocks 5 and 6 are stored in the shared memory provided by host 2, IO data block 7 is stored in the shared memory provided by host 3, and IO data block 8 is stored in the shared memory provided by host 4.

[0110] Optionally, when a host automatically registers a shared memory area when joining a cluster, a global distributed shared memory mapping table is maintained on the management node to record the usage and location information of all memory blocks in the entire cluster. When the CDP service of a host node uses insufficient shared memory on the local machine and needs to apply for additional memory from other hosts, the management node will allocate it according to the situation in the memory mapping table.

[0111] When a host joins a cluster, it needs to send a registration request to the management node. The request contains relevant information about the host's memory area, such as total memory size, available memory size, location, etc., as well as the host's operating load information, such as CPU and memory usage over a period of time.

[0112] After receiving the registration request, the management node verifies the legitimacy of the request and records the registration information of the host in the management data structure of the distributed memory mapping table. The management node plans a shared memory area of ​​appropriate size for the host based on the host's load and system resource conditions, and returns the planning suggestions to the host.

[0113] After receiving the planning suggestion, the host allocates specific shared memory according to the planning suggestion, and performs corresponding configuration and initialization on the shared memory area information so that it can correctly allocate and use the shared memory.

[0114] Optionally, when the host leaves the cluster, it automatically notifies the management node to deregister the shared memory area. After receiving the recycling result, the host releases the resources related to the shared memory area and completes the deregistration operation. When the host leaves the cluster, it needs to send a deregistration request to the management node, and the request contains relevant information about the shared memory area.

[0115] After receiving the deregistration request, the management node verifies the legitimacy of the request and deletes the registration information of the host in the distributed memory mapping table management data structure. The management node reclaims the shared memory area according to the system resource status and returns the reclaim result to the host.

[0116] Optionally, the host can automatically adjust the size of the shared memory according to its own operating workload. For example, when the host load is high, the size of the shared memory is reduced to ensure the operating memory of other applications on the host; when the host load is low, the size of the shared memory is increased to provide additional shared memory resources for the CDP services of the local host and other hosts.

[0117] In order to realize the function of automatically adjusting the shared memory size, the host needs to monitor its own workload in real time and calculate the appropriate shared memory size based on the load. Then the host sends an adjustment request to the management node, which contains the new shared memory information.

[0118] After receiving the adjustment request, the management node verifies the legitimacy of the request and decides whether to approve the adjustment request based on the host system resource status and the needs of other hosts. If the request is approved, the management node will update the host registration information in the shared memory area management data structure and notify the host of the adjustment result.

[0119] After receiving the adjustment result, the host performs corresponding configuration and initialization according to the adjustment result so that it can correctly allocate and use the new shared memory.

[0120] To ensure the stability and reliability of the system, you need to set a minimum capacity and a maximum capacity limit for the shared memory. The minimum value ensures that the host reserves at least a certain amount of shared memory for the CDP service under high load to ensure the performance of the CDP service. The maximum capacity limit prevents the host from over-allocating and occupying shared memory, squeezing out the memory usage of other applications on the local machine. When the host automatically adjusts the shared memory size, it needs to ensure that the adjusted size is not less than the minimum value and does not exceed the maximum limit.

[0121] It should be noted that when implementing the function of automatically registering and deregistering shared memory areas, the influence of factors such as network delay and message loss needs to be considered to ensure the reliability of registration and deregistration operations. When automatically adjusting the shared memory size, the overall performance and resource utilization of the system need to be considered to avoid excessive adjustment that leads to system performance degradation or resource waste. In order to facilitate management and monitoring, corresponding management interfaces and monitoring tools are provided so that administrators can understand the usage of shared memory areas and host load in the system in real time, and make corresponding adjustments and optimizations.

[0122] Through the above steps, the function of automatically registering and deregistering shared memory can be realized, improving the flexibility and scalability of the system while ensuring the stability and reliability of the system.

[0123] Optionally, when the virtual machine starts to generate incremental data, these incremental data are no longer limited to the shared memory of the local host, but through intelligent allocation algorithms, the data is accurately distributed to the memory of multiple hosts according to specific rules and policies. For example, according to the data service priority, IO data size, IO data timeliness and other characteristics, combined with the workload of each host memory and the available memory space, the specific target memory allocation plan is determined, which can ensure that the IO data can be stored in the most reasonable and efficient way, and make full use of the resources of the entire distributed memory.

[0124] The priority of the IO data sent by the virtual machine is comprehensively calculated based on the following characteristics, and a reasonable target memory storage location is allocated according to the priority.

[0125] Business priority: By setting business priorities for each virtual machine in advance, the IO data it sends will be set with clear priority levels. For example, data can be divided into high, medium, and low priorities, and the allocation order is determined based on the priority. High-priority data will be allocated to the target memory location first to ensure that it is processed in a timely manner.

[0126] IO data size: Larger IO data may require more storage space and processing time. When allocating, you can consider the size of the data and prioritize the target memory location of smaller data to improve storage and processing efficiency.

[0127] Timeliness of IO data: Data with high real-time requirements (such as real-time sensor data) has a higher priority, while some non-critical data (such as cached data) has a lower priority.

[0128] Taking the above factors into consideration, the data allocation priority is determined according to the characteristics of IO data. The detailed calculation formula is as follows:

[0129] Among them, Prioriy IO The data represents the final calculated IO data allocation priority. n represents the number of different factors considered. i Represents the weight of the i-th factor, which is used to measure the relative importance of the factor in the priority calculation. i , b i , c i :They are specific coefficients related to each factor, which are used to adjust the specific impact of different factors on the priority. i Indicates the factor corresponding to the priority level of the data itself.i Indicates a factor that is not related to the data size. It represents the derivative of the data timeliness factor, which is used to capture the changing trend of data timeliness. When the value is large and positive, it means that the real-time performance of IO data is rapidly improving during this period, and the data changes more drastically and rapidly. When the value is small (close to 0), it means that the change of real-time performance is relatively gentle. When the value is negative, it may indicate that the real-time performance has decayed or decreased in some aspects.

[0130] Optionally, according to the following characteristics of each host, a shared memory area for storing virtual machine IO data is globally and dynamically allocated.

[0131] Host workload: Detect the real-time workload of each host in real time and prioritize data allocation to hosts with lower memory loads to balance the load and improve overall performance.

[0132] Host performance: Consider the performance differences of each host, such as CPU usage, memory usage, total memory, etc., and distribute data to hosts with better performance to improve data processing efficiency.

[0133] Taking all the above factors into consideration, the target host to store data is determined based on the real-time status of the host. The detailed calculation formula is as follows:

[0134]

[0135] in, Indicates the workload situation over a period of time. Indicates that the CPU usage and enhanced memory usage (multiplied by the square of the total memory) over a period of time are integrated to comprehensively consider their performance in the time dimension. It means that the average effect over time is obtained by dividing by the time length T. This means that the memory usage factor is increased by 2 to make it more weighted than the CPU usage, and then the average is taken and the exponential operation is performed to further emphasize its impact on the evaluation value. It indicates that an exponential function is used to reflect the unique impact of memory usage on the overall evaluation value. Its value will increase exponentially with the increase of memory usage, thus highlighting the relatively more important position of memory usage.

[0136] It should be noted that in actual applications, these parameters need to be adjusted according to specific business requirements, data characteristics, system environment and other factors to ensure that the formula can accurately reflect the priority requirements of data allocation.

[0137] Through the embodiments provided by the present application, virtual machine IO data is saved through cross-host distributed memory, which greatly improves the capacity and flexibility of data storage. It is no longer limited by the memory limitations of a single host, and can cope with the storage needs of large-scale IO data, providing a more reliable foundation for site disaster recovery. The efficient allocation strategy ensures that data can be reasonably distributed and stored, optimizes resource utilization efficiency, and both critical business data and general data can be properly processed, avoiding resource waste and unreasonable allocation. It has strong adaptability and scalability. As the business develops and changes, the distributed memory can be flexibly adjusted and expanded to adapt to new needs and challenges without large-scale hardware upgrades or modifications. It has played an important role in improving the virtual machine IO data storage capacity, enhancing system flexibility and scalability, and bringing significant value and advantages to site disaster recovery scenarios.

[0138] As an optional solution, the above data storage method can also be used in, but not limited to, disaster recovery and fault recovery scenarios to ensure that data can still be properly protected and quickly recovered even when some hosts fail.

[0139] Optionally, in this embodiment, when a second host (i.e., a host that receives excessive data) fails or voluntarily exits the cluster, the disaster recovery mechanism will be triggered immediately. The core of this mechanism is to establish redundant storage of data. Specifically, it is to ensure that there are at least two complete copies of data in the cluster, so that even if one copy is lost, the data can be quickly restored through other copies to ensure that the business is not affected.

[0140] Optionally, in this embodiment, during the data allocation phase, the system will allocate at least one redundant storage location for each excess data according to configuration parameters or dynamic policies. This redundant location can be a second host in another cluster, or a host pre-defined as high availability. The storage location selection of redundant data also follows the priority matching algorithm to ensure that redundant data can be stored on a host with lower load and higher performance, thereby improving data storage efficiency and reading speed.

[0141] Optionally, in this embodiment, the system needs to implement a real-time monitoring mechanism to continuously monitor the health status of all hosts in the cluster. This includes but is not limited to the host's hardware status, network connection status, memory usage, CPU load and other key indicators. Once a host failure is detected, the system will immediately start the disaster recovery process.

[0142] Optionally, in this embodiment, when the failed host is confirmed to be unable to be restored immediately, the system will automatically trigger the data migration mechanism. The management node will select one or more healthy hosts as the new target storage location based on the latest host status and data redundancy strategy. The data migration process is transparent, and the accessibility and consistency of the data will not be affected for users and other applications.

[0143] During the data migration process, the system needs to ensure the consistency and integrity of the data. This is usually achieved through data verification and logging mechanisms. The data will be verified before migration to ensure that it is intact; after migration, the system will verify again to ensure that the data is correctly and flawlessly copied to the new location. In addition, the system will maintain a detailed log to record the details of each data migration, including the host status before and after the migration, the size and type of the data, etc., so as to facilitate backtracking and auditing when necessary.

[0144] Once the data is successfully migrated to the new host, the CDP service or other related applications on the host will automatically take over the data processing tasks on the failed host to ensure business continuity and data processing efficiency. The system should also have self-optimization capabilities, be able to recalculate data allocation priorities based on the new host status after data migration, and adjust data storage strategies to maximize resource utilization.

[0145] It should be noted that in order to improve the redundant storage efficiency of data, a distributed file system or object storage technology can be used to evenly distribute data blocks on multiple hosts to achieve load balancing. At the same time, the data storage strategy should support dynamic adjustment so that non-critical data can be quickly released when resources are tight to make room for critical data.

[0146] The embodiments provided in this application not only improve the storage efficiency and flexibility of data, but also enhance the data persistence and the overall reliability of the cluster system, providing strong technical support for the business continuity management of virtualized environments and data centers.

[0147] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by software plus the necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), including a number of instructions to enable a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0148] In this embodiment, a data storage device is provided, which is used to implement the above-mentioned embodiments and preferred implementations, and the descriptions that have been made are not repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0149] Figure 4 is a structural block diagram of a data storage device according to an embodiment of the present application, such as Figure 4 As shown, the device comprises:

[0150] The acquisition unit 402 is used to acquire a data storage request initiated by a first host, wherein the first host is a host in a cluster, each host in the cluster shares a preset memory, the preset memory is jointly provided by each host, and the data storage request is used to request to store excess data generated by the first host in the preset memory;

[0151] A determining unit 404 is configured to determine at least one second host from other hosts based on the allocation priority of the excess data and the storage priority of other hosts in the cluster;

[0152] The storage unit 406 is configured to store the excess data in at least one second host.

[0153] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0154] As an optional solution, the determining unit 404 includes:

[0155] A first determining module, used to determine the current excess data with the highest allocation priority from the excess data in sequence;

[0156] The second determination module is used to determine a current host with the highest storage priority that can store the current excess data from other hosts, wherein the current host is used to store the current excess data and at least one second host includes the current host.

[0157] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0158] As an optional solution, the device also includes:

[0159] A first acquisition module is used to acquire host performance parameters and host load parameters associated with other hosts before determining at least one second host from other hosts based on the allocation priority of excess data and the storage priority of other hosts in the cluster, wherein the host performance parameters are used to indicate the performance priority of other hosts, and the host load parameters are used to indicate the workload priority of other hosts;

[0160] The third determination module is used to determine the allocation priority of excess data based on the accumulated values ​​of host performance parameters and host load parameters before determining at least one second host from other hosts based on the allocation priority of excess data and the storage priority of other hosts in the cluster.

[0161] As an optional solution, the first acquisition module includes:

[0162] The acquisition submodule is used to obtain the CPU usage information and memory usage information of other hosts within a preset time period;

[0163] The calculation submodule is used to perform integral calculation on the CPU usage information and the memory usage information in a preset time period to obtain host performance parameters associated with other hosts.

[0164] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0165] As an optional solution, the device also includes:

[0166] The device also includes:

[0167] A second acquisition module is used to acquire data service parameters, data size parameters and data aging parameters associated with the excess data before determining at least one second host from other hosts based on the allocation priority of the excess data and the storage priority of other hosts in the cluster, wherein the data service parameter is used to indicate the service priority of the excess data, the data size parameter is used to indicate the memory allocation priority of the excess data, and the data aging parameter is used to indicate the data aging priority of the excess data;

[0168] A calculation module is used to calculate the allocation priority of excess data based on data service parameters, data size parameters and data timeliness parameters, combined with weight coefficients corresponding to each parameter, before determining at least one second host from other hosts based on the allocation priority of excess data and the storage priority of other hosts in the cluster.

[0169] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0170] As an optional solution, the device also includes:

[0171] a third acquisition module, configured to acquire a cluster registration request initiated by the first host before acquiring the data storage request initiated by the first host, wherein the cluster registration request is used to request to join the cluster, and the cluster registration request carries memory information of the first host;

[0172] a planning module, used for responding to a cluster registration request before obtaining a data storage request initiated by the first host, performing a sharing plan on the memory information of the first host, and obtaining first shared memory information of the first host, wherein the first shared memory information is used to indicate a first shared memory provided by the first host in a preset memory;

[0173] A storage module, used for storing the first shared memory information in a shared memory mapping table before obtaining a data storage request initiated by the first host, wherein the shared memory mapping table is used for storing the shared memory information of each host;

[0174] a first feedback module, used for returning the shared memory information of the first host to the first host before obtaining the data storage request initiated by the first host, wherein the first host determines to join the cluster after receiving the shared memory information of the first host, and performs the shared memory configuration provided by the first host;

[0175] The device also includes:

[0176] a fourth acquisition module, configured to acquire a cluster deregistration request initiated by the first host after storing the excess data in at least one second host, wherein the cluster registration request is used to request to leave the cluster;

[0177] A deletion module, configured to, after storing the excess data in at least one second host, respond to a cluster deregistration request, delete the first shared memory information from the shared memory mapping table, and release the first shared memory in a preset memory;

[0178] The second feedback module is used to return the deregistration result to the first host after storing the excess data in at least one second host, wherein the first host releases the data stored in other hosts in the first shared memory after receiving the deregistration result.

[0179] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0180] As an optional solution, the device also includes one of the following:

[0181] a fifth acquisition module, configured to acquire a first memory update request initiated by the first host after returning the shared memory information of the first host to the first host, wherein the first memory update is triggered by the first host when detecting that the workload increases by a first preset threshold, and is configured to request that the first shared memory provided in the preset memory be adjusted to a second shared memory, wherein the storage space of the second shared memory is smaller than the storage space of the first shared memory;

[0182] A sixth acquisition module is used to obtain a second memory update request initiated by the first host after returning the shared memory information of the first host to the first host, wherein the second memory update is triggered by the first host when it detects that the workload is reduced by a second preset threshold, and is used to request that the first shared memory provided in the preset memory be adjusted to a third shared memory, and the storage space of the third shared memory is larger than the storage space of the first shared memory.

[0183] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0184] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by software plus the necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), including a number of instructions to enable a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0185] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or, the above modules are located in different processors in any combination.

[0186] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0187] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0188] An embodiment of the present application also provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above method embodiments.

[0189] In an exemplary embodiment, the electronic device may include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0190] The embodiments of the present application also provide a computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores the computer program product, and when the computer program is executed by a processor, the steps of the method in each embodiment of the present application are implemented.

[0191] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0192] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by the computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Likewise, the present application is not limited to any specific combination of hardware and software.

[0193] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A data storage method, characterized in that: include: Acquire a data storage request initiated by a first host, wherein the first host is a host in a cluster, each host in the cluster shares a preset memory, the preset memory is jointly provided by each host, and the data storage request is used to request to store excess data generated by the first host in the preset memory; Determining at least one second host from the other hosts based on the allocation priority of the excess data and the storage priorities of other hosts in the cluster; The excess data is stored in the at least one second host.

2. The method according to claim 1, characterized in that The step of determining at least one second host from the other hosts based on the allocation priority of the excess data and the storage priority of other hosts in the cluster comprises: Determining the current excess data with the highest allocation priority from the excess data in sequence; A current host with the highest storage priority and capable of storing the current excess data is determined from the other hosts, wherein the current host is used to store the current excess data, and the at least one second host includes the current host.

3. The method according to claim 1, characterized in that Before determining at least one second host from the other hosts based on the allocation priority of the excess data and the storage priorities of the other hosts in the cluster, the method further includes: Acquire host performance parameters and host load parameters associated with the other hosts, wherein the host performance parameters are used to indicate the performance priority of the other hosts, and the host load parameters are used to indicate the workload priority of the other hosts; The allocation priority of the excess data is determined based on the accumulated value of the host performance parameter and the host load parameter.

4. The method according to claim 3, characterized in that The obtaining of host performance parameters associated with the other hosts includes: Obtaining CPU usage information and memory usage information of the other hosts within a preset time period; The CPU usage information and the memory usage information are integrated and calculated over the preset time period to obtain the host performance parameters associated with the other hosts.

5. The method according to claim 1, characterized in that Before determining at least one second host from the other hosts based on the allocation priority of the excess data and the storage priorities of the other hosts in the cluster, the method further includes: Acquire a data service parameter, a data size parameter, and a data aging parameter associated with the excess data, wherein the data service parameter is used to indicate the service priority of the excess data, the data size parameter is used to indicate the memory allocation priority of the excess data, and the data aging parameter is used to indicate the data aging priority of the excess data; The allocation priority of the excess data is calculated based on the data service parameter, the data size parameter and the data timeliness parameter in combination with the weight coefficients corresponding to the various parameters.

6. The method according to claim 1, characterized in that Before obtaining the data storage request initiated by the first host, the method further includes: Obtaining a cluster registration request initiated by the first host, wherein the cluster registration request is used to request to join the cluster, and the cluster registration request carries memory information of the first host; In response to the cluster registration request, share planning is performed on the memory information of the first host to obtain first shared memory information of the first host, wherein the first shared memory information is used to indicate a first shared memory provided by the first host in the preset memory; Storing the first shared memory information in a shared memory mapping table, wherein the shared memory mapping table is used to store the shared memory information of each host; Returning the shared memory information of the first host to the first host, wherein after receiving the shared memory information of the first host, the first host determines to join the cluster and performs the shared memory configuration provided by the first host; After storing the excess data in the at least one second host, the method further comprises: Obtaining a cluster deregistration request initiated by the first host, wherein the cluster registration request is used to request to leave the cluster; In response to the cluster deregistration request, deleting the first shared memory information from the shared memory mapping table, and releasing the first shared memory in the preset memory; Returning a deregistration result to the first host, wherein after receiving the deregistration result, the first host releases the data stored by the other hosts in the first shared memory.

7. The method according to claim 6, characterized in that After returning the shared memory information of the first host to the first host, the method further includes one of the following: Obtaining a first memory update request initiated by the first host, wherein the first memory update is triggered by the first host when detecting that the workload increases by a first preset threshold, and is used to request that the first shared memory provided in the preset memory be adjusted to a second shared memory, wherein the storage space of the second shared memory is smaller than the storage space of the first shared memory; Obtain a second memory update request initiated by the first host, wherein the second memory update is triggered by the first host when detecting that the workload is reduced by a second preset threshold, and is used to request that the first shared memory provided in the preset memory be adjusted to a third shared memory, and the storage space of the third shared memory is larger than the storage space of the first shared memory.

8. A data storage device, characterized in that: include: an acquiring unit, configured to acquire a data storage request initiated by a first host, wherein the first host is a host in a cluster, each host in the cluster shares a preset memory, the preset memory is jointly provided by each host, and the data storage request is used to request to store excess data generated by the first host in the preset memory; a determining unit, configured to determine at least one second host from the other hosts based on an allocation priority of the excess data and a storage priority of the other hosts in the cluster; The storage unit is used to store the excess data in at least one second host.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method according to any one of claims 1 to 7 when executed by a processor.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Memory overconfiguration management method and device

    CN113204407A

  • Method for sharing memory among cluster system nodes on demand based on RDMA (Remote Direct Memory Access)

    CN114756388A

  • Controlling access to a shared storage system

    US20130311659A1