CN115914235A - Load balancing method and device - Google Patents

Load balancing method and device Download PDF

Info

Publication number
CN115914235A
CN115914235A CN202211518371.XA CN202211518371A CN115914235A CN 115914235 A CN115914235 A CN 115914235A CN 202211518371 A CN202211518371 A CN 202211518371A CN 115914235 A CN115914235 A CN 115914235A
Authority
CN
China
Prior art keywords
service node
computing power
task
load balancing
power
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211518371.XA
Other languages
Chinese (zh)
Inventor
朱萌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202211518371.XA priority Critical patent/CN115914235A/en
Publication of CN115914235A publication Critical patent/CN115914235A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a load balancing method and a device, which can be applied to the financial field or other fields, wherein the method comprises the following steps: receiving a task request; screening out target service nodes according to the task request and the pre-calculated residual computing power of each service node; and distributing the computing task in the task request to the target service node. Compared with the technical scheme of load balancing in the prior art, the load balancing method and the load balancing device can screen the target service node for task distribution according to the pre-calculated residual computing power of each service node, can ensure that the computation-intensive task is distributed to the service nodes with high residual computing power for processing so as to obtain quick response, ensure the processing efficiency of task requests in a distributed system and realize reasonable distribution of tasks.

Description

Load balancing method and device
Technical Field
The invention relates to the technical field of system task allocation, in particular to a load balancing method and device.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
Currently, in various fields, such as the financial field, the telecommunication field, and the like, to achieve load balancing of the entire system, a work task needs to be distributed to a plurality of service nodes for execution, for example, an FTP server, a Web server, an enterprise core application server, and other main task servers, so as to cooperatively complete the work task.
The existing load balancing method for performing service allocation according to the resource usage of each service node cannot truly reflect the load capacity of a computer when the computing capacities of computers in a cluster are different, for example, although the resource usage rate of a low-performance computer with poor computing capacity is lower than that of another high-performance computer, the low-performance computer cannot undertake some tasks with high computing amount (i.e. computing-intensive tasks), so that the service allocation according to the resource usage of each service node can result in long service processing time of the computing-intensive tasks, and the total computing resources of the whole distributed system cannot be reasonably allocated.
Disclosure of Invention
The embodiment of the invention provides a load balancing method, which is used for solving the technical problems that reasonable distribution of tasks cannot be realized based on resource use conditions at present and the service processing time of calculation-intensive tasks is long, and comprises the following steps:
receiving a task request;
screening out target service nodes according to the task request and the pre-calculated residual computing power of each service node;
and distributing the computing task in the task request to the target service node.
The embodiment of the invention also provides a load balancing device, which is used for solving the technical problems that the reasonable distribution of tasks cannot be realized based on the resource use condition at present and the service processing time of the calculation-intensive tasks is long, and comprises the following steps:
the task receiving module is used for receiving a task request;
the service node screening module is used for screening out target service nodes according to the task request and the pre-calculated residual computing power of each service node;
and the task distribution module is used for distributing the calculation task in the task request to the target service node.
The embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and when the processor executes the computer program, the load balancing method is implemented.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the load balancing method is implemented.
An embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, the load balancing method is implemented.
Compared with the technical scheme of load balancing in the prior art, the load balancing method and the load balancing device in the embodiment of the invention can screen the target service node for task allocation according to the precomputed residual computing power of each service node, can ensure that the compute-intensive task is allocated to the service node with high residual computing power for processing and can obtain quick response, ensure the processing efficiency of task requests in a distributed system and realize reasonable allocation of tasks.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts. In the drawings:
fig. 1 is a flowchart illustrating a load balancing method according to an embodiment of the present invention.
Fig. 2 is a schematic flowchart of the process of determining the total computing power of each service node in the embodiment of the present invention.
Fig. 3 is a schematic flowchart illustrating a process of screening out a target service node according to an embodiment of the present invention.
Fig. 4 is another schematic flow chart illustrating screening out a target service node according to an embodiment of the present invention.
Fig. 5 is a schematic structural diagram of a load balancing apparatus according to an embodiment of the present invention.
Fig. 6 is a schematic structural diagram of the total computing power determining module in the embodiment of the present invention.
Fig. 7 is a schematic structural diagram of a service node screening module in an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
As shown in fig. 1, the present invention provides a load balancing method, including:
step 101, receiving a task request.
The task request comprises a calculation task and also comprises a calculation amount required for completing the calculation task, and the classification of the task request can be carried out according to the calculation amount of the task request and a classification list of a pre-established task type, for example, the task request is classified into a calculation intensive task or a non-calculation intensive task; the task request may also directly include the task type; different distribution modes can be selected according to task types, and in the embodiment, the calculation-intensive tasks are subjected to screening of target service nodes and distribution of the tasks by adopting the following steps; for non-computation-intensive tasks, screening of target service nodes and distribution of tasks can be performed through existing load balancing algorithms, such as a polling algorithm, a weighted polling algorithm, a random algorithm, a weighted random algorithm, a hash algorithm and the like.
And step 102, screening out target service nodes according to the task request and the pre-calculated residual computing power of each service node.
The calculation Power is the abbreviation of Computing Power, and the measure is the calculation speed for realizing the output of the target result by processing the information data. The metrics include FLOPS (floating point operation number per second), MIPS (million instructions executed per second), OPS (operation number per second), hash/s (Hash operation number per second), and the like. Each service node can report the residual computing power of the service node per se according to a preset period, and can also calculate the residual computing power of each service node in real time after receiving a task request. The screened target service node can be one or more.
And 103, distributing the computing task in the task request to the target service node.
The computing task may be distributed to one of the target service nodes for execution, or the computing task may be divided into a plurality of subtasks and distributed to a plurality of target service nodes for execution.
As shown in fig. 2, before pre-calculating the remaining computation power of each service node, the embodiment of the present invention further includes:
and step 201, calculating the theoretical highest calculation force under the condition of no load of each service node.
Wherein, the calculation formula of the theoretical highest calculation force is as follows: the computational power of the FLOPS (computational power) = CPU core number, single-core dominant frequency, CPU single-cycle floating-point computing capacity, wherein three parameters of the CPU core number, the single-core dominant frequency and the CPU single-cycle floating-point computing capacity can be obtained by looking up performance data of the CPU, for example, an Intel to Strong 6240R processor, the CPU core number is 24, the single-core dominant frequency is 2.4GHz, the CPU single-cycle floating-point computing capacity (AXV-512 instruction set, double-precision operation times) is 32, and therefore the computational power of the FLOPS (computational power) is 24 x 2.4 x 32=1843.2GFLOPS.
Step 202, selecting at least one service node as a test service node, allocating a task with a known calculation amount to the test service node and fully loading the test service node, thereby calculating the actual highest calculation power of the test service node. For example, if the calculated amount of the task is 18000GFOP and the task is completed for 10s, the actual maximum calculation power of the test service node is 18000/10=1800gfops.
And 203, obtaining a calculation power correction coefficient according to the theoretical maximum calculation power and the actual maximum calculation power of the test service node. For example, the theoretical maximum calculated force 1843.2GFOPS, the actual maximum calculated force is 1800GFOPS, and the calculated force correction factor is 1800/1843.2, which is about 0.977. The computational power correction coefficient may be different in the case of multitask parallel, and a multitask parallel computing scenario needs to be set, and then the above steps 202 and 203 are repeated to obtain the computational power correction coefficient.
And 204, determining the total computing power of each service node according to the theoretical highest computing power and the computing power correction coefficient under the condition of no load of each service node. And the total computing power of each service node is the corresponding theoretical highest computing power x computing power correction coefficient.
As shown in fig. 3 and 4, in the embodiment of the present invention, the step of calculating the remaining computation power of each service node in advance includes:
step 301, determining the remaining computing power of each service node according to the total computing power of each service node and the current CPU utilization rate of each service node. Wherein, the remaining computing power of each service node = (1-CPU utilization) × the total computing power of the service node.
As shown in fig. 3, in the embodiment of the present invention, the task request includes a required computation power required to complete the computation task; screening out the service nodes according to the task request and the pre-calculated residual computing power of each service node, and the screening comprises the following steps:
and 302, screening out the service nodes with the residual computing power larger than the required computing power as the target service nodes. The required computing power parameter can be directly obtained from the task request, and the calculated amount and the time required to respond can also be obtained from the task request, so that the required computing power can be calculated according to the calculated amount and the time required to respond.
As shown in fig. 4, when it is not possible to obtain the required computation force parameter from the task request, and it is also not possible to obtain the computation quantity parameter and the time parameter of the required response at the same time, in the embodiment of the present invention, the screening out the service nodes according to the task request and the remaining computation force of each service node includes:
and 303, sorting the service nodes from large to small according to the corresponding residual computing power, and screening the service nodes before the set sorting as the target service nodes. For example, the service node ranked in front of the median (i.e., the top 50%) is selected as the target service node.
As shown in fig. 5, a load balancing apparatus is further provided in the embodiment of the present invention, as described in the following embodiments. Because the principle of the device for solving the problems is similar to that of the load balancing method, the implementation of the device can refer to the implementation of the software requirement evaluation method, and repeated details are not repeated.
As shown in fig. 5, the load balancing apparatus of the present invention includes: a task receiving module 501, configured to receive a task request; a service node screening module 502, configured to screen out a target service node according to the task request and the pre-calculated residual computation power of each service node; a task distributing module 503, configured to distribute the computing task in the task request to the target service node.
As shown in fig. 6, in the embodiment of the present invention, the load balancing apparatus further includes a total computing power determining module 504, configured to determine a total computing power of each service node; the service node screening module 502 pre-calculates the remaining computing power according to the total computing power. The aggregate strength determination module 504 includes: a theoretical maximum computation power calculation unit 601, configured to calculate a theoretical maximum computation power of each service node under an idle condition; an actual maximum computation power calculation unit 602, configured to select at least one service node as a test service node, allocate a task with a known computation amount to the test service node, and fully load the test service node, so as to calculate an actual maximum computation power of the test service node; the computational power correction coefficient determining unit 603 is configured to obtain a computational power correction coefficient according to the theoretical highest computational power and the actual highest computational power of the test service node; and an overall calculation power calculation unit 604, configured to determine an overall calculation power of each service node according to the theoretical highest calculation power and the calculation power correction coefficient of each service node under the no-load condition.
As shown in fig. 7, in the embodiment of the present invention, the service node screening module 502 includes: and a residual computing power calculating unit 701, configured to determine a residual computing power of each service node according to the total computing power of each service node and a current CPU utilization of each service node.
As shown in fig. 7, in the embodiment of the present invention, the task request includes a required computation power required to complete the computation task, and the service node screening module 502 includes: a first screening unit 702, configured to screen out the service node whose remaining computation power is greater than the required computation power as the target service node.
As shown in fig. 7, in the embodiment of the present invention, the service node screening module 502 includes: the second screening unit 703 is configured to sort the service nodes from large to small according to the corresponding residual computation power, and screen out a service node before the set ranking as the target service node.
The embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and when the processor executes the computer program, the load balancing method is implemented.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the load balancing method is implemented.
An embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, the load balancing method is implemented.
Compared with the technical scheme of load balancing in the prior art, the load balancing method and the load balancing device in the embodiment of the invention can screen the target service node for task allocation according to the precomputed residual computing power of each service node, can ensure that the compute-intensive task is allocated to the service node with high residual computing power for processing and can obtain quick response, ensure the processing efficiency of task requests in a distributed system and realize reasonable allocation of tasks.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (13)

1. A method of load balancing, comprising:
receiving a task request;
screening out target service nodes according to the task request and the pre-calculated residual computing power of each service node;
and distributing the computing task in the task request to the target service node.
2. The load balancing method according to claim 1, further comprising, before pre-calculating the remaining computation power of each service node:
calculating the theoretical highest calculation force of each service node under the condition of no load;
selecting at least one service node as a test service node, distributing a task with known calculated amount to the test service node and enabling the test service node to be fully loaded, thereby calculating the actual highest calculation power of the test service node;
obtaining a calculation power correction coefficient according to the theoretical maximum calculation power and the actual maximum calculation power of the test service node;
and determining the total computing power of each service node according to the theoretical highest computing power and the computing power correction coefficient under the no-load condition of each service node.
3. The load balancing method according to claim 2, wherein the step of pre-calculating the remaining computation power of each service node comprises:
and determining the residual computing power of each service node according to the total computing power of each service node and the current CPU utilization rate of each service node.
4. The load balancing method of claim 1, wherein the task request includes a required computing power required to complete the computing task; the screening out the service nodes according to the task request and the residual computing power of each service node comprises the following steps:
and screening out the service nodes with the residual computing power larger than the required computing power as the target service nodes.
5. The load balancing method according to claim 1, wherein the screening out the service nodes according to the task request and the remaining computation power of each service node comprises:
and sequencing all the service nodes from large to small according to the corresponding residual computing power, and screening out the service nodes before the set ranking as the target service nodes.
6. A load balancing apparatus, comprising:
the task receiving module is used for receiving a task request;
the service node screening module is used for screening out target service nodes according to the task request and the pre-calculated residual computing power of each service node;
and the task distribution module is used for distributing the calculation task in the task request to the target service node.
7. The load balancing apparatus of claim 6, further comprising an aggregate force determination module, the aggregate force determination module comprising:
the theoretical maximum calculation force calculation unit is used for calculating the theoretical maximum calculation force under the condition that each service node is in no load;
the actual highest calculation power calculation unit is used for selecting at least one service node as a test service node, distributing a task with known calculation amount to the test service node and enabling the test service node to be fully loaded, and therefore calculating the actual highest calculation power of the test service node;
the calculation force correction coefficient determining unit is used for obtaining a calculation force correction coefficient according to the theoretical highest calculation force and the actual highest calculation force of the test service node;
and the total computing power computing unit is used for determining the total computing power of each service node according to the theoretical highest computing power and the computing power correction coefficient under the no-load condition of each service node.
8. The load balancing apparatus of claim 7, wherein the service node screening module comprises:
and the residual computing power calculating unit is used for determining the residual computing power of each service node according to the total computing power of each service node and the current CPU utilization rate of each service node.
9. The load balancing device of claim 6, wherein the task request includes a demand effort required to complete the computing task, and wherein the service node filtering module comprises:
and the first screening unit is used for screening out the service nodes with the residual computing power larger than the required computing power as the target service nodes.
10. The load balancing apparatus of claim 6, wherein the service node screening module comprises:
and the second screening unit is used for sorting all the service nodes from large to small according to the corresponding residual computing power, and screening the service nodes before the set sorting as the target service nodes.
11. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the load balancing method of any one of claims 1 to 5 when executing the computer program.
12. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the load balancing method of any one of claims 1 to 5.
13. A computer program product, characterized in that the computer program product comprises a computer program which, when being executed by a processor, carries out the method of load balancing according to any one of claims 1 to 5.
CN202211518371.XA 2022-11-29 2022-11-29 Load balancing method and device Pending CN115914235A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211518371.XA CN115914235A (en) 2022-11-29 2022-11-29 Load balancing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211518371.XA CN115914235A (en) 2022-11-29 2022-11-29 Load balancing method and device

Publications (1)

Publication Number Publication Date
CN115914235A true CN115914235A (en) 2023-04-04

Family

ID=86472565

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211518371.XA Pending CN115914235A (en) 2022-11-29 2022-11-29 Load balancing method and device

Country Status (1)

Country Link
CN (1) CN115914235A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117707793A (en) * 2024-02-05 2024-03-15 太平金融科技服务(上海)有限公司 Computing task processing method, device, equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117707793A (en) * 2024-02-05 2024-03-15 太平金融科技服务(上海)有限公司 Computing task processing method, device, equipment and medium
CN117707793B (en) * 2024-02-05 2024-05-03 太平金融科技服务(上海)有限公司 Computing task processing method, device, equipment and medium

Similar Documents

Publication Publication Date Title
Andreolini et al. Dynamic load management of virtual machines in cloud architectures
Selvarani et al. Improved cost-based algorithm for task scheduling in cloud computing
US7877755B2 (en) Dynamic application placement with allocation restrictions and even load distribution
US7668703B1 (en) Determining required capacity for a resource
CN107239336A (en) A kind of method and device for realizing task scheduling
US8572621B2 (en) Selection of server for relocation of application program based on largest number of algorithms with identical output using selected server resource criteria
Anousha et al. An improved Min-Min task scheduling algorithm in grid computing
Mosa et al. Dynamic virtual machine placement considering CPU and memory resource requirements
CN111880939A (en) Container dynamic migration method and device and electronic equipment
CN110968424A (en) Resource scheduling method, device and storage medium based on K8s
CN111124687A (en) CPU resource reservation method, device and related equipment
Moghaddam et al. Energy-efficient and sla-aware virtual machine selection algorithm for dynamic resource allocation in cloud data centers
CN115914235A (en) Load balancing method and device
US20120042322A1 (en) Hybrid Program Balancing
Walia et al. Performance analysis of the task scheduling algorithms in the cloud computing environments
CN116048773B (en) Distributed collaborative task assignment method and system based on wave function collapse
Piao et al. Computing resource prediction for mapreduce applications using decision tree
CN116302327A (en) Resource scheduling method and related equipment
CN110069319A (en) A kind of multiple target dispatching method of virtual machine and system towards cloudlet resource management
CN114466019A (en) Distributed computing system, load balancing method, device and storage medium
Meyer et al. Pipel: exploiting resource reorganisation to optimise performance of pipeline-structured applications in the cloud
Rani et al. A workload-aware vm placement algorithm for performance improvement and energy efficiency in OpenStack cloud
Mehta Designing an effective dynamic load balancing algorithm considering imperative design issues in distributed systems
Wang et al. Resource Scheduling Method Based on Bayes for Cloud Computing.
Jha et al. Power aware resource virtual machine allocation policy for cloud infrastructure

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination