Load balancing method and apparatus, electronic device, and storage medium

By combining load monitoring and prediction with a business type binding mechanism, virtual machines are dynamically migrated to low-load nodes, solving the problem of low resource utilization in NUMA architecture and achieving efficient server load balancing and business stability.

CN120610780BActive Publication Date: 2025-11-07INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511106107.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-07
Publication Date
2025-11-07
Estimated Expiration
2045-08-07

AI Technical Summary

Technical Problem

Existing virtualization platforms are not well adapted to NUMA architecture, resulting in a lack of topology awareness in memory allocation, frequent cross-node access, low resource utilization, and traditional scheduling methods that cannot balance resource isolation and elastic scheduling, leading to load imbalance on hot nodes, decreased throughput, and increased response latency.

Method used

By combining load monitoring and prediction with a business type binding mechanism, the load of resource nodes is monitored in real time. The sliding window and LSTM prediction model are used to predict future load changes, and virtual machines are dynamically migrated to low-load nodes and bound to the corresponding resource nodes according to business type. Hardware isolation mechanism is used to ensure migration security.

Benefits of technology

It achieves precise matching between resource nodes and virtual machines, avoids resource mismatch, improves node load balancing, reduces the proportion of hot nodes, reduces cross-node memory access, reduces the risk of business interruption, and ensures the stable and efficient operation of the server.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120610780B_ABST
    Figure CN120610780B_ABST
Patent Text Reader

Abstract

The present disclosure provides a load balancing method and device, electronic equipment and storage medium, relating to the technical field of servers, load monitoring is performed on resource nodes in a server, load monitoring data is obtained, a virtual machine is deployed on the resource nodes, and computing services of the virtual machine are bound to corresponding classified resource nodes according to service types; load prediction is performed on the resource nodes to obtain load prediction data; whether the virtual machine is migrated to other resource nodes is determined according to the load monitoring data and the load prediction data; and in response to a determination that the virtual machine is to be migrated to other resource nodes, the virtual machine is migrated to a target resource node, and the virtual machine is bound to the target resource node. According to the present disclosure, through load monitoring combined with a service type binding mechanism, accurate matching between resource nodes and virtual machine requirements can be ensured, and waste caused by resource mismatching can be avoided. Through active migration of the virtual machine to a low-load node based on load prediction, the load balancing degree of the node can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of server, and particularly relates to a load balancing method and device, electronic equipment and storage medium. BACKGROUND

[0002] With the development of multi-core servers, NUMA technology becomes a key support for performance. Its architecture divides CPU and memory into multiple logical nodes, communicates within the node through IMC bus, and relies on QPI interconnection between nodes, with significantly higher delay. The current virtualization platform (such as VMware) is not enough for NUMA adaptation, and the memory allocation lacks topology awareness, frequent cross-node access, and limited resource utilization. The existing technology uses static binding or pure dynamic scheduling, the former is difficult to adapt to load changes, and the latter destroys the initial locality, and there is a fundamental contradiction between resource localization and load balancing. The existing virtual machine NUMA scheduling scheme does not fully consider the coordination of memory bandwidth, delay and business characteristics, resulting in core binding failure, high cross-node access rate, unreasonable resource allocation, and performance jitter in dynamic migration, affecting business continuity. In high-concurrency and memory-sensitive scenarios, traditional methods are difficult to balance resource isolation and elastic scheduling, resulting in unbalanced load of hot nodes, decreased throughput, and increased response delay. SUMMARY

[0003] The present disclosure provides a load balancing method and device, electronic equipment and storage medium. The main purpose is to solve the problem of flexible scheduling when running a large number of services.

[0004] According to a first aspect of the present disclosure, a load balancing method is provided, comprising:

[0005] Load monitoring is performed on resource nodes in a server to obtain load monitoring data, the resource nodes are deployed with virtual machines, and the computing services of the virtual machines are bound to corresponding classified resource nodes according to service types;

[0006] Load prediction is performed on the resource nodes to obtain load prediction data;

[0007] According to the load monitoring data and the load prediction data, it is determined whether to migrate the virtual machine to other resource nodes;

[0008] In response to determining to migrate the virtual machine to other resource nodes, the virtual machine is migrated to a target resource node, and the virtual machine is bound to the target resource node.

[0009] Optionally, the load prediction on the resource nodes to obtain the load prediction data comprises:

[0010] Current load data of each resource node is obtained;

[0011] The current load data is input into the load prediction model to perform load prediction, to predict load changes of each resource node in a preset time length, and to generate load prediction data of each resource node.

[0012] Optionally, according to the load monitoring data and the load prediction data, it is determined whether to migrate the virtual machine to other resource nodes, including:

[0013] If the load monitoring data exceeds the preset load threshold, it is determined to migrate the virtual machine to other resource nodes.

[0014] If the load prediction data exceeds the predicted load threshold, it is determined to migrate the virtual machine to other resource nodes.

[0015] Optionally, the load balancing method further includes:

[0016] Obtaining node classifications of each resource node, and distributing the computing service to resource nodes of a corresponding classification based on the service type.

[0017] Optionally, distributing the computing service to resource nodes of a corresponding classification based on the service type includes:

[0018] Classifying using node evaluation parameters of each resource node to obtain node classifications of each resource node.

[0019] Distributing the computing service to resource nodes of a corresponding classification according to the node classification corresponding to the service type.

[0020] Optionally, the node evaluation parameters include resource topology data and running state data.

[0021] Classifying using node evaluation parameters of each resource node to obtain node classifications of each resource node includes:

[0022] Obtaining resource topology data and running state data of each resource node.

[0023] Based on the resource topology data, evaluating each resource node to obtain performance evaluation data, and based on the running state data, evaluating each resource node to obtain running evaluation data.

[0024] According to the performance evaluation data and the running evaluation data, classifying each resource node to obtain node classifications of each resource node.

[0025] Optionally, the service type includes a memory-sensitive type and a general computing type, and the node classification includes a performance classification and a load classification.

[0026] Distributing the computing service to resource nodes of a corresponding node classification according to the node classification corresponding to the service type includes:

[0027] If the computing service is of the memory-sensitive type, the computing service is assigned to a resource node corresponding to the performance category;

[0028] If the computing service is of the general computing type, the computing service is assigned to a resource node corresponding to the load category.

[0029] Optionally, the load balancing method further comprises:

[0030] The computing service is bound to the resource node to which the computing service is assigned.

[0031] Optionally, the binding of the computing service to the resource node to which the computing service is assigned comprises:

[0032] According to the type of the computing service, memory resources are assigned to the computing service and the resource node to which the computing service is assigned;

[0033] Based on the assigned memory resources, the computing service is bound to the resource node to which the computing service is assigned.

[0034] Optionally, the load balancing method further comprises:

[0035] The historical load data of each resource node is preprocessed to generate training load data;

[0036] The training load prediction model is iteratively trained using the training load data to generate a trained load prediction model.

[0037] Optionally, the load balancing method further comprises:

[0038] The memory of each resource node is monitored to obtain cross-node access data of each resource node;

[0039] Based on the cross-node access data, the binding relationship between the virtual machine and the resource node is adjusted.

