Movatterモバイル変換


[0]ホーム

URL:


CN114500547A - Synchronization system, method, device, electronic device and storage medium for session information - Google Patents

Synchronization system, method, device, electronic device and storage medium for session information
Download PDF

Info

Publication number
CN114500547A
CN114500547ACN202210281644.7ACN202210281644ACN114500547ACN 114500547 ACN114500547 ACN 114500547ACN 202210281644 ACN202210281644 ACN 202210281644ACN 114500547 ACN114500547 ACN 114500547A
Authority
CN
China
Prior art keywords
session information
node
standby
host node
session
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210281644.7A
Other languages
Chinese (zh)
Other versions
CN114500547B (en
Inventor
肖立美
杨峰明
徐永健
黄保华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sina Technology China Co Ltd
Original Assignee
Sina Technology China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sina Technology China Co LtdfiledCriticalSina Technology China Co Ltd
Priority to CN202210281644.7ApriorityCriticalpatent/CN114500547B/en
Publication of CN114500547ApublicationCriticalpatent/CN114500547A/en
Application grantedgrantedCritical
Publication of CN114500547BpublicationCriticalpatent/CN114500547B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The application discloses a system, a method and a device for synchronizing session information, electronic equipment and a storage medium, belongs to the technical field of computer networks, can solve the problem of low resource utilization rate during session synchronization, and can effectively utilize resources. The system comprises: at least one load balancing cluster, wherein the at least one load balancing cluster is formed by grouping nodes for load balancing, each load balancing cluster comprises 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; in each load balancing cluster, each backup node corresponds to at least one host node, each host node corresponds to at least one backup node, and each host node is configured to synchronize the received session information to the corresponding backup nodes.

Description

Translated fromChinese
会话信息的同步系统、方法、装置、电子设备及存储介质Synchronization system, method, device, electronic device and storage medium for session information

技术领域technical field

本申请属于计算机网络技术领域,具体涉及一种会话信息的同步系统、方法、装置、电子设备及存储介质。The present application belongs to the technical field of computer networks, and specifically relates to a synchronization system, method, device, electronic device and storage medium for session information.

背景技术Background technique

随着互联网流量的日益增加,业务场景及系统架构日益复杂,服务器规模也越来越庞大。而负载均衡(Load Balancer,LB)则是在这种大流量场景下依据某些策略将接入流量均匀的分发到后端的业务服务集群上,既提高了系统服务能力,同时也增强了服务的可用性。服务器负载均衡(Server Load Balancer,SLB),对接入流量通过一定的调度算法,实现流量到后端业务服务器(Real Server,RS)的负载均衡。SLB通过维护会话表的方式,保证相同会话的流量经过SLB集群后可以被转发到同一台后端RS设备。在SLB集群中可以通过会话同步的方式实现集群间节点共享,或集群节点各自持有当前节点的会话表。With the increasing Internet traffic, business scenarios and system architectures have become increasingly complex, and the scale of servers has become larger and larger. Load Balancer (LB) distributes the access traffic evenly to the back-end business service clusters according to certain strategies in such a large-traffic scenario, which not only improves the system service capability, but also enhances the service quality. availability. Server Load Balancer (SLB), through a certain scheduling algorithm for the access traffic, realizes the load balancing of the traffic to the back-end business server (Real Server, RS). By maintaining the session table, SLB ensures that the traffic of the same session can be forwarded to the same back-end RS device after passing through the SLB cluster. In an SLB cluster, inter-cluster node sharing can be achieved through session synchronization, or each cluster node holds the session table of the current node.

但是,目前的会话同步方式资源利用率较低。However, the resource utilization rate of the current session synchronization method is low.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供了一种会话信息的同步系统、方法、装置、电子设备及存储介质,能够解决会话同步时资源利用率低的问题,能够有效利用资源。The embodiments of the present application provide a system, method, apparatus, 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.

第一方面,本申请实施例提供了一种会话信息的同步系统,该系统包括:至少一个负载均衡集群,其中,所述至少一个负载均衡集群由用于负载均衡的节点分组形成,每个负载均衡集群包括至少两个主机节点和至少一个备用节点,所述每个负载均衡集群中备用节点的数量小于主机节点的数量;其中,在每个所述负载均衡集群中,每个备用节点对应至少一个主机节点,每个主机节点对应至少一个备用节点,所述每个主机节点用于将接收到的会话信息同步至所对应的各备用节点。In a first aspect, an embodiment of the present application provides a system for synchronizing session information, the system includes: at least one load balancing cluster, wherein the at least one load balancing cluster is formed by grouping nodes used for load balancing, and each load balancing cluster is formed by grouping nodes for load balancing. The 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 A host node, each host node corresponds to at least one standby node, and each host node is used for synchronizing the received session information to each corresponding standby node.

第二方面,本申请实施例提供了一种会话信息的同步方法,应用于负载均衡集群中的主机节点,该方法包括:接收所述主机节点所对应的各备用节点发送的会话同步地址;基于所述会话同步地址,每隔第一预设时间间隔将接收到的增量的会话信息同步至所对应的各备用节点,并每隔第二预设时间间隔将接收到的全量的会话信息同步至所对应的各备用节点,其中所述第一预设时间间隔小于所述第二预设时间间隔。In a 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 includes: receiving a session synchronization address sent by each standby node corresponding to the host node; The session synchronization address synchronizes the received incremental session information to the corresponding standby nodes every first preset time interval, and synchronizes the received full amount of session information every second preset time interval to each corresponding standby node, wherein the first preset time interval is smaller than the second preset time interval.

第三方面,本申请实施例提供了一种会话信息的同步方法,应用于负载均衡集群中的备用节点,该方法包括:将会话同步地址发送至所述备用节点对应的各主机节点;接收各主机节点发送的增量的会话信息和全量的会话信息,其中,所述增量的会话信息由主机节点基于所述会话同步地址每隔第一预设时间间隔发送,所述全量的会话信息由主机节点基于所述会话同步地址每隔第二预设时间间隔发送。In a 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 includes: sending a session synchronization address to each host node corresponding to the standby node; receiving each Incremental session information and full session information sent by the host node, wherein the incremental session information is sent by the host node every first preset time interval based on the session synchronization address, and the full session information is sent by the host node. The host node sends every second preset time interval based on the session synchronization address.

第四方面,本申请实施例提供了一种会话信息的同步装置,应用于负载均衡集群中的主机节点,该装置包括:接收模块,用于接收所述主机节点对应的各备用节点发送的会话同步地址;同步模块,用于基于所述会话同步地址,每隔第一预设时间间隔将接收到的增量的会话信息同步至所对应的各备用节点,并每隔第二预设时间间隔将接收到的全量的会话信息同步至所对应的各备用节点,其中所述第一预设时间间隔小于所述第二预设时间间隔。In a fourth aspect, an embodiment of the present application provides an apparatus for synchronizing session information, which is applied to a host node in a load balancing cluster, and the apparatus includes: a receiving module configured to receive a session sent by each standby node corresponding to the host node A synchronization address; a synchronization module, configured to synchronize the received incremental session information to the corresponding standby nodes every first preset time interval based on the session synchronization address, and every second preset time interval Synchronizing the received full amount of session information to each corresponding standby node, wherein the first preset time interval is smaller than the second preset time interval.

第五方面,本申请实施例提供了一种会话信息的同步装置,应用于负载均衡集群中的备用节点,该装置包括:发送模块,用于将会话同步地址发送至所述备用节点对应的各主机节点;接收模块,用于接收各主机节点发送的增量的会话信息和全量的会话信息,其中,所述增量的会话信息由主机节点基于所述会话同步地址每隔第一预设时间间隔发送,所述全量的会话信息由主机节点基于所述会话同步地址每隔第二预设时间间隔发送。In a fifth aspect, an embodiment of the present application provides an apparatus for synchronizing session information, which is applied to a backup node in a load balancing cluster. The apparatus includes: a sending module, configured to send a session synchronization address to each corresponding node of the backup node. a host node; a receiving module configured 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 every first preset time The full amount of session information is sent by the host node every second preset time interval based on the session synchronization address.

第六方面,本申请实施例提供了一种电子设备,该电子设备包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第二方面所述的方法的步骤,或者实现如第三方面所述的方法的步骤。In a sixth aspect, an embodiment of the present application provides an electronic device, the electronic device includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor, the program or instruction being When executed, the processor implements the steps of the method according to the second aspect, or implements the steps of the method according to the third aspect.

第七方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第二方面所述的方法的步骤,或者实现如第三方面所述的方法的步骤。In a seventh aspect, an embodiment of the present application provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or instruction is executed by a processor, the steps of the method according to the second aspect are implemented , or implement the steps of the method described in the third aspect.

在本申请实施例中,会话信息的同步系统包括至少一个负载均衡集群,其中,至少一个负载均衡集群由用于负载均衡的节点分组形成,每个负载均衡集群包括至少两个主机节点和至少一个备用节点,每个负载均衡集群中备用节点的数量小于主机节点的数量;其中,在每个负载均衡集群中,每个备用节点对应至少一个主机节点,每个主机节点对应至少一个备用节点,每个主机节点用于将接收到的会话信息同步至所对应的各备用节点,实现了负载均衡集群中较多的主机节点对应少量的备用节点,这相较于相关技术中一个主机节点对应一个备用节点的情况,提升了硬件资源的利用率,避免了相关技术会话同步方式中硬件资源利用率低的问题。In this embodiment of the present application, the system for synchronizing session information includes at least one load balancing cluster, wherein the at least one load balancing cluster is formed by grouping nodes used for load balancing, and each load balancing cluster includes at least two host nodes and at least one Standby nodes, 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, each host node corresponds to at least one standby node, and each Each host node is used to synchronize the received session information to the corresponding standby nodes, so that more host nodes in the load balancing cluster correspond to a small number of standby nodes. Compared with the related art, one host node corresponds to one standby node. In the case of nodes, the utilization rate of hardware resources is improved, and the problem of low utilization rate of hardware resources in the session synchronization method of related technologies is avoided.

附图说明Description of drawings

图1是本申请实施例提供的一种会话信息的同步系统的结构示意图;1 is a schematic structural diagram of a system for synchronizing session information provided by an embodiment of the present application;

图2是本申请实施例提供的一种会话信息的同步方法的流程示意图;2 is a schematic flowchart of a method for synchronizing session information provided by an embodiment of the present application;

图3是本申请实施例提供的另一种会话信息的同步方法的流程示意图;3 is a schematic flowchart of another method for synchronizing session information provided by an embodiment of the present application;

图4是本申请实施例提供的一种会话信息的同步装置的结构示意图;4 is a schematic structural diagram of an apparatus for synchronizing session information provided by an embodiment of the present application;

图5是本申请实施例提供的另一种会话信息的同步装置的结构示意图;5 is a schematic structural diagram of another apparatus for synchronizing session information provided by an embodiment of the present application;

图6是本申请实施例提供的一种电子设备的结构示意图。FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings 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 those of ordinary skill in the art without creative work fall within the protection scope of the present application.

本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second" and the like in the description and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in sequences other than those illustrated or described herein, and distinguish between "first", "second", etc. The objects are usually of one type, and the number of objects is not limited. For example, the first object may be one or more than one. In addition, "and/or" in the description and claims indicates at least one of the connected objects, and the character "/" generally indicates that the associated objects are in an "or" relationship.

在会话同步的相关技术中,在主备模式下通常是将一主一备作为一个集群分组,在分组内进行会话同步,主机和备机都持有该组内全量的会话信息,此种方式下每台主机都对应有一台冗余备机,存在硬件资源浪费的问题。在非主备模式下是将集群内的节点进行分组,在组内进行会话同步,每台主机持有组内全部主机的会话信息,单机的会话能力会受到组内主机数量的限制,单机的处理效率较低。In the related technology of session synchronization, in the active-standby mode, one active and one standby are usually used as a cluster group, and session synchronization is performed within the group. Each host below has a corresponding redundant standby machine, and there is a problem of wasting hardware resources. In the non-active-standby mode, the nodes in the cluster are grouped and the sessions are synchronized in the group. Each host holds the session information of all the hosts in the group. The session capability of a single machine is limited by the number of hosts in the group. Processing efficiency is low.

针对此本申请将用于负载均衡的节点分为多个负载均衡集群,在一个负载均衡集群中包括至少两个主机节点和至少一个备用节点,且备用节点的数量小于主机节点的数量,即主机节点与备用节点之间的数量为多对1的关系,该种分组方式提高了硬件资源的利用率,且同时保证了单机的处理效率。In view of this, the application divides the nodes used for load balancing into multiple load balancing clusters, and one load balancing cluster includes at least two host nodes and at least one standby node, and the number of standby nodes is less than the number of host nodes, that is, the host The number of nodes and standby nodes is a many-to-one relationship. This grouping method improves the utilization rate of hardware resources, and at the same time ensures the processing efficiency of a single machine.

下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的一种会话信息的同步系统、方法、装置、电子设备及存储介质进行详细地说明。A system, method, apparatus, electronic device, and storage medium for synchronizing session information provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.

其中,该会话信息的同步系统包括:至少一个负载均衡集群,其中,所述至少一个负载均衡集群由用于负载均衡的节点分组形成,每个负载均衡集群包括至少两个主机节点和至少一个备用节点,所述每个负载均衡集群中备用节点的数量小于主机节点的数量;The system for synchronizing session information includes: at least one load balancing cluster, wherein the at least one load balancing cluster is formed by grouping nodes used for load balancing, and each load balancing cluster includes at least two host nodes and at least one standby node nodes, 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, each host node corresponds to at least one standby node, and each host node is used for synchronizing the received session information to the corresponding each standby node.

可选的,可以是每个备用节点对应至少两个主机节点,每个主机节点对应一个备用节点。Optionally, each standby node may correspond to at least two host nodes, and each host node may correspond to one standby node.

如图1所示,在此以一个负载集群中包括两个主机节点和一个备用节点为例进行说明。例如,假设负载均衡集群110包括两个主机节点1101和一个备用节点1102。两个主机节点1101用于发送会话信息至同一个负载均衡集群110中的备用节点1102,备用节点1102用于接收和存储同一个负载均衡集群中的主机节点1101发送的会话信息,并用于替换出现故障的主机节点1101。在负载均衡集群110中,每个备用节点1102对应至少两个主机节点1101,每个主机节点1101对应一个备用节点1102,这相较于相关技术中一个主机节点对应一个备用节点的情况,提升了硬件资源的利用率。As shown in FIG. 1 , a load cluster including two host nodes and one standby node is taken as an example for illustration. For example, assume thatload balancing cluster 110 includes twohost nodes 1101 and onestandby node 1102 . The twohost nodes 1101 are used to send session information to thestandby node 1102 in the sameload balancing cluster 110, and thestandby node 1102 is used to receive and store the session information sent by thehost node 1101 in the same load balancing cluster, and is used to replace the occurrence of The failedhost node 1101. In theload balancing cluster 110, eachstandby node 1102 corresponds to at least twohost nodes 1101, and eachhost node 1101 corresponds to onestandby node 1102. Compared with the situation in which one host node corresponds to one standby node in the related art, it improves the Utilization of hardware resources.

此外,在同一个负载均衡集群110中,主机节点1101可以将全量的会话信息和增量的会话信息同步至备用节点1102,主机节点1101之间不进行会话信息的同步,并且,当有主机节点1101出现故障的情况下,储存有该主机节点全量会话信息的备用节点1102替换出现故障的主机节点1101进行工作。In addition, in the sameload balancing cluster 110, thehost node 1101 can synchronize the full session information and incremental session information to thestandby node 1102, and the session information is not synchronized between thehost nodes 1101, and when there is a host node When 1101 fails, thestandby node 1102 that stores the full session information of the host node replaces the failedhost node 1101 to work.

这样,实现了负载均衡集群中较多的主机节点对应少量的备用节点,这相较于相关技术中一个主机节点对应一个备用节点的情况,提升了硬件资源的利用率,避免了相关技术会话同步方式中硬件资源利用率低的问题,并且,可以在负载均衡集群中的主机节点出现故障的情况下,能够迅速进行主备切换,并且不需要重新建立连接,节约了资源,避免了资源的额外开销。In this way, it is realized that more 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 art, the utilization rate of hardware resources is improved, and the synchronization of sessions in related technologies is avoided. The problem of low utilization of hardware resources in the method, and in the case of failure of the host node in the load balancing cluster, the active and standby switching can be quickly performed, and there is no need to re-establish the connection, saving resources and avoiding additional resources. overhead.

图2示出本发明的一个实施例提供的一种会话信息的同步方法,应用于负载均衡集群中的主机节点,该方法包括如下步骤:FIG. 2 shows a method for synchronizing session information provided by an embodiment of the present invention, which is applied to a host node in a load balancing cluster. The method includes the following steps:

步骤202:接收所述主机节点所对应的各备用节点发送的会话同步地址。Step 202: Receive a session synchronization address sent by each standby node corresponding to the host node.

具体的,在负载均衡集群内的会话同步功能开始之前,备用节点可以向所对应的各主机节点通知自己的会话同步地址,此时各主机节点接收备用节点所发送的会话同步地址。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.

由于每个主机节点对应至少一个备用节点,主机节点接收所对应的备用节点发送的会话同步地址时,需要接收所对应的每个备用节点所发送的会话同步地址。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.

可以理解的是,主机节点所对应的备用节点为,与主机节点建立通信的备用节点。It can be understood that the standby node corresponding to the host node is the standby node that establishes communication with the host node.

步骤204:基于所述会话同步地址,每隔第一预设时间间隔将接收到的增量的会话信息同步至所对应的各备用节点,并每隔第二预设时间间隔将接收到的全量的会话信息同步至所对应的各备用节点。Step 204: Based on the session synchronization address, synchronize the received incremental session information to the corresponding standby nodes every first preset time interval, and synchronize the received full amount every second preset time interval. The session information is synchronized to the corresponding standby nodes.

其中所述第一预设时间间隔小于所述第二预设时间间隔。The first preset time interval is smaller than the second preset time interval.

具体的,主机节点采用等价路由及哈希的方案等价接收会话信息,主机节点基于接收的各备用节点的会话同步地址,开启会话同步功能,基于该会话同步地址,将接收到的会话信息同步至对应的各备用节点。Specifically, the host node adopts the equivalent routing and hashing scheme to receive session information equivalently. The host node enables the session synchronization function based on the received session synchronization address of each standby node, and based on the session synchronization address, the received session information is Synchronize to the corresponding standby nodes.

需要说明的是,主机节点之间并不进行会话同步。It should be noted that session synchronization is not performed between host nodes.

增量的会话信息可以是指在第一预设时间间隔内主机节点所接收到的会话信息。主机节点每隔第一预设时间间隔将自身增量的会话信息同步至对应的各备用节点,提高了会话同步的效率。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 incremental session information to the corresponding standby nodes every first preset time interval, which improves the efficiency of session synchronization.

此外,全量的会话信息可以是指主机节点所接收到的所有会话信息。主机节点可以每隔第二预设时间间隔将自身全量的会话信息同步至对应的各备用节点,这保证了主机节点与对应的备用节点之间的会话信息的一致性。In addition, the full amount of session information may refer to all session information received by the host node. The host node can synchronize its full session information to the corresponding standby nodes every second preset time interval, which ensures the consistency of the session information between the host node and the corresponding standby nodes.

可选的,第一预设时间间隔可以小于第二预设时间间隔,即可以间隔较小时间进行增量会话信息的同步,并间隔较长时间进行全量会话信息的同步,以便备用节点将老化的会话信息及时删除,并兼顾会话同步的效率以及主备节点会话的一致性。Optionally, the first preset time interval can be smaller than the second preset time interval, that is, incremental session information can be synchronized at short intervals, and full session information can be synchronized at long intervals, so that the standby node will age out. The session information is deleted in time, taking into account the efficiency of session synchronization and the consistency of sessions between the active and standby nodes.

这样,主机节点通过每隔第一预设时间间隔将接收到的增量的会话信息同步至所对应的各备用节点,并每隔第二预设时间间隔将接收到的全量的会话信息同步至所对应的各备用节点,使得主机节点的增量的会话信息和全量的会话信息都可以进行会话同步,在提升了会话信息同步的效率的同时,兼顾了备用节点与主机节点的会话信息一致性。In this way, the host node synchronizes the received incremental session information to the corresponding standby nodes every first preset time interval, and synchronizes the received full amount of session information to the corresponding standby nodes every second preset time interval. The corresponding standby nodes enable both the incremental session information and the full session information of the host node to perform session synchronization, which not only improves the efficiency of session information synchronization, but also takes into account the consistency of the session information between the standby node and the host node. .

本发明实施例提供的会话信息的同步方法,通过接收主机节点所对应的各备用节点发送的会话同步地址;基于会话同步地址,每隔第一预设时间间隔将接收到的增量的会话信息同步至所对应的各备用节点,并每隔第二预设时间间隔将接收到的全量的会话信息同步至所对应的各备用节点,其中第一预设时间间隔小于第二预设时间间隔,实现了主机节点能够明确同步了自身会话信息的备用节点,使得主机节点的增量的会话信息和全量的会话信息都可以同步至所对应的各备用节点,在提升了会话信息同步的效率的同时,兼顾了备用节点与主机节点的会话信息一致性,从而使得备用节点持有同一主机节点的全量的会话信息,使得备用节点在替换发生故障的主机节点时,能够完全替换发生故障的主机节点进行工作。In the method for synchronizing session information provided by the embodiment of the present invention, the session synchronization address sent by each standby node corresponding to the host node is received; based on the session synchronization address, the received incremental session information every first preset time interval is Synchronizing to each corresponding standby node, and synchronizing the received full amount of session information to each corresponding standby node every second preset time interval, wherein the first preset time interval is smaller than the second preset time interval, It is realized that the host node can explicitly synchronize the standby node of its own session information, so that the incremental session information and full session information of the host node can be synchronized to the corresponding standby nodes, which improves the efficiency of session information synchronization. , taking into account the consistency of session information between the standby node and the host node, so that the standby node holds the full session information of the same host node, so that when the standby node replaces the failed host node, it can completely replace the failed host node. Work.

此外,在一种实现方式中,主机节点还可以接收所对应的备用节点在检测到该备用节点所对应的任意主机节点发生故障时所发送的指示信息,并基于所述指示信息,停止将所述会话信息同步至所述备用节点。In addition, in an implementation manner, the host node may also receive indication information sent by the corresponding standby node when it detects that any host node corresponding to the standby node is faulty, and based on the indication information, stop The session information is synchronized to the standby node.

其中,所述指示信息用于通知本备用节点待进行主备切换。Wherein, the indication information is used to notify the current standby node to perform active-standby switchover.

具体的,在主机节点所对应的备用节点检测到该备用节点所对应的任意主机节点发生故障时,例如主机节点死机,此时备用节点可以向主机节点发送用于通知本备用节点待进行主备切换的指示信息;主机节点接收该指示信息后,可以停止将会话信息同步至该备用节点。Specifically, when the standby node corresponding to the host node detects that any host node corresponding to the standby node is faulty, for example, the host node is down, the standby node can send a message to the host node for notifying the standby node that the standby node is about to perform active standby. Handover indication information; after receiving the indication information, the host node can stop synchronizing session information to the standby node.

当然,此时备用节点可以切换为主机节点,并接替发生故障的主机节点接收会话信息,这实现了负载均衡集群中的主机节点出现故障等异常情况时,能够迅速进行主备切换,且因其保有集群全量的会话信息,能够做到对用户无感的切换,客户端无需进行重连,避免了客户端重传等额外开销。Of course, at this time, the standby node can be switched to the host node and replace the failed host node to receive session information. This enables rapid master-standby switchover when the host node in the load balancing cluster fails and other abnormal conditions. The full amount of session information of the cluster is retained, which enables users to switch without feeling, and the client does not need to reconnect, avoiding additional overhead such as client retransmission.

此外,若主机节点恢复正常,则可以转换为备用节点重新进入工作状态。In addition, if the host node returns to normal, it can be converted to the standby node and re-enter the working state.

另外,在一种实现方式中,在本实施例中主机节点还可以采用第一预设标识对已进行同步的会话信息进行标记,并采用第二预设标识对未进行同步的会话信息进行标记。In addition, in an implementation manner, in this embodiment, the host node may also use a first preset identifier to mark session information that has been synchronized, and use a second preset identifier to mark session information that has not been synchronized .

具体的,本实施例可以在现有会话表的基础上增加会话同步标记(即第一预设标识和第二预设标识),通过会话同步标记对会话表中的信息进行分类。其中,可以采用第一预设标记对已经同步到备用节点的会话信息进行标记,采用第二预设标记对未同步到备用节点的会话信息进行标记。例如,第一预设标记可以为1,第二预设标记为2,已经同步到备用节点的会话信息标记为1,未同步到备用节点的会话信息标记为2。Specifically, in this embodiment, session synchronization markers (ie, the first preset identifier and the second preset identifier) may be added on the basis of the existing session table, and the information in the session table may be classified by the session synchronization markers. The session information that has been synchronized to the standby node may be marked with a first preset mark, and the session information that has not been synchronized to the standby node may be marked with a second preset mark. For example, the first preset flag may be 1, the second preset flag may 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.

需要说明的是,第一预设标记和第二预设标记可以用管理员预先设置,在此不做具体限定。It should be noted that, the first preset mark and the second preset mark may be preset by an administrator, which is not specifically limited herein.

这样主机节点通过第一预设标识对已进行同步的会话信息进行标记,并通过第二预设标识对未进行同步的会话信息进行标记,使得会话信息同步时,避免了出现重复同步的问题,提升了会话信息同步的效率,避免了资源浪费。In this way, the host node uses the first preset identifier to mark the session information that has been synchronized, and uses the second preset identifier to mark the session information that has not been synchronized, 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.

图3示出本发明的一个实施例提供的另一种会话信息的同步方法,应用于负载均衡集群中的备用节点,该方法包括如下步骤:FIG. 3 shows another method for synchronizing session information provided by an embodiment of the present invention, which is applied to a standby node in a load balancing cluster, and the method includes the following steps:

步骤302:将会话同步地址发送至所述备用节点对应的各主机节点。Step 302: Send the session synchronization address to each host node corresponding to the standby node.

具体的,在负载均衡集群内的会话同步功能开始之前,备用节点可以向所对应的各主机节点通知自己的会话同步地址,此时,各主机节点接收到备用节点所发送的会话同步地址,并开启会话同步功能。Specifically, before the session synchronization function in the load balancing cluster starts, the standby node can 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 Enable session synchronization.

由于每个备用节点对应至少一个主机节点,备用节点将会话同步地址发送至所述备用节点对应的各主机节点时,需要将会话同步地址发送至所述备用节点对应的每个主机节点。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, it needs to send the session synchronization address to each host node corresponding to the standby node.

可以理解的是,备用节点对应的主机节点为,与备用节点建立通信的主机节点。It can be understood that the host node corresponding to the standby node is the host node that establishes communication with the standby node.

步骤304:接收各主机节点发送的增量的会话信息和全量的会话信息。Step 304: Receive incremental session information and full session information sent by each host node.

备用节点接收所对应的各主机节点基于备用节点的会话同步地址发送的增量的会话信息和全量的会话信息,其中,增量的会话信息由主机节点基于会话同步地址每隔第一预设时间间隔发送,全量的会话信息由主机节点基于会话同步地址每隔第二预设时间间隔发送。The standby node receives the incremental session information and the full amount of session information sent by the corresponding host nodes based on the session synchronization address of the standby node, wherein the incremental session information is sent by the host node based on the session synchronization address every first preset time. interval, and the full amount of session information is sent by the host node every second preset time interval based on the session synchronization address.

增量的会话信息可以是指在第一预设时间间隔内主机节点所接收到的会话信息,备用节点每隔第一预设时间间隔,接收主机节点发送的自身增量的会话信息,提高了会话同步的效率。The incremental session information may refer to the session information received by the host node within the first preset time interval, and the standby node receives its own incremental session information sent by the host node every first preset time interval, which improves the Efficiency of session synchronization.

全量的会话信息可以是指主机节点所接收到的所有会话信息。备用节点可以每隔第二预设时间间隔接收主机节点发送的自身全量的会话信息,这保证了主机节点与备用节点之间的会话信息的一致性。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 session information sent by the host node every second preset time interval, which ensures the consistency of the session information between the host node and the standby node.

可选的,第一预设时间间隔可以小于第二预设时间间隔,即可以间隔较小时间进行接收目标主机节点自身增量的会话信息,并间隔较长时间接收目标主机节点发送的自身全量的会话信息,以便备用节点将老化的会话信息及时删除,并兼顾会话同步的效率。Optionally, the first preset time interval may be smaller than the second preset time interval, that is, the incremental session information of the target host node may be received at short intervals, and the full amount of self-sent by the target host node may be received at long intervals. so that the standby node deletes the aged session information in time, and takes into account the efficiency of session synchronization.

本发明实施例提供的会话信息的同步方法,备用节点通过将会话同步地址发送至备用节点对应的各主机节点,接收各主机节点发送的增量的会话信息和全量的会话信息,其中,增量的会话信息由主机节点基于会话同步地址每隔第一预设时间间隔发送,全量的会话信息由主机节点基于会话同步地址每隔第二预设时间间隔发送,提高了会话同步的效率,保证了主机节点与备用节点之间的会话信息的一致性。In the method for synchronizing session information provided by the embodiment of the present invention, the standby node receives the incremental session information and the full amount of session information sent by each host node by sending the session synchronization address to each host node corresponding to the standby node, wherein the incremental session information and the full amount of session information are sent by each host node. The session information is sent by the host node at every first preset time interval based on the session synchronization address, and the full amount of session information is sent by the host node at every second preset time interval based on the session synchronization address, which improves the efficiency of session synchronization and ensures that Consistency of session information between the master node and the standby node.

在一种实现方式中,备用节点还可以在检测到所述备用节点所对应的任意主机节点发生故障时,向所述备用节点所对应的各主机节点发送指示信息,其中,所述指示信息用于通知本备用节点待进行主备切换;所述备用节点切换为主机节点,并接替发生故障的主机节点接收会话信息。In an implementation manner, the standby node may also send indication information to each host node corresponding to the standby node when detecting that any host node corresponding to the standby node is faulty, wherein the indication information uses It notifies the standby node to perform active-standby switching; the standby node is switched to the host node and receives session information in place of the failed host node.

具体的,在该备用节点所对应的任意主机节点发生故障,例如主机节点死机时,备用节点可以检测到主机节点发生了故障,此时备用节点可以向所对应的各主机节点发送用于通知本备用节点待进行主备切换指示信息;主机节点接收该指示信息后,可以停止将会话信息同步至备用节点。Specifically, when any host node corresponding to the standby node fails, for example, when the host node is down, the standby node can detect that the host node is faulty. The standby node is waiting for the active-standby switching instruction information; after receiving the instruction information, the host node can stop synchronizing session information to the standby node.

当然,此时备用节点可以切换为主机节点,并接替发生故障的主机节点接收会话信息,这实现了负载均衡集群中的主用节点出现故障等异常情况时,能够迅速进行主备切换,且因其保有集群全量的会话信息,能够做到对用户无感的切换,客户端无需进行重连,避免了客户端重传等额外开销。Of course, at this time, the standby node can be switched to the host node, and replace the failed host node to receive session information, which realizes that when the active node in the load balancing cluster fails and other abnormal conditions, the active-standby switch can be quickly performed. It retains the full amount of session information of the cluster, and can achieve a switch that is insensitive to the user, and the client does not need to reconnect, avoiding additional overhead such as client retransmission.

此外,若主机节点恢复正常,则可以转换为备用节点重新进入工作状态。In addition, if the host node returns to normal, it can be converted to the standby node and re-enter the working state.

这样本实施例提升了硬件资源的利用率,避免了相关技术会话同步方式中硬件资源利用率低的问题,且可以在负载均衡集群出现死机等异常情况时,迅速进行主备切换,且无需重新建连,避免了客户端重传等额外开销,还实现了在会话同步的基础之上,通过增量同步和全量同步的方式,兼顾了会话同步的效率和主备节点会话表的一致性。In this way, the present embodiment improves the utilization rate of hardware resources, avoids the problem of low utilization rate of hardware resources in the session synchronization method of the related art, and can quickly perform active/standby switchover when the load balancing cluster crashes and other abnormal conditions without restarting Establishing a connection avoids additional overhead such as client retransmission, and also realizes that on the basis of session synchronization, through incremental synchronization and full synchronization, the efficiency of session synchronization and the consistency of the session table of the active and standby nodes are taken into account.

需要说明的是,本申请实施例提供的应用于负载均衡集群中的主机节点会话信息的同步方法,执行主体可以为会话信息的同步装置,或者该会话信息的同步装置中的用于执行会话信息的同步方法的控制模块。本申请实施例中以会话信息的同步装置执行会话信息的同步方法为例,说明本申请实施例提供的会话信息的同步装置。It should be noted that, in the method for synchronizing session information of a host node in a load balancing cluster provided by the embodiments of the present application, the execution subject may be a synchronization device for session information, or a device for synchronizing session information for executing session information. The synchronization method of the control module. In the embodiment of the present application, the method for synchronizing session information performed by the device for synchronizing session information is taken as an example to describe the device for synchronizing session information provided by the embodiment of the present application.

图4是本发明实施例应用于主机节点的会话信息的同步装置的结构示意图。如图4所示,会话信息的同步装置400包括:接收模块410、同步模块420。FIG. 4 is a schematic structural diagram of an apparatus for synchronizing session information applied to a host node according to an embodiment of the present invention. As shown in FIG. 4 , theapparatus 400 for synchronizing session information includes: a receivingmodule 410 and asynchronization module 420 .

接收模块410,用于接收所述主机节点对应的各备用节点发送的会话同步地址,同步模块420,用于基于所述会话同步地址,每隔第一预设时间间隔将接收到的增量的会话信息同步至所对应的各备用节点,并每隔第二预设时间间隔将接收到的全量的会话信息同步至所对应的各备用节点,其中所述第一预设时间间隔小于所述第二预设时间间隔。The receivingmodule 410 is configured to receive the session synchronization address sent by each standby node corresponding to the host node, and thesynchronization module 420 is configured to, based on the session synchronization address, receive the incremental received every first preset time interval. The session information is synchronized to the corresponding standby nodes, and the full amount of received session information is synchronized to the corresponding standby nodes every second preset time interval, wherein the first preset time interval is smaller than the first preset time interval. Two preset time intervals.

在一种实现方式中,接收模块410还用于,In an implementation manner, the receivingmodule 410 is further configured to:

接收所对应的备用节点在检测到该备用节点所对应的任意主机节点发生故障时所发送的指示信息,其中所述指示信息用于通知本备用节点待进行主备切换;基于所述指示信息,停止将所述会话信息同步至所述备用节点。Receive the indication information sent by the corresponding standby node when it detects that any host node corresponding to the standby node is faulty, wherein the indication information is used to notify the standby node to perform an active-standby switchover; based on the indication information, Stop synchronizing the session information to the standby node.

在一种实现方式中,同步模块420还用于,In one implementation, thesynchronization module 420 is further configured to:

所述主机节点采用第一预设标识对已进行同步的会话信息进行标记,并采用第二预设标识对未进行同步的会话信息进行标记。The host node uses the first preset identifier to mark session information that has been synchronized, and uses the second preset identifier to mark session information that has not been synchronized.

本申请实施例中的会话信息的同步装置可以是装置,也可以是终端中的部件、集成电路、或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,非移动电子设备可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The apparatus for synchronizing session information in this embodiment of the present application may be an apparatus, or may be a component, an integrated circuit, or a chip in a terminal. The apparatus may be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (personal digital assistant). assistant, PDA), etc., the non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc. This application Examples are not specifically limited.

