Load balancing optimization method and device, electronic equipment and readable storage medium

By building a target business model and combining the real-time load data of the cloud server, optimizing cloud resource configuration and request allocation, the problem of poor load balancing effect in cloud scenarios is solved, and more efficient resource utilization and load balancing are achieved.

CN118939414APending Publication Date: 2024-11-12GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 0 Cites 8 Cited by

Patent Information

Application Number
CN202410933741.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The resource load balancing effect in cloud scenarios is poor, making it difficult to achieve efficient and stable operation in dynamically changing user visits and complex application architectures.

Method used

By obtaining the business history data of the target business, building the target business model, determining the load optimization strategy based on the load status output by the model and the real-time load data of the cloud server, adjusting cloud resources and allocating business requests to achieve load balancing.

Benefits of technology

It improves the load balancing effect, improves the rationality of resource utilization and request allocation, meets the load needs of different business scenarios, and enhances the stability and availability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939414A_ABST
    Figure CN118939414A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a load balancing optimization method and device, electronic equipment and a readable storage medium, and the method comprises the steps: obtaining business historical data of a target business under the condition that a business request for the target business is received; taking the service request and the service historical data as input of a target service model, and obtaining a target load state corresponding to a target service output by the target service model; determining a load optimization strategy for the target service based on the target load state and the real-time load data of the cloud server; the load optimization strategy is used for carrying out resource adjustment on cloud resources related to the target service and indicating to allocate the service request to the target cloud server. Therefore, reasonable distribution of the service requests is realized, load balance among the cloud servers is adjusted, load requirements of different service scenes are met, the load balance effect is improved, and meanwhile, the resource utilization rate and the request distribution reasonability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer technology, and in particular relates to a load balancing optimization method, device, electronic device and readable storage medium. Background Art

[0002] With the rapid development of cloud computing technology, load balancing technology for cloud scenarios has become a key link in ensuring the efficient and stable operation of large-scale applications. In the cloud computing environment, facing the dynamically changing user access volume, resource requirements and complex application architecture, load balancing technology effectively solves the problems of high concurrency, low latency and reasonable resource allocation through intelligent distribution of network traffic, optimization of resource utilization, automatic expansion and contraction, etc.

[0003] In the related art, the load balancing effect of the load balancing strategy for resources in the cloud scenario is poor. Therefore, there is an urgent need for an optimization method for resource load balancing in the cloud scenario to improve the load balancing effect. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the present invention provides a load balancing optimization method, device, electronic device and readable storage medium.

[0005] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:

[0006] In a first aspect, the present invention provides a load balancing optimization method, the method comprising:

[0007] When receiving a service request for a target service, obtaining service history data of the target service;

[0008] Taking the service request and the service history data as inputs of a target service model, and obtaining a target load state corresponding to the target service output by the target service model;

[0009] Based on the target load status and the real-time load data of the cloud server, a load optimization strategy for the target business is determined; the load optimization strategy is used to adjust the cloud resources related to the target business and instruct to allocate the business request to the target cloud server.

[0010] Optionally, taking the service request and the service history data as inputs of a target service model, and acquiring a target load state corresponding to the target service output by the target service model includes:

[0011] Inputting the business request and the business history data into a target business model;

[0012] Based on the target business model, feature extraction is performed on the business history data to determine business features;

[0013] Based on the service characteristics and preset classification criteria, a target load state corresponding to the target service is determined.

[0014] Optionally, the determining a load optimization strategy for the target service based on the target load state and real-time load data of the cloud server includes:

[0015] Acquire real-time load data of the server, and determine a current load mode based on the real-time load data;

[0016] The target load state is compared with the real-time load pattern to determine a load optimization strategy for the target business.

[0017] Optionally, the method further comprises:

[0018] Determine a request priority corresponding to the business request based on the request type of the business request, and distribute the business request to a target request queue corresponding to the request priority;

[0019] When a preset processing condition is met, the service requests contained in the target request queue are allocated to the target server indicated by the service load policy.

[0020] Optionally, the target business model is trained in the following manner:

[0021] Obtain sample business data corresponding to at least two businesses;

[0022] For any one of the at least two services, the sample service data and the target service label corresponding to the service are used as inputs of the service model to be trained, and a predicted load state predicted by the service model to be trained is obtained;

[0023] Based on the predicted load state and the target service label, adjusting parameters of the service model to be trained; the target service label is used to characterize the expected load state corresponding to the service;

[0024] When a preset stop condition is met, the to-be-trained business model that has met the preset stop condition is determined as the target business model.

[0025] In a second aspect, the present invention provides a load balancing optimization device, the device comprising:

[0026] A first acquisition module, configured to acquire business history data of a target business upon receiving a business request for the target business;

[0027] A second acquisition module, configured to use the service request and the service history data as inputs of a target service model, and acquire a target load state corresponding to the target service output by the target service model;

[0028] The first determination module is used to determine the load optimization strategy for the target business based on the target load status and the real-time load data of the cloud server; the load optimization strategy is used to adjust the cloud resources related to the target business and instruct to allocate the business request to the target cloud server.

[0029] Optionally, the second acquisition module includes:

[0030] A first input module, used for inputting the business request and the business history data into a target business model;

[0031] A first extraction module, configured to extract features from the business history data based on the target business model to determine business features;

[0032] The first determination submodule is used to determine a target load state corresponding to the target service based on the service characteristics and a preset classification standard.

[0033] Optionally, the first determining module includes:

[0034] A first acquisition submodule, used to acquire real-time load data of the server and determine a current load mode based on the real-time load data;

[0035] The second determination submodule is used to compare the target load state with the real-time load mode to determine a load optimization strategy for the target business.

[0036] Optionally, the device further comprises:

[0037] A second determination module is used to determine a request priority corresponding to the business request based on a request type of the business request, and distribute the business request to a target request queue corresponding to the request priority;

[0038] The first allocation module is used to allocate the service requests contained in the target request queue to the target server indicated by the service load policy when a preset processing condition is met.

[0039] Optionally, the device further comprises:

[0040] A third acquisition module is used to acquire sample business data corresponding to at least two businesses;

[0041] A second input module is used to use the sample service data and the target service label corresponding to the service as inputs of the service model to be trained for any service of the at least two services, and obtain a predicted load state predicted by the service model to be trained;

[0042] A first adjustment module, configured to adjust parameters of the service model to be trained based on the predicted load state and the target service label; the target service label is used to characterize the expected load state corresponding to the service;

[0043] The third determination module is used to determine the to-be-trained business model that meets the preset stop condition as the target business model when the preset stop condition is met.

[0044] In a third aspect, the present invention provides an electronic device comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned load balancing optimization method when executing the program.

[0045] In a fourth aspect, the present invention provides a readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is able to perform the above-mentioned load balancing optimization method.

[0046] In an embodiment of the present invention, when a business request for a target business is received, the business history data of the target business is obtained; the business request and the business history data are used as inputs of the target business model, and the target load state corresponding to the target business output by the target business model is obtained; based on the target load state and the real-time load data of the cloud server, the load optimization strategy for the target business is determined; the load optimization strategy is used to adjust the cloud resources related to the target business, and to indicate that the business request is allocated to the target cloud server. In this way, based on the target business model and the business history data of the target business, the target load state corresponding to the target business is obtained, and the historical operation state of the business can be analyzed automatically by the model to obtain the target load state matching the target business, and then the load optimization strategy for the target business is determined by the target load state and the real-time load data of the cloud server, so as to adjust the cloud resources related to the target business, and indicate that the business request is allocated to the target cloud server, so as to achieve reasonable allocation of business requests and adjust the load balancing between cloud servers, meet the load requirements of different business scenarios, improve the load balancing effect, and improve the resource utilization and the rationality of request allocation. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0048] Figure 1 It is a flow chart of the steps of a load balancing optimization method provided by an embodiment of the present invention;

[0049] Figure 2 is a flowchart of a specific example provided by an embodiment of the present invention;

[0050] Figure 3 is a structural diagram of a load balancing optimization device provided by an embodiment of the present invention;

[0051] Figure 4 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] Figure 1 is a flow chart of the steps of a load balancing optimization method provided by an embodiment of the present invention, such as Figure 1 As shown, the method may include:

[0054] Step 101: upon receiving a service request for a target service, obtaining service history data of the target service.

[0055] In an embodiment of the present invention, when a service request sent for a target service is received, the characterization needs to be processed based on the service request, and the service request needs to be distributed to the target server in the server cluster for processing based on the load balancing rule. Based on the target interface, the service history data related to the target service in the cloud server cluster is obtained. Among them, the target interface can be a parameter acquisition interface of the cloud architecture, and the service history data can include but is not limited to service operation data and service monitoring data related to the target service, such as system logs, performance monitoring data, etc.

[0056] Step 102: Use the service request and the service history data as inputs of a target service model, and obtain a target load state corresponding to the target service output by the target service model.

[0057] In an embodiment of the present invention, a target business model is obtained through pre-training, and the target business model is used to predict a load state that is adapted to the target business based on business requests and business history data. The business request and business history data are used as inputs of the target business model, and the business history data is feature extracted through the target business model, and the request priority corresponding to the business request is determined based on the business type of the business request, and the target load state that is adapted to the target business is predicted based on the extracted business features. Among them, the business features may include processor usage, memory occupancy, network bandwidth, request response time, error rate, throughput, and business traffic, etc. The target load state includes a load mode and a load distribution strategy. The target load state is used to indicate a load condition that is adapted to the target business and can achieve load balancing, and describes the target business's demand for system resources and expected performance under different business characteristics.

[0058] The load mode refers to applying a certain amount of load to the system within a certain time range to observe the performance and performance indicators of the system. Different types of business have different matching load modes due to the different amounts of processing and business processing methods. Therefore, it is necessary to determine the load mode that matches the business based on the business characteristics corresponding to the specific business historical data of the business. The load mode can include normal load mode, high load mode and light load mode. The normal load mode can be the load state of the server under standard conditions. It is used to evaluate the basic performance of the system by simulating the load conditions during daily operation of the system. The high load mode can be the load state of the server when the system is in a high-intensity operation state. It simulates the performance of the system under high concurrency, large data volume, etc. in a way that exceeds the daily load of the system to find potential performance bottlenecks. The light load mode can be the load state of the server when the system is in a relatively idle state. It runs when the workload carried by the device is far lower than its design capacity. The judgment of the load mode based on business characteristics can mainly be quantitatively evaluated by monitoring the performance indicators such as the response time, throughput, and error rate of the system, and determine the load mode that matches the target task based on business historical data. Exemplarily, each load mode can be defined as: Normal load mode: the average response time is less than the first response time (e.g., 2s), and the number of response times less than or equal to the first preset duration is greater than the first preset value (e.g., 90% of the response time does not exceed 5s); the throughput value is greater than the first throughput value and less than the second throughput value. It can be understood that the range standard of the throughput can set a reasonable threshold range according to the system design and business requirements; the error rate is lower than the first ratio (e.g., the error rate is lower than 0.6%, that is, the success rate is higher than 99.4%). High load mode: the average response time is greater than the second response time (e.g., 5s), and the number of response times less than or equal to the second preset duration is greater than the second preset value (e.g., 90% of the response time does not exceed 8s); the throughput value is greater than the second throughput value and less than the third throughput value (e.g., the throughput value reaches or approaches the peak throughput of the system, at which time the system may be close to full load operation); the error rate is higher than the first ratio and lower than the second ratio. Light load mode: response time: the average response time is less than the third response time (the third response time is less than the first response time); the throughput value is less than the fourth throughput value, and the fourth throughput value is less than or equal to the first throughput value; the error rate is lower than the third ratio (the third ratio is less than the first ratio).

[0059] Load distribution strategy is a general term for various technologies used by distributed systems to transfer computing loads between nodes in order to achieve certain goals. Load distribution strategies can include load balancing, load sharing, and distributed scheduling. Load balancing refers to evenly distributing the load of a distributed system across all nodes to reduce the average response time of system tasks. Load sharing refers to transferring the load of a heavier load machine to an idle node machine when there are idle nodes in the system to reduce the response time of the job. Distributed scheduling refers to distributing the load to different nodes based on business needs and data characteristics to achieve distributed load processing.

[0060] Step 103: Determine a load optimization strategy for the target business based on the target load status and the real-time load data of the cloud server; the load optimization strategy is used to adjust the cloud resources related to the target business and instruct to allocate the business request to the target cloud server.

[0061] Optionally, step 103 may include the following steps:

[0062] Step 1031: Acquire real-time load data of the server, and determine the current load mode based on the real-time load data.

[0063] Step 1032: Compare the target load state with the real-time load pattern to determine a load optimization strategy for the target business.

[0064] In an embodiment of the present invention, the real-time load data of the cloud server is obtained, and the load optimization strategy for the target business is determined based on the target load state and the real-time load data. Among them, the real-time load data may include processor load data (such as processor utilization, number of processor cores, etc.), memory load data (such as memory utilization, memory available space, etc.), network load data (such as network bandwidth, network throughput, etc.), storage load data (such as disk utilization, number of input and output requests, etc.) and other load data (such as system average load, task queue length, etc.). According to the real-time load data, the current load state of the cloud server can be determined, and based on the target load state and the current load state, the load optimization strategy for the target business can be determined by comparing the difference between the current load state and the target load state. The load optimization strategy can be used to schedule and adjust the cloud resources related to the target business in the cloud server, so that the adjusted system achieves load balancing. The load optimization strategy is a strategy for adjusting traffic distribution in real time according to the system load situation. It monitors the load situation of each node in the system and distributes the request traffic between different nodes according to a preset algorithm, thereby achieving the purpose of optimizing system performance and resource utilization. The load optimization strategy can dynamically distribute traffic according to the load conditions of different server nodes. When the load of a server node is high, the load optimization strategy can dynamically forward the business request traffic to the node with lower load to avoid server node overload and improve the stability and availability of the system. Common dynamic load balancing algorithms can include weighted polling algorithm, minimum connection number algorithm, shortest response time algorithm, etc.

[0065] It is understandable that, since a business request for the target business has been received, the load optimization strategy also includes the policy content of allocating the business request to the target server for processing. The target server is determined based on the request type corresponding to the business request and the current load status. The target server can be a cloud server in a cloud server cluster determined based on the load mode and load distribution strategy characterized by the target load status, combined with the current load status. Exemplarily, for business requests with higher timeliness, a cloud server with lower load and stable performance can be selected as the target server to ensure that the business request can be processed in a timely manner. For business requests with relatively low timeliness, flexible allocation can be made according to the real-time load of the server, for example, a relatively idle cloud server can be determined as the target server to achieve load balancing.

[0066] In a possible implementation, the load characteristics of the target business can be first understood based on the target load state, including requirements for CPU, memory, disk I / O, network bandwidth, etc. Different target businesses have different load characteristics. For example, when the target business is a Web application-related business, network bandwidth and CPU performance may be more concerned, while when the target business is a database application-related business, memory and disk I / O performance may be more concerned. Then, the performance of different servers is evaluated based on the load characteristics and the current load state. Specifically, the performance of the server can be evaluated by viewing the hardware configuration of the server (such as CPU model, memory size, disk type, etc.) and performance test results (such as benchmark tests, stress tests, etc.). Based on the performance of the server, combined with the load characteristics characterized by the target load state, the target server that can process the business request is determined. For example: Assume that the CPU utilization rate of server 1 is low and the network bandwidth is high, but the memory utilization rate is high and the number of disk I / O requests is large, and the CPU utilization rate of server 2 is high and the network bandwidth is low, but the memory utilization rate is low and the number of disk I / O requests is small. When the target business is a Web application-related business, server 1 is determined as the target server in consideration of the load characteristics of the target business; when the target business is a database application-related business, server 2 is determined as the target server in consideration of the load characteristics of the target business.

[0067] It is understandable that when selecting a target server, the scalability and redundancy of the cloud server can also be considered, that is, when selecting a server, its scalability and redundancy also need to be considered. As the business develops, it may be necessary to increase the number of servers or upgrade the hardware configuration. At the same time, in order to ensure the stability and reliability of the system, redundant design, such as the use of load balancers, backup servers, etc., also needs to be considered. Exemplarily, the weights corresponding to different servers can be set according to the performance and processing power of the server to achieve more refined load distribution. Furthermore, cost considerations can be combined, that is, different server configurations and solutions have different costs. On the premise of meeting business needs, it is necessary to make a choice based on actual conditions.

[0068] In another possible implementation, the target server can be further determined based on the request characteristics of the service request. For example, if the service request is a request that requires a long connection (such as WebSocket, database connection), it can be allocated based on the current number of connections of each server to reduce server overload. In addition, the client IP address corresponding to the service request is obtained, and a hash operation is performed based on the client IP address, so that service requests from the same client are allocated to the same server, which is suitable for scenarios with session maintenance requirements.

[0069] In summary, in the embodiment of the present invention, when a business request for a target business is received, the business history data of the target business is obtained; the business request and the business history data are used as the input of the target business model, and the target load state corresponding to the target business output by the target business model is obtained; based on the target load state and the real-time load data of the cloud server, the load optimization strategy for the target business is determined; the load optimization strategy is used to adjust the cloud resources related to the target business, and to indicate that the business request is allocated to the target cloud server. In this way, based on the target business model and the business history data of the target business, the target load state corresponding to the target business is obtained, and the historical operation state of the business can be analyzed by the model automation to obtain the target load state matching the target business, and then the load optimization strategy for the target business is determined by the target load state and the real-time load data of the cloud server, so as to adjust the cloud resources related to the target business, and indicate that the business request is allocated to the target cloud server, so as to achieve reasonable allocation of business requests and adjust the load balancing between cloud servers, meet the load requirements of different business scenarios, improve the load balancing effect, and improve the resource utilization and the rationality of request allocation.

[0070] Optionally, step 102 may include the following steps:

[0071] Step 201: Input the business request and the business history data into a target business model.

[0072] In the embodiment of the present invention, after receiving a service request, the service request and the acquired service history data are input into the target service model.

[0073] Step 202: Based on the target business model, extract features from the business history data to determine business features.

[0074] In an embodiment of the present invention, based on the target business model, feature extraction is performed on business history data to obtain business features. Among them, business features are used to characterize the historical load characteristics corresponding to the target business. Business features may include system resource features, load distribution features, request feature features, etc. System resource features may specifically include processor usage, memory occupancy, network bandwidth, request response time, and business traffic, etc. Load distribution features may include node load imbalance, load migration times, and resource utilization differences. Request feature features may include request type distribution features, request size features, and request response time distribution features. The method for extracting features from business history data may include: before extracting business features, the business history data needs to be cleaned and preprocessed, such as removing outliers, filling missing values, etc. At the same time, for features of different dimensions or ranges, scaling or normalization is required. Feature extraction is performed on the pre-processed business history data. For example, for system resource features, the CPU usage rate at each time point can be extracted, and the average, maximum or minimum value can be calculated as the processor usage rate; the memory usage at each time point can be extracted, including used memory, free memory, etc., and the memory usage rate can be calculated; the traffic in and out of the network interface can be monitored, and the network bandwidth usage can be extracted as the network bandwidth. For load distribution features, the standard deviation or coefficient of variation of the load of each node can be calculated to determine the node load imbalance; the number of load migrations or resource reallocations related to the target task within a period of time can be calculated as the number of load migrations; the utilization differences of different nodes or resource types, such as CPU, memory, disk, etc., can be compared as resource utilization differences. For request feature characteristics, the proportion of different request types, such as read requests, write requests, and computationally intensive requests, can be counted to determine the request type distribution characteristics; the data volume of each request related to the target business can be extracted to determine the request size characteristics; the distribution of request response time can be analyzed, such as the average response time, the maximum response time, the response time distribution curve, etc., to determine the request response time distribution characteristics.

[0075] Step 203: Determine a target load state corresponding to the target service based on the service characteristics and a preset classification standard.

[0076] In an embodiment of the present invention, a target load state corresponding to the target business is determined based on the extracted business characteristics and preset classification standards. The preset classification standards may include division standards corresponding to different load modes and different load distribution strategies. That is to say, when the business characteristics meet the division standards of any load mode and any load distribution strategy, the load mode and load distribution strategy are determined as the target load state corresponding to the target business. Exemplarily, the preset classification standards include a first division standard corresponding to a high load mode, a second division standard corresponding to a normal load mode, a third division standard corresponding to a light load mode, a fourth division standard corresponding to load balancing, a fifth division standard corresponding to load sharing, and a sixth division standard corresponding to distributed scheduling. When the business characteristics meet the first division standard and the fourth division standard, the high load mode and load balancing are determined as the target load state.

[0077] In an embodiment of the present invention, feature extraction is performed based on the target business model based on business requests and business historical data, and then classification judgment is performed based on the business features to determine the target load state corresponding to the target agent. This can more accurately determine the target business's demand for system resources and expected performance, improve the authenticity of the target load state, and lay the foundation for the subsequent determination of the load optimization strategy.

[0078] Optionally, the embodiment of the present invention may include the following steps:

[0079] Step 301: Based on the request type of the service request, determine the request priority corresponding to the service request, and distribute the service request to a target request queue corresponding to the request priority.

[0080] In an embodiment of the present invention, after determining the load optimization strategy, that is, determining the target server, the request type corresponding to the business request can be determined, and different request types correspond to different request priorities. Based on the request type corresponding to the business request, the request priority corresponding to the business request is determined. Different request queues are configured for different request priorities, and the routing priority corresponding to the request queue is the same as the request priority. Business requests with different request priorities are placed in different request queues and routed according to the routing priority of the request queue. Exemplarily, for critical business types (such as payment services, login services, etc.), the corresponding request priority is higher, and for non-critical business types (such as picture browsing services, data download services, etc.), the corresponding request priority is lower.

[0081] Step 302: When a preset processing condition is met, the service requests contained in the target request queue are allocated to the target server indicated by the service load policy.

[0082] In the embodiment of the present invention, the preset processing condition is that when the routing order of the target request queue is reached, the service requests in the target request queue are routed to the target server. The routing order is determined based on the routing priority of each request queue. That is, the service requests in the request queue with a higher routing priority are first routed to the server, and then the service requests in the request queue with a lower routing priority are routed to the server.

[0083] It is understandable that in order to prevent server overload, high-traffic or high-priority business requests can be temporarily limited under appropriate circumstances and then restored after the server performance stabilizes.

[0084] In the embodiment of the present invention, by determining the request priority corresponding to the service request, sending the service request to the target request queue corresponding to the request priority, and then allocating the service request to the target server when the preset processing conditions are met, it is possible to optimize the utilization of network bandwidth and improve the flexibility of request allocation while ensuring that the service requests with high request priority are processed in a timely manner. In addition, by defining multiple request queues, the system can easily expand the request queue to cope with the increasing number of requests.

[0085] In a possible implementation, in order to further improve the load balancing efficiency, the requests can be classified into different categories according to the request type and request characteristics of the service request, and different load balancing strategies can be set for each category of service request. In this way, when a service request is received, it is only necessary to determine the corresponding load balancing strategy according to the request category corresponding to the service request, thereby improving the efficiency.

[0086] Optionally, the target business model can be trained by the following steps:

[0087] Step 401: Obtain sample business data corresponding to at least two businesses.

[0088] In an embodiment of the present invention, the sample business data may include but is not limited to business operation data and business monitoring data related to the target business, such as system logs, performance monitoring data, etc. At least two businesses may include business types under different business scenarios, such as payment business, login business, image processing business, etc. Business sample data corresponding to at least two businesses are obtained, and target business tags corresponding to the businesses are pre-set for different businesses. The target business tags are used to characterize the expected load state of the business. The expected load state that the business is expected to achieve in the actual application scenario can be pre-determined, and the target business tag is generated based on the expected load state. The training task of training the business model to be trained is to make the business model to be trained learn that the predicted load state predicted based on the sample business data is the same as the expected load state.

[0089] Step 402: For any one of the at least two services, use the sample service data and the target service label corresponding to the service as inputs of the service model to be trained, and obtain a predicted load state predicted by the service model to be trained.

[0090] In the embodiment of the present invention, for any business, sample business data and a target business label corresponding to the business are input into the business model to be trained to obtain a predicted load state output by the business model to be trained.

[0091] Step 403: Adjust parameters of the service model to be trained based on the predicted load state and the target service label; the target service label is used to characterize the expected load state corresponding to the service.

[0092] In the embodiment of the present invention, in order to make the similarity between the predicted load state predicted by the business model to be trained and the expected load state as high as possible, the parameters of the business model to be trained are adjusted based on the predicted load state and the expected load state, and the similarity between the predicted load state output by the business model to be trained and the target business label is greater than the first similarity threshold by continuously adjusting the parameters of the business model to be trained. Exemplarily, optimization algorithms such as stochastic gradient descent (SGD) and batch gradient descent (BGD) can be used to adjust the parameters of the business model to be trained.

[0093] Step 404: When a preset stop condition is met, the to-be-trained business model that has met the preset stop condition is determined as the target business model.

[0094] In the embodiment of the present invention, the preset stop condition may include conditions such as the loss value of the business model to be trained reaches a preset threshold, the number of training rounds of the business model to be trained reaches a preset round number threshold, etc.

[0095] In the embodiment of the present invention, by training the service model to be trained, the service model to be trained can learn a general load state prediction capability during the training process, so as to better automatically predict the load state of the service based on the service data.

[0096] In one possible implementation, the operating data of each server can be monitored in real time. When an abnormal situation occurs during the operation of the server (such as server crash, server overload, server error, database connection problem, etc.), different early warning and processing measures can be taken for different abnormal situations, and abnormal records and analysis can be performed, and preventive measures such as regular maintenance, resource optimization and load balancing, security policies and vulnerability patching can be established to reduce the occurrence of server abnormalities.

[0097] Exemplarily, an embodiment of the present invention provides a specific application scenario example of a load balancing optimization method. Assume that in the scenario of payment business, the target business model receives the payment business request and the related business history data as the input of the model. Then, the target business model extracts the features of the business history data and extracts the business features for the payment business from the business history data. Next, the target business model outputs the target load state for the payment business based on these business features and in combination with predefined preset classification standards (these standards may be determined based on historical data, business rules or expert knowledge). The target load state describes the demand for system resources and expected performance of the payment business under different business features. The processor (or load balancer) monitors the real-time load of the server in real time, and determines the load optimization strategy for the payment business in combination with the business features and target load state for the payment business output by the target business model. For example, when a payment business request is identified, the processor may prioritize the request according to the load optimization strategy and preferentially route it to a server with a lower load and stable performance to ensure smooth and efficient processing of the payment business. In this way, it is possible to ensure an effective match between business requirements and system resources and improve the overall performance and availability of the system.

[0098] For example, Figure 2 A flow chart of the steps of a load balancing optimization method is shown, such as Figure 2 As shown, sample business data corresponding to at least two businesses are obtained, and a business model to be trained is trained based on the sample business data corresponding to at least two businesses after preprocessing, and a target business model is determined. When a business request for a target business is received, a target load state is determined through the target business model based on the business request and the business history data corresponding to the target business. A load optimization strategy for the target business is determined based on the target load state and the real-time load data of the server. After the business request is allocated to the target server based on the load optimization strategy, the status of the server is monitored in real time.

[0099] Figure 3 : is a structural diagram of a load balancing optimization device provided by an embodiment of the present invention, and the device may include:

[0100] A first acquisition module 501 is used to acquire business history data of a target business when a business request for the target business is received;

[0101] A second acquisition module 502 is configured to use the service request and the service history data as inputs of a target service model, and acquire a target load state corresponding to the target service output by the target service model;

[0102] The first determination module 503 is used to determine the load optimization strategy for the target business based on the target load status and the real-time load data of the cloud server; the load optimization strategy is used to adjust the cloud resources related to the target business and instruct to allocate the business request to the target cloud server.

[0103] Optionally, the second acquisition module 502 includes:

[0104] A first input module, used for inputting the business request and the business history data into a target business model;

[0105] A first extraction module, configured to extract features from the business history data based on the target business model to determine business features;

[0106] The first determination submodule is used to determine a target load state corresponding to the target service based on the service characteristics and a preset classification standard.

[0107] Optionally, the first determining module 503 includes:

[0108] A first acquisition submodule, used to acquire real-time load data of the server and determine a current load mode based on the real-time load data;

[0109] The second determination submodule is used to compare the target load state with the real-time load mode to determine a load optimization strategy for the target business.

[0110] Optionally, the device further comprises:

[0111] A second determination module is used to determine a request priority corresponding to the business request based on a request type of the business request, and distribute the business request to a target request queue corresponding to the request priority;

[0112] The first allocation module is used to allocate the service requests contained in the target request queue to the target server indicated by the service load policy when a preset processing condition is met.

[0113] Optionally, the device further comprises:

[0114] A third acquisition module is used to acquire sample business data corresponding to at least two businesses;

[0115] A second input module is used to use the sample service data and the target service label corresponding to the service as inputs of the service model to be trained for any service of the at least two services, and obtain a predicted load state predicted by the service model to be trained;

[0116] A first adjustment module, configured to adjust parameters of the service model to be trained based on the predicted load state and the target service label; the target service label is used to characterize the expected load state corresponding to the service;

[0117] The third determination module is used to determine the to-be-trained business model that meets the preset stop condition as the target business model when the preset stop condition is met.

[0118] In summary, the load balancing optimization device provided by the embodiment of the present invention, when receiving a business request for a target business, obtains the business history data of the target business; uses the business request and the business history data as the input of the target business model, and obtains the target load state corresponding to the target business output by the target business model; determines the load optimization strategy for the target business based on the target load state and the real-time load data of the cloud server; the load optimization strategy is used to adjust the cloud resources related to the target business, and instructs the business request to be allocated to the target cloud server. In this way, based on the target business model and the business history data of the target business, the target load state corresponding to the target business is obtained, and the historical operation state of the business can be analyzed automatically by the model to obtain the target load state matching the target business, and then the load optimization strategy for the target business is determined by the target load state and the real-time load data of the cloud server, so as to adjust the cloud resources related to the target business, and instruct the business request to be allocated to the target cloud server, so as to achieve reasonable allocation of business requests and adjust the load balancing between cloud servers, meet the load requirements of different business scenarios, improve the load balancing effect, and improve the resource utilization and the rationality of request allocation.