[0040] According to a second aspect of the present disclosure, a load balancing device is provided, comprising:

[0041] A monitoring unit is configured to monitor the load of the resource nodes in the server and obtain load monitoring data, the resource nodes being deployed with virtual machines, and the computing services of the virtual machines being bound to the resource nodes corresponding to the categories according to the types of the computing services;

[0042] A prediction unit is configured to predict the load of the resource nodes and obtain load prediction data;

[0043] A determination unit is configured to determine whether to migrate the virtual machines to other resource nodes according to the load monitoring data and the load prediction data;

[0044] The migration unit is configured to, in response to determining to migrate the virtual machine to another resource node, migrate the virtual machine to a target resource node and bind the virtual machine to the target resource node.

[0045] Optionally, the prediction unit comprises:

[0046] The acquisition module is configured to acquire current load data of each resource node.

[0047] The prediction module is configured to input the current load data into a load prediction model to perform load prediction, predict load changes of each resource node within a preset time length, and generate load prediction data of each resource node.

[0048] Optionally, the determination unit comprises:

[0049] The first determination module is configured to determine to migrate the virtual machine to another resource node if the load monitoring data exceeds a preset load threshold.

[0050] The second determination module is configured to determine to migrate the virtual machine to another resource node if the load prediction data exceeds a predicted load threshold.

[0051] Optionally, the load balancing device further comprises:

[0052] The allocation unit is configured to acquire node classifications of each resource node, and allocate the computing service to the resource nodes of the corresponding classification based on the service type.

[0053] Optionally, the allocation unit comprises:

[0054] The classification module is configured to perform classification using node evaluation parameters of each resource node to obtain the node classifications of each resource node.

[0055] The first allocation module is configured to allocate the computing service to the resource nodes of the corresponding classification according to the node classification corresponding to the service type.

[0056] Optionally, the node evaluation parameters comprise resource topology data and running state data.

[0057] The classification module is further configured to:

[0058] The resource topology data and the running state data of each resource node are acquired.

[0059] The performance of each resource node is evaluated based on the resource topology data to obtain performance evaluation data, and the running state of each resource node is evaluated based on the running state data to obtain running evaluation data.

[0060] Each resource node is classified based on the performance evaluation data and the running evaluation data to obtain the node classifications of each resource node.

[0061] Optionally, the service type includes: a memory-sensitive type and a general computing type, and the node classification includes: a performance classification and a load classification.

[0062] The first allocation module is further configured to:

[0063] if the computing service is of the memory-sensitive type, allocate the computing service to the resource node corresponding to the performance classification;

[0064] if the computing service is of the general computing type, allocate the computing service to the resource node corresponding to the load classification.

[0065] Optionally, the load balancing device further comprises:

[0066] a binding unit configured to configure and bind the computing service and the resource node to which the computing service is allocated.

[0067] Optionally, the binding unit comprises:

[0068] a second allocation module configured to allocate, according to the service type, memory resources for the computing service and the resource node to which the computing service is allocated;

[0069] a binding module configured to bind, based on the allocated memory resources, the computing service and the resource node to which the computing service is allocated.

[0070] Optionally, the load balancing device further comprises:

[0071] a generating unit configured to preprocess historical load data of each resource node to generate training load data;

[0072] a training unit configured to iteratively train a load prediction model to be trained by using the training load data to generate a trained load prediction model.

[0073] Optionally, the load balancing device further comprises:

[0074] an obtaining unit configured to monitor memory of each resource node to obtain cross-node access data of each resource node;

[0075] an adjusting unit configured to adjust a binding relationship between a virtual machine and a resource node based on the cross-node access data.

[0076] According to a third aspect of the present disclosure, an electronic device is provided, comprising:

[0077] at least one processor; and

[0078] a memory connected in communication with the at least one processor; wherein

[0079] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the load balancing method of the first aspect.

[0080] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to perform the load balancing method of the first aspect.

[0081] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the load balancing method of the first aspect.

[0082] The present disclosure provides a load balancing method and device, electronic equipment and storage medium, relates to the technical field of servers, and can ensure accurate matching of resource nodes and virtual machine demands and avoid waste caused by resource mismatching through load monitoring and a service type binding mechanism. Through load prediction, potential overloaded nodes can be identified in advance, and virtual machines can be actively migrated to low-load nodes, so that the degree of node load balancing can be improved, the proportion of hot nodes can be significantly reduced, and the overall computing power of the server can be released. After the virtual machines are migrated, the virtual machines are forcibly bound to target nodes, so that cross-node memory access can be greatly reduced. Preventive migration based on load prediction can reduce the risk of service interruption caused by sudden load.

[0083] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0084] The accompanying drawings are used to better understand the present scheme and do not limit the present disclosure. Among them:

[0085] Figure 1 A flowchart of a load balancing method provided by an embodiment of the present disclosure is shown in the figure;

[0086] Figure 2 A structural diagram of a load balancing device provided by an embodiment of the present disclosure is shown in the figure;

[0087] Figure 3 A structural diagram of another load balancing device provided by an embodiment of the present disclosure is shown in the figure. DETAILED DESCRIPTION

[0088] Exemplary embodiments of the present disclosure are described herein with reference to the accompanying drawings, which are cited by way of example only. The various details of the embodiments of the present disclosure are described with reference to the accompanying drawings, which are cited by way of example only. Therefore, it should be recognized by those of ordinary skill that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and structures are omitted in the following description for clarity and conciseness.

[0089] The method and device for load balancing, the electronic device and the storage medium of the embodiments of the present disclosure are described below with reference to the accompanying drawings.

[0090] Figure 1 A flowchart of a load balancing method provided by the embodiments of the present disclosure.

[0091] As Figure 1 shown, the method comprises the following steps:

[0092] Step 101, load monitoring is performed on resource nodes in a server to obtain load monitoring data, the resource nodes are deployed with virtual machines, and computing services of the virtual machines are bound to corresponding classified resource nodes according to service types.

[0093] In the embodiments of the present disclosure, in the NUMA architecture of the server, the resource nodes refer to logical nodes with independent CPU cores, memory resources and integrated memory controllers, the nodes communicate internally through the IMC bus, and the nodes communicate with each other through QPI. For load monitoring of these resource nodes, multi-dimensional indicators are collected in real time by means of system tools to form load monitoring data, which specifically include but are not limited to CPU utilization rate, memory bandwidth occupancy rate, cross-node access rate, memory capacity usage, and node-to-node communication delay of each node. These data provide real-time basis for subsequent resource scheduling decisions and accurately reflect the current load state of each resource node. At the same time, considering that different computing services have significant differences in resource demand, the computing services of the virtual machines need to be bound to corresponding classified resource nodes according to service types. For memory-sensitive services (such as database services), because they are highly sensitive to memory access delay, they need to be bound to high-performance nodes with high memory bandwidth and low local access delay, and exclusive node allocation and strict memory isolation strategies are implemented to completely avoid performance loss caused by cross-node access. For general computing services, they can be bound to high-bandwidth nodes with low current load, which balances the basic performance and resource utilization. This classification and binding mechanism according to service types ensures the performance stability of key services and lays a foundation for efficient resource utilization, so that the load monitoring data can more accurately reflect the load characteristics of nodes where different types of services are located.

[0094] Step 102, load prediction is performed on the resource node to obtain load prediction data.

[0095] In the embodiments of the present disclosure, the load prediction on the resource node to obtain the load prediction data is a process of predicting the load state of the resource node in a future period of time based on real-time load monitoring data and historical load information through a specific prediction model. The prediction model used here includes a sliding window prediction model and an LSTM (Long Short Term Memory) prediction model. Among them, the sliding window prediction model takes a fixed 5 minutes as a time window, calculates the historical load mean in the window and analyzes its trend, and predicts the load trend of the resource node in the subsequent period of time based on this; the LSTM prediction model learns a large amount of historical load data to capture the long-term dependence of load changes, thereby more accurately predicting the resource demand in the next 5 minutes. In the prediction process, a corresponding dynamic threshold is set, usually 1.2 times the basic load value, when the load prediction data obtained by the prediction model exceeds the threshold, it means that the resource node may have a load overrun in the future. These load prediction data can alert potential load pressure in advance, provide a forward-looking basis for whether to perform virtual machine migration, and help to avoid performance degradation of the resource node due to sudden load growth, and ensure that the server system can still maintain a stable and efficient running state in a high-concurrency and large-business-volume fluctuation scenario.

[0096] Step 103, whether to migrate the virtual machine to other resource nodes is determined according to the load monitoring data and the load prediction data.

[0097] In the embodiments of the present disclosure, determining whether to migrate the virtual machine to other resource nodes according to the load monitoring data and the load prediction data is a process of making a comprehensive judgment combining real-time load state and future load trend. Among them, the load monitoring data can reflect the current running state of the resource node in real time, specifically including the CPU utilization, memory bandwidth occupancy and cross-node access rate of the node and other key indicators. When the monitoring data shows that the CPU utilization of a resource node exceeds 80%, the memory bandwidth occupancy reaches 70%, or the cross-node access rate abnormally increases, it means that the node is currently in a high load state, and continuing to carry virtual machines may cause performance degradation, at which time it needs to be preliminarily determined that it has migration needs. The load prediction data is obtained by a sliding window prediction model or an LSTM prediction model based on historical load data to predict the load of the resource node in the next 5 minutes. When the prediction data shows that the node load in the future will exceed the dynamic threshold (usually 120% of the basic load value), it means that the node will soon face an overload risk. In order to avoid the impact of sudden load on business, it needs to be determined that preventive migration is needed. By combining real-time load monitoring data with forward-looking load prediction data, the load change trend of the resource node can be comprehensively and accurately grasped, so as to accurately decide whether to start virtual machine migration, which not only ensures timely measures when the node is currently overloaded, but also prepares in advance when the future overload is predicted, effectively balancing the load balancing and business stability of the system.

[0098] Step 104, in response to determining to migrate the virtual machine to other resource nodes, migrating the virtual machine to the target resource node and binding the virtual machine with the target resource node.

[0099] In the embodiments of the present disclosure, when it is determined that the virtual machine needs to be migrated to other resource nodes, first, the target resource node that is suitable for the business type of the virtual machine to be migrated is selected from idle or low-load nodes according to real-time load monitoring data, load prediction data and a node performance score model (the node performance score is obtained based on the calculation formula of memory bandwidth ratio x 70% and 1 / delay x 30%). For example, for memory-sensitive businesses, nodes with high memory bandwidth and low local access delay are preferentially selected as target nodes. Subsequently, real-time migration of the virtual machine is performed by using a virsh migrate tool or the like, and in the migration process, a hardware MMU / SMMU isolation mechanism is enabled to ensure the security of memory data during migration and avoid data leakage or access conflicts. After the migration is completed, the virtual machine and the target resource node need to be bound immediately, and the binding mode is dynamically selected according to business requirements and system configuration: if the static mode of the ENABLE CPU PINNING parameter is enabled, the vCPU of the virtual machine is forced to be bound to a specific CPU core of the target node by using the --cpunodebind strategy of the numactl tool, and the memory of the virtual machine is bound to the local memory area of the node by using the --membind strategy, and 1 GB of pre-allocated huge page memory (mounted by using --hugetlbfs) of the target node is also bound to the virtual machine to reduce the page table management overhead; if the dynamic mode is used, the vCPU dynamic binding at the process level is supported by using the taskset tool, and the load change is flexibly adapted. In addition, within 3 seconds after the migration, the system will forcibly execute the memory rebinding protocol to ensure that the memory data of the virtual machine resides in the local memory of the target node as much as possible by using the numactl --membind command, so that the cross-node access rate is controlled to be less than 5%, thereby ensuring that the virtual machine can run on the target resource node with optimal performance and maintain the continuity and stability of the business.

[0100] The present disclosure provides a load balancing method, which can ensure accurate matching of resource nodes and virtual machine requirements by combining load monitoring with business type binding mechanisms, and avoid waste caused by resource mismatch. By identifying potential overloaded nodes in advance through load prediction and actively migrating virtual machines to low-load nodes, the load balancing degree of the nodes can be improved, the proportion of hot nodes can be significantly reduced, and the overall computing power of the server can be released. After the virtual machine is migrated and bound to the target node, cross-node memory access can be greatly reduced. Preventive migration based on load prediction can reduce the risk of business interruption caused by sudden load.

[0101] Further, in some embodiments of the present disclosure, for the operation of "performing load prediction on the resource nodes to obtain load prediction data", the specific implementation is various. For clear illustration, the following listed implementation modes include but are not limited to some of the implementation modes: obtaining current load data of each resource node; inputting the current load data into a load prediction model to perform load prediction, predicting the load change of each resource node within a preset time length, and generating load prediction data of each resource node.

[0102] Specifically, in the process of performing load prediction on the resource nodes to obtain load prediction data, first, the current load data of each resource node needs to be obtained, which is obtained based on real-time load monitoring of the resource nodes, and specifically includes but is not limited to CPU utilization rate, memory bandwidth occupancy rate, cross-node access rate, memory capacity usage, and communication delay between nodes and other key indicators. These data can reflect the current running load state of the resource nodes in real time and comprehensively. Then, the obtained current load data is input into a load prediction model to perform load prediction. The load prediction model used includes a sliding window prediction model and an LSTM (Long Short Term Memory) prediction model, etc. Among them, the sliding window prediction model takes a fixed 5 minutes as a time window, analyzes the load change trend by calculating the historical load mean value in the window, and then predicts the load trend of the resource nodes within a future preset time length. The LSTM prediction model can capture the long-term dependence relationship in the load change through learning and training of a large amount of historical load data, so as to more accurately predict the load of the resource nodes. The preset time length is usually set to 5 minutes in the future, which is determined after considering the periodicity of business load change and the timeliness of system response. It can provide enough prediction time for subsequent scheduling decisions, and also ensure the accuracy of the prediction results. Through the processing and analysis of the current load data by these prediction models, the load prediction data of each resource node within the preset time length is finally generated. These data will clearly present the future load change of the resource nodes, such as whether the load will exceed the preset dynamic threshold (usually 1.2 times of the basic load value), etc., which provides an important basis for judging whether preventive migration of virtual machines is needed.

[0103] Further, in some embodiments of the present disclosure, for the operation of "determining whether to migrate the virtual machine to other resource nodes according to the load monitoring data and the load prediction data", the specific implementation is various. For clear illustration, the following listed implementation modes include but are not limited to some of the implementation modes: if the load monitoring data exceeds the preset load threshold, it is determined to migrate the virtual machine to other resource nodes; if the load prediction data exceeds the predicted load threshold, it is determined to migrate the virtual machine to other resource nodes.

[0104] Specifically, in determining whether to migrate the virtual machine to other resource nodes according to the load monitoring data and the load prediction data, the preset load threshold and the predicted load threshold can be used as the judgment basis. The preset load threshold is a real-time load upper limit set based on the performance bearing capacity of the resource node and the business stability requirement, and specifically includes indicators such as CPU utilization exceeding 80% and memory bandwidth occupancy exceeding 70%. The setting of these thresholds refers to the hardware performance parameters (such as CPU core processing capacity and memory controller bandwidth) of the node and the historical load stress test results, to ensure that the node can stably run within the threshold range without a significant performance decline. When any indicator in the load monitoring data exceeds the corresponding preset load threshold, it indicates that the current resource node is in a high load state, and continuing to bear virtual machines will cause problems such as increased business response delay and increased cross-node access rate. At this time, it is determined that the virtual machine needs to be migrated to other resource nodes.

[0105] The predicted load threshold is a warning value set for future load changes, which is usually 120% of the base load value of the resource node. This threshold is determined by analyzing the historical load fluctuation law and business growth trend, aiming to identify potential overload risks in advance. When the load prediction data obtained by the sliding window prediction model (based on historical 5-minute load mean calculation trend) or the LSTM prediction model exceeds this predicted load threshold, it means that the resource node is likely to exceed the load limit in the future preset time (such as 5 minutes), and if not intervened in advance, it will cause business performance jitter. At this time, it is also determined that the virtual machine needs to be migrated to other resource nodes.

[0106] Through the combination of these two judgment methods, both the real-time overload of the resource node can be responded to in time, and the future possible load pressure can be avoided in advance, forming a dual judgment mechanism covering real-time and forward-looking, ensuring the timeliness and accuracy of the migration decision. At the same time, it is compatible with the mechanism of binding virtual machines to corresponding resource nodes according to business types, ensuring that the business can still run stably in the adapted node environment after migration.

[0107] Further, in some embodiments of the present disclosure, the load balancing method further includes other specific implementation steps in addition to the foregoing. To clearly present these components, the following detailed description of the related specific implementation is expanded: obtaining the node classification of each resource node, and distributing the computing business to the resource node of the corresponding classification based on the business type.

[0108] Specifically, to obtain the node classification of each resource node, the hardware performance characteristics and topology attributes of the resource node are needed to be based on, the CPU core distribution, memory capacity, interconnection bandwidth and delay data of the physical node are analyzed through system tools (such as numactl), and the node scoring model (calculation formula: bandwidth ratio × 70% + 1 / delay × 30%) is used for quantitative evaluation, and then different types of resource nodes are divided. Specifically, the node classification can include high-performance nodes (high memory bandwidth and low local access delay), high-bandwidth nodes (high memory throughput capacity), ordinary nodes (balanced comprehensive performance), etc., wherein the high-performance nodes usually correspond to physical nodes with high memory controller efficiency and low IMC bus communication delay, and are suitable for carrying performance-sensitive services; the high-bandwidth nodes focus on memory data transmission rate and are suitable for large data throughput service scenarios.

[0109] When the computing services are allocated to the corresponding classified resource nodes based on the service type, differentiated strategies need to be implemented according to the resource demand characteristics of different services: for memory-sensitive computing services (such as database services), since they are highly sensitive to memory access delay, they need to be preferentially allocated to high-performance nodes and adopt exclusive node allocation and strict memory isolation strategies, and through the --cpunodebind / --membind strategy of the numactl tool, cross-node access is completely avoided; for general computing services (such as web application services), they are allocated to high-bandwidth nodes or ordinary nodes with low current load, and an elastic vCPU binding strategy (dynamic switching between static / dynamic modes through the ENABLE_CPU_PINNING parameter) is adopted to improve resource utilization while ensuring basic performance. In addition, for large-scale monolithic services (such as in-memory databases), adjacent physical nodes can be grouped into a logical resource cluster through SNC technology to form a dedicated classified node, which expands the local access range to meet the large CPU resource demand, and through this precise matching allocation method based on service type and node classification, the directional and efficient use of resources is realized, laying a foundation for load balancing.

[0110] Further, in some embodiments of the present disclosure, for the operation of "allocating computing services to corresponding classified resource nodes based on service type", the specific implementation methods are various. For clear illustration, the following listed implementation methods include but are not limited to some implementation methods: classifying each resource node by using node evaluation parameters to obtain the node classification of each resource node; and allocating computing services to corresponding classified resource nodes according to the node classification corresponding to the service type.

[0111] Specifically, when classifying using the node evaluation parameters of each resource node, the node evaluation parameters mainly include memory bandwidth, access delay, CPU core performance, and node interconnection bandwidth, etc. key indicators. Specifically, the numactl tool is used to analyze the physical node topology, obtain the memory bandwidth data of each node (such as the memory read / write speed of different nodes), the CPU core distribution, the communication delay within the node and between nodes (such as IMC Bus delay and QPI delay), and build a node scoring model based on these parameters. The calculation formula of the model is “bandwidth ratio × 70% + 1 / delay × 30%”, wherein the bandwidth ratio is the ratio of the memory bandwidth of the node to the average memory bandwidth of all nodes, and 1 / delay reflects the influence weight of access speed on node performance. According to the scoring results and actual performance differences (such as memory bandwidth difference > 20%), the resource nodes are divided into different categories, for example, nodes with high scores and high memory bandwidth and low access delay are classified as “high-performance nodes”, which are suitable for carrying performance-sensitive services; nodes with outstanding memory bandwidth but slightly lower comprehensive score are classified as “high-bandwidth nodes”, which are suitable for services with large data throughput; and nodes with balanced performance but no significant advantage are classified as “general nodes”, which are used to carry ordinary computing services.

[0112] When allocating computing services according to the node classification corresponding to the service type, the resource demand characteristics of each type of service need to be determined first: for memory-sensitive services (such as database services), the node classification corresponding to the service type is “high-performance nodes”, because it is highly sensitive to memory access delay, it needs to be allocated to this type of node and implement exclusive node allocation and strict memory isolation strategy, through --cpunodebind / --membind strategy Forced binding to ensure local memory access; for general computing services (such as web application services), the corresponding node classification is “high-bandwidth nodes” or “general nodes”, and when allocating, high-bandwidth nodes with lower current load are preferred, and elastic vCPU binding strategy (controlled by ENABLE_CPU_PINNING parameter to switch mode) is adopted to improve resource utilization while ensuring basic performance; for large-scale monolithic services (such as in-memory databases), the corresponding node classification can be set to a logical resource cluster (such as Node0+1) formed by the sub- NUMA cluster (SNC) technology. This type of node classification meets the large CPU resource demand by expanding the local access range, and when allocating, 1GB huge page memory configuration is combined to further optimize performance. Through this allocation method based on node evaluation parameter classification and accurate matching of service type, efficient adaptation of computing services and resource nodes is achieved, laying the foundation for subsequent load balancing.

[0113] Further, in some embodiments of the present disclosure, for the operation of "classifying each resource node based on the node evaluation parameter of each resource node to obtain the node classification of each resource node", the specific implementation is various. For clear illustration, the following listed implementation modes include but are not limited to some implementation modes: obtaining resource topology data and running state data of each resource node; evaluating each resource node based on the resource topology data to obtain performance evaluation data, and evaluating each resource node based on the running state data to obtain running evaluation data; and classifying each resource node based on the performance evaluation data and the running evaluation data to obtain the node classification of each resource node. The node evaluation parameter includes the resource topology data and the running state data.

[0114] Specifically, when obtaining the resource topology data and the running state data of each resource node, the resource topology data is mainly obtained by analyzing the hardware architecture information of the physical node through numactl and other system tools, and specifically includes the CPU core distribution (such as the number of cores, the number and the affiliation of the cores), the memory capacity (the total capacity and the allocated capacity of the local memory of each node), the interconnection bandwidth of the integrated memory controller (IMC) and the Quick Path Interconnect (QPI), the internal communication delay (IMC Bus delay) of the node, and the inter-node communication delay (QPI delay) and other hardware inherent attribute data. These data reflect the physical topology structure and the basic performance potential of the resource node. The running state data is collected through a real-time monitoring mechanism, and covers the dynamic running indexes such as the CPU utilization of the node, the memory bandwidth occupancy (the ratio of the current memory data transmission rate to the maximum memory bandwidth of the node), the cross-node access rate (the proportion of the remote memory access times to the total access times), and the memory page table management overhead, which reflect the current load pressure and the running stability of the node in real time.

[0115] When the performance evaluation data is evaluated based on the resource topology data, the memory bandwidth and the delay in the resource topology data are taken as core indexes, a node performance scoring model is constructed, a calculation formula of the model is "bandwidth proportion x 70% + 1 / delay x 30%", wherein the bandwidth proportion is a ratio of the memory bandwidth of the node to an average memory bandwidth of all nodes, and 1 / delay is obtained by taking an inverse of the delay index to reflect the influence of the access speed on the performance in a positive direction, and a quantitative score obtained by the model is the performance evaluation data, and the higher the score is, the better the basic performance of the node is, for example, the node with high memory bandwidth and low access delay obtains a higher score and is preliminarily determined to have the potential to bear the high-performance demand service. When the running evaluation data is evaluated based on the running state data, mainly, the matching degrees of various dynamic indexes in the running state data and preset thresholds are analyzed, for example, whether the CPU utilization is lower than 80%, whether the memory bandwidth occupancy rate is lower than 70%, whether the cross-node access rate is lower than 5% and the like, if all indexes are in a reasonable range, the running evaluation data is "low-load stable state", otherwise, the running evaluation data is "high-load pressure state", and the evaluation result reflects the actual running bearing capacity of the node.

[0116] When the resource nodes are classified according to the performance evaluation data and the running evaluation data, the classification of the nodes is determined by comprehensively considering the results of the two, for the node with a higher score in the performance evaluation data (for example, in the top 20%) and the running evaluation data being "low-load stable state", because the node has high basic performance and low load pressure, the node is classified as a "high-performance node" and is specially used for memory-sensitive key services (for example, a database); for the node with an outstanding memory bandwidth index (for example, the bandwidth proportion is higher than the average value by 30%) in the performance evaluation data and the running evaluation data showing that the memory bandwidth occupancy rate is low, the node is classified as a "high-bandwidth node" and is suitable for services with large data throughput (for example, a web application service); for the node with the performance evaluation data being at a medium level and the running evaluation data showing that the load is balanced, the node is classified as a "general node" and is used for bearing ordinary computing services; and for the node with lower performance evaluation data or the running evaluation data being "high-load pressure state", the node is temporarily classified as a "to-be-scheduled node" and needs to be reevaluated and classified after load balancing adjustment. Through the classification mode combining the static hardware performance and the dynamic running state, it is ensured that the classification result of the resource nodes can match the performance demand of the services and can adapt to real-time load changes, and a reliable basis is provided for the accurate allocation of computing services.

[0117] Further, in some embodiments of the present disclosure, for the operation of "allocating the computing service to the resource node corresponding to the node classification according to the service type", the specific implementation is various. For clear illustration, the following enumerated implementation modes include but are not limited to some implementation modes: if the computing service is of the memory-sensitive type, the computing service is allocated to the resource node corresponding to the performance classification; if the computing service is of the general computing type, the computing service is allocated to the resource node corresponding to the load classification. The service type includes the memory-sensitive type and the general computing type, and the node classification includes the performance classification and the load classification.

[0118] Specifically, if the computing service is of the memory-sensitive type, this type of service has very high requirements for memory access delay and bandwidth stability, and is typically like a database service, which has frequent data read and write and is sensitive to response time, and needs to be allocated to the resource node corresponding to the performance classification. The resource node of the performance classification is a high-performance node evaluated by a node performance scoring model (calculation formula: bandwidth proportion x 70% + 1 / delay x 30%) based on the memory bandwidth, access delay and other core parameters in the resource topology data. This type of node has the hardware characteristics of high memory bandwidth (usually more than 20% higher than the average level) and low local access delay (IMC Bus delay is significantly lower than QPI delay), and through the numactl tool analysis, it is known that the matching degree of CPU core and memory controller is better. When allocating, the memory-sensitive type service implements an exclusive node allocation strategy, and through the --cpunodebind / --membind parameter, the vCPU and memory of the service are forced to bind to the node, 1GB huge page memory ( --hugetlbfs) is configured to reduce the page table management overhead, and memory isolation is strictly implemented to completely avoid cross-node access, ensure that the memory access of the service during operation is almost local access, and the cross-node access rate is controlled to be less than 5%, meeting the high demand for performance stability.

[0119] If the computing service is a general computing type, such as a web application service, the real-time requirement for resources is relatively low, but the resource utilization and load balancing need to be considered, and the computing service needs to be allocated to the resource node corresponding to the load classification. The resource node of load classification is a node with low current load evaluated based on running state data. The evaluation is based on dynamic indicators such as CPU utilization (usually less than 60%), memory bandwidth occupancy (less than 50%), and cross-node access rate (less than 10%) to ensure that the node still has sufficient resource margin to carry new services. When allocating, the elastic vCPU binding strategy is adopted, the ENABLE_CPU_PINNING parameter is used to dynamically switch the binding mode, and the process-level dynamic binding (taskset) or configuration-level static mapping can be selected. At the same time, large page memory is pre-allocated to the node to optimize the basic performance. On the premise of ensuring the normal operation of the service, the node with the lowest current load is preferentially selected to achieve balanced utilization of resources, avoid excessive load on a single node, and maintain stable operation of the system as a whole.

