A session synchronization method, apparatus, device, and medium
By acquiring monitoring information from the load balancer cluster and using a fault detection model to predict faulty and normal load balancers, the efficiency problem of load balancer session synchronization is solved by dynamically adjusting the session synchronization frequency and traffic routing. This enables rapid backup and synchronization of session data, improving system stability and resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DAWNING CLOUD COMPUTING TECH CO LTD
- Filing Date
- 2024-11-12
- Publication Date
- 2026-07-31
AI Technical Summary
Existing load balancer session synchronization methods suffer from high performance overhead, high network bandwidth consumption, synchronization delay, and resource waste in high-traffic scenarios, making it difficult to achieve efficient session synchronization.
By acquiring monitoring information of the load balancer cluster, using a fault detection model to predict faulty and normal load balancers, configuration information to increase the outbound session synchronization frequency is sent to the faulty load balancer, and configuration information to increase the inbound session synchronization frequency is sent to the normal load balancer. Traffic routing is adjusted through a programmable switch to ensure rapid backup and synchronization of session data.
It improves the stability and fault tolerance of session synchronization, reduces the impact of failures on the overall system, ensures the security and reliability of session data, and optimizes resource utilization.
Smart Images

Figure CN119520525B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network application technology, and in particular to a session synchronization method, apparatus, device, and medium. Background Technology
[0002] In modern network environments, especially in Software-Defined Networking (SDN) scenarios, load balancers are critical devices for ensuring high system availability and performance. To achieve high availability, load balancers are typically deployed in clusters. Traditional Layer 4 load balancing is primarily based on transport layer protocols, such as Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). Its main function is to distribute workloads across multiple server nodes to optimize resource utilization and system performance.
[0003] To ensure that the continuity of TCP connections and the overall service availability are not affected when a load balancer fails, session synchronization is usually required between load balancers. This ensures that the backup load balancer in the cluster can take over the workload in a timely manner without interrupting existing connections.
[0004] Currently, the main methods for session synchronization include the following two:
[0005] 1. Real-time session synchronization.
[0006] Real-time session synchronization is performed via UDP multicast each time a new session is established. However, frequent synchronization operations can lead to significant performance overhead and network bandwidth consumption, especially in high-traffic scenarios, potentially causing overuse of system resources. Furthermore, since UDP cannot guarantee packet order or reliable transmission, additional acknowledgment and retransmission mechanisms may be needed to ensure data transmission integrity and accuracy, further increasing system complexity.
[0007] 2. Scheduled session synchronization.
[0008] Scheduled session synchronization uses a periodic synchronization mechanism to synchronize session information at specified time intervals to ensure consistency between the primary and backup load balancers. However, scheduled synchronization mechanisms suffer from issues such as synchronization delays and resource waste. For example, setting too long a synchronization interval may lead to inconsistencies in session information, while too short an interval may increase system load and bandwidth consumption.
[0009] In summary, improving the efficiency of session synchronization between load balancers is an urgent issue to be addressed. Summary of the Invention
[0010] This application provides a session synchronization method, apparatus, electronic device, and storage medium to improve the efficiency of session synchronization between load balancers.
[0011] This application provides a session synchronization method applied to an SDN controller, comprising:
[0012] Obtain the monitoring information uploaded by each load balancer in the load balancer cluster;
[0013] Based on the monitoring information, predict the faulty and normal load balancers in the load balancer cluster.
[0014] The system sends first configuration information to the faulty load balancer to increase the session synchronization frequency of the faulty load balancer in the outgoing direction; and sends second configuration information to the normal load balancer to increase the session synchronization frequency of the normal load balancer in the incoming direction. The incoming direction of the load balancer indicates that session data of other load balancers in the shared database is written to the memory of the load balancer. The outgoing direction of the load balancer indicates that session data of the load balancer is written to the shared database.
[0015] Optionally, sending the first configuration information to the fault load balancer to increase the session synchronization frequency of the fault load balancer in the outgoing direction further includes: stopping the session synchronization of the fault load balancer in the incoming direction.
[0016] Furthermore, the step of 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, thereby avoiding invalid data processing. The session synchronization of the normal load balancer in the outbound direction is stopped, and resources are concentrated 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 the trained fault detection model, the fault probability of each load balancer predicted by the fault detection model can be obtained.
[0019] Load balancers with a failure probability higher than a preset probability threshold are designated as faulty load balancers.
[0020] Furthermore, load balancers whose corresponding failure probability is not higher than a preset probability threshold are designated as normal load balancers.
[0021] By using the above methods, a fault detection model is constructed to predict faulty and normal load balancers, enabling early identification and dynamic adjustment of load balancer status. This facilitates the adoption of targeted session synchronization strategies to ensure the stable operation of the system.
[0022] Optionally, a third configuration message is sent to the programmable switch to delete the routing entry of the fault 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 fault load balancer through a specific path.
[0023] By employing the above method, traffic routing can be adjusted in a timely manner before a load balancer fails, preventing new session requests from being assigned to a load balancer that is about to fail. This ensures the high availability and stability of the session system, effectively reduces the risk of session loss, and guarantees the continuity of existing sessions. This method maintains a stable distribution of traffic through dynamic routing adjustments via the programmable switch, ensuring uninterrupted service and optimizing overall resource utilization.
[0024] Another session synchronization method provided in this application embodiment, applied to a load balancer, includes:
[0025] The monitoring information is uploaded to the SDN controller so that the SDN controller can predict the faulty load balancers and normal load balancers in the load balancer cluster based on the monitoring information uploaded by each load balancer in the load balancer cluster, and send the first configuration information to the faulty load balancer and the second configuration information to the normal load balancer.
[0026] If the first configuration information is received, the session synchronization frequency of the load balancer in the outgoing direction is increased based on the first configuration information, and session synchronization is performed 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 inbound direction is increased based on the second configuration information, and session synchronization is performed based on the adjusted session synchronization frequency; 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.
[0028] Optionally, increasing the session synchronization frequency of the load balancer in the outgoing direction based on the first configuration information further includes:
[0029] Stop the load balancer's session synchronization in the inbound direction;
[0030] Furthermore, the step of increasing the session synchronization frequency of the load balancer in the inbound direction based on the second configuration information further includes:
[0031] Stop the load balancer's session synchronization in the outbound direction.
[0032] Through the above process, the session synchronization of the faulty load balancer in the inbound direction is stopped, thereby avoiding invalid data processing. The session synchronization of the normal load balancer in the outbound direction is stopped, and resources are concentrated 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 the timed session synchronization scenario, outgoing and incoming session synchronization can be performed periodically according to the first synchronization frequency.
[0034] Increasing the session synchronization frequency of the load balancer in the outgoing direction includes:
[0035] Increase the session synchronization frequency in the outgoing direction from the first synchronization frequency to the second synchronization frequency;
[0036] 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 the third synchronization frequency.
[0038] Through the above process, the outbound session synchronization frequency is increased to the second synchronization frequency, enabling rapid synchronization of session data to the shared database. The inbound session synchronization frequency is increased to the third synchronization frequency, enabling rapid synchronization of session data from the faulty load balancer in the shared database to the normal load balancer. This effectively improves the stability and fault tolerance of session synchronization, ensuring the continuity and security of session data when the load balancer fails.
[0039] This application provides a session synchronization device, comprising:
[0040] The acquisition unit is used to acquire the monitoring information uploaded by each load balancer in the load balancer cluster.
[0041] The prediction unit is used to predict the faulty load balancers and normal load balancers in the load balancer cluster based on the monitoring information.
[0042] The configuration unit is configured to send first configuration information to the faulty load balancer to increase the session synchronization frequency of the faulty load balancer in the outgoing direction; and to send second configuration information to the normal load balancer to increase the session synchronization frequency of the normal load balancer in the incoming direction; the incoming direction of the load balancer indicates that the session data of other load balancers in the shared database is written to the memory of the load balancer; the outgoing direction of the load balancer indicates that the session data of the load balancer is written to the shared database.
[0043] Another session synchronization device provided in this application embodiment includes:
[0044] The upload unit is used to upload monitoring information to the SDN controller, so that the SDN controller can predict the faulty load balancers and normal load balancers in the load balancer cluster based on the monitoring information uploaded by each load balancer in the load balancer cluster, and send first configuration information to the faulty load balancer and second configuration information to the normal load balancer.
[0045] An adjustment unit is configured to, if it receives first configuration information, increase the session synchronization frequency of the load balancer in the outgoing 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 inbound direction is increased based on the second configuration information, and session synchronization is performed based on the adjusted session synchronization frequency; 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.
[0047] An electronic device provided in this 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 performs the steps of any of the above-described session synchronization methods.
[0048] This application provides a computer-readable storage medium including a computer program that, when run on an electronic device, causes the electronic device to perform the steps of any of the above-described session methods.
[0049] This application provides a computer program product, which includes a computer program 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, causing the electronic device to perform the steps of any of the above-described session methods.
[0050] The beneficial effects of this application are as follows:
[0051] This application provides a session synchronization method, apparatus, electronic device, and storage medium. First, monitoring information uploaded by each load balancer is acquired for training and prediction of a fault detection model, ensuring the model accurately reflects the load balancer's operating status and potential fault risks. Then, based on the monitoring information, the fault detection model predicts which load balancers in the load balancer cluster are faulty or normal, allowing for timely intervention. Finally, first and second configuration information are sent to the faulty and normal load balancers respectively to increase the session synchronization frequency of the faulty load balancer in the outgoing direction, ensuring rapid backup of its session data to the shared database, and to increase the session synchronization frequency of the normal load balancer in the incoming direction. This achieves timely reception and redundant backup of the faulty load balancer's session data, improving the stability and fault tolerance of session synchronization, ensuring the security and reliability of session data, and reducing the impact of faults on the overall system.
[0052] This application provides another session synchronization method, apparatus, 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. Second, if first configuration information is received, the session synchronization frequency of the load balancer in the outgoing direction is increased based on the information, and 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 second configuration information is received, the session synchronization frequency of the load balancer in the incoming direction is increased based on the information, and session synchronization is performed based on the adjusted session synchronization frequency, thereby timely receiving the session data of the faulty load balancer, ensuring the stability of session synchronization and data redundancy backup. By flexibly adjusting the session synchronization frequency, the load balancer's ability to respond to faults is improved, which helps to improve overall performance and reliability.
[0053] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description
[0054] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0055] Figure 1 An architecture diagram of a session synchronization system provided in this application embodiment;
[0056] Figure 2 A flowchart illustrating the implementation of a session synchronization method provided in this application embodiment;
[0057] Figure 3 A flowchart illustrating the training process of a fault detection model provided in this application embodiment;
[0058] Figure 4 A flowchart illustrating the implementation of another session synchronization method provided in this application embodiment;
[0059] Figure 5 This is a schematic diagram illustrating an implementation of a session synchronization method provided in an embodiment of this application.
[0060] Figure 6 This is a schematic diagram of the structure of a session synchronization device;
[0061] Figure 7 A schematic diagram of another type of session synchronization device;
[0062] Figure 8 This is a schematic diagram of the composition structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0063] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this application. Obviously, the described embodiments are only some embodiments of the technical solutions of this application, and not all embodiments. Based on the embodiments recorded in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the technical solutions of this application.
[0064] The preferred embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit this application. Furthermore, the embodiments and features in the embodiments of this application can be combined with each other without conflict.
[0065] See Figure 1As shown, it is an architecture diagram of a session synchronization system provided in an embodiment of this application.
[0066] like Figure 1 As shown, the session synchronization system consists of six parts: client, SDN controller, programmable switch, load balancer cluster, shared database (for session shared storage) and backend server pool.
[0067] In simple terms, in this system, client requests are distributed to load balancers via programmable switches, and then the load balancers forward the requests to the backend server pool for processing. The programmable switches are 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 functions of each part are described below:
[0069] Client: The client is responsible for initiating requests, typically from users or applications. Client request traffic first enters the network's programmable switch, is routed to the load balancer, and then forwarded to the backend server pool. The servers process the traffic and return the results 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 a potential fault is predicted, the SDN controller issues configuration information, adjusts the traffic distribution path of the programmable switch, and adjusts the session synchronization strategy of the load balancer.
[0071] Programmable switches: Programmable switches are responsible for determining 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). They can adjust the forwarding path in real time to ensure that the failed load balancer no longer receives new session requests and redistributes traffic to other normal load balancers.
[0072] Load balancer cluster: A cluster of multiple load balancers responsible for distributing requests from clients to a pool of backend servers. Each load balancer synchronizes its session state to a shared database used for shared storage, so that if one load balancer fails, the others can continue processing unfinished sessions.
[0073] In one optional embodiment, the load balancer cluster has 3 load balancers; in another optional embodiment, the load balancer cluster may have 8 load balancers. The document does not impose a specific limitation on the number of load balancers in the load balancer cluster.
[0074] The load balancer consists of four processes, each with the following functions:
[0075] 1) Configure receiving process: Receive configuration information sent by the SDN controller.
[0076] 2) Monitoring information reporting process: The monitoring information of the load balancer is reported to the SDN controller.
[0077] 3) Data Forwarding Process: The load balancer receives user request traffic forwarded by the programmable switch and uses a load balancing algorithm to forward the requests to the backend server. A session is established and stored in memory. Session read and write APIs (Application Programming Interfaces) are provided for the session synchronization process to call. The API provides interfaces for session reading and writing for the session synchronization process to use.
[0078] 4) Session synchronization process: Session synchronization is performed periodically. Session synchronization has two directions:
[0079] The outgoing 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 sessions synchronized from other load balancers within the shared database, calling the session write API of the "data forwarding process", and writing to the data forwarding process.
[0081] A shared database is used to store session information synchronized from load balancers and is responsible for managing and coordinating the session synchronization process between load balancers. Load balancers maintain session data synchronization through the shared database, especially when one load balancer fails; other load balancers can read session information from the shared database to ensure uninterrupted sessions.
[0082] In one alternative implementation, the in-memory data structure storage system Redis can be used because it provides fast data read and write capabilities and supports data expiration, which helps manage session information; alternatively, the distributed key-value storage system etcd can be used, leveraging its strong consistency and distributed coordination capabilities to ensure the reliability and consistency of session data.
[0083] Backend server pool: The server pool is where client requests are ultimately processed. The load balancer distributes traffic to various nodes in the server pool, and the servers process the requests and return response results. Regardless of which load balancer receives the request, the request will ultimately be processed by a node in the server pool.
[0084] The session synchronization method provided by the exemplary embodiments of this application will be described below with reference to the system architecture described above and the accompanying drawings.
[0085] See Figure 2 The diagram shown is an implementation flowchart of a session synchronization method provided in this application embodiment, applied to an SDN controller, including the following steps S21 to S23:
[0086] S21: Obtain the monitoring information uploaded by each load balancer in the load balancer cluster.
[0087] A load balancer cluster refers to a system composed of multiple load balancing devices that work together to distribute client requests to a pool of backend servers to achieve traffic sharing and fault redundancy. A load balancer is each device in the cluster whose responsibility is to distribute requests to the appropriate backend server according to a scheduling algorithm when it receives traffic.
[0088] Monitoring information refers to the data uploaded by each load balancer regarding its operating status. This data includes, but is not limited to: number of new sessions, number of concurrent sessions, session establishment time, session duration, traffic fluctuations, central processing unit (CPU) utilization, and memory utilization, which are used to monitor the health and performance of the load balancer.
[0089] Specifically, the number of new sessions refers to the number of new sessions processed by the load balancer per unit of time. This unit of time can be 1 second, 2 seconds, etc., and this document does not specify a particular unit of time. The number of concurrent sessions refers to the number of sessions currently established by the load balancer. Session establishment time records the establishment time of each session by the load balancer to understand the frequency and time distribution of session initiation. Session duration records the time from session initiation to termination, used to evaluate the load balancer's load and session stability. Traffic fluctuation measures network traffic changes per unit of time, used to analyze traffic load and fluctuations. CPU utilization monitors the percentage of CPU usage by the load balancer to assess the utilization of computing resources. Memory utilization monitors the percentage of memory usage by the load balancer to assess the utilization of memory resources.
[0090] In one alternative embodiment, monitoring information can be sent to the SDN controller by the load balancer 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 monitoring data from each load balancer.
[0091] In another alternative embodiment, monitoring information can be sent to the SDN controller by the load balancer in real time. In this mode, the load balancer immediately uploads monitoring information to the SDN controller when its operating status changes (such as the creation of a new session or significant traffic fluctuations), allowing the SDN controller to monitor the status in real time at a fine-grained level and quickly adjust session synchronization strategies.
[0092] In another alternative embodiment, monitoring information can also be uploaded via event-triggered methods. When the load balancer detects abnormal indicators (such as CPU or memory utilization exceeding preset thresholds, or traffic fluctuations exceeding normal ranges), it immediately uploads the abnormal information to the SDN controller, enabling the SDN controller to take timely and appropriate measures.
[0093] It should be noted that the above-listed methods for uploading monitoring information are just simple examples. Other uploading methods are also applicable to the embodiments of this application, and will not be described in detail here.
[0094] In this embodiment, the SDN controller can obtain the monitoring information uploaded by each load balancer in the load balancer cluster through the monitoring information collection process. Based on this, fault prediction can be performed on these load balancers. The specific process is as follows:
[0095] S22: Based on various monitoring information, predict the faulty load balancers and normal load balancers in the load balancer cluster.
[0096] A faulty load balancer refers to a load balancer whose monitoring information is analyzed by a fault detection model. Based on this analysis, the model predicts the load balancer's operational status over a future period and deems it to have a high probability of failure. Such devices exhibit abnormal operating conditions and may be unable to process requests normally in the short term, due to reasons such as hardware failure, overload, high network latency, or resource exhaustion. A normal load balancer, on the other hand, refers to a load balancer whose monitoring information is analyzed by a fault detection model. Based on this analysis, the model predicts the load balancer's operational status over a future period and deems it to have a low probability of failure. This load balancer is stable, capable of processing client requests normally, and shows no signs of failure.
[0097] In this embodiment, the prediction of faulty load balancers and normal load balancers 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 to obtain the fault probability of each load balancer predicted by the fault detection model.
[0099] Among them, the trained fault detection model refers to the model trained through machine learning algorithms.
[0100] In one alternative embodiment, the fault detection model can be a Long Short-Term Memory Network (LSTM) model, a Gated Recurrent Unit (GRU) model, or other neural network-based prediction models, such as Convolutional Neural Network (CNN), Random Forest model, or Bayesian network model.
[0101] It should be noted that the 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 according to the data characteristics, computing resource requirements and prediction accuracy requirements in the actual application scenario. These will not be elaborated on here.
[0102] Considering that LSTM can effectively process time series data and capture long-term dependencies, and is especially suitable for predicting the operating status of load balancers, the following will use the fault detection model as an example to introduce the training process of the fault detection model.
[0103] See Figure 3 The diagram shown is a flowchart of the training process of a fault detection model provided in an embodiment of this application.
[0104] S31: Data collection.
[0105] First, data collection is required. This involves collecting historical data of relevant monitoring information from load balancers and / or SDN controllers to build dataset samples and sample labels. The dataset samples consist of historical 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, the session establishment time, the session duration, traffic fluctuations, CPU utilization, and memory utilization.
[0106] In this embodiment of the application, the sample labels for training the fault detection model are fault status labels, which identify whether each sample load balancer has a fault.
[0107] After constructing the dataset samples and sample labels in the manner described above, data preprocessing is required for the dataset samples.
[0108] S32: Data preprocessing.
[0109] In one alternative embodiment, outliers and noise can be removed from the collected data through cleaning and standardization. Furthermore, the data can be divided into training, validation, and test sets to ensure the model's generalization ability.
[0110] S33: Model building.
[0111] After constructing the dataset samples and sample labels and performing data preprocessing as described above, a fault detection model can be built.
[0112] Taking the fault detection model as an example, the fault detection model is determined by constructing the input layer, hidden layer and output layer of the LSTM model. 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 as described above, it can be trained using the training set data. Specifically, during training, the training samples are first input into the model for prediction, yielding the model's output. Then, a loss function is constructed based on the difference between the model output and the sample labels. This loss function includes, but is not limited to, mean squared error and cross-entropy loss. The model's predictive performance is evaluated by calculating the value of the loss function. Next, the gradient of the loss function with respect to the model parameters is calculated using the backpropagation algorithm, and the model parameters are updated using gradient descent to minimize the loss function. This process continues until the model converges or reaches a preset number of iterations, ensuring that the model can effectively capture the features of the data and improve the accuracy of fault prediction.
[0115] In the embodiments of this application, during the training process, validation set data is used to evaluate the model and adjust the model hyperparameters (including but not limited to learning rate, number of hidden layer units, etc.) to improve model performance.
[0116] S35: Model Evaluation.
[0117] After training the model as described above, the trained LSTM model is evaluated using test set data. The model's metrics are calculated, including but not limited to prediction accuracy, recall, and F1 score, to ensure the reliability and accuracy of the model in fault prediction tasks.
[0118] In one optional embodiment of this application, after training and evaluating the model as described above, the LSTM model will be retrained periodically using the latest monitoring data to adapt to changes in the network environment and load balancer status. Through continuous optimization, the efficiency and accuracy of the LSTM model in fault prediction are ensured.
[0119] The trained fault detection model, obtained through the above method, can then be used for prediction. Real-time monitoring information of the load balancer to be predicted is input into the fault detection model to obtain its failure probability. This process is repeated to predict the failure probability of each load balancer in the load balancer cluster. By utilizing the fault detection model to predict the operating status of the load balancers in real time, potential faults can be detected early.
[0120] Then, load balancers with a failure probability higher than a preset probability threshold are designated as faulty load balancers; and load balancers with a failure probability not higher than the preset probability threshold are designated as normal load balancers.
[0121] In this embodiment, a preset probability threshold is used to measure the risk level of a load balancer failure. The preset probability threshold can be flexibly set according to actual needs. For example, it can be set based on factors such as system tolerance, historical failure data, and load balancer performance metrics. For instance, it can be set to 80%. This means that if a load balancer is predicted to fail in future operations with a probability exceeding 80%, it will be considered a failed load balancer, and corresponding fault handling measures must be taken immediately to ensure the high availability and stability of the system. Depending on different application scenarios, the preset probability threshold can also be adjusted appropriately to achieve better balancing and response efficiency. This application does not specifically limit the setting of the preset probability threshold.
[0122] In the above implementation, by using a fault detection model to predict faulty load balancers and normal load balancers, it is possible to identify potential faults in load balancers in advance, which facilitates the subsequent dynamic adjustment of the session direction and session synchronization frequency of the load balancers.
[0123] By employing the methods described above, a fault detection model is constructed to predict faulty and normal load balancers, enabling early identification and dynamic adjustment of load balancer status. This facilitates the subsequent implementation of targeted session synchronization strategies, ensuring stable system operation. The following section will detail the operations of the SDN controller after prediction.
[0124] In one alternative implementation, the SDN controller may also send third configuration information to the programmable switch to remove the routing entry of the fault 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 fault load balancer through a specific path.
[0125] Specifically, the third configuration information is used to instruct the programmable switch to remove the routing entry of the faulty load balancer from its routing list, ensuring that new sessions no longer pass through the faulty load balancer.
[0126] Optionally, the third configuration information includes, but is not limited to, the load balancer's identifier, route priority, and status indication. The load balancer's identifier is used to uniquely identify and quickly locate the route entry of the faulty load balancer; the route priority allows the switch to adjust the load balancing strategy in a timely manner based on this information; and the status indication is used to indicate the current operating status of the load balancer (such as "faulty" or "normal"), ensuring that the switch can correctly update the route list according to the fault status.
[0127] In this embodiment of the application, the routing list is used to record the path information between the programmable switch and each load balancer, so as to achieve efficient routing and traffic distribution of the session.
[0128] Optionally, the routing list can be an Equal-Cost Multi-Path (ECMP) forwarding list. The ECMP list records all available paths so that the programmable switch can distribute traffic evenly among multiple equal-cost paths according to real-time conditions, thereby achieving higher fault tolerance and transmission efficiency.
[0129] In one optional embodiment, when the SDN controller's fault prediction process predicts the operating status of the load balancer over a future period based on monitoring information, it identifies the faulty load balancer. Assuming load balancer 1 is predicted to be faulty, the SDN controller first sends a configuration to the programmable switch to remove load balancer 1 from the ECMP list, maintaining only traffic with existing sessions with load balancer 1 and not establishing new sessions with it.
[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: Send first configuration information to the faulty load balancer to increase the session synchronization frequency of the faulty load balancer in the outgoing direction; and send second configuration information to the normal load balancer to increase the session synchronization frequency of the normal load balancer in the incoming direction.
[0132] The inbound direction of the load balancer means writing session data from other load balancers in the shared database into the load balancer's memory; the outbound direction of the load balancer means writing session data from the load balancer into the shared database.
[0133] The first configuration information is used to indicate the adjustment of the session synchronization direction and session frequency of the faulty load balancer, and the second configuration information is used to indicate the adjustment of the session synchronization direction and session frequency of the normal load balancer.
[0134] In this embodiment of the application, sending first configuration information to the faulty load balancer to increase the session synchronization frequency of the faulty load balancer in the outgoing direction further includes: stopping the session synchronization of the faulty load balancer in the incoming direction; and sending second configuration information to the normal load balancer to increase the session synchronization frequency of the normal load balancer in the incoming direction further includes: stopping the session synchronization of the normal load balancer in the outgoing direction.
[0135] The following example uses a load balancer cluster with three load balancers. The fault detection model predicts that load balancer 1 is a faulty load balancer, while load balancer 2 and load balancer 3 are normal load balancers:
[0136] In this embodiment of the application, when the SDN controller predicts that a certain load balancer is a faulty load balancer through the fault detection model, taking load balancer 1 as an example, the SDN controller sends the 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 sessions existing in load balancer 1 are synchronized to the shared database.
[0137] The first configuration information is an instruction issued by the SDN controller to the fault load balancer, which is used to adjust the session synchronization strategy of the fault load balancer so as to quickly synchronize the existing session data in the fault load balancer to the shared database and reduce the risk of data loss caused by failure.
[0138] Optionally, the first configuration information includes, but is not limited to, a command to disable inbound session synchronization, a command to increase the outbound session synchronization frequency, and a list of current session identifiers. The command to disable inbound session synchronization instructs the load balancer to stop inbound session synchronization, preventing the continued reception and transmission of new session data. The command to increase the outbound session synchronization frequency accelerates the synchronization frequency of existing sessions, allowing the session data of the failed load balancer to be backed up to the shared database more quickly. The list of current session identifiers records the active session identifiers in the failed load balancer, ensuring the integrity of the synchronization process and preventing any incomplete session data from being missed during synchronization.
[0139] Taking load balancer 1 as an example, the SDN controller sends out the first configuration information to ensure that load balancer 1 only retains the synchronization of existing sessions and stops the access of new session traffic, thereby reducing the synchronization pressure. Since the switch will not establish new sessions to load balancer 1 at this time, the pressure of session synchronization will not be very high even in high-concurrency scenarios.
[0140] In this embodiment, when the SDN controller predicts through a fault detection model that a load balancer is a faulty load balancer (taking load balancer 1 as the faulty load balancer and load balancers 2 and 3 as normal load balancers as an example), the SDN controller sends second configuration information to load balancers 2 and 3, stopping session synchronization in the outbound direction and only performing inbound session synchronization. Furthermore, the inbound session synchronization does not consider the sessions of other normal load balancers; it only synchronizes the session synchronization of the predicted faulty load balancer (load balancer 1) and increases the inbound synchronization frequency. This quickly synchronizes the sessions of load balancer 1 to load balancers 2 and 3.
[0141] The second configuration information is an instruction issued by the SDN controller to the normal load balancer, which is used to assist in quickly synchronizing the session state data in the failed load balancer to other normal load balancers, ensuring that the sessions of the failed load balancer can be taken over and restored by other load balancers, and ensuring uninterrupted service.
[0142] Optionally, the second configuration information includes, but is not limited to: an inbound session synchronization enable command, an outbound session synchronization disable command, and a faulty load balancer session identifier list. The inbound session synchronization enable command instructs the normal load balancer to receive session data from the faulty load balancer only in the inbound direction, achieving targeted session synchronization. The outbound session synchronization disable command stops the normal load balancer from synchronizing session data in the outbound direction, reducing the synchronization load. The faulty load balancer session identifier list ensures that the normal load balancer receives all active session data from the faulty load balancer during synchronization, preventing omissions.
[0143] Since some sessions of load balancer 1 have already been synchronized during the previous scheduled session synchronization, this synchronization is only to check for omissions and fill in the missing sessions that were not synchronized within the scheduled time. Therefore, the synchronization pressure will not be great and the impact on the overall performance of the load balancer will be minimal.
[0144] Through the above process, the reliability and stability of the load balancer cluster can be effectively improved. When a failure occurs, the SDN controller can promptly identify the faulty load balancer and quickly adjust the session synchronization strategy to ensure that client requests can be continuously processed. This dynamic management capability reduces fault response time, enhances the overall service availability, optimizes resource utilization efficiency, and avoids service interruptions caused by faulty load balancers.
[0145] The above describes how the SDN controller sends configuration information to the load balancer. This primarily involves using a fault detection model to predict faulty and normal load balancers, then sending third configuration information to the programmable switch, first configuration information to the faulty load balancer, and second configuration information to the normal load balancer. This enables the programmable switch to adjust its routing list and the load balancer to adjust its session policies. The specific adjustment of session policies is performed within the load balancer itself; therefore, the following section will describe the specific operations of the load balancer.
[0146] See Figure 4 The diagram shown is an implementation flowchart of another session synchronization method provided in this application embodiment, applied to a load balancer, and includes the following steps:
[0147] S41: Upload monitoring information to the SDN controller so that the SDN controller can predict the faulty load balancers and normal load balancers in the load balancer cluster based on the monitoring information uploaded by each load balancer in the load balancer cluster, and send the first configuration information to the faulty load balancer and the second configuration information to the normal load balancer.
[0148] In this embodiment, the load balancer uploads monitoring information to the SDN controller, so that the SDN controller can predict the faulty load balancers and normal load balancers in the load balancer cluster based on the monitoring information uploaded by each load balancer in the load balancer cluster, and send first configuration information to the faulty load balancer and second configuration information to the normal load balancer. For the specific implementation of this process, please refer to the relevant description on the SDN controller side above, and it will not be repeated here.
[0149] S42: If the first configuration information is received, the session synchronization frequency of the load balancer in the outgoing direction is increased based on the first configuration information, and session synchronization is performed based on the adjusted session synchronization frequency; if the second configuration information is received, the session synchronization frequency of the load balancer in the incoming direction is increased based on the second configuration information, and session synchronization is performed based on the adjusted session synchronization frequency.
[0150] The inbound direction of the load balancer means writing session data from other load balancers in the shared database into the load balancer's memory; the outbound direction of the load balancer means writing session data from the load balancer into the shared database.
[0151] In this embodiment of the application, if the first configuration information is received, it indicates that the load balancer is a fault load balancer. When the fault load balancer receives the first configuration information, it stops the inbound session and increases the outbound session synchronization frequency.
[0152] Among them, increasing the session synchronization frequency of the load balancer in the outgoing direction includes: increasing the session synchronization frequency in the outgoing direction from the first synchronization frequency to the second synchronization frequency;
[0153] The first synchronization frequency refers to the base frequency at which session synchronization is performed under timed synchronization mode, i.e., the frequency at which the load balancer writes session data to the shared database or to the load balancer itself under timed synchronization mode. The second synchronization frequency refers to the frequency at which the outbound session synchronization is increased after the faulty load balancer receives the first configuration information, used to achieve faster data transfer and backup in the event of a failure.
[0154] Scheduled synchronization refers to a mechanism that periodically synchronizes session information at fixed time intervals to ensure data consistency between the primary and backup load balancers. Scheduled synchronization operates at a preset first synchronization frequency to periodically synchronize session information and ensure data consistency between the primary and backup load balancers. The first synchronization frequency can be set according to specific application requirements, such as synchronizing every few minutes.
[0155] In this application, based on timed synchronization, the first synchronization frequency is dynamically adjusted in the event of a fault. In an optional embodiment, after detecting that the faulty load balancer has received the first configuration information, the inbound session synchronization is stopped, and the outbound synchronization frequency is quickly increased. This enables faster data transfer and backup, no longer limited by the previously set fixed frequency, thereby effectively reducing synchronization latency and resource waste.
[0156] In one alternative 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 synchronization from once per minute to once every 30 seconds; dynamically adjusting according to current traffic requests, such as automatically increasing the synchronization frequency when traffic increases; or using a tiered / proportional step-by-step increase, gradually increasing the synchronization frequency according to the current load of the load balancer to more flexibly handle different workloads. These methods can effectively improve data synchronization efficiency and reduce the impact of failures on system stability.
[0157] By receiving initial configuration information when the load balancer fails, the system stops inbound session synchronization and increases outbound session synchronization frequency to a second synchronization frequency, enabling rapid synchronization of session data to the shared database. This mechanism effectively reduces the load on the failed load balancer, ensures real-time backup of session data, and improves system stability and data security.
[0158] In this embodiment of the application, if the second configuration information is received, it indicates that the load balancer is a normal load balancer. When the normal load balancer receives the second configuration information, it stops the outgoing sessions and increases the synchronization frequency of the incoming sessions.
[0159] 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 frequency of inbound session synchronization that a normal load balancer increases after receiving the second configuration information. This is used to receive and process data from the faulty load balancer in a timely and comprehensive manner, thereby enabling rapid migration and redundant backup of session data and improving the fault tolerance and stability of session synchronization.
[0161] In this embodiment, the session synchronization frequency of the normal load balancer in the inbound direction is increased. 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 described above. The second synchronization frequency and the third synchronization frequency can be the same or different. This application does not impose specific restrictions on this.
[0162] By receiving the second configuration information when the load balancer is normal, stopping 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, 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.
[0163] See Figure 5 As shown, it is a schematic diagram of an implementation of a session synchronization method provided in an embodiment of this 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: Uploads monitoring information from each load balancer in the load balancer cluster to the SDN controller.
[0166] S53: The SDN controller predicts which load balancers in the load balancer cluster are faulty or normal based on the monitoring information uploaded by each load balancer in the cluster.
[0167] S54: The SDN controller sends third configuration information to the programmable switch to remove the routing entry of the faulty load balancer from the routing list on the programmable switch side.
[0168] S55: The SDN controller sends the first configuration information to the fault load balancer, stops the fault load balancer's session synchronization 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 outgoing direction, and increases the session synchronization frequency in the incoming direction from the first synchronization frequency to the third synchronization frequency.
[0170] S57: Transfer session traffic from the load balancer to the backend server pool.
[0171] The specific implementation of the above process has been described in detail above, and will not be repeated here, but is intended to demonstrate the overall implementation of the solution.
[0172] Based on the same inventive concept, embodiments of this application also provide a session synchronization device. For example... Figure 6 As shown, this is a schematic diagram of the structure 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] The prediction unit 602 is used to predict the faulty load balancers and normal load balancers in the load balancer cluster based on various monitoring information.
[0175] Configuration unit 603 is used to send first configuration information to the faulty load balancer to increase the session synchronization frequency of the faulty load balancer in the outgoing direction; and to send second configuration information to the normal load balancer to increase the session synchronization frequency of the normal load balancer in the ingoing direction; the ingoing direction of the load balancer indicates that the session data of other load balancers in the shared database is written to the load balancer memory; the outgoing direction of the load balancer indicates that the session data of the load balancer is written to the shared database.
[0176] Optionally, configuration unit 603 is also used for:
[0177] Stop the faulty load balancer from synchronizing sessions in the inbound direction;
[0178] In addition, configuration unit 603 is also used for:
[0179] Stop normal load balancer session synchronization in the outbound direction.
[0180] Optionally, the prediction unit 602 is specifically used for:
[0181] After inputting each monitoring information into the trained fault detection model, the fault probability of each load balancer is predicted by the fault detection model.
[0182] Load balancers with a failure probability higher than a preset probability threshold are designated as faulty load balancers.
[0183] Furthermore, load balancers whose corresponding failure probability is not higher than a preset probability threshold are designated as normal load balancers.
[0184] Optionally, after the prediction unit 602 predicts the faulty and normal load balancers in the load balancer cluster based on various monitoring information, the configuration unit 603 is further configured to:
[0185] The third configuration information is sent to the programmable switch to remove the routing entry of the fault 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 fault load balancer through a specific path.
[0186] Based on the same inventive concept, embodiments of this application also provide another session synchronization device. For example... Figure 7 As shown, this is a schematic diagram of another session synchronization device 700, which may include:
[0187] Upload unit 701 is used to upload monitoring information to the SDN controller so that the SDN controller can predict the faulty load balancers and normal load balancers in the load balancer cluster based on the monitoring information uploaded by each load balancer in the load balancer cluster, and send the first configuration information to the faulty load balancer and the second configuration information to the normal load balancer.
[0188] The adjustment unit 702 is used to, if it receives the first configuration information, increase the session synchronization frequency of the load balancer in the outgoing direction based on the first configuration information, 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 inbound direction is increased based on the second configuration information, and session synchronization is performed based on the adjusted session synchronization frequency; the inbound direction of the load balancer means: writing the session data of other load balancers in the shared database into the load balancer memory; the outbound direction of the load balancer means: writing the session data of the load balancer into the shared database.
[0190] Optionally, the adjustment unit 702 is also used for:
[0191] Stop the load balancer's session synchronization in the inbound direction;
[0192] Furthermore, the adjustment unit 702 is also used for:
[0193] Stop the load balancer's session synchronization in the outbound direction.
[0194] Optionally, each load balancer in the load balancer cluster is also used to: periodically perform outgoing and incoming session synchronization according to a first synchronization frequency in a timed session synchronization scenario. Specifically, the adjustment unit 702 is used for:
[0195] The outgoing session synchronization frequency is increased from the first synchronization frequency to the second synchronization frequency; and the adjustment unit is specifically used for:
[0196] The inbound session synchronization frequency is increased from the first synchronization frequency to the third synchronization frequency.
[0197] For ease of description, the above sections are divided into modules (or units) according to their functions and described separately. Of course, in implementing this application, the functions of each module (or unit) can be implemented in one or more software or hardware components.
[0198] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0199] Having introduced the session synchronization method and apparatus according to exemplary embodiments of this application, we will now introduce an electronic device according to another exemplary embodiment of this application.
[0200] Those skilled in the art will understand that various aspects of this application can be implemented as a system, method, or program product. Therefore, various aspects of this application can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, collectively referred to herein as a "circuit," "module," or "system."
[0201] Based on the same inventive concept as the above-described method embodiments, this application also provides an electronic device. In one embodiment, the electronic device may be a server, and 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. The program storage area may store the operating system and programs required to run instant messaging functions, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0203] Memory 801 may be volatile memory, such as random-access memory (RAM); memory 801 may also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 801 may be any other medium capable of carrying or storing a desired computer program having the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 801 may be a combination of the above-described memories.
[0204] Processor 802 may include one or more central processing units (CPUs) or digital processing units, etc. Processor 802 is used to implement the above-described session synchronization method when calling computer programs stored in memory 801.
[0205] The communication module 803 is used to communicate with terminal devices and other servers.
[0206] This application embodiment does not limit the specific connection medium between the memory 801, communication module 803, and processor 802 described above. This application embodiment... Figure 8 The memory 801 and the processor 802 are connected via a bus 804, and the bus 804 is in Figure 8 The diagram uses thick lines to describe the connections between other components; these are for illustrative purposes only and should not be considered limiting. The 804 bus can be divided into address bus, data bus, control bus, etc. For ease of description, Figure 8 It is described using only a thick line, but does not indicate that there is only one bus or one type of bus.
[0207] The memory 801 stores a computer storage medium, which in turn stores computer-executable instructions for implementing the XXXX method of this application embodiment. The processor 802 is used to execute the aforementioned session synchronization method, such as... Figure 2 As shown.
[0208] In some possible implementations, various aspects of the session synchronization method provided in this application can also be implemented as a program product, which includes a computer program. When the program product is run on an electronic device, the computer program causes the electronic device to perform the steps in the session synchronization method according to the various exemplary embodiments of this application described above. For example, the electronic device can perform actions such as... Figure 2 or Figure 4 The steps are shown in the figure.
[0209] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0210] The program product of the embodiments of this application may employ a portable compact disc read-only memory (CD-ROM) and include a computer program, and may run on an electronic device. However, the program product of this application is not limited thereto. In this document, the readable storage medium may be any tangible medium that contains or stores a program that may be used by or in conjunction with a command execution system, apparatus, or device.
[0211] It should be noted that although several units or sub-units of the device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this 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 and embodied by multiple units.
[0212] Furthermore, although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0213] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing a computer-usable computer program.
[0214] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, produce a machine for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0215] These computer program commands may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the commands stored in the computer-readable storage medium produce an article of manufacture including command means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0216] These computer program commands can also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing the commands executed on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0217] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0218] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method of session synchronization, the method comprising: The method, applied to a software-defined networking (SDN) controller, includes: Obtain the monitoring information uploaded by each load balancer in the load balancer cluster; Based on the monitoring information, predict the faulty and normal load balancers in the load balancer cluster. The system sends first configuration information to the faulty load balancer to increase the session synchronization frequency of the faulty load balancer in the outgoing direction; and sends second configuration information to the normal load balancer to increase the session synchronization frequency of the normal load balancer in the incoming direction. The incoming direction of the load balancer indicates that session data of other load balancers in the shared database is written to the memory of the load balancer. The outgoing direction of the load balancer indicates that session data of the load balancer is written to the shared database.
2. The method of claim 1, wherein, The step of sending first configuration information to the fault load balancer to increase the session synchronization frequency of the fault load balancer in the outgoing direction further includes: Stop the inbound session synchronization of the faulty load balancer; Furthermore, the step of 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 normal load balancer's session synchronization in the outbound direction.
3. The method of claim 1, wherein, The step of predicting the faulty and normal load balancers in the load balancer cluster based on the monitoring information includes: After inputting each of the monitoring information into the trained fault detection model, the fault probability of each load balancer is obtained as predicted by the fault detection model. Load balancers with a failure probability higher than a preset probability threshold are designated as faulty load balancers. Furthermore, load balancers whose corresponding failure probability is not higher than a preset probability threshold are designated as normal load balancers.
4. The method according to any one of claims 1 to 3, characterized in that, After predicting the faulty and normal load balancers in the load balancer cluster based on the various monitoring information, the method further includes: A third configuration message is sent to the programmable switch to remove the routing entry of the fault 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 fault load balancer through a specific path.
5. A session synchronization method, characterized by, Applied to a load balancer, the method includes: The monitoring information is uploaded to the SDN controller so that the SDN controller can predict the faulty load balancers and normal load balancers in the load balancer cluster based on the monitoring information uploaded by each load balancer in the load balancer cluster, and send the first configuration information to the faulty load balancer and the second configuration information to the normal load balancer. If the first configuration information is received, the session synchronization frequency of the load balancer in the outgoing direction is increased based on the first configuration information, and session synchronization is performed based on the adjusted session synchronization frequency. If the second configuration information is received, the session synchronization frequency of the load balancer in the inbound direction is increased based on the second configuration information, and session synchronization is performed based on the adjusted session synchronization frequency; 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.
6. The method of claim 5, wherein, The step of increasing the session synchronization frequency of the load balancer in the outgoing direction based on the first configuration information further includes: Stop the load balancer's session synchronization in the inbound direction; Furthermore, the step of increasing the session synchronization frequency of the load balancer in the inbound direction based on the second configuration information further includes: Stop the load balancer's session synchronization in the outbound direction.
7. The method of claim 5, wherein, Each load balancer in the load balancer cluster is also used to: periodically perform outgoing and incoming session synchronization according to a first synchronization frequency in a timed session synchronization scenario. Increasing the session synchronization frequency of the load balancer in the outgoing direction includes: Increase the session synchronization frequency in the outgoing direction from the first synchronization frequency to the second synchronization frequency; 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 the third synchronization frequency.
8. A session synchronization apparatus, characterized by comprising: include: The acquisition unit is used to acquire the monitoring information uploaded by each load balancer in the load balancer cluster. The prediction unit is used to predict the faulty load balancers and normal load balancers in the load balancer cluster based on the monitoring information. The configuration unit is configured to send first configuration information to the faulty load balancer to increase the session synchronization frequency of the faulty load balancer in the outgoing direction; and to send second configuration information to the normal load balancer to increase the session synchronization frequency of the normal load balancer in the incoming direction. The inbound direction of 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 of the load balancer means: writing the session data of the load balancer into the shared database.
9. A session synchronization apparatus, characterized by comprising: include: The upload unit is used to upload monitoring information to the SDN controller, so that the SDN controller can predict the faulty load balancers and normal load balancers in the load balancer cluster based on the monitoring information uploaded by each load balancer in the load balancer cluster, and send first configuration information to the faulty load balancer and second configuration information to the normal load balancer. An adjustment unit is configured to, if it receives first configuration information, increase the session synchronization frequency of the load balancer in the outgoing 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 inbound direction is increased based on the second configuration information, and session synchronization is performed based on the adjusted session synchronization frequency; 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.
10. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of any one of the methods described in claims 1 to 7.