Processing method and device for realizing load balancing
By obtaining task configuration information and load quantization information of business equipment, dynamically adjusting the load feedback cycle, solving the problem of untimely load changes in the existing technology, improving the accuracy of load balancing and cluster resource utilization.
Patent Information
- Application Number
- CN202110650757.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-10
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2041-06-10
AI Technical Summary
The existing load balancing technology cannot be promptly informed when the load of business equipment changes, which affects the accuracy of load balancing.
By obtaining the task configuration information of the business equipment within the preset statistical cycle, determining the load feedback cycle, and calculating the allocation weight based on the load quantization information, dynamically adjusting the load feedback cycle to achieve load balancing.
It improves the timeliness of load conditions, avoids load tilt and excessive load pressure, optimizes load balancing effect, and improves cluster resource utilization.
Smart Images

Figure CN113377539B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a processing method and device for implementing load balancing. Background Art
[0002] Load balancing is a computer technology used to expand business processing capabilities. It can evenly distribute the load generated by concurrent business requests to business devices in a service node cluster, give full play to the cluster's parallel processing capabilities, and improve the cluster's resource utilization and business processing efficiency.
[0003] In the process of implementing the technical solution disclosed in the present invention, the inventors found that in the current load balancing technology, the load information of the service equipment is usually obtained periodically, and the service requests are evenly distributed based on the load information. When the load of the service equipment changes significantly, this method cannot timely know the load change, which will have a certain impact on the accuracy of load balancing. Summary of the invention
[0004] One aspect of the present disclosure provides a processing method for implementing load balancing, including: performing the following operations for any business device in a business device cluster: obtaining task configuration information of the business device within a preset statistical period; determining a load feedback period for the business device based on the task configuration information; obtaining load quantification information of the business device within the load feedback period; and determining an allocation weight associated with the business device based on the load quantification information, so as to determine a target business device for processing a business request based on the allocation weight associated with each of the business devices.
[0005] Optionally, obtaining the task configuration information of the business device within a preset statistical period includes: obtaining the number of business requests allocated to the business device within the statistical period; determining the load feedback period for the business device based on the task configuration information includes: determining the load feedback period for the business device according to a change in the number of business requests allocated to the business device within the statistical period, and according to a preset correspondence between the change and the load feedback period.
[0006] Optionally, the preset corresponding relationship includes a negative correlation between the change amount and the load feedback period.
[0007] Optionally, the acquiring of the load quantization information of the service device within the load feedback cycle includes: based on the latest load feedback cycle for the service device, when a timer reaches the load feedback cycle, requesting to acquire the load quantization information of the service device.
[0008] Optionally, determining the allocation weight associated with the business device based on the load quantification information includes: calculating the available capacity of the business device according to the configured capacity of the business device and the load quantification information; dividing the business device into appropriate business device subsets based on the available capacity, wherein the business device subsets are obtained by dividing according to the available capacity of each business device in the business device cluster; using the comparison value of the total available capacity of each business device in the business device subset and the total available capacity of each business device in the business device cluster as the subset weight for the business device subset; and using the subset weight for the business device subset as the allocation weight associated with the business device.
[0009] Optionally, the load quantification information includes at least one of CPU utilization, memory utilization and network bandwidth occupancy.
[0010] Another aspect of the present disclosure provides a processing device for implementing load balancing, which is used to perform the following operations on any business device in a business device cluster, and the device includes: a first acquisition module, used to obtain task configuration information of the business device within a preset statistical period; a first processing module, used to determine the load feedback period for the business device based on the task configuration information; a second acquisition module, used to obtain load quantification information of the business device within the load feedback period; a second processing module, used to determine the allocation weight associated with the business device based on the load quantification information; and a third processing module, used to determine the target business device for processing the business request based on the allocation weight associated with each of the business devices.
[0011] Optionally, the first acquisition module includes: a first acquisition sub-module, used to obtain the number of business requests allocated to the business device during the statistical period; the first processing module includes: a first processing sub-module, used to determine the load feedback cycle for the business device based on the change in the number of business requests allocated to the business device during the statistical period, and based on a preset correspondence between the change and the load feedback cycle.
[0012] Optionally, the preset corresponding relationship includes a negative correlation between the change amount and the load feedback period.
[0013] Optionally, the second acquisition module includes: a second acquisition submodule, configured to request to acquire the load quantization information of the service device according to the latest load feedback cycle for the service device when the timer reaches the load feedback cycle.
[0014] Optionally, the second processing module includes: a second processing sub-module, used to calculate the available capacity of the business device according to the configuration capacity of the business device and the load quantification information; a third processing sub-module, used to divide the business device into appropriate business device subsets based on the available capacity, wherein the business device subsets are obtained by dividing according to the available capacity of each business device in the business device cluster; a fourth processing sub-module, used to use the comparison value of the total available capacity of each business device in the business device subset and the total available capacity of each business device in the business device cluster as the subset weight for the business device subset; and a fifth processing sub-module, used to use the subset weight for the business device subset as the allocation weight associated with the business device.
[0015] Optionally, the load quantification information includes at least one of CPU utilization, memory utilization and network bandwidth occupancy.
[0016] Another aspect of the present disclosure provides an electronic device, comprising one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method of an embodiment of the present disclosure.
[0017] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the method of the embodiment of the present disclosure when executed.
[0018] Another aspect of the present disclosure provides a computer program product, including computer-readable instructions, wherein the computer-readable instructions are used to execute the processing method for implementing load balancing according to an embodiment of the present disclosure when executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] For a more complete understanding of the present disclosure and its advantages, reference will now be made to the following description taken in conjunction with the accompanying drawings, in which:
[0020] Figure 1 The system architecture of the processing method and device for implementing load balancing according to the embodiment of the present disclosure is schematically shown;
[0021] Figure 2 A flowchart of a method for implementing load balancing according to an embodiment of the present disclosure is schematically shown;
[0022] Figure 3 A flowchart schematically shows another processing method for implementing load balancing according to an embodiment of the present disclosure;
[0023] Figure 4A flowchart schematically shows another processing method for implementing load balancing according to an embodiment of the present disclosure;
[0024] Figure 5 A block diagram schematically shows a processing device for implementing load balancing according to an embodiment of the present disclosure;
[0025] Figure 6 A block diagram of an electronic device according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0026] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0027] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "include", "comprising", etc. used herein indicate the existence of features, operations, operations and / or components, but do not exclude the existence or addition of one or more other features, operations, operations or components.
[0028] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0029] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0030] Some block diagrams and / or flow charts are shown in the accompanying drawings. It should be understood that some boxes or combinations thereof in the block diagrams and / or flow charts can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable processing device for implementing load balancing, so that these instructions can create a device for implementing the functions / operations described in these block diagrams and / or flow charts when executed by the processor. The technology of the present disclosure can be implemented in the form of hardware and / or software (including firmware, microcode, etc.). In addition, the technology of the present disclosure can take the form of a computer program product on a computer-readable storage medium storing instructions, which can be used by an instruction execution system or used in combination with an instruction execution system.
[0031] The embodiment of the present disclosure provides a processing method for realizing load balancing and a processing device capable of applying the method. The method includes performing the following operations for any service device in a service device cluster: first, obtaining task configuration information of the service device within a preset statistical period, and determining a load feedback period for the service device based on the task configuration information; then, obtaining load quantification information of the service device within the load feedback period, and determining an allocation weight associated with the service device based on the load quantification information, so as to determine a target service device for processing a service request according to the allocation weight associated with each service device.
[0032] Figure 1 The system architecture of the processing method and device for implementing load balancing according to the embodiment of the present disclosure is schematically shown. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0033] like Figure 1 As shown, the system architecture 100 includes a load balancer 101 and a service device cluster, and the service device cluster includes multiple service devices (such as service devices 102-10N). Service devices 102-10N are used to process service requests from user terminals or computer device terminals. Service devices 102-10N can be different types of devices, such as streaming media servers, Web servers, FTP servers, or other task servers. The load balancer 101 is used to evenly distribute the load generated by concurrent service requests to the service devices 102-10N in the service device cluster, and it can support the scheduling of service devices of different types and processing capabilities.
[0034] Specifically, when performing a load balancing operation, the load balancer 101 can perform the following operations on any business device in the business device cluster: the load balancer 101 obtains the task configuration information of the business device (such as business device 102) within a preset statistical period, and based on the task configuration information, determines the load feedback period for the business device (business device 102). Then, the load balancer 101 obtains the load quantification information of the business device (business device 102) within the load feedback period, and based on the load quantification information, determines the allocation weight associated with the business device (business device 102), thereby determining the allocation weight associated with each business device (business devices 102~10N), and determining the target business device for processing the business request based on the allocation weight associated with each business device.
[0035] It should be noted that the processing method and device for implementing load balancing in the embodiments of the present disclosure can be used in the financial field, and can also be used in any field other than the financial field. The present disclosure will be described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0036] Figure 2 The flowchart of a method for implementing load balancing according to an embodiment of the present disclosure is schematically shown. The method 200 can be executed by a load balancer. The load balancer can perform the following operations on any service device in the service device cluster, such as: Figure 2 As shown, method 200 may include operations S210 to S240.
[0037] In operation S210, task configuration information of a service device within a preset statistical period is obtained.
[0038] In this embodiment, specifically, the service device is used to process service requests originating from a user end or a computer device end. Service requests originating from a user end may include, for example, login requests, access requests, communication connection requests, service processing requests, etc. Service requests originating from a computer device end may specifically be requests automatically generated in the computer device, for example, interface call requests, etc. In different service scenarios, the types and sources of service requests may be different, and this application does not limit this.
[0039] The business device performs business processing based on the assigned business request and the preset processing logic corresponding to the business request. Business devices may include different types of devices, such as streaming media servers, Web servers, FTP servers, application servers and other servers of different task types. Business devices may be physical servers or virtual servers, and this application does not impose any restrictions on this. Among them, different business devices can directly support the scheduling and deployment of the load balancer, and can also realize information transmission with the load balancer through the device manager.
[0040] For any service device in the service device cluster, the load balancer obtains the task configuration information of the service device within a preset statistical period. The statistical period size can remain unchanged. For example, the statistical period Tlinks=1s. The task configuration information of each service device within the statistical period is obtained. The task configuration information can specifically include the number of service requests assigned to the service device, the task priority, the task running status, and other information. The way to obtain the task configuration information can include directly requesting the service device, obtaining it from the device manager, obtaining it by accessing the database server, obtaining it from its own task allocation module, etc.
[0041] Next, in operation S220, a load feedback cycle for the service device is determined based on the task configuration information.
[0042] In this embodiment, specifically, after the load feedback initialization cycle for the service device is manually predefined, it is determined whether the load feedback cycle associated with the service device needs to be updated according to the task configuration information of the service device in each statistical cycle. Exemplarily, when the task configuration information indicates that the number of service requests allocated to the service device in the corresponding statistical cycle is too high or the change in the number of allocated task requests is large, the frequency of obtaining the load status of the service device is changed by updating the load feedback cycle in real time.
[0043] Next, in operation S230, load quantification information of the service device in the load feedback cycle is obtained.
[0044] In this embodiment, specifically, for any service device in the service device cluster, according to the latest load feedback cycle associated with the service device, when the timer reaches the load feedback cycle, a request is made to obtain the load quantification information of the service device. Specifically, the load quantification information can be directly requested from the service device, or the load quantification information of the service device can be requested from the device manager. The load quantification information can be characterized by one or more load performance indicators, and the load performance indicators can include, for example, CPU utilization, memory utilization, network bandwidth occupancy, number of virtual rooms, number of accessible users, etc. The load quantification information indicates the load degree and available resource information of the service device. In practical applications, the available resource information of the service device can be measured separately by a load performance indicator, or the available resource information of the service device can be comprehensively evaluated by multiple load performance indicators.
[0045] Next, in operation S240, allocation weights associated with service devices are determined based on the load quantification information, so as to determine a target service device for processing a service request according to the allocation weights associated with each service device.
[0046] In this embodiment, specifically, the load quantification information indicates the load degree and available resource information of the service device. The available resources correspond to the load capacity of the service device. The more available resources are, the more service requests the service device can carry. Therefore, the allocation weight associated with the service device can be determined based on the load quantification information. Since the load quantification information is obtained based on the dynamically updated load feedback cycle, the allocation weight for the service device is determined based on the load quantification information, which is conducive to automatically adjusting the allocation weight for the service device according to the load situation in a timely manner when an emergency causes the service device to be overloaded or irregular in load, and can well avoid the situation where the service device is overloaded or even downtime due to untimely feedback of the load situation.
[0047] Through the disclosed embodiment, the task configuration information of the business device within the preset statistical period is obtained; based on the task configuration information, the load feedback period for the business device is determined; the load quantification information of the business device within the load feedback period is obtained; based on the load quantification information, the allocation weight associated with the business device is determined, so as to achieve the determination of the target business device for processing the business request according to the allocation weight associated with each business device. By obtaining the task configuration information of the business device within the statistical period, the load feedback period for the business device is dynamically adjusted based on the task configuration information. Dynamically adjusting the load feedback period for the business device according to the task configuration information is beneficial to improving the timeliness of the feedback of the load situation of the business device, and can effectively avoid the phenomenon of cluster load tilt caused by uneven distribution of business requests, and can effectively avoid the situation that the load pressure of the business device is too large or even downtime caused by poor real-time load feedback, which is beneficial to optimizing the load balancing effect and improving the cluster resource utilization; on the other hand, according to the periodically obtained task configuration information, it is determined whether it is necessary to adjust the load feedback period for the business device, which is beneficial to effectively control the number and frequency of load update calculations on the basis of achieving load balancing, improve the effectiveness of load balancing operations, and improve the efficiency of cluster load balancing.
[0048] Figure 3 The flowchart of another method for implementing load balancing according to an embodiment of the present disclosure is schematically shown. The method 300 can be executed by a load balancer. The load balancer can perform the following operations on any service device in the service device cluster, such as: Figure 3 As shown, method 300 may include operations S310 to S320 , S230 , and S240 .
[0049] In operation S310, the number of service requests allocated to the service device within a statistical period is obtained.
[0050] In this embodiment, specifically, the number of service requests allocated to the service device in the statistical period is obtained, and the number of service requests reflects the load increase of the service device in the statistical period. When the load of the service device increases too much in the statistical period, it is necessary to perform more detailed load measurement for the service device to avoid the situation where the service device is overloaded due to untimely load feedback.
[0051] Next, in operation S320, a load feedback cycle for the service device is determined according to a change in the number of service requests allocated to the service device within a statistical period and a preset corresponding relationship between the change and the load feedback cycle.
[0052] In this embodiment, specifically, the preset corresponding relationship includes a negative correlation between the change amount and the load feedback cycle. The larger the change amount of the number of business requests, the smaller the load feedback cycle for the business device, and the higher the frequency of obtaining the load quantification information of the business device. In practical applications, the number of business requests allocated to the business device in each statistical period is obtained. For example, the number of new login requests accessed by the Web server in every 1s is obtained. Based on the change amount of the number of business requests, it is determined whether the load feedback cycle for the business device needs to be updated. Specifically, according to the interval in which the change amount is located, and according to the preset corresponding relationship between the change amount and the load feedback cycle, the load feedback cycle corresponding to the change amount is determined. In general, the more frequent the load change of the business device in the statistical period, the higher the frequency of load information feedback for the business device, and the smaller the load feedback cycle associated with the business device. Therefore, when there is an emergency that causes the business device to operate beyond the routine or irregularly, the load feedback cycle for the business device can be automatically adjusted according to the load change of the current business device.
[0053] Next, in operation S230, load quantization information of the service device within the load feedback cycle is obtained.
[0054] In this embodiment, specifically, since the load feedback cycle for the service device may be dynamically updated, based on the latest load feedback cycle associated with the service device, when the timer reaches the load feedback cycle, a request is made to obtain the load quantification information of the service device. The load quantification information indicates the load degree and available resource information of the service device, and the available resource information indicates the number of service requests that the service device can still load. The more available resources, the more service requests that the service device can still load. The load performance indicators used to measure the available resource information may include, for example, CPU utilization, memory utilization, network bandwidth occupancy, number of virtual rooms, number of accessible users, user data flow bandwidth characteristics, etc.
[0055] Next, in operation S240, allocation weights associated with service devices are determined based on the load quantification information, so as to determine a target service device for processing a service request according to the allocation weights associated with each service device.
[0056] In this embodiment, specifically, based on the load quantification information, the allocation weight associated with the business device is determined, including: calculating the available capacity of the business device according to the configuration capacity of the business device and the load quantification information; dividing the business device into appropriate business device subsets based on the available capacity, wherein the business device subsets are obtained by dividing according to the available capacity of each business device in the business device cluster; using the comparison value of the total available capacity of each business device in the business device subset and the total available capacity of each business device in the business device cluster as the subset weight for the business device subset; using the subset weight for the business device subset as the allocation weight associated with the business device.
[0057] Based on the dynamically updated load feedback cycle, the load quantification information of the business equipment in the load feedback cycle is obtained. According to the latest acquired load quantification information, combined with the configuration capacity of the business equipment, the available capacity of the business equipment in the current load feedback cycle is calculated (that is, the load level of the business equipment in the current load feedback cycle is calculated), and then the business equipment subset to which the business equipment belongs is determined based on the available capacity. Among them, the business equipment subset is obtained according to the preset group division rules, for example, multiple business equipment whose available capacity difference is less than the preset threshold value are divided into the same business equipment subset. Exemplarily, based on the preset group division rules, according to the available capacity size, the business equipment cluster is divided into 3 business equipment subsets of large capacity, medium capacity and small capacity, or according to the load level relative to the available capacity size, the business equipment cluster is divided into 3 business equipment subsets of high load, normal load and low load.
[0058] After determining the service equipment subset to which the service equipment belongs, the comparison value of the total available capacity of each service equipment in the service equipment subset and the total available capacity of each service equipment in the service equipment cluster is used as the subset weight for the service equipment subset. Then, the subset weight for the service equipment subset is used as the allocation weight associated with the service equipment, that is, different service equipment in the same service equipment subset is considered to have the same allocation weight. Among them, the comparison value of the total available capacity of the service equipment subset and the total available capacity of the service equipment cluster can be the ratio of the two or the difference between the two, which is not limited in this application. The larger the value of the subset weight, the more available resources there are in the service equipment subset, the smaller the current load level of the service equipment subset, and the stronger its load capacity in the current time.
[0059] For the same business device, when its load quantification information is different in different load feedback cycles, it may be divided into different business device subsets. Similarly, for the same business device subset, the business devices it is divided into may be continuously updated, and the total available capacity of each business device in the business device subset may also be continuously updated. Therefore, the subset weights for the same business device subset may change, and the allocation weights for the same business device may also be continuously updated. According to the allocation weights of the business devices, the corresponding number of business requests are allocated to the corresponding business device subsets, achieving load balance between different business device subsets, which can effectively avoid the possibility of overload of business equipment due to uneven distribution of business requests, affecting the efficiency of business request processing and even downtime.
[0060] Figure 4 A flowchart of another method for implementing load balancing according to an embodiment of the present disclosure is schematically shown. Figure 4 As shown, method 400 may include operations A1-A8, B1-B5 and C1-C4, and the load balancer includes a load information collection module, a load feedback cycle update module, a service device classification module, a task allocation module and a load migration module.
[0061] The load information collection module is used to obtain the number of service requests allocated to the service equipment within the statistical period based on a preset statistical period, and to obtain the load quantification information of the service equipment within the corresponding load feedback period based on a dynamically updated load feedback period.
[0062] The load feedback cycle updating module is used to dynamically update the load feedback cycle T and the corresponding timer according to the change in the number of service requests allocated to the service device within the statistical period.
[0063] The service equipment classification module is used to update the classification to which the service equipment belongs according to the acquired load quantification information, and determine a service equipment subset that matches the service equipment.
[0064] The task allocation module is used to select the target service device for processing the service request according to the classification result of the service device. Specifically, according to the subset division result of the service device cluster, the target service device subset for processing the service request is determined, and then the target service device for processing the service request is determined in the target service device subset based on methods such as polling screening algorithm, random screening algorithm, maximum available capacity screening algorithm, etc.
[0065] The load migration module is used to randomly forward the service requests allocated to the overloaded service device to the low-loaded service device when the service device is overloaded.
[0066] Specifically, in method 400,
[0067] A1~A8: Processing process for business requests
[0068] After the user initiates a service request (or the computer device initiates a service request), the load balancer obtains the service request and places it in a globally unique task request queue, so that the load balancer can sequentially assign service device cluster nodes to the tasks in the task request queue. After the task is assigned, the load balancer forwards the service request to the assigned cluster node for processing, and maintains information exchange during the task execution until the task is processed.
[0069] B1-B5: Process of dynamically updating the load feedback period T and the category to which the service equipment belongs
[0070] The load balancer obtains the task configuration information of each service device within the statistical period, and determines whether to update the load feedback period T associated with each service device based on the task configuration information, so as to dynamically modify the load feedback period T of the service device.
[0071] When the timer of the load feedback cycle T of the service device expires, the load balancer requests to obtain the load quantification information of the service device, and then updates the classification of the service device according to the load quantification information returned by the service device, so as to improve the accuracy of cluster system load balancing.
[0072] C1~C4: Load migration process
[0073] Based on the load quantification information, it is determined whether the current load of the service device is overloaded. If so, some tasks on the service device are migrated to low-load service devices. Specifically, based on the load quantification information, it is determined whether the load quantification value of the service device exceeds a first preset threshold. If so, the service requests to be balanced are randomly selected from the service requests allocated to the service device, and the service requests to be balanced are allocated to the service devices whose load quantification values are lower than a second preset threshold.
[0074] Figure 5 A block diagram schematically shows a processing device for implementing load balancing according to an embodiment of the present disclosure.
[0075] like Figure 5As shown, the apparatus 500 includes a first acquisition module 501, a first processing module 502, a second acquisition module 503, a second processing module 504 and a third processing module 505. For any service device in the service device cluster, the first acquisition module 501 is used to acquire the task configuration information of the service device within a preset statistical period; the first processing module 502 determines the load feedback period for the service device based on the task configuration information; the second acquisition module 503 acquires the load quantification information of the service device within the load feedback period; the second processing module 504 determines the allocation weight associated with the service device based on the load quantification information; and the third processing module 505 is used to determine the target service device for processing the service request according to the allocation weight associated with each service device.
[0076] Through the disclosed embodiment, the task configuration information of the business device within the preset statistical period is obtained; based on the task configuration information, the load feedback period for the business device is determined; the load quantification information of the business device within the load feedback period is obtained; based on the load quantification information, the allocation weight associated with the business device is determined, so as to achieve the determination of the target business device for processing the business request according to the allocation weight associated with each business device. By obtaining the task configuration information of the business device within the statistical period, the load feedback period for the business device is dynamically adjusted based on the task configuration information. Dynamically adjusting the load feedback period for the business device according to the task configuration information is beneficial to improving the timeliness of the feedback of the load situation of the business device, and can effectively avoid the phenomenon of cluster load tilt caused by uneven distribution of business requests, and can effectively avoid the situation that the load pressure of the business device is too large or even downtime caused by poor real-time load feedback, which is beneficial to optimizing the load balancing effect and improving the cluster resource utilization; on the other hand, according to the periodically obtained task configuration information, it is determined whether it is necessary to adjust the load feedback period for the business device, which is beneficial to effectively control the number and frequency of load update calculations on the basis of achieving load balancing, improve the effectiveness of load balancing operations, and improve the efficiency of cluster load balancing.
[0077] As a feasible embodiment, the first acquisition module includes: a first acquisition sub-module, used to obtain the number of business requests allocated to the business device during the statistical period; the first processing module includes: a first processing sub-module, used to determine the load feedback cycle for the business device based on the change in the number of business requests allocated to the business device during the statistical period, and based on a preset correspondence between the change and the load feedback cycle.
[0078] As a feasible embodiment, the preset corresponding relationship includes that the change amount is negatively correlated with the load feedback period.
[0079] As a feasible embodiment, the second acquisition module includes: a second acquisition submodule, which is used to request to acquire the load quantification information of the service device according to the latest load feedback cycle for the service device when the timer reaches the load feedback cycle.
[0080] As a feasible embodiment, the second processing module includes: a second processing sub-module, used to calculate the available capacity of the business equipment according to the configuration capacity and load quantification information of the business equipment; a third processing sub-module, used to divide the business equipment into appropriate business equipment subsets based on the available capacity, wherein the business equipment subsets are obtained by dividing according to the available capacity of each business equipment in the business equipment cluster; a fourth processing sub-module, used to use the comparison value of the total available capacity of each business equipment in the business equipment subset and the total available capacity of each business equipment in the business equipment cluster as the subset weight for the business equipment subset; and a fifth processing sub-module, used to use the subset weight for the business equipment subset as the allocation weight associated with the business equipment.
[0081] As a feasible embodiment, the load quantification information includes at least one of CPU utilization, memory utilization, and network bandwidth occupancy.
[0082] It should be noted that in the embodiments of the present disclosure, the implementation of the device part is the same as or similar to the implementation of the method part, and will not be repeated here.
[0083] According to any one or more of the modules of the embodiments of the present disclosure, or at least part of the functions of any one of them, can be implemented in one module. According to any one or more of the modules of the embodiments of the present disclosure, it can be split into multiple modules for implementation. According to any one or more of the modules of the embodiments of the present disclosure, it can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware of any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Or according to one or more of the modules of the embodiments of the present disclosure, it can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be performed.
[0084] For example, any multiple of the first acquisition module 501, the first processing module 502, the second acquisition module 503, the second processing module 504, and the third processing module 505 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the first acquisition module 501, the first processing module 502, the second acquisition module 503, the second processing module 504, and the third processing module 505 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware, and firmware, or by a suitable combination of any of them. At least one of the first acquisition module 501 , the first processing module 502 , the second acquisition module 503 , the second processing module 504 and the third processing module 505 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be executed.
[0085] Figure 6 A block diagram of an electronic device 600 suitable for implementing the processing method and processing device according to an embodiment of the present disclosure is schematically shown. Figure 6 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0086] like Figure 6 As shown, the electronic device 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0087] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in one or more memories.
[0088] According to an embodiment of the present disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.
[0089] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0090] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0091] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 602 and / or RAM 603 described above and / or one or more memories other than ROM 602 and RAM 603.
[0092] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains a program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the method for detecting file upload vulnerabilities provided by the embodiment of the present disclosure.
[0093] When the computer program is executed by the processor 601, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0094] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0095] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0096] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0097] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Without departing from the scope of the present disclosure, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A method for implementing load balancing, comprising: Perform the following operations on any service device in the service device cluster: Acquiring task configuration information of the service device within a preset statistical period, wherein the acquiring task configuration information of the service device within a preset statistical period comprises: acquiring the number of service requests allocated to the service device within the statistical period; Determine the load feedback cycle for the service device based on the task configuration information, wherein the load feedback cycle for the service device based on the task configuration information includes: determining the load feedback cycle for the service device according to the change in the number of service requests allocated to the service device within the statistical period, and according to a preset correspondence between the change and the load feedback cycle, wherein the preset correspondence includes: a preset correspondence between the interval in which the change is located and the load feedback cycle; Acquiring load quantification information of the service equipment within the load feedback cycle; Based on the load quantification information, the allocation weight associated with the service device is determined, so as to determine the target service device for processing the service request according to the allocation weight associated with each service device.
2. The method according to claim 1, wherein: The preset corresponding relationship includes that the change amount is negatively correlated with the load feedback period.
3. The method according to claim 1, wherein: The acquiring load quantification information of the service device in the load feedback cycle includes: According to the latest load feedback cycle for the service device, when the timer reaches the load feedback cycle, a request is made to obtain the load quantization information of the service device.
4. The method according to claim 1, wherein: The determining, based on the load quantification information, an allocation weight associated with the service device includes: Calculating the available capacity of the service device according to the configured capacity of the service device and the load quantification information; Based on the available capacity, the service devices are divided into appropriate service device subsets, wherein the service device subsets are obtained by dividing according to the available capacity of each service device in the service device cluster; Using a comparison value of the total available capacity of each service device in the service device subset and the total available capacity of each service device in the service device cluster as a subset weight for the service device subset; and The subset weight for the service device subset is used as the allocation weight associated with the service device.
5. The method according to claim 4, wherein: The load quantification information includes at least one of CPU utilization, memory utilization, and network bandwidth occupancy.
6. The method according to any one of claims 1 to 5, further comprising: Based on the load quantization information, determining whether the load quantization value of the service device exceeds a first preset threshold; as well as If yes, randomly select a service request to be balanced from the service requests allocated to the service device; The service requests to be balanced are allocated to service devices whose load quantization values are lower than a second preset threshold.
7. A processing device for implementing load balancing, used to perform the following operations on any service device in a service device cluster, the device comprising: A first acquisition module is used to acquire task configuration information of the service device within a preset statistical period, wherein acquiring the task configuration information of the service device within the preset statistical period includes: acquiring the number of service requests allocated to the service device within the statistical period; A first processing module is used to determine a load feedback period for the service device based on the task configuration information, wherein the determining the load feedback period for the service device based on the task configuration information comprises: determining the load feedback period for the service device according to a change in the number of service requests allocated to the service device within the statistical period, and according to a preset correspondence between the change and the load feedback period, wherein the preset correspondence comprises: a preset correspondence between an interval in which the change is located and the load feedback period; A second acquisition module is used to obtain load quantification information of the service equipment within the load feedback period; A second processing module, configured to determine an allocation weight associated with the service device based on the load quantification information; and The third processing module is used to determine the target service device for processing the service request according to the allocation weight associated with each of the service devices.
8. An electronic device comprising: one or more processors; as well as a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for realizing load balancing
CN103582015A
Business request allocation method and device, computer equipment and storage medium
CN112131006A
Resource scheduling method and system for edge computing
CN112433846A