[0120] Further, in some embodiments of the present disclosure, the load balancing method further includes other specific implementation steps in addition to the foregoing. For the sake of clarity, the relevant specific embodiments are described in detail as follows: The computing service and the resource node to which it is allocated are configured and bound.

[0121] Specifically, the computing service is configured and bound to the resource node, and a differentiated binding strategy is adopted in combination with the service type and node characteristics to achieve hard binding or flexible binding through system tools and parameter configuration. For memory-sensitive services (such as databases), the binding operation takes strict localization and isolation as the core: the numactl tool is used to force the vCPU to be bound to the specific CPU core of the target resource node through the --cpunodebind parameter, and the memory is bound to the local memory area of the node through the --membind parameter, ensuring that the vCPU and the memory resource belong to the same node and completely avoiding cross-node access. To further optimize performance, 1 GB of huge page memory is pre-allocated to the target node (mounted through --hugetlbfs), and it is bound to the service, which can reduce the page table management overhead by more than 50%, and the global kernel parameter (sysctl kernel.numa_balancing=0) is used to disable NUMA automatic balancing, eliminating the interference of system-level scheduling on the binding relationship, and achieving strict isolation at the node level. For general computing services, the binding strategy focuses on flexibility and load adaptability: the ENABLE_CPU_PINNING parameter is used to dynamically switch the binding mode, and in the static mode, the vCPU and memory are bound to the target node through configuration-level mapping; in the dynamic mode, the taskset tool is used to support dynamic binding of process-level vCPU, which can adjust the binding relationship in real time according to the node load changes. At the same time, the node bound to this type of service is pre-allocated with large page memory, which guarantees the basic performance and avoids interference with other services through cgroups fine-grained control of resource usage upper limit.

[0122] Regardless of the type of service, after the binding is completed, the binding state needs to be monitored in real time through the eBPF-driven SD-NUMA framework, and when the cross-node access rate exceeds 10%, the re-binding mechanism is triggered immediately to ensure the effectiveness of the binding relationship. In the virtual machine migration scenario, within 3 seconds after the migration is completed, the numactl --membind command is used to enforce the memory re-binding protocol to re-anchor the service memory data to the local memory of the target node, and the hardware MMU / SMMU isolation mechanism (such as the register configuration of the Kunpeng 920 platform) is enabled to ensure the memory safety during the binding process, finally realizing the stable binding of the computing service and the resource node, which meets the performance requirements and also considers the scheduling flexibility.

[0123] Further, in some embodiments of the present disclosure, for the operation of "binding the computing service to the resource node to which the computing service is allocated", the specific implementation is various. For the sake of clear illustration, the following enumerated implementation modes include but are not limited to some implementation modes: according to the service type, the memory resource is allocated to the resource node to which the computing service is allocated; and based on the allocated memory resource, the computing service is bound to the resource node to which the computing service is allocated.

[0124] Specifically, when allocating memory resources to computing services according to service types, differentiated strategies need to be implemented in combination with the differences in the memory performance requirements of services. For memory-sensitive computing services (such as databases), based on their high requirements for memory access delay and bandwidth stability, when allocating memory resources, an exclusive node allocation strategy is adopted, all local memories of the resource node where the service is located are allocated to the service, and access to the node memory by other services is strictly limited, so as to completely avoid cross-node memory access. At the same time, 1 GB of huge page memory (mounted through --hugetlbfs) is allocated exclusively to this type of service, which can reduce the page table management overhead (more than 50% reduction in actual test) and further optimize memory access efficiency. The huge page memory is only bound to the resource node corresponding to the service, ensuring exclusive use of memory resources. For general computing services, when allocating memory resources, high-bandwidth resource nodes with low current load are preferentially selected, and appropriate local memory of the node is allocated to the service. The memory capacity is dynamically adjusted according to the service size, and huge page memory can also be configured to improve the basic performance, but the exclusive mode is not adopted, allowing flexible allocation of memory resources when the node load changes. When binding computing services and resource nodes based on allocated memory resources, the numactl tool is used to bind the memory address space of the computing service to the allocated local memory area through the --membind strategy, ensuring that the memory accessed during the service running is the local memory of the resource node. For memory-sensitive services, the --cpunodebind strategy is used to bind the vCPU to the CPU core of the node, achieving hard binding of vCPU and memory in the same node, and the NUMA automatic balancing mechanism is disabled through the global kernel parameter (sysctl kernel.numa_balancing=0) to prevent the system from automatically scheduling and destroying the binding relationship. For general computing services, the ENABLE_CPU_PINNING parameter can be used to switch the binding mode. In the static mode, configuration-level mapping is used to achieve binding, and in the dynamic mode, taskset tool is used for dynamic binding of process-level vCPU, maintaining the flexibility of the binding relationship. In addition, the eBPF-driven SD-NUMA framework is used to monitor the memory binding state in real time, and when the cross-node access rate exceeds 10%, a rebinding operation is triggered in a timely manner to ensure the effectiveness of the binding of computing services and resource nodes and guarantee the stability of service performance.

[0125] Further, in some embodiments of the present disclosure, the load balancing method further comprises other specific implementation steps in addition to the foregoing, in order to clearly present these components, the following detailed description of the related specific embodiments is expanded: preprocessing the historical load data of each resource node to generate training load data; using the training load data to iteratively train the load prediction model to be trained to generate the trained load prediction model.

[0126] Specifically, when preprocessing the historical load data of each resource node, the historical load data generated by the resource node during long-term operation needs to be collected first. These data cover multi-dimensional indicators such as CPU utilization, memory bandwidth occupancy, cross-node access rate, and inter-node communication delay, and are recorded in time series (such as once every minute). The preprocessing process first performs data cleaning to eliminate outliers (such as abnormal data where the CPU utilization jumps to 100% and then immediately returns to zero) caused by hardware failure or abnormal collection, fills in missing values that appear in the data collection interval through the moving average method to ensure data continuity; then standardize the data, unify the indicators of different magnitudes (such as CPU utilization is a percentage value, and memory bandwidth is GB / s) to the 0-1 interval, and eliminate the influence of dimension differences on model training; finally, divide the data by time window, use a 5-minute fixed window to segment the continuous data into sample segments, each segment contains all the indicator data within the window, as the basic input unit for model training, and generate training load data. When iteratively training the load prediction model (such as the LSTM model) to be trained using the training load data, first divide the training load data into a training set and a validation set in a 7:3 ratio, the training set is used for model parameter learning, and the validation set is used to evaluate the model generalization ability. During the training process, the load data of each time window is used as the input feature, and the actual load data of the next 5 minutes is used as the label. The predicted value of the model is calculated through forward propagation, the mean square error is used as the loss function to measure the difference between the predicted value and the label, and the model weight parameters are updated through back propagation with the help of the Adam optimizer. Set the iteration termination condition: when the validation set loss of 10 consecutive epochs no longer decreases, stop training to avoid overfitting, and finally generate the trained load prediction model. Based on the historical load trend, this model can accurately predict the load change of the resource node in the next 5 minutes, provide a reliable basis for preventive migration, and cooperate with real-time load monitoring data to form a complete closed loop of “historical data-prediction model-real-time adjustment”.

[0127] Further, in some embodiments of the present disclosure, the load balancing method further comprises other specific implementation steps in addition to the foregoing, in order to clearly present these components, the following detailed description of the related specific embodiments is expanded: memory monitoring is performed on each resource node, and cross-node access data of each resource node is obtained; based on the cross-node access data, the binding relationship between the virtual machine and the resource node is adjusted.

[0128] Specifically, when memory monitoring is performed on each resource node, the perf tool is mainly used to monitor memory access events (such as numa miss events), and at the same time, the eBPF driven software defined NUMA (SD-NUMA) framework is deployed to collect cross-node access data of each resource node in real time. These data specifically include cross-node access times, cross-node access rate (the proportion of remote memory access times to total memory access times), cross-node data transmission volume and corresponding delay changes, etc. Among them, the cross-node access rate is the core monitoring index, which directly reflects the effectiveness of the binding relationship between the virtual machine and the current resource node - according to the measured data, when the index exceeds 10%, it will significantly affect the business performance.

[0129] When the binding relationship between the virtual machine and the resource node is adjusted based on the cross-node access data, the logic of "real-time monitoring - threshold triggering - dynamic adjustment" is followed: when the cross-node access rate of a certain resource node is monitored to exceed 10% (2 times the sensitivity of the industry standard), the SD-NUMA framework immediately triggers the rebinding mechanism, calls the kernel interface through the mounted eBPF probe, and combines the --membind strategy of the numactl tool to rebinding the memory resources of the virtual machine to the resource node with higher local access proportion; if the cross-node access rate continues to be higher than 5%, the sub- NUMA cluster (SNC) technology is further enabled to form a logical resource cluster (such as Node0+1) by grouping adjacent physical nodes, expand the local access range, and reduce the cross-cluster access probability; for memory sensitive business (such as database), if the cross-node access rate abnormally increases, exclusive node redistribution will be triggered, the virtual machine will be migrated to a node with better performance through the virsh migrate tool, and then the hard binding is executed again, and at the same time, the 1GB huge page memory ( --hugetlbfs) is redistributed to reduce the interference of page table management overhead on memory access. In addition, within 3 seconds after adjustment, the system will perform feedback control through the PID calibration algorithm, taking the cross-node access rate as the input parameter, and forcibly executing the memory rebinding protocol (numactl --membind) to ensure that the cross-node access rate after adjustment is stably controlled within 5%, so as to guarantee the business continuity while maintaining the high performance state of the binding relationship between the virtual machine and the resource node.

[0130] It should be noted that the embodiments of the present disclosure can include a plurality of steps, which are numbered for the convenience of description, but these numbers are not a limitation on the execution time slot and execution order between the steps; these steps can be implemented in any order, and the embodiments of the present disclosure do not limit this.

[0131] Corresponding to the above-mentioned load balancing method, the present disclosure also proposes a load balancing device. Since the device embodiments of the present disclosure correspond to the above-mentioned method embodiments, for the details not disclosed in the device embodiments, please refer to the above-mentioned method embodiments, which will not be described in detail in the present disclosure.

[0132] Figure 2 The structural schematic diagram of a load balancing device provided by the embodiments of the present disclosure is shown in Figure 2 , which includes:

[0133] The monitoring unit 21 is configured to perform load monitoring on the resource nodes in the server, and obtain load monitoring data. The resource nodes are deployed with virtual machines, and the computing services of the virtual machines are bound to the corresponding classified resource nodes according to service types.

[0134] The prediction unit 22 is configured to perform load prediction on the resource nodes, and obtain load prediction data.

[0135] The determination unit 23 is configured to determine whether to migrate the virtual machines to other resource nodes according to the load monitoring data and the load prediction data.

[0136] The migration unit 24 is configured to, in response to the determination that the virtual machines are to be migrated to other resource nodes, migrate the virtual machines to target resource nodes, and bind the virtual machines to the target resource nodes.

[0137] The present disclosure provides a load balancing device. Through load monitoring combined with service type binding mechanism, the resource nodes and virtual machine demand can be accurately matched, and waste caused by resource mismatch can be avoided. Through load prediction, potential overloaded nodes can be identified in advance, and virtual machines can be actively migrated to low-load nodes, which can improve the load balancing degree of the nodes, significantly reduce the proportion of hot nodes, and release the overall computing power of the server. After the virtual machines are migrated, the virtual machines are forcibly bound to the target nodes, which can greatly reduce cross-node memory access. Based on the preventive migration of the load prediction, the risk of service interruption caused by sudden load can be reduced.

[0138] Further, in a possible implementation manner of the present embodiment, as shown in Figure 3 , the prediction unit 22 includes:

[0139] The acquisition module 221 is configured to acquire current load data of each resource node.

[0140] The prediction module 222 is configured to input the current load data into a load prediction model to perform load prediction, predict load changes of each resource node in a preset time length, and generate load prediction data of each resource node.

[0141] Further, in a possible implementation of the embodiment, as shown in Figure 3 The determination unit 23 includes:

[0142] The first determination module 231 is configured to determine to migrate the virtual machine to another resource node if the load monitoring data exceeds the preset load threshold.

[0143] The second determination module 232 is configured to determine to migrate the virtual machine to another resource node if the load prediction data exceeds the predicted load threshold.

[0144] Further, in a possible implementation of the embodiment, as shown in Figure 3 The load balancing apparatus further includes:

[0145] The distribution unit 25 is configured to obtain node classifications of each resource node, and distribute the computing service to the resource nodes of the corresponding classification based on the service type.

[0146] Further, in a possible implementation of the embodiment, as shown in Figure 3 The distribution unit 25 includes:

[0147] The classification module 251 is configured to perform classification by using the node evaluation parameters of each resource node to obtain the node classifications of each resource node.

[0148] The first distribution module 252 is configured to distribute the computing service to the resource nodes of the corresponding classification according to the node classification corresponding to the service type.

[0149] Further, in a possible implementation of the embodiment, the node evaluation parameters include resource topology data and running state data.

[0150] The classification module 251 is further configured to:

[0151] Obtain the resource topology data and the running state data of each resource node.

[0152] Evaluate each resource node based on the resource topology data to obtain performance evaluation data, and evaluate each resource node based on the running state data to obtain running evaluation data.

[0153] Classify each resource node according to the performance evaluation data and the running evaluation data to obtain the node classifications of each resource node.

[0154] Further, in a possible implementation of the embodiment, the service type includes: memory-sensitive type and general computing type, and the node classification includes: performance classification and load classification.

[0155] The first allocation module 252 is further configured to:

[0156] if the computing service is of the memory-sensitive type, allocate the computing service to the resource node corresponding to the performance classification;

[0157] if the computing service is of the general computing type, allocate the computing service to the resource node corresponding to the load classification.

[0158] Further, in a possible implementation of the embodiment, as shown in Figure 3 the load balancing apparatus further includes:

[0159] a binding unit 26 configured to configure and bind the computing service and the resource node to which the computing service is allocated.

[0160] Further, in a possible implementation of the embodiment, as shown in Figure 3 the binding unit 26 includes:

[0161] a second allocation module 261 configured to allocate, according to the service type, memory resources for the computing service and the resource node to which the computing service is allocated;