本申请实施例中的会话信息的同步装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The apparatus for synchronizing session information in this embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.

本申请实施例提供的会话信息的同步装置能够实现图2的方法实施例中实现的各个过程,为避免重复,这里不再赘述。The apparatus for synchronizing session information provided in this embodiment of the present application can implement each process implemented in the method embodiment of FIG. 2 , and to avoid repetition, details are not described here.

需要说明的是,本申请实施例提供的应用于负载均衡集群中的备用节点的会话信息的同步方法,执行主体可以为会话信息的同步装置,或者该会话信息的同步装置中的用于执行会话信息的同步方法的控制模块。本申请实施例中以会话信息的同步装置执行会话信息的同步方法为例,说明本申请实施例提供的会话信息的同步装置。It should be noted that, in the method for synchronizing session information applied to a standby node in a load balancing cluster provided by the embodiments of the present application, the execution subject may be a session information synchronization device, or a session information synchronization device for executing session information. The control module of the information synchronization method. In the embodiment of the present application, the method for synchronizing session information performed by the device for synchronizing session information is taken as an example to describe the device for synchronizing session information provided by the embodiment of the present application.

图5是本发明实施例应用于备用节点的会话信息的同步装置的结构示意图。如图5所示,会话信息的同步装置500包括:发送模块510、接收模块520。FIG. 5 is a schematic structural diagram of an apparatus for synchronizing session information applied to a standby node according to an embodiment of the present invention. As shown in FIG. 5 , theapparatus 500 for synchronizing session information includes: a sendingmodule 510 and areceiving module 520 .

