A dynamic load method and system based on data weights

CN115269141BActive Publication Date: 2026-08-14SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-08
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

对于应用,目前的负载均衡通常是在机器的IP层面上进行负载,这种方式无法了解机器以及应用的资源情况,无法很好的对机器及应用的资源充分利用或者对于应用的处理更好的平衡,从而无法更好的服务

Benefits of technology

[0028]本发明的有益效果为:通过使用该模式的计算的负载,能够更好的利用机器以及服务资源,从而实现更高更好的服务,主要体现在以下几个方面:1.数据的准确性:通过使用当前资源数据以及一段时间的资源数据来计算当前数据,一方面能够通过一段时间的应用数据来反应资源的消耗情况和应用响应的变化量,另一方面通过使用当前数据来反应当前资源的响应情况。能够准确表现资源的使用及有效的负载;2.负载的实时性:结合了当前时间的资源数据,能够实时的反应当前应用的响应及资源情况。除此之外还结合一段时间内的数据,对于未来资源的变化情况具有一定的评估计算;3.数据的多维度:能够通过使用多方面的资源数据进行负载计算,例如:机器的基本资源数据(CPU、IO、内存、磁盘、文件句柄、链接数等),应用的基本资源数据(请求量、JAVA的JVM数据、数据库链接数等),应用本身的限制数据(限流数、容错率等)4.资源的利用率:能够对应用利用有限的资源提供的服务进行评估,从而增加应用实例或停止不必要的应用实例,进而释放有限的资源。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269141B_ABST
    Figure CN115269141B_ABST
Patent Text Reader

Abstract

This invention discloses a dynamic load balancing method and system based on data weights, belonging to the field of load balancing technology. The specific steps of the method are as follows: First, application information is registered with the computing system using heartbeat detection; then, during application registration, machine resource information and the application's own resource information are sent to the computing system; finally, the load data required by the application is calculated based on the resource information, and load adjustment is performed. This invention can reflect resource consumption and application response changes through application data over a period of time, and reflect the current resource response status using current data; it can accurately represent resource usage and effective load; it has a certain assessment calculation for future resource changes; it can perform load calculation using multiple aspects of resource data; it can evaluate services, thereby adjusting applications and releasing limited resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention discloses a dynamic load balancing method and system based on data weights, relating to the field of load balancing technology. Background Technology

[0002] Currently, load balancing technology is divided into two parts: hardware load balancing and software load balancing. This invention focuses on software load balancing. Software load balancing is further divided into two parts: static load balancing and dynamic load balancing. Static load balancing refers to applications writing load data into their programs and applying load balancing algorithms, such as Nginx. Dynamic load balancing refers to applications dynamically adjusting load data, adding or removing load balancing machines based on the application's ability to provide service, such as Ribbon. For applications, current load balancing typically operates at the machine's IP level. This approach cannot assess the resource status of machines and applications, failing to fully utilize resources effectively or balance application processing, thus hindering better service delivery.

[0003] Therefore, a dynamic load method and system based on data weights are invented to solve the above problems. Summary of the Invention

[0004] This invention addresses the problems of existing technologies by providing a dynamic load balancing method and system based on data weights. The technical solution adopted is as follows: a dynamic load balancing method based on data weights, the specific steps of which are as follows:

[0005] First, the application information is registered with the computing system using heartbeat detection. Then, during application registration, the machine's resource information and the application's own resource information are sent to the computing system. Finally, the load data required by the application is calculated based on the resource information, and the load is adjusted accordingly.

[0006] The specific steps for calculating the load data required by the application based on resource information and adjusting the load are as follows:

[0007] S1 stores the application's service registration and current data in the computing module using a hash data structure;

[0008] Before the calculation, S2 can calculate the resources and resource ratios involved in the application's calculation based on the specific actual situation, and update the obtained data periodically.

[0009] S3 reconstructs polling data based on the load weight of data exchange, evaluates the services provided using current resources, and adjusts the load by adding or stopping unnecessary application instances.

[0010] The specific steps of S2 are as follows:

[0011] S201 uses current data to calculate the load weight data at the current time point, reflecting the responsiveness of the current resources and displaying the resource utilization and effective load;

[0012] S202 obtains application data over a period of time by periodically updating the data, reflecting the changes in resource consumption and application response.

[0013] The specific steps of S3 are as follows:

[0014] S301 combines data over a period of time to assess and calculate the trend of resource changes;

[0015] The resource data used by S302 for load calculation includes the machine's basic resource data, the application's basic resource data, and the application's own limitation data.

[0016] A dynamic load balancing system based on data weights, characterized in that the system specifically includes a storage module, a computing module, and an adjustment module:

[0017] Storage module: The application creates service registration and stores current data in the calculation module using a hash data structure;

[0018] Calculation module: Before calculation, it can calculate the resources and resource ratios for the application to participate in the calculation based on the specific actual situation, and update the obtained data periodically;

[0019] Adjustment module: Reconstructs polling data based on the load weight of data exchange, evaluates the services provided using current resources, and adjusts the load by adding or stopping unnecessary application instances.

[0020] The calculation module specifically includes a point-in-time data module and a time-period data module:

[0021] Time-point data module: Calculates the load weight data for the current time point using current data, reflecting the responsiveness of the current resources, and displays the resource utilization and effective load;

[0022] Time Period Data Module: By updating data periodically, application data over a certain period of time is obtained, reflecting changes in resource consumption and application response.

[0023] The adjustment module specifically includes a trend assessment module and a resource data module:

[0024] Trend assessment module: By combining data over a period of time, it can assess and calculate the trend of resource changes;

[0025] Resource Data Module: The resource data used for load calculation includes the machine's basic resource data, the application's basic resource data, and the application's own limitation data.

[0026] A dynamic load device based on data weights, characterized in that it includes a memory and a processor; the memory is used to store computer programs;

[0027] The processor is configured to implement the data weight-based dynamic load method as described in any one of claims 1 to 4 when executing the computer program.

[0028] The beneficial effects of this invention are as follows: By using the computational load of this mode, machine and service resources can be better utilized, thereby achieving higher and better service. This is mainly reflected in the following aspects: 1. Data accuracy: By using current resource data and resource data over a period of time to calculate current data, on the one hand, the application data over a period of time can reflect the resource consumption and changes in application response; on the other hand, the current data can reflect the current resource response. This accurately represents resource usage and effective load. 2. Load real-time performance: Combining current time resource data, it can reflect the current application response and resource status in real time. In addition, combining data over a period of time allows for a certain assessment and calculation of future resource changes. 3. Multi-dimensional data: Load calculation can be performed using various aspects of resource data, such as: basic machine resource data (CPU, IO, memory, disk, file handles, number of connections, etc.), basic application resource data (request volume, JAVA JVM data, number of database connections, etc.), and application's own limitation data (rate limits, fault tolerance, etc.). 4. Resource utilization: It can evaluate the service provided by the application using limited resources, thereby increasing application instances or stopping unnecessary application instances, and thus releasing limited resources. Attached Figure Description

[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0030] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0031] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.

[0032] Example 1:

[0033] A dynamic load balancing method based on data weights, the specific steps of which are as follows:

[0034] First, application information is registered with the computing system using heartbeat detection. Then, during application registration, the machine's resource information and the application's own resource information are sent to the computing system. Finally, the load data required by the application is calculated based on the resource information, and load adjustments are made.

[0035] Furthermore, the specific steps for calculating the load data required by the application through resource information and adjusting the load are as follows:

[0036] S1 stores the application's service registration and current data in the computing module using a hash data structure;

[0037] Before the calculation, S2 can calculate the resources and resource ratios involved in the application's calculation based on the specific actual situation, and update the obtained data periodically.

[0038] S3 reconstructs the polling data based on the load weight of the data exchange, evaluates the services provided using the current resources, and thus adjusts the load by adding or stopping unnecessary application instances.

[0039] Step 1. Let the resources involved in the application calculation be Xi, and the resource usage percentage be Ki, where {i|i∈N}. Xi and Ki can be calculated based on the specific actual situation before the calculation.

[0040] Let f(x) be the matrix composed of resources Xi within T seconds, then:

[0041]

[0042] Let g(x) be the matrix formed by Ki, then:

[0043] Let the verification matrix be p(x), where XT is the current time. p(x) is used to determine if any resource of the current application has reached a critical value. If Xi = 1, it indicates that the critical value has been reached. Then:

[0044]

[0045] The result obtained from the data is R = f(x) * g(x).

[0046] Set q(t) = R, default value K, and growth rate V. If this is the first calculation, set the default value K for all values ​​within T except the current time.

[0047] Calculate the load weight data at the current time point:

[0048] If p(x) contains 1 and R is in ascending order after being sorted by time point, then select the load data at the time point with the second largest value in R.

[0049] If there is no increasing trend when sorting by time points in R, then choose AVG = |q(t)| / T.

[0050] If all values ​​in p(x) are less than 1 and R is increasing after being sorted by time points, and the average value AVG = |q(t)| / T, then:

[0051] Load data

[0052] Step 2. Using the calculation method from Step 1 above, assume that the application's basic information is updated to the calculation module every second. This data includes the application's supported request volume / second (qt), total application memory size (mt), current request volume / second (qu), current application memory usage (mu), application CPU usage (cu), application request waiting queue size (qut), waiting queue usage size (quu), and service status, etc. The calculations are as follows:

[0053] Let T = 9, i = 5, the matrix of each indicator be f(x), a0-e0 be the indicators at the current time, the verification matrix be p(x), and the percentage of each indicator be g(x).

[0054] Obtain the data for the indicator a0-e0:

[0055] a0=mu / mt*100b0=cu / ct*100d0=qu / qt*100e=quu / qut*100

[0056] Obtain the indicator matrix:

[0057] Result set: R = f(x) * g(x)

[0058] If p(x) contains 1 and R is in ascending order after being sorted by time point, then select the load data at the time point with the second largest value in R.

[0059] If there is no increasing trend when sorting by time points in R, then choose AVG = |q(t)| / T.

[0060] If all values ​​in p(x) are less than 1, let the load data at time points a1-a9 be q(x), the initial load value K = 1, and the number of load data points T = 9.

[0061]

[0062] Average value: AVG = |q(x)| / T

[0063] Load data

[0064] Step 3. Make corresponding load adjustments based on the load data, using weighted round-robin to call the application. The specific adjustments are as follows:

[0065] 1. Round the load data up to the nearest integer, denoted as W;

[0066] 2. Readjust the load weight corresponding to this load data and set it to W;

[0067] 3. Reconstruct the polling data based on the load weight of the data exchange;

[0068] Furthermore, the specific steps of S2 are as follows:

[0069] S201 uses current data to calculate the load weight data at the current time point, reflecting the responsiveness of the current resources and displaying the resource utilization and effective load;

[0070] S202 obtains application data over a period of time by periodically updating the data, reflecting the changes in resource consumption and application response.

[0071] Furthermore, the specific steps of S3 are as follows:

[0072] S301 combines data over a period of time to assess and calculate the trend of resource changes;

[0073] The resource data used by S302 for load calculation includes the machine's basic resource data, the application's basic resource data, and the application's own limitation data.

[0074] Example 2:

[0075] A dynamic load balancing system based on data weights, characterized in that the system specifically includes a storage module, a computing module, and an adjustment module:

[0076] Storage module: The application creates service registration and stores current data in the calculation module using a hash data structure;

[0077] Calculation module: Before calculation, it can calculate the resources and resource ratios for the application to participate in the calculation based on the specific actual situation, and update the obtained data periodically;

[0078] Adjustment module: Reconstructs polling data based on the load weight of data exchange, evaluates the services provided using current resources, and adjusts the load by adding or stopping unnecessary application instances.

[0079] The calculation module specifically includes a point-in-time data module and a time-period data module:

[0080] Time-point data module: Calculates the load weight data for the current time point using current data, reflecting the responsiveness of the current resources, and displays the resource utilization and effective load;

[0081] Time Period Data Module: By updating data periodically, application data over a period of time is obtained, reflecting changes in resource consumption and application response.

[0082] The adjustment module specifically includes a trend assessment module and a resource data module:

[0083] Trend assessment module: By combining data over a period of time, it can assess and calculate the trend of resource changes;

[0084] Resource data module: The resource data used for load calculation includes the machine's basic resource data, the application's basic resource data, and the application's own limitation data;

[0085] A dynamic load device based on data weights, characterized in that it includes a memory and a processor;

[0086] The memory is used to store computer programs;

[0087] The processor is configured to implement the data weight-based dynamic load method as described in any one of claims 2 to 4 when executing the computer program;

[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A dynamic load balancing method based on data weights, characterized by: The specific steps of the method are as follows: First, application information is registered with the computing system using heartbeat detection. Then, during application registration, the machine's resource information and the application's own resource information are sent to the computing system. Finally, the load data required by the application is calculated based on the resource information, and load adjustments are made. The specific steps for calculating the load data required by the application based on resource information and adjusting the load are as follows: S1 stores the application's service registration and current data in the computing module using a hash data structure; Before the calculation, S2 can calculate the resources and resource ratios involved in the application's calculation based on the specific actual situation, and update the obtained data periodically. S3 reconstructs the polling data based on the load weight of the data exchange, evaluates the services provided using the current resources, and thus adjusts the load by adding or stopping unnecessary application instances. The specific steps of S2 are as follows: S201 uses current data to calculate the load weight data at the current time point, reflecting the responsiveness of the current resources and displaying the resource utilization and effective load; S202 obtains application data over a period of time by periodically updating the data, reflecting the changes in resource consumption and application response. The specific steps of S3 are as follows: S301 combines data over a period of time to assess and calculate the trend of resource changes; The resource data used by S302 for load calculation includes the machine's basic resource data, the application's basic resource data, and the application's own limitation data.

2. A dynamic load system based on data weights, characterized in that: The system specifically includes a storage module, a computing module, and an adjustment module: Storage module: The application creates service registration and stores current data in the calculation module using a hash data structure; Calculation module: Before calculation, it can calculate the resources and resource ratios for the application to participate in the calculation based on the specific actual situation, and update the obtained data periodically; Adjustment module: Reconstructs polling data based on the load weight of data exchange, evaluates the services provided using current resources, and adjusts the load by adding or stopping unnecessary application instances. The calculation module specifically includes a point-in-time data module and a time-period data module: Time-point data module: Calculates the load weight data for the current time point using current data, reflecting the responsiveness of the current resources, and displays the resource utilization and effective load; Time Period Data Module: By updating data periodically, application data over a period of time is obtained, reflecting changes in resource consumption and application response. The adjustment module specifically includes a trend assessment module and a resource data module: Trend assessment module: By combining data over a period of time, it can assess and calculate the trend of resource changes; Resource Data Module: The resource data used for load calculation includes the machine's basic resource data, the application's basic resource data, and the application's own limitation data.

3. A dynamic load device based on data weights, characterized in that, Including memory and processor: The memory is used to store computer programs; The processor is configured to implement the data weight-based dynamic load method as described in claim 1 when executing the computer program.

Citation Information

Patent Citations

  • Yarn architecture-based virtual machine scheduling system

    CN105404549A