A load balancer-based website traffic management method and system

By acquiring server information in real time and using neural network models for dynamic load distribution, the problem that traditional load balancing technology cannot adapt to dynamic load fluctuations is solved, achieving efficient traffic management and resource utilization, and improving system availability and user experience.

CN119814792BActive Publication Date: 2025-11-04CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411639461.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-11-04
Estimated Expiration
2044-11-15

AI Technical Summary

Technical Problem

Traditional load balancing technologies cannot flexibly adapt to dynamic load fluctuations, resulting in uneven resource utilization and performance degradation. Existing methods rely on manual configuration, which is inefficient and cannot meet complex and ever-changing traffic demands.

Method used

By acquiring real-time server status and load information, dynamic load allocation is performed using a pre-defined load decision model, and the model performance is periodically evaluated and optimized. Combined with neural networks and attention mechanisms, traffic management is carried out to achieve dynamic adjustment of server resources.

Benefits of technology

It improves the accuracy and resource utilization of load balancing, better responds to load changes, enhances system availability and efficiency, and provides a better user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814792B_ABST
    Figure CN119814792B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of data analysis, and discloses a website traffic management method and system based on a load balancer, which comprises the following steps: acquiring real-time state information and real-time load information of a plurality of servers, inputting the real-time state information and the real-time load information into a preset load decision model to obtain real-time load decision data; configuring the load balancer according to the real-time load decision data to determine network traffic borne by each server; periodically acquiring performance index data of a website system under the real-time load decision data, and evaluating and optimizing the performance of the preset load decision model based on the performance index data of the website system. The preset load decision model is used to dynamically adjust the configuration of the load balancer, the load balancing accuracy and the resource utilization rate are improved, the decision and implementation results are periodically evaluated and optimized, the efficiency and robustness of the system are ensured, and the traffic load balancing demand of effectively managing a large website or application is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data analysis technology, specifically to a website traffic management method and system based on a load balancer. Background Technology

[0002] With the rapid development of the Internet, large-scale websites and applications are facing increasing pressure from user access, such as e-commerce platforms, social media, and online videos. The user experience provided by these applications often depends on their performance and reliability, and the smoothness of user access to these applications mainly depends on network traffic.

[0003] Traditional load balancing technologies typically rely on fixed rules or statistical models for load balancing decisions, failing to adapt flexibly to dynamic load fluctuations. These fixed rules may inaccurately predict and adjust server resource demands, leading to uneven resource utilization and performance degradation. Traditional load forecasting methods may depend solely on historical data or simple statistical models, unable to accurately capture the complex dynamic changes in server resource status. Inaccurate load forecasting results in inaccurate load balancing decisions and resource waste. Existing technologies require manual configuration and adjustments for load balancing, a cumbersome task for large-scale, complex systems. Furthermore, the efficiency and accuracy of manual configuration and adjustments are limited due to the rapid and complex nature of load changes. Traditional load balancing methods suffer from low load forecasting accuracy and inefficient load adjustment, leading to low resource utilization and an inability to meet increasingly complex and variable traffic demands. Summary of the Invention

[0004] In view of this, the present invention provides a website traffic management method and system based on a load balancer to solve the problems of low accuracy and low resource utilization of traditional load balancing.

[0005] In a first aspect, the present invention provides a website traffic management method based on a load balancer, wherein the load balancer is connected to multiple servers and is used to distribute load to each server, and the method includes:

[0006] The system acquires real-time status and load information from multiple servers and inputs this information into a preset load decision model to obtain real-time load decision data.

[0007] The load balancer is configured based on real-time load decision data to determine the network traffic handled by each server.

[0008] Periodically acquire the website system's performance metrics data under real-time load decision data, and evaluate and optimize the performance of the preset load decision model based on the website system's performance metrics data.

[0009] The website traffic management method based on a load balancer provided by this invention collects status data from each server, uses a preset load decision model to determine real-time load decision data, and dynamically adjusts the configuration of the load balancer to make the load distribution among servers more balanced, thereby improving the accuracy of load balancing and resource utilization. By periodically evaluating and optimizing the decision and implementation results, the system's efficiency and robustness are ensured, meeting the needs of effectively managing the traffic load balancing of large websites or applications.

[0010] In one optional implementation, the training process of the preset load decision model includes:

[0011] Acquire historical status information and corresponding historical load information and historical load decision data of multiple servers, and preprocess the historical status information and corresponding historical load information and historical load decision data;

[0012] A neural network model is established based on the attention mechanism. Historical state information and corresponding historical load information are used as input to the neural network model, and the output is predicted load decision data.

[0013] Compare the predicted load decision data with the historical load decision data, and adjust the parameters of the neural network model based on the comparison results;

[0014] The process of repeatedly inputting historical state information and corresponding historical load information into the neural network model, outputting predicted load decision data, comparing the predicted load decision data with the historical load decision data, and adjusting the parameters of the neural network model based on the comparison results continues until the error between the predicted load decision data and the historical load decision data converges, thus obtaining the preset load decision model.

[0015] The website traffic management method based on load balancer provided by this invention uses historical data to train a preset load decision model to determine the relationship between server status information, load information and load decision data, which facilitates the accurate and rapid output of real-time load decision data based on real-time status information and load information.

[0016] In one optional implementation, the historical load information includes abnormal load information, the historical load decision data includes load decision data corresponding to the abnormal load information, and the abnormal load information includes burst traffic and abnormal traffic.

[0017] The website traffic management method based on load balancer provided by this invention increases the breadth of the sample by adding abnormal data to the model training data samples, better covers various load conditions, improves the model's generalization ability, reduces the risk of overfitting, enables the model to better predict and utilize traffic during peak periods, improves system response speed, and provides a better user experience.

[0018] In one alternative implementation, a neural network model is built based on an attention mechanism, including:

[0019] A neural network model based on a multilayer perceptron structure is constructed, and an attention layer is added after the hidden layer of the neural network model to obtain the constructed neural network model. The attention layer is used to dynamically allocate the weights of multiple servers.

[0020] The website traffic management method based on load balancer provided by this invention adds an attention mechanism to the neural network model and uses the attention mechanism to perform dynamic feature weighting, thereby realizing dynamic adjustment of server resources. It can better capture the complex relationship of server resource status, predict future traffic and server load, and provide more accurate traffic load prediction results.

[0021] In one optional implementation, the real-time load decision data includes: the weight of each server, the number of servers, and the load balancer is configured based on the real-time load decision data, and further includes:

[0022] Predict the load information for the next moment based on real-time load information;

[0023] The number of servers connected to the load balancer is determined based on predicted load information and real-time load decision data.

[0024] The website traffic management method based on a load balancer provided by this invention implements elastic scaling decisions based on the load situation after feature weighting. By increasing or decreasing resource capacity according to the server's attention weight, the server resources are dynamically adjusted. This ability to dynamically adjust performance enables the system to better cope with load changes and improve the system's availability and efficiency.

[0025] In one optional implementation, the performance of a preset load decision model is evaluated and optimized based on the website system's performance metrics data, including:

[0026] Determine whether each performance indicator data meets the corresponding preset requirements. If at least one performance indicator data does not meet the corresponding preset requirements, then reacquire the historical status information of multiple servers and the corresponding historical load information and historical load decision data.

[0027] By utilizing the historical status information and corresponding historical load information and historical load decision data of multiple servers, the preset load decision model is retrained until all performance indicators meet the corresponding preset requirements.

[0028] The website traffic management method based on load balancer provided by this invention evaluates the performance of decision-making and implementation results through multiple performance indicators, and adjusts and optimizes the preset load decision model and server resource balancing based on the evaluation results, thereby improving system availability, flexibility and load decision efficiency, and better adapting to the requirements of dynamic load fluctuations on system performance and resource needs.

[0029] Secondly, this invention provides a website traffic management system based on a load balancer, wherein the load balancer is connected to multiple servers and is used to distribute load to each server, and the system includes:

[0030] The real-time load decision module is used to acquire real-time status information and real-time load information from multiple servers, and input the real-time status information and real-time load information into a preset load decision model to obtain real-time load decision data.

[0031] The traffic configuration module is used to configure the load balancer based on real-time load decision data and determine the network traffic to be handled by each server.

[0032] The model optimization module is used to periodically acquire the performance index data of the website system under real-time load decision data, and evaluate and optimize the performance of the preset load decision model based on the performance index data of the website system.

[0033] Thirdly, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the method described in the first aspect or any corresponding embodiment thereof.

[0034] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the method described in the first aspect or any corresponding embodiment thereof.

[0035] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to perform the method described in the first aspect or any corresponding embodiment thereof. Attached Figure Description

[0036] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific 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 from these drawings without creative effort.

[0037] Figure 1This is a flowchart illustrating a website traffic management method based on a load balancer according to an embodiment of the present invention.

[0038] Figure 2 This is a flowchart illustrating another website traffic management method based on a load balancer according to an embodiment of the present invention;

[0039] Figure 3 This is a structural block diagram of a website traffic management system based on a load balancer according to an embodiment of the present invention;

[0040] Figure 4 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation

[0041] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0042] This invention provides a website traffic management method based on a load balancer. By calculating real-time load decision data through a model, the workload of each server is allocated to improve the accuracy of load balancing and the utilization rate of resources.

[0043] According to an embodiment of the present invention, a method for website traffic management based on a load balancer is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0044] This embodiment provides a website traffic management method based on a load balancer, which can be used in the aforementioned computer system. Figure 1 This is a flowchart of a website traffic management method based on a load balancer according to an embodiment of the present invention. The load balancer is connected to multiple servers and is used to distribute the load to each server, such as... Figure 1 As shown, the process includes the following steps:

[0045] Step S101: Obtain real-time status information and real-time load information of multiple servers, and input the real-time status information and real-time load information into a preset load decision model to obtain real-time load decision data.

[0046] Specifically, to monitor the status information of each server, monitoring tools, such as Prometheus, need to be deployed and configured on the servers, along with the necessary software components and runtime environment setup. Within the runtime environment, the monitoring target (the specific server, service, or application to be monitored) is configured, specifying its address, port, and the types of metrics to be monitored. Once the monitoring target is defined, the corresponding monitoring metrics must be configured, selecting system performance parameters to be monitored, such as CPU utilization, memory usage, and disk space. The data acquisition method for the monitoring tool is specified: actively polling the target or having the target send data to the monitoring tool. The collected monitoring data needs to be stored and processed. The monitoring tool can be configured to store the data in a database or time-series database, such as InfluxDB, for subsequent analysis and querying. The collected monitoring data can be aggregated, compressed, and processed to optimize storage and query performance. Through the interface or API provided by the monitoring tool, server status information can be monitored and displayed in real time (Grafana dashboards can be used to display the real-time status of each server, this is just an example, but not the only one), providing a more intuitive understanding of the status of each server. Alert triggering mechanisms can be set as needed, such as sending emails, SMS messages, or integrating into the notification system. Historical alerts and events can also be recorded for later analysis and retrospective review.

[0047] Step S102: Configure the load balancer based on real-time load decision data to determine the network traffic borne by each server.

[0048] Specifically, real-time load information represents the traffic consumed when users access the website. Nginx is used as a reverse proxy server (i.e., a load balancer) to distribute the traffic consumed by user requests to multiple backend servers connected to the load balancer. Traffic is allocated according to pre-defined rules (such as round-robin, least connections, or source address hashing), and the load of the backend servers is monitored in real time. In implementing load balancing, Nginx is used as the load balancer and deployed on a dedicated server, connecting multiple backend servers. To achieve high availability, multiple load balancers can be used to build redundancy and failover mechanisms.

[0049] The load balancer configuration is adjusted based on real-time load decision data, such as dynamically adjusting the weight of each server and adding or removing backend servers. During the decision-making process, load thresholds and fault tolerance mechanisms can be set for each server. When the difference between the current load distribution and the real-time load decision data is not significant, no adjustment is needed to avoid instability caused by frequent adjustments. For example, if the load balancer connects to three servers, and each server currently has a load rate of 40%, 45%, and 60%, and the real-time load decision data determines that the load rate of each server should be 42%, 43%, and 59%, with a preset 2% fault tolerance for each server's load rate, then no adjustment is needed to keep up with the real-time load decision data. This maintains the current load situation of each server, avoids frequent adjustments, and maintains network traffic stability.

[0050] In addition to implementing load balancing functionality, monitoring and diagnostic features are needed for rapid troubleshooting and problem resolution. These features include logging, metric collection and analysis, performance benchmarking, and application tracing. To enhance security, Secure Socket Layer (SSL) termination needs to be configured. Furthermore, caching and acceleration mechanisms can be used to improve application or service performance. Finally, to protect applications or services from malicious attacks, firewall and security group rules need to be configured to restrict access to the load balancer and control inbound and outbound traffic. By following these steps, a highly reliable, highly available, and high-performance load balancing solution can be achieved to distribute application or service traffic and workload.

[0051] In some optional implementations, the real-time load decision data includes: the weight of each server, the number of servers, and the load balancer is configured based on the real-time load decision data, and also includes:

[0052] Predict the load information for the next moment based on real-time load information.

[0053] Specifically, by analyzing historical load information, the predicted load information for the next moment can be predicted based on real-time load information. For example, historical data analysis shows that the peak time for website usage is from 10 am to 6 pm on weekdays. Deep learning algorithms can be used to train on historical traffic data to predict future traffic load. This is just an example, but not a limitation.

[0054] The number of servers connected to the load balancer is determined based on predicted load information and real-time load decision data.

[0055] Specifically, based on predicted load information and real-time load decision data, the website system can use the elastic scaling capabilities provided by cloud service providers (such as AWS Auto Scaling) to automatically increase or decrease the number of servers and automatically increase backend server resources during peak periods to cope with increased traffic demand.

[0056] The website traffic management method based on a load balancer provided in this embodiment implements elastic scaling decisions based on the load situation after feature weighting. By increasing or decreasing resource capacity according to the server's attention weight, the server resources are dynamically adjusted. This ability to dynamically adjust performance enables the system to better cope with load changes and improve the system's availability and efficiency.

[0057] Step S103: Periodically acquire the performance index data of the website system under real-time load decision data, and evaluate and optimize the performance of the preset load decision model based on the performance index data of the website system.

[0058] Specifically, the performance of the website system should be evaluated regularly, key performance indicators (KPIs) should be collected and compared with expected targets. If the KPIs meet the expected targets, no adjustments are needed; otherwise, the preset load decision model needs to be optimized or server resources increased. By regularly monitoring the website system's throughput, response time, service quality, and other indicators, the performance of the preset load decision model can be evaluated, and adjustments and optimizations can be made based on the evaluation results.

[0059] The website traffic management method based on a load balancer provided in this embodiment collects status data from each server, determines real-time load decision data using a preset load decision model, and dynamically adjusts the load balancer configuration to achieve a more balanced load distribution across servers, thereby improving load balancing accuracy and resource utilization. By periodically evaluating and optimizing the decision and implementation results, the system's efficiency and robustness are ensured, meeting the needs of effectively managing the traffic load balancing of large websites or applications.

[0060] This embodiment provides a website traffic management method based on a load balancer, which can be used in the aforementioned computer system. Figure 2 This is a flowchart of a website traffic management method based on a load balancer according to an embodiment of the present invention, as shown below. Figure 2 As shown, the process includes the following steps:

[0061] Step S201: Obtain real-time status information and real-time load information of multiple servers, and input the real-time status information and real-time load information into a preset load decision model to obtain real-time load decision data.

[0062] Specifically, the training process of the preset load decision model in step S201 above includes:

[0063] Step S2011: Obtain historical status information and corresponding historical load information and historical load decision data of multiple servers, and preprocess the historical status information and corresponding historical load information and historical load decision data.

[0064] Specifically, historical data is used for model training. In this embodiment, the historical data includes historical status information and corresponding historical load information and historical load decision data of multiple servers. The historical data is preprocessed and feature extracted to obtain real-time server resource status data, which is then normalized and standardized. Features such as CPU utilization, memory usage, and network bandwidth are extracted from this historical data, and the correlation information between servers is incorporated into the feature set.

[0065] In some optional implementations, historical load information includes abnormal load information, historical load decision data includes load decision data corresponding to abnormal load information, and abnormal load information includes burst traffic and abnormal traffic.

[0066] Specifically, to address sudden traffic spikes and abnormal situations, historical abnormal data needs to be added to the sample. This increases the breadth of the model training data, better covers various traffic scenarios, improves the model's generalization ability, reduces the risk of overfitting, and helps the model learn to cope with sudden traffic spikes and peak load periods. Through training on simulated sudden and abnormal traffic scenarios, the system can better predict and adapt to peak traffic, improve system response speed, reduce user waiting time, and provide a better user experience. During operation, real-time collected server resource status is input into the trained model, and dynamic load balancing decisions are made based on the model's output. Furthermore, the performance of the load balancing algorithm in the preset load decision model is continuously monitored and evaluated, and optimized and improved to adapt to different load conditions, thereby improving the performance and reliability of the load balancing system.

[0067] The website traffic management method based on load balancer provided in this embodiment increases the breadth of the sample by adding abnormal data to the model training data samples, better covers various load conditions, improves the model's generalization ability, reduces the risk of overfitting, enables the model to better predict and utilize traffic during peak periods, improves system response speed, and provides a better user experience.

[0068] Step S2012: Establish a neural network model based on the attention mechanism, take historical state information and corresponding historical load information as input to the neural network model, and output predicted load decision data.

[0069] In some optional implementations, step S2012 above includes:

[0070] A neural network model based on a multilayer perceptron structure is constructed, and an attention layer is added after the hidden layer of the neural network model to obtain the constructed neural network model. The attention layer is used to dynamically allocate the weights of multiple servers.

[0071] Specifically, a model based on a Multilayer Perceptron (MLP) architecture was designed and constructed, with an attention layer introduced after the hidden layer output. By weighting the output of the hidden layers, the attention layer can allocate attention to important features, focusing more on factors that significantly influence load balancing decisions. The model is trained using a labeled training dataset, and the backpropagation algorithm and optimizer are used to iteratively optimize the model parameters, enabling it to accurately predict appropriate load allocation.

[0072] During the real-time load monitoring phase, the server resource status collected in real time is input into the trained model, and an attention weight is calculated for each server. These weights represent the importance of the server under the current load conditions. Feature weighting is performed based on the attention weights, comprehensively considering various indicators required for load balancing decisions. Elastic scaling decisions are then executed based on the feature-weighted load situation: if a server has a high load and a high attention weight, its resource capacity is increased; conversely, if the load is low and the attention weight is low, the server's resources are reduced or released.

[0073] The website traffic management method based on a load balancer provided in this embodiment incorporates an attention mechanism into the neural network model. This mechanism performs dynamic feature weighting, enabling dynamic adjustment of server resources. It better captures the complex relationships between server resource states, predicts future traffic and server load, and provides more accurate traffic load prediction results. Elastic scaling is performed based on real-time server resource status to meet the performance and resource requirements of dynamic load fluctuations. This maximizes the utilization of server resources and improves system availability, flexibility, and efficiency.

[0074] Step S2013: Compare the predicted load decision data with the historical load decision data, and adjust the parameters of the neural network model based on the comparison results.

[0075] Specifically, historical state information and corresponding historical load information are used as input to the neural network model, and the output is predicted load decision data. The error between the predicted load decision data and the historical load decision data is used to evaluate the prediction accuracy of the preset load decision model, and the model parameters are adjusted according to the error.

[0076] Step S2014 involves repeatedly inputting historical state information and corresponding historical load information into the neural network model, outputting predicted load decision data, comparing the predicted load decision data with the historical load decision data, and adjusting the parameters of the neural network model based on the comparison results, until the error between the predicted load decision data and the historical load decision data converges, thus obtaining the preset load decision model.

[0077] Specifically, each time the model parameters are adjusted, the model is trained again using historical data until the error between the predicted load decision data output by the model and the actual historical load decision data converges, or the error reaches the preset expected error or the preset number of iterations is reached. The last neural network model is then used as the preset load decision model.

[0078] The website traffic management method based on a load balancer provided in this embodiment uses historical data to train a preset load decision model to determine the relationship between server status information, load information and load decision data, which facilitates the accurate and rapid output of real-time load decision data based on real-time status information and load information.

[0079] Step S202: Configure the load balancer based on real-time load decision data to determine the network traffic load assigned to each server. For details, please refer to [link to relevant documentation]. Figure 1 Step S102 of the illustrated embodiment will not be described again here.

[0080] Step S203: Periodically acquire the performance index data of the website system under the real-time load decision data, and evaluate and optimize the performance of the preset load decision model based on the performance index data of the website system.

[0081] Specifically, step S203 includes:

[0082] Step S2031: Determine whether each performance indicator data meets the corresponding preset requirements. If at least one performance indicator data does not meet the corresponding preset requirements, then reacquire the historical status information of multiple servers and the corresponding historical load information and historical load decision data.

[0083] Specifically, performance metrics include, but are not limited to, throughput, response time, and service quality. If each performance metric meets the corresponding preset requirements, no adjustment or optimization is needed. If at least one performance metric does not meet the corresponding preset requirements, historical data needs to be reacquired. The historical data at this time includes the latest historical status information of multiple servers and the corresponding historical load information and historical load decision data.

[0084] Step S2032: Using the historical status information of multiple servers and the corresponding historical load information and historical load decision data, retrain the preset load decision model until all performance index data meet the corresponding preset requirements.

[0085] Specifically, using the latest historical data, the preset load decision model is retrained, and the number of servers is adjusted until all performance metrics meet the corresponding preset requirements. The optimized preset load decision model is then used for load balancing, and performance metrics are periodically evaluated and the system optimized. The load balancing algorithm is continuously improved and optimized to better meet business needs and enhance user experience.

[0086] The website traffic management method based on load balancer provided in this embodiment evaluates the performance of decision-making and implementation results through multiple performance indicators. Based on the evaluation results, it adjusts and optimizes the preset load decision model and server resource balancing to improve system availability, flexibility and load decision efficiency, and better adapt to the requirements of dynamic load fluctuations on system performance and resource needs.

[0087] This embodiment also provides a website traffic management system based on a load balancer, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the system described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0088] This embodiment provides a website traffic management system based on a load balancer, where the load balancer connects to multiple servers, such as... Figure 3 As shown, it includes:

[0089] The real-time load decision module 301 is used to acquire real-time status information and real-time load information of multiple servers, and input the real-time status information and real-time load information into a preset load decision model to obtain real-time load decision data.

[0090] The traffic configuration module 302 is used to configure the load balancer based on real-time load decision data to determine the network traffic borne by each server.

[0091] The model optimization module 303 is used to periodically acquire the performance index data of the website system under real-time load decision data, and evaluate and optimize the performance of the preset load decision model based on the performance index data of the website system.

[0092] In some optional implementations, the training process of the preset load decision model in the real-time load decision module 301 includes:

[0093] The historical data acquisition unit is used to acquire historical status information and corresponding historical load information and historical load decision data of multiple servers, and to preprocess the historical status information and corresponding historical load information and historical load decision data.

[0094] The model prediction unit is used to build a neural network model based on the attention mechanism. It takes historical state information and corresponding historical load information as input to the neural network model and outputs predicted load decision data.

[0095] The model parameter optimization unit is used to compare the predicted load decision data with the historical load decision data and adjust the parameters of the neural network model based on the comparison results.

[0096] The preset load decision model determination unit is used to repeatedly input historical state information and corresponding historical load information into the neural network model, output predicted load decision data, compare the predicted load decision data with the historical load decision data, and adjust the parameters of the neural network model according to the comparison results until the error between the predicted load decision data and the historical load decision data converges, thus obtaining the preset load decision model.

[0097] In some alternative implementations, the model optimization module 303 includes:

[0098] The performance evaluation unit is used to determine whether each performance indicator data meets the corresponding preset requirements. If at least one performance indicator data does not meet the corresponding preset requirements, the historical status information of multiple servers and the corresponding historical load information and historical load decision data are re-acquired.

[0099] The model optimization unit is used to retrain the preset load decision model using the historical status information and corresponding historical load information and historical load decision data of multiple servers until all performance index data meet the corresponding preset requirements.

[0100] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0101] In this embodiment, the website traffic management system based on a load balancer is presented in the form of functional units. Here, a unit refers to an ASIC (Application Specific Integrated Circuit), a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0102] This invention also provides a computer device having the above-described features. Figure 3 The example shown is a website traffic management system based on a load balancer.

[0103] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 4 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 4 Take a processor 10 as an example.

[0104] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0105] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.

[0106] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0107] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0108] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.

[0109] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.

[0110] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0111] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A website traffic management method based on a load balancer, wherein the load balancer is connected to multiple servers and is used to distribute load to each server, characterized in that, The method includes: The system acquires real-time status information and real-time load information of multiple servers, and inputs the real-time status information and real-time load information into a preset load decision model to obtain real-time load decision data. The real-time load decision data includes: the weight of each server and the number of servers. The weight represents the importance of the server under the current load conditions. The load balancer is configured based on the real-time load decision data to determine the network traffic handled by each server. This configuration further includes: predicting the predicted load information for the next moment based on the real-time load information; and determining the number of servers connected to the load balancer based on the predicted load information and the real-time load decision data. The training process of the preset load decision model includes: acquiring historical state information and corresponding historical load information and historical load decision data from multiple servers, and preprocessing the historical state information, historical load information, and historical load decision data; establishing a neural network model based on an attention mechanism, using the historical state information and corresponding historical load information as input. A neural network model outputs predicted load decision data; the predicted load decision data is compared with historical load decision data, and the parameters of the neural network model are adjusted according to the comparison result; the process of repeatedly inputting historical state information and corresponding historical load information into the neural network model, outputting predicted load decision data, comparing the predicted load decision data with the historical load decision data, and adjusting the parameters of the neural network model according to the comparison result is repeated until the error between the predicted load decision data and the historical load decision data converges, thus obtaining a preset load decision model; the historical load information includes abnormal load information, the historical load decision data includes load decision data corresponding to the abnormal load information, and the abnormal load information includes burst traffic and abnormal traffic; The system periodically acquires performance metrics data of the website system under real-time load decision data, and evaluates and optimizes the performance of the preset load decision model based on the performance metrics data of the website system. This includes: determining whether each performance metric data meets the corresponding preset requirements; if at least one performance metric data does not meet the corresponding preset requirements, then reacquires the historical status information of multiple servers and the corresponding historical load information and historical load decision data; using the historical status information of multiple servers and the corresponding historical load information and historical load decision data, the preset load decision model is retrained until all performance metrics data meet the corresponding preset requirements.

2. The method according to claim 1, characterized in that, The neural network model based on the attention mechanism includes: A neural network model based on a multilayer perceptron structure is constructed, and an attention layer is added after the hidden layer of the neural network model to obtain the constructed neural network model. The attention layer is used to dynamically allocate the weights of multiple servers.

3. A website traffic management system based on a load balancer, wherein the load balancer is connected to multiple servers and is used to distribute load among the servers, characterized in that, The system includes: The real-time load decision module is used to acquire real-time status information and real-time load information of multiple servers, and input the real-time status information and real-time load information into a preset load decision model to obtain real-time load decision data. The real-time load decision data includes: the weight of each server and the number of servers. The weight represents the importance of the server under the current load conditions. A traffic configuration module is used to configure the load balancer based on the real-time load decision data, determining the network traffic handled by each server. The configuration of the load balancer based on the real-time load decision data further includes: predicting the predicted load information for the next moment based on the real-time load information; and determining the number of servers connected to the load balancer based on the predicted load information and the real-time load decision data. The training process of the preset load decision model includes: acquiring historical state information and corresponding historical load information and historical load decision data of multiple servers, and preprocessing the historical state information and corresponding historical load information and historical load decision data; establishing a neural network model based on an attention mechanism, using the historical state information and corresponding historical load information as... The neural network model is input and outputs predicted load decision data. The predicted load decision data and historical load decision data are compared, and the parameters of the neural network model are adjusted based on the comparison results. This process of inputting historical state information and corresponding historical load information into the neural network model, outputting predicted load decision data, comparing the predicted load decision data and historical load decision data, and adjusting the parameters of the neural network model based on the comparison results is repeated until the error between the predicted load decision data and the historical load decision data converges, thus obtaining a preset load decision model. The historical load information includes abnormal load information, and the historical load decision data includes load decision data corresponding to the abnormal load information. The abnormal load information includes burst traffic and abnormal traffic. The model optimization module is used to periodically acquire performance index data of the website system under real-time load decision data, and evaluate and optimize the performance of the preset load decision model based on the performance index data of the website system. This includes: determining whether each performance index data meets the corresponding preset requirements; if at least one performance index data does not meet the corresponding preset requirements, then reacquiring the historical status information of multiple servers and the corresponding historical load information and historical load decision data; and using the historical status information of multiple servers and the corresponding historical load information and historical load decision data, retraining the preset load decision model until all performance index data meets the corresponding preset requirements.

4. A computer device, characterized in that, include: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of any one of claims 1 to 2.

5. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of any one of claims 1 to 2.

6. A computer program product, characterized in that, Includes computer instructions, which, when executed by a processor, cause the computer to perform the method of any one of claims 1 to 2.

Citation Information

Patent Citations

  • Server load balancing method and system based on comparison service

    CN117311984A

  • Adaptive load balancing method and system based on multiple models

    CN118656211A