发送模块510,用于将会话同步地址发送至所述备用节点对应的各主机节点;接收模块520,用于接收各主机节点发送的增量的会话信息和全量的会话信息,其中,所述增量的会话信息由主机节点基于所述会话同步地址每隔第一预设时间间隔发送,所述全量的会话信息由主机节点基于所述会话同步地址每隔第二预设时间间隔发送。The sendingmodule 510 is configured to send the session synchronization address to each host node corresponding to the standby node; the receivingmodule 520 is configured to receive the incremental session information and full session information sent by each host node, wherein the incremental session information is The amount of session information is sent by the host node at every first preset time interval based on the session synchronization address, and the full amount of session information is sent by the host node at every second preset time interval based on the session synchronization address.

在一种实现方式中,发送模块520还用于,在检测到所述备用节点所对应的任意主机节点发生故障时,向所述备用节点所对应的各主机节点发送指示信息,其中,所述指示信息用于通知本备用节点待进行主备切换;所述备用节点切换为主机节点,并接替发生故障的主机节点接收会话信息。In an implementation manner, the sendingmodule 520 is further configured to, when detecting that any host node corresponding to the standby node fails, send indication information to each host node corresponding to the standby node, wherein the The indication information is used to notify the current standby node to perform active-standby switchover; the standby node is switched to the host node and receives the session information in place of the failed host node.

本申请实施例中的会话信息的同步装置可以是装置,也可以是终端中的部件、集成电路、或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,非移动电子设备可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The apparatus for synchronizing session information in this embodiment of the present application may be an apparatus, or may be a component, an integrated circuit, or a chip in a terminal. The apparatus may be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (personal digital assistant). assistant, PDA), etc., the non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc. This application Examples are not specifically limited.

本申请实施例中的会话信息的同步装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The apparatus for synchronizing session information in this embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.

本申请实施例提供的会话信息的同步装置能够实现图3的方法实施例中实现的各个过程,为避免重复,这里不再赘述。The apparatus for synchronizing session information provided in this embodiment of the present application can implement each process implemented in the method embodiment of FIG. 3 , which is not repeated here to avoid repetition.

可选的,如图6所示,本申请实施例还提供一种电子设备600,包括处理器601,存储器602,存储器602上存储有可在所述处理器601上运行的程序或指令,该程序或指令被处理器601执行时实现:接收所述主机节点所对应的各备用节点发送的会话同步地址;基于所述会话同步地址,每隔第一预设时间间隔将接收到的增量的会话信息同步至所对应的各备用节点,并每隔第二预设时间间隔将接收到的全量的会话信息同步至所对应的各备用节点,其中所述第一预设时间间隔小于所述第二预设时间间隔。Optionally, as shown in FIG. 6 , an embodiment of the present application further provides anelectronic device 600 , including aprocessor 601 and amemory 602 . Thememory 602 stores programs or instructions that can run on theprocessor 601 . When the program or instruction is executed by theprocessor 601, it is realized: receiving the session synchronization address sent by each standby node corresponding to the host node; The session information is synchronized to the corresponding standby nodes, and the full amount of received session information is synchronized to the corresponding standby nodes every second preset time interval, wherein the first preset time interval is smaller than the first preset time interval. Two preset time intervals.

在一种实现方式中,还包括:接收所对应的备用节点在检测到该备用节点所对应的任意主机节点发生故障时所发送的指示信息,其中所述指示信息用于通知本备用节点待进行主备切换;基于所述指示信息,停止将所述会话信息同步至所述备用节点。In an implementation manner, the method further includes: receiving indication information sent by the corresponding standby node when it detects that any host node corresponding to the standby node is faulty, wherein the indication information is used to notify the standby node to perform Active/standby switchover; based on the indication information, stop synchronizing the session information to the standby node.

在一种实现方式中,还包括:所述主机节点采用第一预设标识对已进行同步的会话信息进行标记,并采用第二预设标识对未进行同步的会话信息进行标记。In an implementation manner, the method further includes: the host node uses a first preset identifier to mark session information that has been synchronized, and uses a second preset identifier to mark session information that has not been synchronized.

或者,该程序或指令被处理器601执行时实现:将会话同步地址发送至所述备用节点对应的各主机节点;接收各主机节点发送的增量的会话信息和全量的会话信息,其中,所述增量的会话信息由主机节点基于所述会话同步地址每隔第一预设时间间隔发送,所述全量的会话信息由主机节点基于所述会话同步地址每隔第二预设时间间隔发送。Alternatively, when the program or instruction is executed by theprocessor 601, it is implemented: sending the session synchronization address to each host node corresponding to the standby node; receiving the incremental session information and the full amount of session information sent by each host node, wherein all the The incremental session information is sent by the host node every first preset time interval based on the session synchronization address, and the full amount of session information is sent by the host node every second preset time interval based on the session synchronization address.

在一种实现方式中,还包括:在检测到所述备用节点所对应的任意主机节点发生故障时,向所述备用节点对应的各主机节点发送指示信息,其中,所述指示信息用于通知本备用节点待进行主备切换;所述备用节点切换为主机节点,并接替发生故障的主机节点接收会话信息。In an implementation manner, the method further includes: when it is detected that any host node corresponding to the standby node is faulty, sending indication information to each host node corresponding to the standby node, where the indication information is used to notify This standby node is to be switched between active and standby; the standby node is switched to the host node and receives session information in place of the failed host node.

具体执行步骤可以参见上述会话信息的同步方法实施例的各个步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。For specific execution steps, reference may be made to the respective steps in the above-mentioned embodiment of the method for synchronizing session information, and the same technical effect can be achieved. To avoid repetition, details are not repeated here.

需要说明的是,本申请实施例中的电子设备包括:服务器、终端或除终端之外的其他设备。It should be noted that the electronic devices in the embodiments of the present application include: a server, a terminal, or other devices other than the terminal.

以上电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,例如,输入单元,可以包括图形处理器(Graphics Processing Unit,GPU)和麦克风,显示单元可以采用液晶显示器、有机发光二极管等形式来配置显示面板。用户输入单元包括触控面板以及其他输入设备中的至少一种。触控面板也称为触摸屏。其他输入设备可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。The above structure of the electronic device does not constitute a limitation on the electronic device, and the electronic device may include more or less components than shown, or combine some components, or arrange different components, for example, the input unit may include a graphics processor (Graphics Processing Unit, GPU) and a microphone, the display unit may use a liquid crystal display, an organic light emitting diode, or the like to configure the display panel. The user input unit includes at least one of a touch panel and other input devices. A touch panel is also called a touch screen. Other input devices may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be repeated here.

存储器可用于存储软件程序以及各种数据。存储器可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器可以包括易失性存储器或非易失性存储器,或者,存储器可以包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。The memory can be used to store software programs as well as 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. Further, the memory may include volatile memory or non-volatile memory, or alternatively, the memory may include both volatile and non-volatile memory. Wherein, the non-volatile memory may be Read-Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (Erasable PROM, EPROM), Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory can be random access memory (Random Access Memory, RAM), static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous random access memory) DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synchlink DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DRRAM).

处理器可包括一个或多个处理单元;可选的,处理器集成应用处理器和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,调制解调处理器主要处理无线通信信号,如基带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器中。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 involving the operating system, user interface, and application programs, etc. The modulation processor mainly deals with wireless communication signals, such as the baseband processor. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor.

本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述会话信息的同步方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application further provide a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or instruction is executed by a processor, each process of the above-mentioned embodiment of the method for synchronizing session information is implemented, and can To achieve the same technical effect, in order to avoid repetition, details are not repeated here.

其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device described in the foregoing embodiments. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in the reverse order depending on the functions involved. To perform functions, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to some examples may be combined in other examples.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or in a part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, CD-ROM), including several instructions to make a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of this application.

上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific embodiments, which are merely illustrative rather than restrictive. Under the inspiration of this application, without departing from the scope of protection of the purpose of this application and the claims, many forms can be made, which all fall within the protection of this application.

Claims (10)

Translated fromChinese
1.一种会话信息的同步系统,其特征在于,包括:1. a synchronization system of session information, is characterized in that, comprises:至少一个负载均衡集群,其中,所述至少一个负载均衡集群由用于负载均衡的节点分组形成,每个负载均衡集群包括至少两个主机节点和至少一个备用节点,所述每个负载均衡集群中备用节点的数量小于主机节点的数量;At least one load balancing cluster, wherein the at least one load balancing cluster is formed by grouping nodes used for load balancing, each load balancing cluster includes at least two host nodes and at least one standby node, and each load balancing cluster includes The number of standby nodes is less than the number of master nodes;其中,在每个所述负载均衡集群中,每个备用节点对应至少一个主机节点,每个主机节点对应至少一个备用节点,所述每个主机节点用于将接收到的会话信息同步至所对应的各备用节点。Wherein, in each of the load balancing clusters, each standby node corresponds to at least one host node, each host node corresponds to at least one standby node, and each host node is used for synchronizing the received session information to the corresponding each standby node.2.一种会话信息的同步方法,应用于如权利要求1所述的负载均衡集群中的主机节点,其特征在于,包括:2. A method for synchronizing session information, applied to the host node in the load balancing cluster as claimed in claim 1, wherein the method comprises:接收所述主机节点所对应的各备用节点发送的会话同步地址;receiving a session synchronization address sent by each standby node corresponding to the host node;基于所述会话同步地址,每隔第一预设时间间隔将接收到的增量的会话信息同步至所对应的各备用节点,并每隔第二预设时间间隔将接收到的全量的会话信息同步至所对应的各备用节点,其中所述第一预设时间间隔小于所述第二预设时间间隔。Based on the session synchronization address, the received incremental session information is synchronized to the corresponding standby nodes every first preset time interval, and the received full amount of session information is every second preset time interval. Synchronizing to each corresponding standby node, wherein the first preset time interval is smaller than the second preset time interval.3.根据权利要求2所述的同步方法,其特征在于,还包括:3. The synchronization method according to claim 2, further comprising:接收所对应的备用节点在检测到该备用节点所对应的任意主机节点发生故障时所发送的指示信息,其中所述指示信息用于通知本备用节点待进行主备切换;Receive indication information sent by the corresponding standby node when it detects that any host node corresponding to the standby node is faulty, wherein the indication information is used to notify the standby node to perform active-standby switchover;基于所述指示信息,停止将所述会话信息同步至所述备用节点。Based on the indication information, stop synchronizing the session information to the standby node.4.根据权利要求2所述的同步方法,其特征在于,还包括:4. The synchronization method according to claim 2, further comprising:所述主机节点采用第一预设标识对已进行同步的会话信息进行标记,并采用第二预设标识对未进行同步的会话信息进行标记。The host node uses the first preset identifier to mark session information that has been synchronized, and uses the second preset identifier to mark session information that has not been synchronized.5.一种会话信息的同步方法,应用于如权利要求1所述的负载均衡集群中的备用节点,其特征在于,包括:5. A method for synchronizing session information, applied to the standby node in the load balancing cluster as claimed in claim 1, wherein the method comprises:将会话同步地址发送至所述备用节点对应的各主机节点;sending the session synchronization address to each host node corresponding to the standby node;接收各主机节点发送的增量的会话信息和全量的会话信息,其中,所述增量的会话信息由主机节点基于所述会话同步地址每隔第一预设时间间隔发送,所述全量的会话信息由主机节点基于所述会话同步地址每隔第二预设时间间隔发送。Receive the incremental session information and the 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. The information is sent by the host node every second preset time interval based on the session synchronization address.6.根据权利要求5所述的同步方法,其特征在于,还包括:6. The synchronization method according to claim 5, further comprising:在检测到所述备用节点所对应的任意主机节点发生故障时,向所述备用节点所对应的各主机节点发送指示信息,其中,所述指示信息用于通知本备用节点待进行主备切换;When detecting that any host node corresponding to the standby node is faulty, sending indication information to each host node corresponding to the standby node, wherein the indication information is used to notify the standby node to perform an active-standby switchover;所述备用节点切换为主机节点,并接替发生故障的主机节点接收会话信息。The standby node is switched to the host node, and receives session information in place of the failed host node.7.一种会话信息的同步装置,应用于如权利要求1所述的负载均衡集群中的主机节点,其特征在于,包括:7. A device for synchronizing session information, applied to a host node in a load balancing cluster as claimed in claim 1, wherein the device comprises:接收模块,用于接收所述主机节点对应的各备用节点发送的会话同步地址;a receiving module, configured to receive a session synchronization address sent by each standby node corresponding to the host node;同步模块,用于基于所述会话同步地址,每隔第一预设时间间隔将接收到的增量的会话信息同步至所对应的各备用节点,并每隔第二预设时间间隔将接收到的全量的会话信息同步至所对应的各备用节点,其中所述第一预设时间间隔小于所述第二预设时间间隔。The synchronization module is configured to synchronize the received incremental session information to the corresponding standby nodes every first preset time interval based on the session synchronization address, and receive the received incremental session information every second preset time interval. The full amount of session information is synchronized to each corresponding standby node, wherein the first preset time interval is smaller than the second preset time interval.8.一种会话信息的同步装置,应用于如权利要求1所述的负载均衡集群中的备用节点,其特征在于,包括:8. An apparatus for synchronizing session information, applied to the standby node in the load balancing cluster as claimed in claim 1, characterized in that, comprising:发送模块,用于将会话同步地址发送至所述备用节点对应的各主机节点;a sending module, configured to send the session synchronization address to each host node corresponding to the standby node;接收模块,用于接收各主机节点发送的增量的会话信息和全量的会话信息,其中,所述增量的会话信息由主机节点基于所述会话同步地址每隔第一预设时间间隔发送,所述全量的会话信息由主机节点基于所述会话同步地址每隔第二预设时间间隔发送。a receiving module, configured 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 every first preset time interval based on the session synchronization address, The full amount of session information is sent by the host node every second preset time interval based on the session synchronization address.9.一种电子设备,其特征在于,包括处理器,存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求2-4任一项所述的会话信息的同步方法的步骤,或者实现如权利要求5-6任一项所述的会话信息的同步方法的步骤。9. An electronic device, characterized in that it comprises a processor, a memory and a program or instruction that is stored on the memory and can run on the processor, the program or instruction being implemented when executed by the processor The steps of the method for synchronizing session information according to any one of claims 2-4, or the steps for implementing the method for synchronizing session information according to any one of claims 5-6.10.一种可读存储介质,其特征在于,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求2-4任一项所述的会话信息的同步方法的步骤,或者实现如权利要求5-6任一项所述的会话信息的同步方法的步骤。10. A readable storage medium, wherein a program or an instruction is stored on the readable storage medium, and when the program or instruction is executed by a processor, the session information according to any one of claims 2-4 is realized The steps of the synchronization method, or the steps of implementing the synchronization method of session information according to any one of claims 5-6.
CN202210281644.7A2022-03-222022-03-22System, method, device, electronic equipment and storage medium for synchronizing session informationActiveCN114500547B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202210281644.7ACN114500547B (en)2022-03-222022-03-22System, method, device, electronic equipment and storage medium for synchronizing session information

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202210281644.7ACN114500547B (en)2022-03-222022-03-22System, method, device, electronic equipment and storage medium for synchronizing session information