[0162] a binding module 262 configured to bind, based on the allocated memory resources, the computing service and the resource node to which the computing service is allocated.

[0163] Further, in a possible implementation of the embodiment, as shown in Figure 3 the load balancing apparatus further includes:

[0164] a generating unit 27 configured to pre-process historical load data of each resource node to generate training load data;

[0165] a training unit 28 configured to iteratively train a to-be-trained load prediction model using the training load data to generate a trained load prediction model.

[0166] Further, in a possible implementation of the embodiment, as shown in Figure 3 the load balancing apparatus further includes:

[0167] an obtaining unit 29 configured to monitor memory of each resource node to obtain cross-node access data of each resource node;

[0168] an adjusting unit 210 configured to adjust a binding relationship between a virtual machine and a resource node based on the cross-node access data.

[0169] It should be noted that the foregoing description of the method embodiments also applies to the device of this embodiment, and the principles are the same, which will not be repeated in this embodiment.

[0170] The features of the device corresponding to the embodiment of load balancing can be referred to the related description of the method corresponding to the embodiment of load balancing, which will not be repeated here.

[0171] Embodiments of the present application also provide an electronic device, comprising a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above load balancing method embodiments.

[0172] Embodiments of the present application also provide a computer readable storage medium, which stores a computer program, wherein the computer program is configured to perform the steps in any of the above load balancing method embodiments when running.

[0173] In an exemplary embodiment, the above computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic or optical disk, and various media that can store computer programs.

[0174] Embodiments of the present application also provide a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps in any of the above load balancing method embodiments.

[0175] Embodiments of the present application also provide another computer program product, which comprises a non-volatile computer readable storage medium, and the non-volatile computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps in any of the above load balancing method embodiments.

[0176] The skilled person can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in the foregoing description in general terms. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0177] The above describes in detail the method and device for load balancing, the electronic device and the storage medium provided by the present application. The principles and implementation modes of the present application are described by applying specific examples, and the above description of the embodiments is only used to help understand the method of the present application and its core idea. It should be pointed out that, for ordinary skilled persons in the technical field, some improvements and modifications can be made to the present application without departing from the principles of the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Claims

1. A method of load balancing, characterized by, The method comprises: performing load monitoring on resource nodes in a server to obtain load monitoring data, wherein the resource nodes are deployed with virtual machines, and computing services of the virtual machines are bound to corresponding classified resource nodes according to service types; performing load prediction on the resource nodes to obtain load prediction data; determining whether to migrate the virtual machines to other resource nodes according to the load monitoring data and the load prediction data; in response to determining to migrate the virtual machines to other resource nodes, migrating the virtual machines to target resource nodes and binding the virtual machines to the target resource nodes; wherein, node classifications of each resource node are obtained, and the computing services are distributed to corresponding classified resource nodes based on the service types; the load prediction on the resource nodes to obtain load prediction data comprises: obtaining current load data of each resource node; inputting the current load data into a load prediction model to perform load prediction, predicting load changes of each resource node within a preset time length, and generating load prediction data of each resource node; the determination of whether to migrate the virtual machines to other resource nodes according to the load monitoring data and the load prediction data comprises: if the load monitoring data exceeds a preset load threshold, it is determined to migrate the virtual machines to other resource nodes; if the load prediction data exceeds a predicted load threshold, it is determined to migrate the virtual machines to other resource nodes.

2. The method of load balancing according to claim 1, wherein, the distribution of the computing services to corresponding classified resource nodes based on the service types comprises: classifying each resource node by using node evaluation parameters to obtain node classifications of each resource node; distributing the computing services to corresponding classified resource nodes according to the node classifications corresponding to the service types.

3. The method of load balancing according to claim 2, wherein, The node evaluation parameters comprise resource topology data and running state data. The classification of each resource node by using node evaluation parameters comprises: obtaining the resource topology data and the running state data of each resource node; evaluating each resource node based on the resource topology data to obtain performance evaluation data, and evaluating each resource node based on the running state data to obtain running evaluation data; classifying each resource node according to the performance evaluation data and the running evaluation data to obtain node classifications of each resource node.

4. The method of load balancing according to claim 3, wherein, The service types comprise memory-sensitive types and general computing types, and the node classifications comprise performance classifications and load classifications. The distribution of the computing services to corresponding classified resource nodes according to the node classifications corresponding to the service types comprises: if the computing services are of the memory-sensitive types, the computing services are distributed to resource nodes corresponding to the performance classifications; if the computing services are of the general computing types, the computing services are distributed to resource nodes corresponding to the load classifications.

5. The method of load balancing according to claim 4, wherein, The method further comprises: configuring and binding the computing services to the distributed resource nodes.

6. The method of load balancing according to claim 5, wherein, The binding of the computing services to the distributed resource nodes comprises: allocating memory resources for the computing service and the resource node to which the computing service is allocated according to the business type; binding the computing service and the resource node to which the computing service is allocated based on the allocated memory resources.

7. The method for load balancing of claim 1, wherein, The method further comprises: preprocessing historical load data of each resource node to generate training load data; iteratively training a load prediction model to be trained using the training load data to generate a trained load prediction model.

8. The method for load balancing of claim 1, wherein, The method further comprises: monitoring memory of each resource node to obtain cross-node access data of each resource node; adjusting a binding relationship between the virtual machine and the resource node based on the cross-node access data.

9. An apparatus for load balancing, the apparatus comprising: Comprise: a monitoring unit configured to monitor load of resource nodes in a server to obtain load monitoring data, wherein the resource nodes are deployed with virtual machines, and computing services of the virtual machines are bound to corresponding classified resource nodes according to business types; a prediction unit configured to predict load of the resource nodes to obtain load prediction data; a determination unit configured to determine whether to migrate the virtual machines to other resource nodes according to the load monitoring data and the load prediction data; a migration unit configured to, in response to a determination that the virtual machines are to be migrated to other resource nodes, migrate the virtual machines to target resource nodes and bind the virtual machines to the target resource nodes; wherein a node classification of each resource node is obtained, and the computing services are allocated to corresponding classified resource nodes based on the business types; and the load prediction of the resource nodes to obtain load prediction data comprises: obtaining current load data of each resource node; inputting the current load data into a load prediction model to predict load changes of each resource node within a preset time period and generate load prediction data of each resource node; the determination of whether to migrate the virtual machines to other resource nodes according to the load monitoring data and the load prediction data comprises: if the load monitoring data exceeds a preset load threshold, it is determined that the virtual machines are to be migrated to other resource nodes; and if the load prediction data exceeds a predicted load threshold, it is determined that the virtual machines are to be migrated to other resource nodes.

10. An electronic device, comprising: Comprise: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the load balancing method of any one of claims 1-8.

11. A non-transitory computer-readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the load balancing method of any one of claims 1-8.

12. A computer program product, characterised in that, The computer program, when executed by a processor, implements the load balancing method of any one of claims 1-8. The computer program, when executed by a processor, implements the load balancing method of any one of claims 1-8.

Citation Information

Patent Citations

  • Virtual machine migration method and related product

    CN114265668A

  • Real-time hierarchical distribution method for power cloud resources of digital power grid

    CN119603304A