[0119] The present invention also provides an electronic device, see Figure 4 , including: a processor 601, a memory 602, and a computer program 6021 stored in the memory and executable on the processor, wherein when the processor executes the program, the load balancing optimization method of the aforementioned embodiment is implemented.

[0120] The present invention also provides a readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the load balancing optimization method of the aforementioned embodiment.

[0121] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0122] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description of the above specific languages ​​is for disclosing the best mode of the present invention.

[0123] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0124] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.

[0125] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0126] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the present invention. The present invention may also be implemented as a device or apparatus program for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0127] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.

[0128] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0129] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

[0130] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A load balancing optimization method, characterized in that: The method comprises: When receiving a service request for a target service, obtaining service history data of the target service; Taking the service request and the service history data as inputs of a target service model, and obtaining a target load state corresponding to the target service output by the target service model; Based on the target load status and the real-time load data of the cloud server, a load optimization strategy for the target business is determined; the load optimization strategy is used to adjust the cloud resources related to the target business and instruct to allocate the business request to the target cloud server.

2. The method according to claim 1, characterized in that The taking the service request and the service history data as inputs of a target service model and acquiring a target load state corresponding to the target service output by the target service model includes: Inputting the business request and the business history data into a target business model; Based on the target business model, feature extraction is performed on the business history data to determine business features; Based on the service characteristics and preset classification criteria, a target load state corresponding to the target service is determined.

3. The method according to claim 1, characterized in that The determining, based on the target load state and the real-time load data of the cloud server, a load optimization strategy for the target service includes: Acquire real-time load data of the server, and determine a current load mode based on the real-time load data; The target load state is compared with the real-time load pattern to determine a load optimization strategy for the target business.

4. The method according to claim 1, characterized in that: The method further comprises: Determine a request priority corresponding to the business request based on the request type of the business request, and distribute the business request to a target request queue corresponding to the request priority; When a preset processing condition is met, the service requests contained in the target request queue are allocated to the target server indicated by the service load policy.

5. The method according to claim 1, characterized in that The target business model is trained in the following way: Obtain sample business data corresponding to at least two businesses; For any one of the at least two services, the sample service data and the target service label corresponding to the service are used as inputs of the service model to be trained, and a predicted load state predicted by the service model to be trained is obtained; Based on the predicted load state and the target service label, adjusting parameters of the service model to be trained; the target service label is used to characterize the expected load state corresponding to the service; When a preset stop condition is met, the to-be-trained business model that has met the preset stop condition is determined as the target business model.

6. A load balancing optimization device, characterized in that: The device comprises: A first acquisition module, configured to acquire business history data of a target business upon receiving a business request for the target business; A second acquisition module, configured to use the service request and the service history data as inputs of a target service model, and acquire a target load state corresponding to the target service output by the target service model; The first determination module is used to determine the load optimization strategy for the target business based on the target load status and the real-time load data of the cloud server; the load optimization strategy is used to adjust the cloud resources related to the target business and instruct to allocate the business request to the target cloud server.

7. The device according to claim 6, characterized in that The second acquisition module includes: A first input module, used for inputting the business request and the business history data into a target business model; A first extraction module, configured to extract features from the business history data based on the target business model to determine business features; The first determination submodule is used to determine a target load state corresponding to the target service based on the service characteristics and a preset classification standard.

8. The device according to claim 6, characterized in that The first determining module includes: A first acquisition submodule, used to acquire real-time load data of the server and determine a current load mode based on the real-time load data; The second determination submodule is used to compare the target load state with the real-time load mode to determine a load optimization strategy for the target business.

9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the load balancing optimization method as claimed in any one of claims 1 to 5 when executing the program.

10. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the load balancing optimization method described in one or more of claims 1-5.

Citation Information

Cited By

  • Load balancing scheduling method and device, computer equipment, computer readable storage medium and computer program product

    CN119255006A

  • Service scheduling method, electronic equipment, storage medium and computer program

    CN119862017A

  • Service scheduling method, electronic device, storage medium and computer program

    CN119862017B

  • Base station load balancing method and device, storage medium and electronic equipment

    CN120186680A

  • Base station load balancing method, device, storage medium and electronic equipment

    CN120186680B