Publications (2)

Publication NumberPublication Date
CN114500547Atrue CN114500547A (en)2022-05-13
CN114500547B CN114500547B (en)2024-10-29

Family

ID=81489130

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202210281644.7AActiveCN114500547B (en)2022-03-222022-03-22System, method, device, electronic equipment and storage medium for synchronizing session information

Country Status (1)

CountryLink
CN (1)CN114500547B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115695538A (en)*2022-10-272023-02-03中国银行股份有限公司Service data processing method and device and server

Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102882981A (en)*2012-10-192013-01-16南京邮电大学Load balancing method of node task under equivalence structural cloud platform
CN104506357A (en)*2014-12-222015-04-08国云科技股份有限公司High-usability cluster node management method
US20160105502A1 (en)*2013-06-202016-04-14Huawei Technologies Co., Ltd.Data synchronization method, data synchronization apparatus, and distributed system
CN110417842A (en)*2018-04-282019-11-05北京京东尚科信息技术有限公司Fault handling method and device for gateway server
CN110647580A (en)*2019-09-052020-01-03南京邮电大学 Distributed container cluster image management master node, slave node, system and method
CN111625592A (en)*2019-02-282020-09-04北京京东尚科信息技术有限公司Load balancing method and device for distributed database
CN112671928A (en)*2020-12-312021-04-16北京天融信网络安全技术有限公司Equipment centralized management architecture, load balancing method, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102882981A (en)*2012-10-192013-01-16南京邮电大学Load balancing method of node task under equivalence structural cloud platform
US20160105502A1 (en)*2013-06-202016-04-14Huawei Technologies Co., Ltd.Data synchronization method, data synchronization apparatus, and distributed system
CN104506357A (en)*2014-12-222015-04-08国云科技股份有限公司High-usability cluster node management method
CN110417842A (en)*2018-04-282019-11-05北京京东尚科信息技术有限公司Fault handling method and device for gateway server
CN111625592A (en)*2019-02-282020-09-04北京京东尚科信息技术有限公司Load balancing method and device for distributed database
CN110647580A (en)*2019-09-052020-01-03南京邮电大学 Distributed container cluster image management master node, slave node, system and method
CN112671928A (en)*2020-12-312021-04-16北京天融信网络安全技术有限公司Equipment centralized management architecture, load balancing method, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115695538A (en)*2022-10-272023-02-03中国银行股份有限公司Service data processing method and device and server

Also Published As

Publication numberPublication date
CN114500547B (en)2024-10-29

Similar Documents

PublicationPublication DateTitle
CN110224871B (en)High-availability method and device for Redis cluster
US9639437B2 (en)Techniques to manage non-disruptive SAN availability in a partitioned cluster
CN109151045B (en) A distributed cloud system and monitoring method
US11734138B2 (en)Hot standby method, apparatus, and system
AU2014302471B2 (en)Management of computing sessions
CN102355369B (en) Virtualized cluster system and its processing method and equipment
CN110890980A (en)Method, device, server and system for switching main terminal and standby terminal
US9992058B2 (en)Redundant storage solution
CN102932409B (en)The method and system that a kind of virtual machine moves online
AU2017232147A1 (en)Management of computing sessions
CN104038376A (en)Method and device for managing real servers and LVS clustering system
CN102388570B (en)Single board running method and system under active-standby mode
CN104010034A (en)Management method for group dependence of high-availability cluster
CN106385330B (en) Implementation method and device of a network function virtualization orchestrator
CN103532764B (en)Multiple-node backup method and system
CN114553900B (en)Distributed block storage management system, method and electronic equipment
CN114500547B (en)System, method, device, electronic equipment and storage medium for synchronizing session information
US8621260B1 (en)Site-level sub-cluster dependencies
CN111835684B (en)Network isolation monitoring method and system for haproxy equipment
CN107707665A (en)A kind of network storage method, device, system and computer-readable recording medium
CN112187523A (en)Network high-availability implementation method and super-convergence system
CN111224881A (en)Routing method, system, equipment and computer readable storage medium
CN107087021B (en)Master-slave server determination method and device
CN109936462A (en) Disaster recovery method and device
CN112965790B (en)PXE protocol-based virtual machine starting method and electronic equipment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
TA01Transfer of patent application right

Effective date of registration:20230307

Address after:Room 501-502, 5/F, Sina Headquarters Scientific Research Building, Block N-1 and N-2, Zhongguancun Software Park, Dongbei Wangxi Road, Haidian District, Beijing, 100193

Applicant after:Sina Technology (China) Co.,Ltd.

Address before:100080 7th floor, Sina headquarters scientific research building, plot n-1 and n-2, Zhongguancun Software Park Phase II (West Expansion), Dongbeiwang West Road, Haidian District, Beijing

Applicant before:Sina.com Technology (China) Co.,Ltd.

TA01Transfer of patent application right
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp