System, method, device, electronic device and storage medium for synchronizing session information

By synchronizing session information with multiple host nodes corresponding to fewer backup nodes in the load balancing cluster, the problem of low resource utilization in the existing technology is solved, efficient resource utilization and fast failover are achieved, and resource waste and redundancy are avoided. Even overhead.

CN114500547BActive Publication Date: 2024-10-29SINA TECH (CHINA) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210281644.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-22
Publication Date
2024-10-29
Estimated Expiration
2042-03-22

AI Technical Summary

Technical Problem

The resource utilization rate of the existing session synchronization method is low, resulting in a waste of hardware resources and low processing efficiency.

Method used

In a load balancing cluster, each cluster includes multiple host nodes and a small number of standby nodes. Each host node synchronizes session information to the corresponding standby node, and synchronizes incremental and full information through preset time intervals to improve resources. utilization and processing efficiency.

Benefits of technology

It improves the utilization of hardware resources, avoids waste of resources, realizes fast active and backup switching when the host node fails, without re-establishing the connection, saves resource overhead, and takes into account the synchronization efficiency and consistency of session information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114500547B_ABST
    Figure CN114500547B_ABST
Patent Text Reader

Abstract

The present application discloses a synchronization system, method, device, electronic device and storage medium for session information, which belongs to the field of computer network technology, can solve the problem of low resource utilization during session synchronization, and can effectively utilize resources. The system includes: at least one load balancing cluster, wherein the at least one load balancing cluster is formed by node grouping for load balancing, each load balancing cluster includes at least two host nodes and at least one standby node, and the number of standby nodes in each load balancing cluster is less than the number of host nodes; wherein, in each of the load balancing clusters, each standby node corresponds to at least one host node, and each host node corresponds to at least one standby node, and each host node is used to synchronize the received session information to the corresponding standby nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer network technology, and specifically relates to a session information synchronization system, method, device, electronic device and storage medium. Background Art

[0002] With the increasing traffic on the Internet, business scenarios and system architectures are becoming increasingly complex, and the scale of servers is also growing. Load balancing (LB) evenly distributes access traffic to the backend business service cluster based on certain strategies in such a large traffic scenario, which not only improves the system service capabilities, but also enhances the availability of services. Server Load Balancer (SLB) uses a certain scheduling algorithm for access traffic to achieve load balancing of traffic to the backend business server (Real Server, RS). SLB maintains the session table to ensure that the traffic of the same session can be forwarded to the same backend RS device after passing through the SLB cluster. In the SLB cluster, node sharing between clusters can be achieved through session synchronization, or cluster nodes can each hold the session table of the current node.

[0003] However, the current session synchronization method has low resource utilization. Summary of the invention

[0004] The embodiments of the present application provide a system, method, device, electronic device and storage medium for synchronizing session information, which can solve the problem of low resource utilization during session synchronization and can effectively utilize resources.

[0005] In a first aspect, an embodiment of the present application provides a session information synchronization system, the system comprising: at least one load balancing cluster, wherein the at least one load balancing cluster is formed by a node grouping for load balancing, each load balancing cluster comprises at least two host nodes and at least one backup node, and the number of backup nodes in each load balancing cluster is less than the number of host nodes; wherein, in each of the load balancing clusters, each backup node corresponds to at least one host node, and each host node corresponds to at least one backup node, and each host node is used to synchronize the received session information to the corresponding backup nodes.

[0006] In the second aspect, an embodiment of the present application provides a method for synchronizing session information, which is applied to a host node in a load balancing cluster, the method comprising: receiving a session synchronization address sent by each backup node corresponding to the host node; based on the session synchronization address, synchronizing the received incremental session information to each corresponding backup node at every first preset time interval, and synchronizing the received full session information to each corresponding backup node at every second preset time interval, wherein the first preset time interval is less than the second preset time interval.

[0007] In the third aspect, an embodiment of the present application provides a method for synchronizing session information, which is applied to a standby node in a load balancing cluster, the method comprising: sending a session synchronization address to each host node corresponding to the standby node; receiving incremental session information and full session information sent by each host node, wherein the incremental session information is sent by the host node based on the session synchronization address at intervals of a first preset time interval, and the full session information is sent by the host node based on the session synchronization address at intervals of a second preset time interval.

[0008] In a fourth aspect, an embodiment of the present application provides a session information synchronization device, which is applied to a host node in a load balancing cluster, and the device includes: a receiving module, which is used to receive a session synchronization address sent by each backup node corresponding to the host node; a synchronization module, which is used to synchronize the received incremental session information to the corresponding backup nodes at every first preset time interval based on the session synchronization address, and synchronize the received full session information to the corresponding backup nodes at every second preset time interval, wherein the first preset time interval is less than the second preset time interval.

[0009] In the fifth aspect, an embodiment of the present application provides a session information synchronization device, which is applied to a standby node in a load balancing cluster, and the device includes: a sending module, used to send a session synchronization address to each host node corresponding to the standby node; a receiving module, used to receive incremental session information and full session information sent by each host node, wherein the incremental session information is sent by the host node based on the session synchronization address at intervals of a first preset time interval, and the full session information is sent by the host node based on the session synchronization address at intervals of a second preset time interval.

[0010] In a sixth aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the second aspect, or implements the steps of the method described in the third aspect.

[0011] In the seventh aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the second aspect are implemented, or the steps of the method described in the third aspect are implemented.

[0012] In an embodiment of the present application, a system for synchronizing session information includes at least one load balancing cluster, wherein at least one load balancing cluster is formed by a node grouping for load balancing, each load balancing cluster includes at least two host nodes and at least one standby node, and the number of standby nodes in each load balancing cluster is less than the number of host nodes; wherein, in each load balancing cluster, each standby node corresponds to at least one host node, and each host node corresponds to at least one standby node, and each host node is used to synchronize the received session information to the corresponding standby nodes, thereby achieving a situation in which a large number of host nodes in the load balancing cluster correspond to a small number of standby nodes. Compared with the situation in which one host node corresponds to one standby node in the related technology, this improves the utilization rate of hardware resources and avoids the problem of low utilization rate of hardware resources in the session synchronization method of the related technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 It is a structural diagram of a session information synchronization system provided by an embodiment of the present application;

[0014] Figure 2 It is a flowchart of a method for synchronizing session information provided by an embodiment of the present application;

[0015] Figure 3 It is a flowchart of another method for synchronizing session information provided in an embodiment of the present application;

[0016] Figure 4 It is a structural diagram of a session information synchronization device provided in an embodiment of the present application;

[0017] Figure 5 It is a structural diagram of another apparatus for synchronizing session information provided in an embodiment of the present application;

[0018] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0020] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0021] In the related technologies of session synchronization, in the active-standby mode, one active node and one standby node are usually grouped as a cluster, and session synchronization is performed within the group. Both the active node and the standby node hold the full amount of session information in the group. In this way, each host corresponds to a redundant standby node, which wastes hardware resources. In the non-active-standby mode, the nodes in the cluster are grouped, and session synchronization is performed within the group. Each host holds the session information of all hosts in the group. The session capacity of a single machine is limited by the number of hosts in the group, and the processing efficiency of a single machine is low.

[0022] To this end, the present application divides the nodes used for load balancing into multiple load balancing clusters. A load balancing cluster includes at least two host nodes and at least one backup node, and the number of backup nodes is less than the number of host nodes, that is, the number between host nodes and backup nodes is a many-to-1 relationship. This grouping method improves the utilization rate of hardware resources and at the same time ensures the processing efficiency of a single machine.

[0023] In conjunction with the accompanying drawings, a session information synchronization system, method, device, electronic device and storage medium provided by the embodiments of the present application are described in detail through specific embodiments and application scenarios.

[0024] The session information synchronization system includes: at least one load balancing cluster, wherein the at least one load balancing cluster is formed by node grouping for load balancing, each load balancing cluster includes at least two host nodes and at least one standby node, and the number of standby nodes in each load balancing cluster is less than the number of host nodes;

[0025] In each of the load balancing clusters, each standby node corresponds to at least one host node, and each host node corresponds to at least one standby node. Each host node is used to synchronize the received session information to the corresponding standby nodes.

[0026] Optionally, each standby node may correspond to at least two host nodes, and each host node may correspond to one standby node.

[0027] like Figure 1 As shown, a load balancing cluster including two host nodes and one standby node is used as an example for explanation. For example, assume that the load balancing cluster 110 includes two host nodes 1101 and one standby node 1102. The two host nodes 1101 are used to send session information to the standby node 1102 in the same load balancing cluster 110, and the standby node 1102 is used to receive and store the session information sent by the host node 1101 in the same load balancing cluster, and to replace the failed host node 1101. In the load balancing cluster 110, each standby node 1102 corresponds to at least two host nodes 1101, and each host node 1101 corresponds to one standby node 1102, which improves the utilization rate of hardware resources compared to the situation in the related art where one host node corresponds to one standby node.

[0028] In addition, in the same load balancing cluster 110, the host node 1101 can synchronize the full session information and the incremental session information to the backup node 1102. The host nodes 1101 do not synchronize the session information with each other. Moreover, when a host node 1101 fails, the backup node 1102 storing the full session information of the host node replaces the failed host node 1101 to work.

[0029] In this way, a small number of backup nodes are matched with a large number of host nodes in the load balancing cluster. Compared with the situation in the related technology where one host node corresponds to one backup node, this improves the utilization rate of hardware resources and avoids the problem of low utilization rate of hardware resources in the session synchronization method of the related technology. In addition, when a host node in the load balancing cluster fails, the active-standby switching can be performed quickly without the need to re-establish the connection, thus saving resources and avoiding additional resource overhead.

[0030] Figure 2 A method for synchronizing session information provided by an embodiment of the present invention is shown, which is applied to a host node in a load balancing cluster. The method comprises the following steps:

[0031] Step 202: Receive the session synchronization address sent by each standby node corresponding to the host node.

[0032] Specifically, before the session synchronization function in the load balancing cluster starts, the standby node may notify each corresponding host node of its own session synchronization address, and at this time each host node receives the session synchronization address sent by the standby node.

[0033] Since each host node corresponds to at least one standby node, when the host node receives the session synchronization address sent by the corresponding standby node, it needs to receive the session synchronization address sent by each corresponding standby node.

[0034] It can be understood that the standby node corresponding to the host node is the standby node that establishes communication with the host node.

[0035] Step 204: Based on the session synchronization address, synchronize the received incremental session information to the corresponding backup nodes at every first preset time interval, and synchronize the received full session information to the corresponding backup nodes at every second preset time interval.

[0036] The first preset time interval is smaller than the second preset time interval.

[0037] Specifically, the host node uses an equal-cost routing and hashing scheme to equally receive session information. The host node starts a session synchronization function based on the received session synchronization addresses of each backup node, and synchronizes the received session information to the corresponding backup nodes based on the session synchronization address.

[0038] It should be noted that session synchronization is not performed between host nodes.

[0039] The incremental session information may refer to the session information received by the host node within the first preset time interval. The host node synchronizes its own incremental session information to the corresponding standby nodes every first preset time interval, thereby improving the efficiency of session synchronization.

[0040] In addition, the full amount of session information may refer to all session information received by the host node. The host node may synchronize its full amount of session information to the corresponding backup nodes at every second preset time interval, which ensures the consistency of session information between the host node and the corresponding backup nodes.

[0041] Optionally, the first preset time interval may be smaller than the second preset time interval, that is, incremental session information may be synchronized at shorter intervals and full session information may be synchronized at longer intervals, so that the standby node may delete aged session information in a timely manner and take into account both the efficiency of session synchronization and the consistency of sessions between the primary and standby nodes.

[0042] In this way, the host node synchronizes the received incremental session information to the corresponding backup nodes at every first preset time interval, and synchronizes the received full session information to the corresponding backup nodes at every second preset time interval, so that both the incremental session information and the full session information of the host node can be synchronized, which improves the efficiency of session information synchronization while taking into account the consistency of session information between the backup node and the host node.

[0043] The method for synchronizing session information provided by the embodiment of the present invention receives session synchronization addresses sent by each backup node corresponding to the host node; based on the session synchronization address, synchronizes the received incremental session information to each corresponding backup node at every first preset time interval, and synchronizes the received full session information to each corresponding backup node at every second preset time interval, wherein the first preset time interval is less than the second preset time interval, so that the host node can clearly synchronize the backup node of its own session information, so that the incremental session information and the full session information of the host node can be synchronized to each corresponding backup node, while improving the efficiency of session information synchronization, taking into account the consistency of session information between the backup node and the host node, so that the backup node holds the full session information of the same host node, so that when the backup node replaces the failed host node, it can completely replace the failed host node to work.

[0044] In addition, in one implementation, the host node may also receive indication information sent by the corresponding backup node when detecting that any host node corresponding to the backup node fails, and based on the indication information, stop synchronizing the session information to the backup node.

[0045] The indication information is used to notify the standby node to perform active / standby switching.

[0046] Specifically, when the backup node corresponding to the host node detects that any host node corresponding to the backup node has a fault, such as the host node crashes, the backup node can send an indication message to the host node to notify the backup node to perform a master-slave switch; after the host node receives the indication message, it can stop synchronizing the session information to the backup node.

[0047] Of course, at this time, the standby node can be switched to the host node and take over the failed host node to receive session information. This enables rapid master-slave switching when abnormal situations such as failures occur in the host node in the load balancing cluster. And because it retains the full amount of session information in the cluster, it can achieve user-imperceptible switching, and the client does not need to reconnect, avoiding additional overhead such as client retransmission.

[0048] In addition, if the host node returns to normal, it can be converted to a standby node and re-enter the working state.

[0049] In addition, in an implementation manner, in this embodiment, the host node may also use a first preset identifier to mark the synchronized session information, and use a second preset identifier to mark the unsynchronized session information.

[0050] Specifically, this embodiment can add a session synchronization mark (i.e., a first preset mark and a second preset mark) on the basis of the existing session table, and classify the information in the session table by the session synchronization mark. The first preset mark can be used to mark the session information that has been synchronized to the standby node, and the second preset mark can be used to mark the session information that has not been synchronized to the standby node. For example, the first preset mark can be 1, the second preset mark can be 2, the session information that has been synchronized to the standby node is marked as 1, and the session information that has not been synchronized to the standby node is marked as 2.

[0051] It should be noted that the first preset mark and the second preset mark can be preset by an administrator, and are not specifically limited here.

[0052] In this way, the host node marks the synchronized session information with the first preset identifier, and marks the unsynchronized session information with the second preset identifier, so that when the session information is synchronized, the problem of repeated synchronization is avoided, the efficiency of session information synchronization is improved, and resource waste is avoided.

[0053] Figure 3 Another method for synchronizing session information provided by an embodiment of the present invention is shown, which is applied to a standby node in a load balancing cluster. The method comprises the following steps:

[0054] Step 302: Send the session synchronization address to each host node corresponding to the standby node.

[0055] Specifically, before the session synchronization function in the load balancing cluster starts, the standby node may notify each corresponding host node of its own session synchronization address. At this time, each host node receives the session synchronization address sent by the standby node and starts the session synchronization function.

[0056] Since each standby node corresponds to at least one host node, when the standby node sends the session synchronization address to each host node corresponding to the standby node, the session synchronization address needs to be sent to each host node corresponding to the standby node.

[0057] It can be understood that the host node corresponding to the standby node is the host node that establishes communication with the standby node.

[0058] Step 304: Receive the incremental session information and the full session information sent by each host node.

[0059] The backup node receives incremental session information and full session information sent by the corresponding host nodes based on the session synchronization address of the backup node, wherein the incremental session information is sent by the host node based on the session synchronization address at every first preset time interval, and the full session information is sent by the host node based on the session synchronization address at every second preset time interval.

[0060] The incremental session information may refer to the session information received by the host node within a first preset time interval. The standby node receives its own incremental session information sent by the host node every first preset time interval, thereby improving the efficiency of session synchronization.

[0061] The full amount of session information may refer to all session information received by the host node. The standby node may receive its own full amount of session information sent by the host node every second preset time interval, which ensures the consistency of session information between the host node and the standby node.

[0062] Optionally, the first preset time interval may be smaller than the second preset time interval, that is, the target host node's own incremental session information may be received at a shorter interval, and the target host node's own full session information may be received at a longer interval, so that the standby node can delete the aged session information in time and take into account the efficiency of session synchronization.

[0063] According to the method for synchronizing session information provided by an embodiment of the present invention, a standby node sends a session synchronization address to each host node corresponding to the standby node, and receives incremental session information and full session information sent by each host node, wherein the incremental session information is sent by the host node at a first preset time interval based on the session synchronization address, and the full session information is sent by the host node at a second preset time interval based on the session synchronization address, thereby improving the efficiency of session synchronization and ensuring the consistency of session information between the host node and the standby node.

[0064] In one implementation, the standby node can also send indication information to each host node corresponding to the standby node when it detects that any host node corresponding to the standby node fails, wherein the indication information is used to notify the standby node to perform a master-slave switch; the standby node switches to a host node and takes over the failed host node to receive session information.

[0065] Specifically, when any host node corresponding to the backup node fails, for example, when the host node crashes, the backup node can detect that the host node has failed. At this time, the backup node can send indication information to each corresponding host node to notify the backup node to perform a master-slave switch; after receiving the indication information, the host node can stop synchronizing the session information to the backup node.

[0066] Of course, at this time, the standby node can be switched to the host node and take over the failed host node to receive session information. This enables rapid master-slave switching when the main node in the load balancing cluster fails or other abnormal situations occur. And because it retains the full amount of session information in the cluster, it can achieve user-imperceptible switching, and the client does not need to reconnect, avoiding additional overhead such as client retransmission.

[0067] In addition, if the host node returns to normal, it can be converted to a standby node and re-enter the working state.

[0068] In this way, this embodiment improves the utilization rate of hardware resources, avoids the problem of low hardware resource utilization in the session synchronization method of the related technology, and can quickly perform master-slave switching when an abnormal situation such as a crash occurs in the load balancing cluster, without the need to re-establish the connection, avoiding additional overhead such as client retransmission, and also achieves both the efficiency of session synchronization and the consistency of the session tables of the master and standby nodes through incremental synchronization and full synchronization on the basis of session synchronization.

[0069] It should be noted that the method for synchronizing session information of host nodes in a load balancing cluster provided in the embodiment of the present application can be executed by a synchronization device for session information, or a control module in the synchronization device for session information for executing the synchronization method for session information. In the embodiment of the present application, the synchronization device for session information is taken as an example to illustrate the synchronization device for session information provided in the embodiment of the present application.

[0070] Figure 4 FIG. 1 is a schematic diagram of the structure of a synchronization device for session information of a host node according to an embodiment of the present invention. Figure 4 As shown, the session information synchronization device 400 includes: a receiving module 410 and a synchronization module 420 .

[0071] The receiving module 410 is used to receive the session synchronization address sent by each backup node corresponding to the host node, and the synchronization module 420 is used to synchronize the received incremental session information to each corresponding backup node at every first preset time interval based on the session synchronization address, and synchronize the received full session information to each corresponding backup node at every second preset time interval, wherein the first preset time interval is smaller than the second preset time interval.

[0072] In one implementation, the receiving module 410 is further configured to:

[0073] Receive indication information sent by the corresponding standby node when detecting that any host node corresponding to the standby node fails, wherein the indication information is used to notify the standby node to perform a master-slave switch; based on the indication information, stop synchronizing the session information to the standby node.

[0074] In one implementation, the synchronization module 420 is further configured to:

[0075] The host node uses a first preset identifier to mark the synchronized session information, and uses a second preset identifier to mark the unsynchronized session information.

[0076] The synchronization device of session information in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0077] The synchronization device of the session information in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0078] The synchronization device for session information provided in the embodiment of the present application can achieve Figure 2 To avoid repetition, the various processes implemented in the method embodiment are not described here.

[0079] It should be noted that the execution subject of the method for synchronizing session information of a standby node in a load balancing cluster provided in an embodiment of the present application may be a synchronization device for session information, or a control module in the synchronization device for session information for executing the synchronization method for session information. In the embodiment of the present application, the execution of the synchronization method for session information by a synchronization device for session information is taken as an example to illustrate the synchronization device for session information provided in an embodiment of the present application.

[0080] Figure 5FIG. 1 is a schematic diagram of the structure of a synchronization device for session information of a standby node according to an embodiment of the present invention. Figure 5 As shown, the session information synchronization device 500 includes: a sending module 510 and a receiving module 520.

[0081] The sending module 510 is used to send the session synchronization address to each host node corresponding to the backup node; the receiving module 520 is used to receive incremental session information and full session information sent by each host node, wherein the incremental session information is sent by the host node at every first preset time interval based on the session synchronization address, and the full session information is sent by the host node at every second preset time interval based on the session synchronization address.

[0082] In one implementation, the sending module 520 is also used to send indication information to each host node corresponding to the backup node when a failure is detected in any host node corresponding to the backup node, wherein the indication information is used to notify the backup node to perform a master-slave switch; the backup node switches to a host node and takes over the failed host node to receive session information.

[0083] The synchronization device of session information in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0084] The synchronization device of the session information in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0085] The synchronization device for session information provided in the embodiment of the present application can achieve Figure 3 To avoid repetition, the various processes implemented in the method embodiment are not described here.

[0086] Optional, such as Figure 6 As shown, an embodiment of the present application also provides an electronic device 600, including a processor 601 and a memory 602, wherein the memory 602 stores a program or instruction that can be run on the processor 601, and when the program or instruction is executed by the processor 601, it implements: receiving a session synchronization address sent by each backup node corresponding to the host node; based on the session synchronization address, synchronizing the received incremental session information to each corresponding backup node at every first preset time interval, and synchronizing the received full session information to each corresponding backup node at every second preset time interval, wherein the first preset time interval is less than the second preset time interval.

[0087] In one implementation, it also includes: receiving indication information sent by the corresponding backup node when detecting that any host node corresponding to the backup node fails, wherein the indication information is used to notify the backup node to perform a master-slave switch; based on the indication information, stop synchronizing the session information to the backup node.

[0088] In one implementation, the method further includes: the host node using a first preset identifier to mark the synchronized session information, and using a second preset identifier to mark the unsynchronized session information.

[0089] Alternatively, when the program or instruction is executed by the processor 601, it is implemented: sending the session synchronization address to each host node corresponding to the backup node; receiving incremental session information and full session information sent by each host node, wherein the incremental session information is sent by the host node based on the session synchronization address at every first preset time interval, and the full session information is sent by the host node based on the session synchronization address at every second preset time interval.

[0090] In one implementation, it also includes: when a failure is detected in any host node corresponding to the backup node, an indication message is sent to each host node corresponding to the backup node, wherein the indication message is used to notify the backup node to perform a master-slave switch; the backup node switches to a host node and takes over the failed host node to receive session information.

[0091] The specific execution steps can refer to the various steps of the above-mentioned session information synchronization method embodiment, and can achieve the same technical effect. To avoid repetition, they are not described here.

[0092] It should be noted that the electronic devices in the embodiments of the present application include: servers, terminals, or other devices except terminals.

[0093] The above electronic device structure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, the input unit may include a graphics processing unit (GPU) and a microphone, and the display unit may be configured with a display panel in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit includes a touch panel and at least one of other input devices. The touch panel is also called a touch screen. Other input devices may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0094] The memory can be used to store software programs and various data. The memory may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory may include a volatile memory or a non-volatile memory, or the memory may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DRRAM).

[0095] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor.

[0096] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned session information synchronization method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0097] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0098] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0099] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0100] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A method for synchronizing session information, characterized in that: The nodes used for load balancing are grouped to form at least one load balancing cluster, each load balancing cluster includes at least two host nodes and at least one standby node, and the number of standby nodes in each load balancing cluster is less than the number of host nodes; wherein, in each load balancing cluster, each standby node corresponds to at least two host nodes, and each host node corresponds to one standby node; the host node is used to synchronize the received session information to the corresponding standby node; the standby node is used to receive and store the session information sent by the corresponding host nodes, and is used to replace the failed host node; the host nodes do not synchronize the session information; The method for synchronizing session information, applied to a host node in the load balancing cluster, comprises: Receiving a session synchronization address sent by a standby node corresponding to the host node; Based on the session synchronization address, the received incremental session information is synchronized to the corresponding backup node every first preset time interval, and the received full session information is synchronized to the corresponding backup node every second preset time interval, wherein the first preset time interval is smaller than the second preset time interval.

2. The synchronization method according to claim 1, characterized in that: Also includes: Receiving indication information sent by the corresponding standby node when detecting that any host node corresponding to the standby node fails, wherein the indication information is used to notify the standby node to perform a master-slave switch; Based on the indication information, stop synchronizing the session information to the standby node.

3. The synchronization method according to claim 1, characterized in that: Also includes: The host node uses a first preset identifier to mark the synchronized session information, and uses a second preset identifier to mark the unsynchronized session information.

4. A method for synchronizing session information, characterized in that: The nodes used for load balancing are grouped to form at least one load balancing cluster, each load balancing cluster includes at least two host nodes and at least one standby node, and the number of standby nodes in each load balancing cluster is less than the number of host nodes; wherein, in each load balancing cluster, each standby node corresponds to at least two host nodes, and each host node corresponds to one standby node; the host node is used to synchronize the received session information to the corresponding standby node; the standby node is used to receive and store the session information sent by the corresponding host nodes, and is used to replace the failed host node; the host nodes do not synchronize the session information; The method for synchronizing session information is applied to a standby node in the load balancing cluster, comprising: Sending the session synchronization address to each host node corresponding to the standby node; Receive incremental session information and full session information sent by each host node, wherein the incremental session information is sent by the host node at every first preset time interval based on the session synchronization address, and the full session information is sent by the host node at every second preset time interval based on the session synchronization address.

5. The synchronization method according to claim 4, characterized in that: Also includes: When a failure occurs in any host node corresponding to the standby node, an indication message is sent to each host node corresponding to the standby node, wherein the indication message is used to notify the standby node to perform a master-slave switch; The standby node switches to the host node and takes over the failed host node to receive session information.

6. A synchronization device for session information, characterized in that: The nodes used for load balancing are grouped to form at least one load balancing cluster, each load balancing cluster includes at least two host nodes and at least one standby node, and the number of standby nodes in each load balancing cluster is less than the number of host nodes; wherein, in each load balancing cluster, each standby node corresponds to at least two host nodes, and each host node corresponds to one standby node; the host node is used to synchronize the received session information to the corresponding standby node; the standby node is used to receive and store the session information sent by the corresponding host nodes, and is used to replace the failed host node; the host nodes do not synchronize the session information; The session information synchronization device is applied to the host node in the load balancing cluster, including: A receiving module, used for receiving a session synchronization address sent by a standby node corresponding to the host node; A synchronization module is used to synchronize the received incremental session information to the corresponding backup node at a first preset time interval based on the session synchronization address, and synchronize the received full session information to the corresponding backup node at a second preset time interval, wherein the first preset time interval is smaller than the second preset time interval.

7. A device for synchronizing session information, characterized in that: The nodes used for load balancing are grouped to form at least one load balancing cluster, each load balancing cluster includes at least two host nodes and at least one standby node, and the number of standby nodes in each load balancing cluster is less than the number of host nodes; wherein, in each load balancing cluster, each standby node corresponds to at least two host nodes, and each host node corresponds to one standby node; the host node is used to synchronize the received session information to the corresponding standby node; the standby node is used to receive and store the session information sent by the corresponding host nodes, and is used to replace the failed host node; the host nodes do not synchronize the session information; The session information synchronization device is applied to the standby node in the load balancing cluster, including: A sending module, used for sending the session synchronization address to each host node corresponding to the standby node; A receiving module is used to receive incremental session information and full session information sent by each host node, wherein the incremental session information is sent by the host node at every first preset time interval based on the session synchronization address, and the full session information is sent by the host node at every second preset time interval based on the session synchronization address.

8. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method for synchronizing session information as described in any one of claims 1 to 3, or implements the steps of the method for synchronizing session information as described in any one of claims 4 to 5.

9. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the method for synchronizing session information according to any one of claims 1 to 3 are implemented, or the steps of the method for synchronizing session information according to any one of claims 4 to 5 are implemented.

Citation Information

Patent Citations

  • Load balancing method and device for distributed database

    CN111625592A