Session synchronization method and device, equipment and medium
By dynamically adjusting the session synchronization frequency of the load balancer, the problems of high performance overhead and synchronization delay in the load balancer session synchronization in the prior art are solved, and efficient and reliable session data synchronization and fault handling are achieved.
Patent Information
- Application Number
- CN202411612400.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-12
AI Technical Summary
Session synchronization between existing load balancers has problems such as high performance overhead, large network bandwidth consumption, synchronization delay and waste of resources, resulting in excessive use of system resources and inconsistent session information in high traffic scenarios.
By obtaining monitoring information of the load balancer cluster, predicting faults and normal load balancers, dynamically adjusting the session synchronization frequency, and increasing the outgoing direction of the failed load balancer and the incoming direction of the normal load balancer, to achieve fast data backup and redundancy.
It improves the efficiency of session synchronization between load balancers, reduces the impact of failures on the system, ensures the security and reliability of session data, and optimizes the utilization of overall resources.
Smart Images

Figure CN119520525A_ABST
Abstract
Description
Background Art
[0002] In modern network environments, especially in software-defined networking (SDN) scenarios, load balancers are key devices to ensure high availability and performance of the system. In order to achieve high availability of the load balancer itself, it is usually deployed in a cluster. Traditional four-layer load balancing is mainly based on transport layer protocols, such as Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). Its main function is to distribute workloads among multiple server nodes to optimize resource usage and system performance.
[0003] In order to ensure that the continuity of TCP connections and the availability of the overall service are not affected when a load balancer fails, session synchronization is usually required between load balancers to ensure that the backup load balancers in the cluster can take over the work tasks in time without interrupting the existing connections.
[0004] Currently, the mainstream session synchronization methods include the following two:
[0005] 1: Real-time session synchronization.
[0006] Real-time session synchronization is performed through UDP multicast each time a new session is established. However, frequent synchronization operations will cause large performance overhead and network bandwidth consumption, especially in high-traffic scenarios. This method may lead to excessive use of system resources. In addition, since UDP cannot guarantee the order of data packets and the reliability of transmission, additional confirmation and retransmission mechanisms may be required to ensure the integrity and accuracy of data transmission, which further increases the complexity of the system.
[0007] 2: Scheduled session synchronization.
[0008] Scheduled session synchronization is to synchronize session information at a specified time interval through a periodic synchronization mechanism to make the session information between the primary load balancer and the backup load balancer consistent. However, the scheduled synchronization mechanism has problems such as synchronization delay and resource waste. For example, setting a long synchronization interval may lead to inconsistent session information, while a too short interval will increase system load and bandwidth consumption.
[0009] In summary, how to improve the efficiency of session synchronization between load balancers is an urgent problem to be solved. Summary of the invention
[0010] Embodiments of the present application provide a session synchronization method, device, electronic device, and storage medium to improve the efficiency of session synchronization between load balancers.
[0011] A session synchronization method provided in an embodiment of the present application is applied to an SDN controller, including:
[0012] Get the monitoring information uploaded by each load balancer in the load balancer cluster;
[0013] Predicting faulty load balancers and normal load balancers in the load balancer cluster according to each of the monitoring information;
[0014] The first configuration information is sent to the faulty load balancer to increase the session synchronization frequency of the faulty load balancer in the outbound direction; and the second configuration information is sent to the normal load balancer to increase the session synchronization frequency of the normal load balancer in the inbound direction; the inbound direction corresponding to the load balancer indicates: writing the session data of other load balancers in the shared database into the memory of the load balancer; the outbound direction corresponding to the load balancer indicates: writing the session data of the load balancer into the shared database.
[0015] Optionally, the sending of the first configuration information to the faulty load balancer to increase the session synchronization frequency of the faulty load balancer in the outbound direction further includes: stopping the session synchronization of the faulty load balancer in the inbound direction;
[0016] Furthermore, sending the second configuration information to the normal load balancer to increase the session synchronization frequency of the normal load balancer in the inbound direction also includes: stopping the session synchronization of the normal load balancer in the outbound direction.
[0017] Through the above process, the session synchronization of the faulty load balancer in the inbound direction is stopped to avoid invalid data processing, and the session synchronization of the normal load balancer in the outbound direction is stopped to concentrate resources on the session data of the faulty load balancer. The key is to stop the synchronization of irrelevant sessions, thereby improving fault handling efficiency and overall stability.
[0018] Optionally, after inputting each of the monitoring information into a trained fault detection model, the failure probability of each load balancer predicted by the fault detection model is obtained;
[0019] The load balancer whose corresponding failure probability is higher than the preset probability threshold is regarded as a failed load balancer;
[0020] And, the load balancer whose corresponding failure probability is not higher than the preset probability threshold is regarded as a normal load balancer.
[0021] Through the above method, a fault detection model is constructed to predict faulty load balancers and normal load balancers, so as to realize early identification and dynamic adjustment of the load balancer status, facilitate the subsequent adoption of targeted session synchronization strategies, and ensure the stable operation of the system.
[0022] Optionally, third configuration information is sent to the programmable switch to delete the routing entry of the faulty load balancer from the routing list on the programmable switch side; wherein the routing entry is used to instruct the programmable switch to establish a session with the faulty load balancer through a specific path.
[0023] Through the above method, traffic routing can be adjusted in time before the load balancer fails, avoiding new session requests from being assigned to the load balancer that is about to fail, ensuring the high availability and stability of the session system, and effectively reducing the risk of session loss and ensuring the continuity of existing sessions. This method maintains a smooth distribution of traffic through dynamic routing adjustment of programmable switches, so that services are not interrupted and the overall resource utilization is optimized.
[0024] Another session synchronization method provided in an embodiment of the present application is applied to a load balancer, including:
[0025] Uploading monitoring information to the SDN controller, so that the SDN controller predicts a faulty load balancer and a normal load balancer in the load balancer cluster based on the monitoring information uploaded by each load balancer in the load balancer cluster, and sends the first configuration information to the faulty load balancer and sends the second configuration information to the normal load balancer;
[0026] If the first configuration information is received, based on the first configuration information, increasing the session synchronization frequency of the load balancer in the outbound direction, and performing session synchronization based on the adjusted session synchronization frequency;
[0027] If the second configuration information is received, the session synchronization frequency of the load balancer in the input direction is increased based on the second configuration information, and session synchronization is performed based on the adjusted session synchronization frequency; the input direction corresponding to the load balancer indicates: writing the session data of other load balancers in the shared database into the memory of the load balancer; the output direction corresponding to the load balancer indicates: writing the session data of the load balancer into the shared database.
[0028] Optionally, the increasing the session synchronization frequency of the load balancer in the outbound direction based on the first configuration information further includes:
[0029] Stopping session synchronization of the load balancer in the inbound direction;
[0030] And, the increasing the session synchronization frequency of the load balancer in the inbound direction based on the second configuration information further includes:
[0031] Stops session synchronization of the load balancer in the outbound direction.
[0032] Through the above process, the session synchronization of the faulty load balancer in the inbound direction is stopped to avoid invalid data processing, and the session synchronization of the normal load balancer in the outbound direction is stopped to concentrate resources on the session data of the faulty load balancer. The key is to stop the synchronization of irrelevant sessions, thereby improving fault handling efficiency and overall stability.
[0033] Optionally, in a scheduled session synchronization scenario, session synchronization in the outbound direction and the inbound direction is periodically performed according to the first synchronization frequency;
[0034] The increasing the session synchronization frequency of the load balancer in the outbound direction includes:
[0035] Increasing the outgoing session synchronization frequency from the first synchronization frequency to a second synchronization frequency;
[0036] The increasing the session synchronization frequency of the load balancer in the inbound direction includes:
[0037] The session synchronization frequency in the inbound direction is increased from the first synchronization frequency to a third synchronization frequency.
[0038] Through the above process, the outbound session synchronization frequency is increased to the second synchronization frequency, and the session data is quickly synchronized to the shared database. The inbound session synchronization frequency is increased to the third synchronization frequency, and the session data of the faulty load balancer in the shared database is quickly synchronized to the normal load balancer, which effectively improves the stability and fault tolerance of session synchronization and ensures the continuity and security of session data when the load balancer fails.
[0039] An embodiment of the present application provides a session synchronization device, including:
[0040] An acquisition unit, used to acquire monitoring information uploaded by each load balancer in the load balancer cluster;
[0041] A prediction unit, configured to predict a faulty load balancer and a normal load balancer in the load balancer cluster according to each of the monitoring information;
[0042] A configuration unit is used to send the first configuration information to the faulty load balancer to increase the session synchronization frequency of the faulty load balancer in the outbound direction; and send the second configuration information to the normal load balancer to increase the session synchronization frequency of the normal load balancer in the inbound direction; the inbound direction corresponding to the load balancer means: writing the session data of other load balancers in the shared database into the memory of the load balancer; the outbound direction corresponding to the load balancer means: writing the session data of the load balancer into the shared database.
[0043] Another session synchronization device provided by an embodiment of the present application includes:
[0044] an uploading unit, configured to upload monitoring information to the SDN controller, so that the SDN controller predicts a faulty load balancer and a normal load balancer in the load balancer cluster based on the monitoring information uploaded by each load balancer in the load balancer cluster, and sends first configuration information to the faulty load balancer and sends second configuration information to the normal load balancer;
[0045] an adjusting unit, configured to, if receiving the first configuration information, increase the session synchronization frequency of the load balancer in the outbound direction based on the first configuration information, and perform session synchronization based on the adjusted session synchronization frequency;
[0046] If the second configuration information is received, the session synchronization frequency of the load balancer in the input direction is increased based on the second configuration information, and session synchronization is performed based on the adjusted session synchronization frequency; the input direction corresponding to the load balancer indicates: writing the session data of other load balancers in the shared database into the memory of the load balancer; the output direction corresponding to the load balancer indicates: writing the session data of the load balancer into the shared database.
[0047] An electronic device provided by an embodiment of the present application includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of the above-mentioned session synchronization methods.
[0048] An embodiment of the present application provides a computer-readable storage medium, which includes a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of any one of the above-mentioned conversation methods.
[0049] An embodiment of the present application provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device performs the steps of any one of the above-mentioned conversation methods.
[0050] The beneficial effects of this application are as follows:
[0051] The embodiments of the present application provide a session synchronization method, device, electronic device and storage medium. First, monitoring information uploaded by each load balancer is obtained for training and prediction of a fault detection model, thereby ensuring that the model can accurately reflect the operating status and potential fault risks of the load balancer; then, based on each monitoring information, the fault detection model is used to predict the faulty load balancer and the normal load balancer in the load balancer cluster so that corresponding measures can be taken in time to handle them; finally, the first and second configuration information are respectively sent to the faulty load balancer and the normal load balancer to increase the session synchronization frequency of the faulty load balancer in the outbound direction, ensure that the session data of the faulty load balancer can be quickly backed up to a shared database, and increase the session synchronization frequency of the normal load balancer in the inbound direction to achieve timely reception and redundant backup of the session data of the faulty load balancer, thereby improving the stability and fault tolerance of session synchronization, ensuring the security and reliability of session data, and reducing the overall impact of the fault.
[0052] The embodiments of the present application provide another session synchronization method, device, electronic device and storage medium. First, the load balancer uploads monitoring information to the SDN controller to facilitate the training and prediction of the fault detection model, thereby ensuring that the operating status and potential fault risks of the load balancer can be obtained in real time; secondly, if the first configuration information is received, the session synchronization frequency of the load balancer in the outbound direction is increased based on the information, and the session synchronization is performed based on the adjusted session synchronization frequency to ensure that the session data of the faulty load balancer can be quickly backed up to the shared database; if the second configuration information is received, the session synchronization frequency of the load balancer in the inbound direction is increased based on the information, and the session synchronization is performed based on the adjusted session synchronization frequency, so as to timely receive the session data of the faulty load balancer, ensure the stability of session synchronization and data redundant backup, and flexibly adjust the session synchronization frequency to improve the load balancer's ability to respond to faults, which helps to improve overall performance and reliability.
[0053] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0055] Figure 1 An architectural diagram of a session synchronization system provided in an embodiment of the present application;
[0056] Figure 2 A flow chart of an implementation of a session synchronization method provided in an embodiment of the present application;
[0057] Figure 3 A flow chart of a training process of a fault detection model provided in an embodiment of the present application;
[0058] Figure 4 A flowchart of another session synchronization method provided in an embodiment of the present application;
[0059] Figure 5 A schematic diagram of an implementation of a session synchronization method provided in an embodiment of the present application;
[0060] Figure 6 It is a structural schematic diagram of a conversation synchronization device;
[0061] Figure 7 It is a structural diagram of another conversation synchronization device;
[0062] Figure 8 The figure is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.
[0064] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.
[0065] See also Figure 1As shown, it is an architecture diagram of a session synchronization system provided in an embodiment of the present application.
[0066] like Figure 1 As shown, the session synchronization system includes six parts, namely: client, SDN controller, programmable switch, load balancer cluster, shared database (for session shared storage) and backend server pool.
[0067] Simply put, in this system, client requests are distributed to the load balancer through programmable switches, and the load balancer then forwards the requests to the backend server pool for processing. The programmable switch is responsible for dynamically adjusting the traffic distribution path according to the instructions of the SDN controller, and with the assistance of the shared database, ensuring session synchronization and fault recovery between load balancers.
[0068] The following is an introduction to the functions of each part:
[0069] Client: The client is responsible for initiating requests, usually requests from users or applications. The traffic requested by the client first enters the programmable switch of the network, is routed to the load balancer through the programmable switch, and is forwarded to the backend server pool through the load balancer. The server processes it and returns the result to the client.
[0070] SDN controller: The SDN controller is responsible for monitoring the operating status of the load balancer and predicting faults based on the fault detection model. When it is predicted that the load balancer may fail, it sends configuration information, adjusts the traffic distribution path of the programmable switch, and adjusts the session synchronization strategy of the load balancer.
[0071] Programmable switch: The programmable switch is responsible for deciding which load balancer to route client traffic to based on the configuration information of the SDN controller (referred to as the third configuration information in this article). It can adjust the forwarding path in real time to ensure that the failed load balancer no longer receives new session requests and redistribute the traffic to other normal load balancers.
[0072] Load balancer cluster: A cluster consisting of multiple load balancers that distribute requests from clients to a pool of backend servers. Each load balancer synchronizes its session state to a shared database for shared storage so that when a load balancer fails, other load balancers can continue to process unfinished sessions.
[0073] In an optional embodiment, the load balancer cluster has 3 load balancers. In another optional embodiment, the load balancer cluster may have 8 load balancers. This document does not specifically limit the number of load balancers in the load balancer cluster.
[0074] The load balancer consists of four processes, which have the following functions:
[0075] 1) Configuration receiving process: receiving the configuration information sent by the SDN controller.
[0076] 2) Monitoring information reporting process: reporting the monitoring information of the load balancer to the SDN controller.
[0077] 3) Data forwarding process: The load receives user request traffic forwarded by the programmable switch and forwards the request to the backend server using a load balancing algorithm. A session is established and saved in memory. A session read and session write API (Application Programming Interface) is provided for the session synchronization process to call. The API provides a session read and write interface for the session synchronization process to call.
[0078] 4) Session synchronization process: Session synchronization is performed regularly. Session synchronization is divided into two directions:
[0079] The outbound direction refers to calling the session read API of the data forwarding process to write the session established by this load balancer into the shared database.
[0080] The inbound direction refers to reading the sessions synchronized by other load balancers in the shared database, calling the session write API of the "data forwarding process", and writing to the data forwarding process.
[0081] The shared database is used to store session information synchronized by the load balancer and is responsible for managing and coordinating the session synchronization process between load balancers. The load balancer keeps the session data synchronized through the shared database. In particular, when a load balancer fails, other load balancers can read the session information from the shared database to ensure that the session is not interrupted.
[0082] In an optional implementation, the memory data structure storage system Redis can be used because it provides fast data reading and writing capabilities and supports data expiration, which helps manage session information; or the distributed key-value storage system etcd can be used to ensure the reliability and consistency of session data by taking advantage of its strong consistency and distributed coordination capabilities.
[0083] Backend server pool: The server pool is where client requests are ultimately processed. The load balancer distributes traffic to the nodes in the server pool. The server processes the request and returns a response. No matter which load balancer receives the request, the request will ultimately be processed by a node in the server pool.
[0084] The following describes a session synchronization method provided by an exemplary embodiment of the present application in combination with the system architecture described above and with reference to the accompanying drawings.
[0085] See also Figure 2 As shown, it is a flow chart of an implementation of a session synchronization method provided in an embodiment of the present application, which is applied to an SDN controller and includes the following steps S21 to S23:
[0086] S21: Obtain monitoring information uploaded by each load balancer in the load balancer cluster.
[0087] Among them, the load balancer cluster refers to a system composed of multiple load balancing devices, which are jointly responsible for distributing client requests to the backend server pool to achieve traffic sharing and fault redundancy; the load balancer refers to each device in the cluster, whose responsibility is to allocate requests to the appropriate backend server according to the scheduling algorithm when receiving traffic.
[0088] Monitoring information refers to the data uploaded by each load balancer about its operating status. This data includes but is not limited to: the number of new sessions, the number of concurrent sessions, session establishment time, session duration, traffic fluctuations, central processing unit (CPU) usage, and memory usage, and is used to monitor the health and performance of the load balancer.
[0089] Among them, the number of new sessions refers to the number of new sessions processed by the load balancer per unit time. The unit time can be 1 second, 2 seconds, etc., and this article does not make specific restrictions on the unit time. The number of concurrent sessions refers to the number of sessions that the load balancer has established. The session establishment time refers to the establishment time of each session of the load balancer to understand the frequency and time distribution of session startup. The session duration refers to the time from the start to the end of the session of the load balancer, which is used to evaluate the load balancer load and session stability. Traffic fluctuation refers to measuring the change in network traffic per unit time, which is used to analyze traffic load and fluctuation. CPU usage refers to monitoring the CPU usage percentage of the load balancer and evaluating the usage of computing resources. Memory usage refers to monitoring the memory usage percentage of the load balancer and evaluating the usage of memory resources.
[0090] In an optional embodiment, the monitoring information can be sent by the load balancer to the SDN controller in a timed upload manner. The load balancer uploads its current operating status at fixed intervals (e.g., 1 second or 5 seconds) to ensure that the SDN controller can periodically obtain the monitoring data of each load balancer.
[0091] In another optional embodiment, the monitoring information can be sent by the load balancer to the SDN controller in real-time upload. In this mode, the load balancer will immediately upload the monitoring information to the SDN controller when the running status changes (such as a new session or a significant fluctuation in traffic), so that the SDN controller can control the status in real time at a fine-grained level and quickly adjust the session synchronization strategy.
[0092] In another optional embodiment, the monitoring information can also be uploaded in an event-triggered manner. When the load balancer detects an abnormal indicator (for example, CPU usage or memory usage exceeds a preset threshold, or traffic fluctuation exceeds a normal range), the abnormal information is immediately uploaded to the SDN controller, so that the SDN controller can take corresponding measures in a timely manner.
[0093] It should be noted that the several monitoring information uploading methods listed above are just simple examples. In addition, other uploading methods are also applicable to the embodiments of the present application and will not be described in detail here.
[0094] In the embodiment of the present application, the SDN controller can obtain the monitoring information uploaded by each load balancer in the load balancer cluster through the monitoring information collection process, and on this basis, the fault prediction of these load balancers can be performed. The specific process is as follows:
[0095] S22: predicting faulty load balancers and normal load balancers in the load balancer cluster according to various monitoring information.
[0096] Among them, a faulty load balancer refers to a load balancer that is considered to have a high probability of failure after the fault detection model analyzes the monitoring information of the load balancer and the model predicts the operating status of the load balancer in the future based on the monitoring information. The operating status of such a device is abnormal and may not be able to process requests normally in the short term, for example, due to hardware failure, overload, excessive network latency or resource exhaustion. A normal load balancer refers to a load balancer that is considered to have a low probability of failure after the fault detection model analyzes the monitoring information and the model predicts the operating status of the load balancer in the future based on the monitoring information, and the load balancer is considered to have a stable operating status, can process client requests normally and shows no signs of failure.
[0097] In the embodiment of the present application, the prediction of the faulty load balancer and the normal load balancer is achieved through a fault detection model, which will be described in detail below:
[0098] First, the monitoring information of each load balancer needs to be input into the trained fault detection model respectively to obtain the failure probability of each load balancer predicted by the fault detection model.
[0099] The trained fault detection model refers to a model trained by a machine learning algorithm.
[0100] In an optional embodiment, the fault detection model can be a long short-term memory network (LSTM) model, or a gated recurrent unit (GRU) model, or other neural network-based prediction models, convolutional neural network (CNN), random forest model or Bayesian network model.
[0101] It should be noted that the several models listed above are just simple examples. This article does not limit the specific types of fault detection models. The choice of different models can be flexibly determined based on the data characteristics, computing resource requirements and prediction accuracy requirements in the actual application scenarios, and will not be elaborated here one by one.
[0102] Considering that LSTM can effectively process time series data and capture long-term dependencies, it is particularly suitable for predicting the operating status of a load balancer. The following takes the LSTM model as an example to introduce the training process of the fault detection model.
[0103] See also Figure 3 As shown, it is a flow chart of the training process of a fault detection model provided in an embodiment of the present application.
[0104] S31: Data collection.
[0105] First, data collection is required, that is, by collecting historical data of relevant monitoring information from the load balancer and / or SDN controller, constructing data set samples and sample labels. The data set samples are the historical data of monitoring information of each sample load balancer. The monitoring information includes but is not limited to the number of new sessions, the number of concurrent sessions, session establishment time, session duration, traffic fluctuations, CPU usage, memory usage, etc.
[0106] In an embodiment of the present application, the sample labels for fault detection model training are fault status labels, which identify whether each sample load balancer has a fault.
[0107] After constructing the data set samples and sample labels in the above manner, the data set samples need to be preprocessed.
[0108] S32: Data preprocessing.
[0109] In an optional embodiment, the collected data may be cleaned and standardized to remove outliers and noise, and the data may be divided into a training set, a validation set, and a test set to ensure the generalization ability of the model.
[0110] S33: Model construction.
[0111] After constructing the dataset samples and sample labels and preprocessing the data in the above manner, the fault detection model can be constructed.
[0112] Taking the LSTM model as an example, the fault detection model is determined by constructing the input layer, hidden layer and output layer of the LSTM model, where the input layer is used to receive the time series data of the preprocessed monitoring information, the hidden layer is composed of multiple LSTM units, and the output layer is used to predict the failure probability of the load balancer.
[0113] S34: Model training.
[0114] After constructing the fault detection model in the above manner, the fault detection model can be trained using the training set data. Specifically, during the training process, the training samples are first input into the model for prediction to obtain the output of the model. Then, a loss function is constructed based on the difference between the model output and the sample label. The loss function includes but is not limited to mean square error and cross entropy loss. The prediction performance of the model is evaluated by calculating the value of the loss function. Next, the back-propagation algorithm is used to calculate the gradient of the loss function to the model parameters, and the model parameters are updated by the gradient descent method to minimize the loss function. This process will continue until the model converges or reaches the preset number of iterations, thereby ensuring that the model can effectively capture the characteristics of the data and improve the accuracy of fault prediction.
[0115] In an embodiment of the present application, during the training process, validation set data is used to evaluate the model, and model hyperparameters (including but not limited to learning rate, number of hidden layer units, etc.) are adjusted to improve model performance.
[0116] S35: Model evaluation.
[0117] After the model is trained in the above manner, the trained LSTM model is evaluated using the test set data to calculate the model's indicators, including but not limited to prediction accuracy, recall rate, F1 score, etc., to ensure the reliability and accuracy of the model in the fault prediction task.
[0118] In an optional embodiment of the present application, after the model is trained and evaluated in the above manner, the LSTM model will be retrained regularly using the latest monitoring data to adapt to changes in the network environment and the state of the load balancer. Through continuous optimization, the efficiency and accuracy of the LSTM model in fault prediction are ensured.
[0119] By obtaining the trained fault detection model in the above manner, you can use the fault detection model to make predictions. Input the real-time monitoring information of the load balancer to be predicted into the fault detection model to obtain the failure probability of the load balancer, and predict the failure probability of each load balancer in the load balancer cluster in turn. Use the fault detection model to make real-time predictions on the operating status of the load balancer and discover potential faults in advance.
[0120] Then, the load balancer whose corresponding failure probability is higher than the preset probability threshold is regarded as a faulty load balancer; and the load balancer whose corresponding failure probability is not higher than the preset probability threshold is regarded as a normal load balancer.
[0121] In an embodiment of the present application, a preset probability threshold is used to measure the risk level of failure of the load balancer. The preset probability threshold can be flexibly set according to actual needs. For example, it can be set according to factors such as the tolerance of the system, historical failure data, and performance indicators of the load balancer. For example, it can be set to 80%. This means that if a load balancer is predicted to have a probability of failure exceeding 80% in future operation, the load balancer will be regarded as a faulty load balancer, and corresponding fault handling measures must be taken immediately to ensure the high availability and stability of the system. According to different application scenarios, the preset probability threshold can also be adjusted appropriately to achieve better balance and response efficiency. This application does not specifically limit the setting of the specific preset probability threshold.
[0122] In the above implementation, by predicting the faulty load balancer and the normal load balancer through the fault detection model, it is possible to identify the potential fault of the load balancer in advance, and facilitate the subsequent dynamic adjustment of the session direction and session synchronization frequency of the load balancer.
[0123] Through the above method, a fault detection model is constructed to predict faulty load balancers and normal load balancers, so as to realize early identification and dynamic adjustment of the load balancer status, and facilitate the subsequent adoption of targeted session synchronization strategies to ensure the stable operation of the system. The following will specifically introduce the operation of the SDN controller after the prediction.
[0124] In an optional implementation, the SDN controller may also send third configuration information to the programmable switch to delete the routing entry of the faulty load balancer from the routing list on the programmable switch side; wherein the routing entry is used to instruct the programmable switch to establish a session with the faulty load balancer through a specific path.
[0125] Specifically, the third configuration information is used to instruct the programmable switch to delete the routing entry of the failed load balancer from its routing list, ensuring that new sessions no longer pass through the failed load balancer.
[0126] Optionally, the third configuration information includes but is not limited to the load balancer identifier, routing priority, and status indication, wherein the load balancer identifier is used to uniquely identify and quickly locate the routing entry of the faulty load balancer; the routing priority enables the switch to adjust the load balancing strategy in a timely manner based on the information; the status indication is used to indicate the current operating status of the load balancer (such as "fault" or "normal"), ensuring that the switch can correctly update the routing list according to the fault status.
[0127] In an embodiment of the present application, the routing list is used to record the path information between the programmable switch and each load balancer to achieve efficient routing and traffic distribution of the session.
[0128] Optionally, the routing list may be an Equal-Cost Multi-Path (ECMP) forwarding list, which records all available paths so that the programmable switch can evenly distribute traffic among multiple equal-cost paths according to real-time conditions, thereby achieving higher fault tolerance and transmission efficiency.
[0129] In an optional embodiment, when the fault prediction process of the SDN controller predicts the operation status of the load balancer in the future based on the monitoring information, the faulty load balancer is determined. Assuming that the load balancer 1 is predicted to be the faulty load balancer, the SDN controller first sends a configuration to the programmable switch to delete the load balancer 1 from the ECMP list, and only keeps the traffic that has established a session with the load balancer 1, and no new session is established to the load balancer 1.
[0130] The above describes how the SDN controller sends configuration information to the programmable switch to adjust traffic routing. The following describes how the SDN controller sends configuration information to the faulty load balancer and the normal load balancer to adjust the session synchronization strategy and ensure session continuity.
[0131] S23: Sending first configuration information to the faulty load balancer to increase the session synchronization frequency of the faulty load balancer in the outbound direction; and sending second configuration information to the normal load balancer to increase the session synchronization frequency of the normal load balancer in the inbound direction.
[0132] The inbound direction corresponding to the load balancer indicates: writing the session data of other load balancers in the shared database into the load balancer memory; the outbound direction corresponding to the load balancer indicates: writing the session data of the load balancer into the shared database.
[0133] The first configuration information is used to indicate the adjustment of the session synchronization direction and the session frequency of the failed load balancer, and the second configuration information is used to indicate the adjustment of the session synchronization direction and the session frequency of the normal load balancer.
[0134] In an embodiment of the present application, first configuration information is sent to a faulty load balancer to increase the session synchronization frequency of the faulty load balancer in the outbound direction, and also includes: stopping the session synchronization of the faulty load balancer in the inbound direction; and, second configuration information is sent to a normal load balancer to increase the session synchronization frequency of the normal load balancer in the inbound direction, and also includes: stopping the session synchronization of the normal load balancer in the outbound direction.
[0135] The following example uses a load balancer cluster with three load balancers, where the fault detection model predicts that load balancer 1 is a faulty load balancer and load balancer 2 and load balancer 3 are normal load balancers:
[0136] In an embodiment of the present application, when the SDN controller predicts through a fault detection model that a load balancer is a faulty load balancer, still taking load balancer 1 as an example of a faulty load balancer, the SDN controller sends a first configuration information to load balancer 1 to stop the session synchronization of load balancer 1 in the inbound direction and increase the session synchronization frequency of load balancer 1 in the outbound direction, so that the existing sessions of load balancer 1 are synchronized to the shared database.
[0137] Among them, the first configuration information is an instruction issued by the SDN controller to the faulty load balancer, which is used to adjust the session synchronization strategy of the faulty load balancer so as to quickly synchronize the existing session data in the faulty load balancer to the shared database and reduce the risk of data loss caused by the failure.
[0138] Optionally, the first configuration information includes but is not limited to an instruction to close the session synchronization in the input direction, an instruction to increase the frequency of the session synchronization in the output direction, and a list of current session identifiers. Among them, the instruction to close the session synchronization in the input direction is used to instruct the load balancer to stop the session synchronization in the "input direction" to avoid continuing to receive and transmit new session data; the instruction to increase the frequency of the session synchronization in the output direction is used to speed up the synchronization frequency of the existing session so that the session data of the failed load balancer can be backed up to the shared database more quickly; the list of current session identifiers is used to record the active session identifiers in the failed load balancer to ensure the integrity of the synchronization process and avoid missing any unfinished session data during the synchronization process.
[0139] Still taking the faulty load balancer as load balancer 1 as an example, the first configuration information is sent down through the SDN controller. The SDN controller ensures that load balancer 1 only retains the synchronization of existing sessions, stops the access of new session traffic, and reduces the synchronization pressure. Since the switch will no longer establish a new session to load balancer 1 at this time, even in a high concurrency scenario, the pressure of session synchronization will not be very high.
[0140] In the embodiment of the present application, when the SDN controller predicts that a certain load balancer is a faulty load balancer through the fault detection model, and still taking load balancer 1 as a faulty load balancer and load balancers 2 and 3 as normal load balancers as an example, the SDN controller sends the second configuration information to load balancers 2 and 3, stops the session synchronization of load balancers 2 and 3 in the outbound direction, and only performs session synchronization in the inbound direction, and the inbound direction session synchronization does not pay attention to the sessions of other normal load balancers, only synchronizes the session synchronization of the predicted faulty load balancer (load balancer 1), and increases the inbound direction synchronization frequency. The session of load balancer 1 is synchronized to load balancers 2 and 3 in a short time.
[0141] Among them, the second configuration information is the instruction issued by the SDN controller to the normal load balancer, which is used to assist in quickly synchronizing the session status data in the faulty load balancer to other normal load balancers, ensuring that the session of the faulty load balancer can be taken over and restored by other load balancers to ensure uninterrupted service.
[0142] Optionally, the second configuration information includes but is not limited to: an inbound session synchronization start instruction, an outbound session synchronization stop instruction, and a faulty load balancer session identifier list. The inbound session synchronization start instruction is used to instruct the normal load balancer to receive session data from the faulty load balancer only in the inbound direction to achieve directional session synchronization; the outbound session synchronization stop instruction is used to stop the normal load balancer from synchronizing session data in the outbound direction to reduce the synchronization load; the faulty load balancer session identifier list is used to ensure that the normal load balancer receives all active session data from the faulty load balancer during the synchronization process to prevent omissions.
[0143] Since some sessions of load balancer 1 have been synchronized during the previous scheduled session synchronization, the synchronization at this time is just to check for omissions and fill in the gaps, so the synchronization pressure will not be very large and the overall performance of the load balancer will be slightly affected.
[0144] Through the above process, the reliability and stability of the load balancer cluster can be effectively improved. When a fault occurs, the SDN controller can promptly identify the faulty load balancer and quickly adjust the session synchronization strategy to ensure that client requests can continue to be processed. This dynamic management capability reduces the fault response time, enhances the high availability of the overall service, and optimizes the utilization efficiency of resources, avoiding service interruptions caused by faulty load balancers.
[0145] The above introduces that the SDN controller sends configuration information to the load balancer, mainly predicting the faulty load balancer and the normal load balancer through the fault detection model, and then sends the third configuration information to the programmable switch, sends the first configuration information to the faulty load balancer, and sends the second configuration information to the normal load balancer, so that the programmable switch adjusts the routing list and the load balancer adjusts the session policy. That is, the specific adjustment of the session policy is carried out in the load balancer, so the specific operation of the load balancer will be introduced below.
[0146] See also Figure 4 As shown, it is an implementation flow chart of another session synchronization method provided in an embodiment of the present application, which is applied to a load balancer and includes the following steps:
[0147] S41: Upload monitoring information to the SDN controller so that the SDN controller predicts the faulty load balancer and the normal load balancer in the load balancer cluster based on the monitoring information uploaded by each load balancer in the load balancer cluster, and sends the first configuration information to the faulty load balancer and sends the second configuration information to the normal load balancer.
[0148] In an embodiment of the present application, the load balancer uploads monitoring information to the SDN controller, so that the SDN controller predicts the faulty load balancer and the normal load balancer in the load balancer cluster based on the monitoring information uploaded by each load balancer in the load balancer cluster, and sends the first configuration information to the faulty load balancer and sends the second configuration information to the normal load balancer. The specific implementation method of this process refers to the above-mentioned relevant description of the SDN controller side, which will not be repeated here.
[0149] S42: If the first configuration information is received, based on the first configuration information, the session synchronization frequency of the load balancer in the outbound direction is increased, and session synchronization is performed based on the adjusted session synchronization frequency; if the second configuration information is received, based on the second configuration information, the session synchronization frequency of the load balancer in the inbound direction is increased, and session synchronization is performed based on the adjusted session synchronization frequency.
[0150] The inbound direction corresponding to the load balancer indicates: writing the session data of other load balancers in the shared database into the load balancer memory; the outbound direction corresponding to the load balancer indicates: writing the session data of the load balancer into the shared database.
[0151] In the embodiment of the present application, if the first configuration information is received, it means that the load balancer is a faulty load balancer. The faulty load balancer receives the first configuration information, stops the session in the incoming direction, and increases the session synchronization frequency in the outgoing direction.
[0152] Wherein, increasing the session synchronization frequency of the load balancer in the outbound direction includes: increasing the session synchronization frequency in the outbound direction from a first synchronization frequency to a second synchronization frequency;
[0153] The first synchronization frequency refers to the base frequency for executing session synchronization in the timed synchronization working state, that is, the frequency at which the load balancer writes session data into the shared database or into the load balancer in the timed synchronization state. The second synchronization frequency refers to the frequency at which the faulty load balancer increases the outbound session synchronization frequency after receiving the first configuration information, which is used to achieve faster data transfer and backup in the event of a fault.
[0154] Among them, scheduled synchronization refers to a mechanism that synchronizes session information regularly by setting a fixed time interval, aiming to ensure data consistency between the primary load balancer and the backup load balancer. Scheduled synchronization is synchronized at a preset first synchronization frequency, which is used to periodically synchronize session information to ensure data consistency between the primary load balancer and the backup load balancer. The first synchronization frequency may be set according to specific application requirements, such as synchronization every few minutes.
[0155] In the present application, based on the timed synchronization, the first synchronization frequency is dynamically adjusted when a fault occurs. In an optional embodiment, after the load balancer receives the first configuration information after detecting the fault, the session synchronization in the inbound direction is stopped, and the synchronization frequency in the outbound direction is quickly increased, so that data transfer and backup can be achieved faster, and are no longer limited to the originally set fixed frequency, thereby effectively reducing synchronization delays and resource waste.
[0156] In an optional implementation, the first synchronization frequency can be increased to the second synchronization frequency in the following ways, including but not limited to: increasing the synchronization frequency by a fixed value, such as adjusting the synchronization once per minute to once every 30 seconds; dynamically adjusting according to the current traffic request, such as automatically increasing the synchronization frequency when the traffic increases; or using a grade / point ratio step-by-step increase, increasing the synchronization frequency in stages according to the current load of the load balancer, so as to more flexibly cope with different workloads. Through these ways, the data synchronization efficiency can be effectively improved and the impact of failures on system stability can be reduced.
[0157] By receiving the first configuration information when the load balancer fails, the "inbound direction" session synchronization is stopped, and the outbound direction session synchronization frequency is increased to the second synchronization frequency, the session data is quickly synchronized to the shared database. This mechanism effectively reduces the pressure on the failed load balancer, ensures the real-time backup of the session data, and improves the stability of the system and data security.
[0158] In the embodiment of the present application, if the second configuration information is received, it means that the load balancer is a normal load balancer. The normal load balancer receives the second configuration information, stops the session in the outbound direction, and increases the session synchronization frequency in the inbound direction.
[0159] Among them, increasing the session synchronization frequency of the normal load balancer in the inbound direction includes: increasing the session synchronization frequency in the inbound direction from the first synchronization frequency to the third synchronization frequency.
[0160] The third synchronization frequency refers to the increase of the session synchronization frequency in the inbound direction after the normal load balancer receives the second configuration information, which is used to timely and comprehensively receive and process the data of the faulty load balancer, thereby realizing rapid migration and redundant backup of session data, and improving the fault tolerance and stability of session synchronization.
[0161] In an embodiment of the present application, the session synchronization frequency of the normal load balancer in the inbound direction is increased, and the method of increasing the session synchronization frequency in the inbound direction from the first synchronization frequency to the third synchronization frequency is the same as the method of increasing the first synchronization frequency to the second synchronization frequency mentioned above. The second synchronization frequency and the third synchronization frequency may be the same or different, and the present application does not impose any specific restrictions on this.
[0162] By receiving the second configuration information when the load balancer is normal, stopping the outbound session synchronization, and increasing the inbound session synchronization frequency to the third synchronization frequency, the session data of the faulty load balancer in the shared database is quickly synchronized to the normal load balancer, effectively improving the stability and fault tolerance of the session synchronization, and ensuring the continuity and security of the session data when the load balancer fails.
[0163] See also Figure 5 As shown, it is a schematic diagram of an implementation of a session synchronization method provided in an embodiment of the present application.
[0164] S51: The client forwards data traffic to the programmable switch, and the programmable switch distributes the traffic to each load balancer in the load balancer cluster.
[0165] S52: Upload monitoring information of each load balancer in the load balancer cluster to the SDN controller.
[0166] S53: The SDN controller predicts a faulty load balancer and a normal load balancer in the load balancer cluster based on the monitoring information uploaded by each load balancer in the load balancer cluster.
[0167] S54: The SDN controller sends third configuration information to the programmable switch to delete the routing entry of the failed load balancer from the routing list on the programmable switch side.
[0168] S55: The SDN controller sends the first configuration information to the faulty load balancer, stops the session synchronization of the faulty load balancer in the inbound direction, and increases the session synchronization frequency in the outbound direction from the first synchronization frequency to the second synchronization frequency.
[0169] S56: The SDN controller sends the second configuration information to the normal load balancer, stops the session synchronization of the normal load balancer in the outbound direction, and increases the session synchronization frequency in the inbound direction from the first synchronization frequency to the third synchronization frequency.
[0170] S57: Transfers the session traffic of the load balancer to the backend server pool.
[0171] The specific implementation of the above process has been specifically introduced above, and this application will not repeat it here in order to show the overall implementation example of the solution.
[0172] Based on the same inventive concept, the embodiment of the present application also provides a session synchronization device. Figure 6 As shown, it is a structural diagram of a session synchronization device 600, which may include:
[0173] The acquisition unit 601 is used to acquire the monitoring information uploaded by each load balancer in the load balancer cluster;
[0174] A prediction unit 602, configured to predict a faulty load balancer and a normal load balancer in the load balancer cluster according to various monitoring information;
[0175] Configuration unit 603 is used to send the first configuration information to the faulty load balancer to increase the session synchronization frequency of the faulty load balancer in the outbound direction; and to send the second configuration information to the normal load balancer to increase the session synchronization frequency of the normal load balancer in the inbound direction; the inbound direction corresponding to the load balancer means: writing the session data of other load balancers in the shared database into the load balancer memory; the outbound direction corresponding to the load balancer means: writing the session data of the load balancer into the shared database.
[0176] Optionally, the configuration unit 603 is further configured to:
[0177] Stop session synchronization in the inbound direction of the failed load balancer;
[0178] And, the configuration unit 603 is further used for:
[0179] Stops normal load balancer session synchronization in the outbound direction.
[0180] Optionally, the prediction unit 602 is specifically configured to:
[0181] After inputting each monitoring information into the trained fault detection model, the failure probability of each load balancer predicted by the fault detection model is obtained;
[0182] The load balancer whose corresponding failure probability is higher than the preset probability threshold is regarded as a failed load balancer;
[0183] And, the load balancer whose corresponding failure probability is not higher than the preset probability threshold is regarded as a normal load balancer.
[0184] Optionally, after the prediction unit 602 predicts the faulty load balancer and the normal load balancer in the load balancer cluster according to various monitoring information, the configuration unit 603 is further used to:
[0185] The third configuration information is sent to the programmable switch to delete the routing entry of the faulty load balancer from the routing list on the programmable switch side; wherein the routing entry is used to instruct the programmable switch to establish a session with the faulty load balancer through a specific path.
[0186] Based on the same inventive concept, the present application embodiment also provides another session synchronization device. Figure 7 As shown, it is a structural diagram of another session synchronization device 700, which may include:
[0187] The uploading unit 701 is used to upload the monitoring information to the SDN controller, so that the SDN controller predicts the faulty load balancer and the normal load balancer in the load balancer cluster based on the monitoring information uploaded by each load balancer in the load balancer cluster, and sends the first configuration information to the faulty load balancer and sends the second configuration information to the normal load balancer;
[0188] The adjusting unit 702 is configured to increase the session synchronization frequency of the load balancer in the outbound direction based on the first configuration information if the first configuration information is received, and perform session synchronization based on the adjusted session synchronization frequency;
[0189] If the second configuration information is received, the session synchronization frequency of the load balancer in the input direction is increased based on the second configuration information, and session synchronization is performed based on the adjusted session synchronization frequency; the input direction corresponding to the load balancer indicates: writing the session data of other load balancers in the shared database into the load balancer memory; the output direction corresponding to the load balancer indicates: writing the session data of the load balancer into the shared database.
[0190] Optionally, the adjusting unit 702 is further configured to:
[0191] Stop the load balancer's session synchronization in the inbound direction;
[0192] And, the adjustment unit 702 is further used for:
[0193] Stops session synchronization in the outbound direction of the load balancer.
[0194] Optionally, each load balancer in the load balancer cluster is further used to: periodically perform session synchronization in the outbound direction and the inbound direction according to the first synchronization frequency in the timed session synchronization scenario, and the adjustment unit 702 is specifically used to:
[0195] The session synchronization frequency in the outbound direction is increased from the first synchronization frequency to the second synchronization frequency; and the adjustment unit is specifically used to:
[0196] The session synchronization frequency in the inbound direction is increased from the first synchronization frequency to the third synchronization frequency.
[0197] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing this application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.
[0198] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0199] After introducing the session synchronization method and apparatus according to an exemplary embodiment of the present application, next, an electronic device according to another exemplary embodiment of the present application is introduced.
[0200] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.
[0201] Based on the same inventive concept as the above method embodiment, an electronic device is also provided in the embodiment of the present application. In one embodiment, the electronic device may be a server. In this embodiment, the structure of the electronic device may be as follows: Figure 8 As shown, it includes a memory 801 , a communication module 803 and one or more processors 802 .
[0202] The memory 801 is used to store computer programs executed by the processor 802. The memory 801 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0203] The memory 801 may be a volatile memory, such as a random-access memory (RAM); the memory 801 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 801 may be any other medium that can be used to carry or store a desired computer program in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 801 may be a combination of the above memories.
[0204] The processor 802 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 802 is configured to implement the above session synchronization method when calling the computer program stored in the memory 801 .
[0205] The communication module 803 is used to communicate with terminal devices and other servers.
[0206] The specific connection medium between the memory 801, the communication module 803 and the processor 802 is not limited in the embodiment of the present application. Figure 8 In the embodiment, the memory 801 and the processor 802 are connected via a bus 804. The bus 804 is Figure 8 The connections between the other components are described with bold lines, which are only for illustrative purposes and are not intended to be limiting. The bus 804 can be divided into an address bus, a data bus, a control bus, etc. For ease of description, Figure 8 The diagram shows that only one thick line is used, but this does not mean that there is only one bus or only one type of bus.
[0207] The memory 801 stores a computer storage medium, and the computer storage medium stores computer executable instructions, and the computer executable instructions are used to implement the XXXX method of the embodiment of the present application. The processor 802 is used to execute the above-mentioned session synchronization method, such as Figure 2 shown.
[0208] In some possible implementations, various aspects of the session synchronization method provided by the present application may also be implemented in the form of a program product, which includes a computer program. When the program product is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of the session synchronization method according to various exemplary implementations of the present application described above in this specification. For example, the electronic device may execute the following steps: Figure 2 or Figure 4 Follow the steps shown in .
[0209] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0210] The program product of the embodiment of the present application may adopt a portable compact disk read-only memory (CD-ROM) and include a computer program, and can be run on an electronic device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which can be used by or in combination with a command execution system, apparatus, or device.
[0211] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0212] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0213] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain a computer-usable computer program.
[0214] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program commands. These computer program commands can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the commands executed by the processor of the computer or other programmable data processing device generate commands for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0215] These computer program commands may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the commands stored in the computer readable memory produce an article of manufacture comprising a command device, the command device implementing the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0216] These computer program commands can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the commands executed on the computer or other programmable device provide the instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0217] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0218] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A session synchronization method, characterized in that: Applied to a software defined network (SDN) controller, the method comprises: Get the monitoring information uploaded by each load balancer in the load balancer cluster; Predicting faulty load balancers and normal load balancers in the load balancer cluster according to each of the monitoring information; The first configuration information is sent to the faulty load balancer to increase the session synchronization frequency of the faulty load balancer in the outbound direction; and the second configuration information is sent to the normal load balancer to increase the session synchronization frequency of the normal load balancer in the inbound direction; the inbound direction corresponding to the load balancer indicates: writing the session data of other load balancers in the shared database into the memory of the load balancer; the outbound direction corresponding to the load balancer indicates: writing the session data of the load balancer into the shared database.
2. The method according to claim 1, characterized in that The sending of the first configuration information to the faulty load balancer to increase the session synchronization frequency of the faulty load balancer in the outbound direction also includes: Stopping session synchronization of the failed load balancer in the inbound direction; And, sending the second configuration information to the normal load balancer to increase the session synchronization frequency of the normal load balancer in the inbound direction also includes: Stop the session synchronization of the normal load balancer in the outgoing direction.
3. The method according to claim 1, characterized in that The predicting, according to each of the monitoring information, a faulty load balancer and a normal load balancer in the load balancer cluster includes: After inputting each of the monitoring information into the trained fault detection model, the failure probability of each load balancer predicted by the fault detection model is obtained; The load balancer whose corresponding failure probability is higher than the preset probability threshold is regarded as a failed load balancer; And, the load balancer whose corresponding failure probability is not higher than the preset probability threshold is regarded as a normal load balancer.
4. The method according to any one of claims 1 to 3, characterized in that: After predicting the faulty load balancers and normal load balancers in the load balancer cluster according to each of the monitoring information, the method further includes: The third configuration information is sent to the programmable switch to delete the routing entry of the faulty load balancer from the routing list on the programmable switch side; wherein the routing entry is used to instruct the programmable switch to establish a session with the faulty load balancer through a specific path.
5. A session synchronization method, characterized in that: Applied to a load balancer, the method comprises: Uploading monitoring information to the SDN controller, so that the SDN controller predicts a faulty load balancer and a normal load balancer in the load balancer cluster based on the monitoring information uploaded by each load balancer in the load balancer cluster, and sends the first configuration information to the faulty load balancer and sends the second configuration information to the normal load balancer; If the first configuration information is received, based on the first configuration information, increasing the session synchronization frequency of the load balancer in the outbound direction, and performing session synchronization based on the adjusted session synchronization frequency; If the second configuration information is received, the session synchronization frequency of the load balancer in the input direction is increased based on the second configuration information, and session synchronization is performed based on the adjusted session synchronization frequency; the input direction corresponding to the load balancer indicates: writing the session data of other load balancers in the shared database into the memory of the load balancer; the output direction corresponding to the load balancer indicates: writing the session data of the load balancer into the shared database.
6. The method according to claim 5, characterized in that The increasing the session synchronization frequency of the load balancer in the outbound direction based on the first configuration information further includes: Stopping session synchronization of the load balancer in the inbound direction; And, the increasing the session synchronization frequency of the load balancer in the inbound direction based on the second configuration information further includes: Stops session synchronization of the load balancer in the outbound direction.
7. The method according to claim 5, characterized in that Each load balancer in the load balancer cluster is further used to: periodically perform session synchronization in an outbound direction and an inbound direction according to a first synchronization frequency in a timed session synchronization scenario; The increasing the session synchronization frequency of the load balancer in the outbound direction includes: Increasing the outgoing session synchronization frequency from the first synchronization frequency to a second synchronization frequency; The increasing the session synchronization frequency of the load balancer in the inbound direction includes: The session synchronization frequency in the inbound direction is increased from the first synchronization frequency to a third synchronization frequency.
8. A conversation synchronization device, characterized in that: include: An acquisition unit, used to acquire monitoring information uploaded by each load balancer in the load balancer cluster; A prediction unit, configured to predict a faulty load balancer and a normal load balancer in the load balancer cluster according to each of the monitoring information; A configuration unit, configured to send first configuration information to the faulty load balancer to increase the session synchronization frequency of the faulty load balancer in the outbound direction; and send second configuration information to the normal load balancer to increase the session synchronization frequency of the normal load balancer in the inbound direction; The inbound direction corresponding to the load balancer indicates: writing the session data of other load balancers in the shared database into the memory of the load balancer; the outbound direction corresponding to the load balancer indicates: writing the session data of the load balancer into the shared database.
9. A conversation synchronization device, characterized in that: include: an uploading unit, configured to upload monitoring information to the SDN controller, so that the SDN controller predicts a faulty load balancer and a normal load balancer in the load balancer cluster based on the monitoring information uploaded by each load balancer in the load balancer cluster, and sends first configuration information to the faulty load balancer and sends second configuration information to the normal load balancer; an adjusting unit, configured to, if receiving the first configuration information, increase the session synchronization frequency of the load balancer in the outbound direction based on the first configuration information, and perform session synchronization based on the adjusted session synchronization frequency; If the second configuration information is received, the session synchronization frequency of the load balancer in the input direction is increased based on the second configuration information, and session synchronization is performed based on the adjusted session synchronization frequency; the input direction corresponding to the load balancer indicates: writing the session data of other load balancers in the shared database into the memory of the load balancer; the output direction corresponding to the load balancer indicates: writing the session data of the load balancer into the shared database.
10. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of the methods of claims 1 to 7.
Citation Information
Patent Citations
A load balancing system for realizing cross-regional cluster scheduling
CN109842686A
Communication method and network element
CN110913437A
Information synchronization method and system, electronic equipment and computer readable storage medium
CN116192876A
Packet transfer system and packet transfer method
JP2017126976A
Load balancing in a network with session information
US20120210416A1