CN114938373A - High-availability connection method and system for cloud platform TCP long connection service - Google Patents

High-availability connection method and system for cloud platform TCP long connection service Download PDF

Info

Publication number
CN114938373A
CN114938373A CN202210559817.7A CN202210559817A CN114938373A CN 114938373 A CN114938373 A CN 114938373A CN 202210559817 A CN202210559817 A CN 202210559817A CN 114938373 A CN114938373 A CN 114938373A
Authority
CN
China
Prior art keywords
address
service
server
sdk
tcp long
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
CN202210559817.7A
Other languages
Chinese (zh)
Other versions
CN114938373B (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.)
Ringslink Xiamen Network Communication Technologies Co ltd
Original Assignee
Ringslink Xiamen Network Communication Technologies 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 Ringslink Xiamen Network Communication Technologies Co ltd filed Critical Ringslink Xiamen Network Communication Technologies Co ltd
Priority to CN202210559817.7A priority Critical patent/CN114938373B/en
Publication of CN114938373A publication Critical patent/CN114938373A/en
Application granted granted Critical
Publication of CN114938373B publication Critical patent/CN114938373B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields

Abstract

The invention discloses a high-availability connection method and a high-availability connection system for a cloud platform TCP long connection service, which relate to the technical field of communication. Meanwhile, the server issues the domain name, analyzes the IP address from the domain name and issues the IP address to the SDK of the terminal equipment, and can solve the problem of firewall interception only by filling the domain name of the server into a white list of the firewall and binding the domain name-IP address relation. The SDK of the terminal equipment can acquire a new IP address list and provide the new IP address list for the SDK of the terminal equipment by polling the IP address list or re-executing DNS analysis, so that the fault transfer is realized. The method also discloses a method for detecting the response delay of the server by adopting the service address gateway and combining a load balancing scheduling method to send the server with the highest priority to the SDK of the terminal equipment so as to effectively solve the problems of load balancing and fault transfer of the TCP service cluster.

Description

High-availability connection method and system for cloud platform TCP long connection service
Technical Field
The invention relates to the technical field of communication, in particular to a high-availability connection method and a high-availability connection system for a cloud platform TCP long connection service.
Background
The TCP long connection service means that once the terminal device and the server establish a connection, a request initiated by one terminal device must fall on the same server, and the server can actively initiate a signaling issuing function to a certain specified terminal device according to a service requirement.
Most access control terminal equipment's connection scheme is, the IP address of the TCP service node list of high in the clouds is fixed write in terminal equipment, in case any trouble appears in high in the clouds service node like this, terminal equipment can't realize the failover, seriously influences user experience, can only wait for the developer of producer to implement the service recovery to the trouble node after, just can resume normal.
In addition, the other scheme is that only a communication protocol between the access control terminal device and the cloud TCP long connection server is provided, and devices of different types are developed according to the protocol, so that device development teams of different types need to realize a set of code modules with the same functions as the SDK, efficiency is low, the code modules developed by different teams are different, and later maintenance is difficult.
Disclosure of Invention
The invention provides a high-availability connection method and a high-availability connection system for a TCP long connection service of a cloud platform, and aims to solve the problems in the prior art.
The invention adopts the following technical scheme:
a high-availability connection method of a cloud platform TCP long connection service comprises the following steps:
(1) deploying a plurality of servers by adopting a cluster to construct a TCP long connection service cluster;
(2) registering the IP addresses of all the servers to a service address gateway, and checking the health state of the servers in real time by the service address gateway;
(3) the SDK of the terminal equipment obtains at least one healthy IP address from the service address gateway through DNS analysis;
(4) and the SDK of the terminal equipment and a server corresponding to the IP address establish TCP long connection service.
One embodiment is as follows: in the step (3), the service address gateway sends the plurality of IP addresses to DNS analysis equipment to form a first IP address list; the DNS analysis equipment issues the first IP address list to the SDK of each terminal equipment; in the step (4), the SDK of the terminal device selects an IP address from the first IP address list to establish the TCP long connection service.
Further, still include: when the TCP long connection service is disconnected, the SDK of the terminal equipment polls the IP addresses in the first IP address list one by one and tries to reestablish the TCP long connection service.
Further, still include: when the TCP long connection service cannot be reestablished after the IP addresses in the first IP address list are polled one by one, DNS analysis is carried out again, and a second IP address list is obtained; and then the SDK of the terminal equipment selects an IP address from the second IP address list to establish the TCP long connection service.
As another specific embodiment, between the step (2) and the step (3), the method further includes, initiating, by the serving address gateway, a probe of response delay for all servers; in the step (3), the service address gateway converges all healthy IP addresses into a third IP address list; and the service address gateway carries out priority order on all the IP addresses in the third IP address list through a load balancing scheduling algorithm based on response delay, and issues the IP address with the highest priority to the SDK of the terminal equipment through DNS analysis equipment.
Further, the load balancing scheduling algorithm based on response delay specifically includes:
when the third IP address list is in the third IP address list, the real-time delay time L of one server cut Greater than the minimum delay time L among all servers min When the duration reaches the duration T, the server is adjusted as the target, and the server with the minimum delay time is used as the reference, and the splitting weight of the target adjustment server is calculated according to the following formula:
Figure BDA0003656094260000031
wherein M, T are constants, and M>1; w represents the splitting weight of the target adjustment server; w 0 Representing a splitting weight unit; l is min Represents the minimum delay time among all servers; l represents the average delay time of the target adjustment server within the time length T; n denotes an adjustment factor.
The setting method of the adjustment factor N is specifically as follows:
and calculating the dynamic delay adjustment factor B in real time according to the following formula:
Figure BDA0003656094260000032
wherein L is cut Representing the real-time delay time of the target adjustment server; l is min Represents the minimum delay time among all servers; l is max Adjusting the maximum delay time since the server starts the shunting weight adjustment for the purpose;
(c) when B is 0-20%, N is 2; when B is 20% to 50%, N is 1, and when B is 50% to 100%, N is 0.5.
Further, the method also comprises the following steps: when the TCP long connection service is disconnected, the service address gateway carries out priority sequence on the rest IP addresses except the original IP address, and the IP address with the highest priority is sent to the SDK of the terminal equipment through the DNS analysis equipment.
Furthermore, the DNS resolution equipment comprises a DNS authoritative server and a self-research DNS resolution server; the step (3) specifically comprises: the SDK of the terminal equipment sends a TCP long service connection request to a DNS authoritative server; the DNS authoritative server obtains the CNAME record from the self-research DNS analysis server and returns the CNAME record to the SDK of the terminal equipment; the SDK of the terminal equipment inquires a self-research DNS analysis server; and the self-research DNS analysis server acquires at least one IP address from the service address gateway and sends the IP address to the SDK of the terminal equipment.
The invention also protects a high-availability connection system of the cloud platform TCP long connection service.
As a specific implementation mode: the system comprises DNS analysis equipment, a server, a service address gateway and an SDK of terminal equipment;
the service address gateway is connected with a plurality of servers deployed in a cluster and used for registering the IP addresses of the servers and checking the health states of the servers in real time;
the SDK of the terminal equipment is connected with a service address gateway through DNS analysis equipment and used for acquiring a first IP address list from the service address gateway and selecting one IP address from the first IP address list to establish TCP long connection service;
the SDK of the terminal equipment is used for trying to reestablish the TCP long connection service in a mode of polling the IP address list one by one when the TCP long connection service is disconnected; and when the polling fails one by one, performing DNS analysis again through DNS analysis equipment to obtain a second IP address list, and selecting one IP address from the second IP address list to establish TCP long connection service.
As another specific embodiment: the system comprises DNS analysis equipment, a server, a service address gateway and an SDK of terminal equipment;
the service address gateway is connected with a plurality of servers deployed in a cluster and used for registering the IP address of each server, checking the health state of each server in real time and detecting the response delay of the server;
the service address gateway is used for gathering all healthy IP addresses into a third IP address list, carrying out priority sequence on all the IP addresses in the third IP address list through a load balancing scheduling algorithm based on response delay, and issuing the IP address with the highest priority to the SDK of the terminal equipment through DNS analysis equipment; when the TCP long connection service is disconnected, priority order is carried out on the rest IP addresses except the original IP address, and the IP address with the highest priority is sent to the SDK of the terminal equipment through the DNS analysis equipment.
From the above description of the structure of the present invention, it can be seen that the present invention has the following advantages:
the invention realizes the fault transfer by adopting the cluster to deploy a plurality of servers and matching with the SDK of the terminal equipment, and can effectively solve the problems of dynamic expansion and updating of the nodes. Meanwhile, the server issues the domain name, analyzes the IP address from the domain name and issues the IP address to the SDK of the terminal equipment, so that the problem of firewall interception on a project site can be effectively solved, the domain name is filled in a white list of the firewall only when the project is deployed, and the server is newly added subsequently, so long as the DNS analysis equipment (DNS authoritative server) binds the relationship between the domain name and the IP address, the problem of firewall interception can be solved.
When the TCP long connection service fails in the air, the SDK of the terminal equipment can acquire a new SDK provided for the terminal equipment by polling the IP address list and even re-executing DNS analysis, so that the fault transfer is realized, and the effect of high availability of the TCP long connection service is achieved.
In addition, the invention also discloses a method for detecting the response delay of the server in real time by adopting the service address gateway, and issuing the server with the highest priority to the SDK of the terminal equipment according to the delay and the load balancing scheduling method, thereby effectively solving the problems of load balancing and fault transfer of the TCP service cluster.
Drawings
Fig. 1 is a flow chart of a first embodiment of the method of the present invention.
Fig. 2 is a block diagram of a first embodiment of the system of the present invention.
Fig. 3 is a flow chart of a second embodiment of the method of the present invention.
Fig. 4 is a block diagram of a second embodiment of the system of the present invention.
Detailed Description
The following describes embodiments of the present invention with reference to the drawings.
Example one
A high-availability connection method of a cloud platform TCP long connection service comprises the following steps:
(1) and adopting the cluster to deploy a plurality of servers to construct a TCP long connection service cluster.
Preferably, the server is a cloud server, a cloud server cluster is established, and TCP long connection service is provided for the outside. Preferably, the server enables a single server to maintain a long connection service of the TCP with a hundred thousand level of terminal devices by introducing a high-performance network library libvent, and can forward network messages between the terminal devices in real time.
(2) And registering the IP addresses of all the servers to the service address gateway, and checking the health state of the servers in real time by the service address gateway.
(3) And the SDK of the terminal equipment needing to establish the TCP long connection service acquires at least one healthy IP address from the service address gateway through DNS analysis. The terminal equipment comprises but does not want to be an intelligent access control equipment integrated with the SDK, and communication with the server is realized through an interface of the SDK.
Specifically, the service address gateway sends the IP addresses of all or a plurality of servers with good health status to a DNS resolution device, and aggregates the IP addresses to form a first IP address list; then, the DNS analysis device issues the first IP address list to the SDK of each terminal device requesting TCP long connection service.
More specifically, the DNS resolution device comprises a DNS authoritative server and a self-research DNS resolution server; firstly, an SDK of a terminal device sends a TCP long service connection request to a DNS authoritative server; then, the DNS authoritative server obtains a CNAME record from a self-research DNS analysis server and returns the CNAME record to the SDK of the terminal equipment; the SDK of the terminal equipment inquires a self-research DNS analysis server; and then, the self-research DNS analysis server acquires at least one IP address from the service address gateway and sends the IP address to the SDK of the terminal equipment. And if the number of the delivered IP addresses is multiple, forming a first IP address list on the SDK of the terminal equipment.
Preferably, the self-research DNS analysis server, the service address gateway and the server are deployed on a Linux operating system to form a set of distributed services for completing the server.
(4) And the SDK of the terminal equipment selects an IP address from the first IP address list, so that the TCP long connection service is established with the server corresponding to the IP address. Preferably, the SDK of the terminal device randomly selects an IP address from the first IP address list. Of course, the SDK of the terminal device may also select a most suitable IP address from the first IP address list by using a certain policy or method.
(5) When the TCP long connection service is disconnected, the SDK of the terminal equipment polls the IP addresses in the first IP address list one by one and tries to reestablish the TCP long connection service. If the SDK of the terminal equipment successfully establishes the TCP long connection service with one IP address, the polling is finished. And if the SDK of the terminal equipment and all the IP addresses in the first IP address list cannot successfully establish the TCP long connection service, the polling is also finished. The reasons for the disconnection of the TCP long connection service include, but are not limited to, sudden reasons such as failure and network interruption, and may also be normal reasons such as restart.
(6) When the SDK of the terminal equipment polls all IP addresses in the first IP address list one by one and TCP long connection service cannot be established successfully, DNS analysis is carried out again by the DNS analysis equipment, IP address lists of all or a plurality of servers with good health conditions are obtained and sent to the SDK of the terminal equipment, and the SDK of the terminal equipment obtains a new IP address list, namely a second IP address list. Then, an IP address is selected from the second IP address list by the SDK of the terminal device to establish the TCP long connection service.
Preferably, the SDK of the terminal device randomly selects an IP address from the second IP address list.
The invention also discloses a high-availability connection system for protecting the cloud platform TCP long connection service, which mainly comprises DNS analysis equipment, a server, a service address gateway and an SDK of terminal equipment.
The servers are constructed by adopting cluster deployment connection and are used for providing TCP long connection service for the outside.
The service address gateway is connected with the servers and is used for registering the IP addresses of the servers. In addition, the service address gateway is also used for checking the health status of each server in real time.
The DNS analysis equipment is connected with the service address gateway and used for acquiring the IP address. And the SDK of the terminal equipment and the DNS analysis equipment are used for receiving the IP address transferred from the DNS analysis equipment so as to establish TCP long connection service between the SDK of the terminal equipment and the server corresponding to the network IP address. If the number of the IP addresses is multiple, the method is also used for forming a first IP address list so that the SDK of the terminal equipment can select one IP address from the first IP address list and establish the TCP long connection service with the server corresponding to the network IP address.
In addition, the SDK of the terminal equipment is also used for trying to reestablish the TCP long connection service in a mode of polling the IP address list one by one when the TCP long connection service is disconnected unexpectedly; and when the polling fails one by one, performing DNS analysis again through DNS analysis equipment to obtain a second IP address list, and selecting one IP address from the second IP address list to establish TCP long connection service.
Example two
A high-availability connection method of a cloud platform TCP long connection service comprises the following steps:
(1) and adopting the cluster to deploy a plurality of servers to construct a TCP long connection service cluster. Preferably, the server is a cloud server, a cloud server cluster is established, and TCP long connection service is provided for the outside.
(2) Registering the IP addresses of all servers to a service address gateway; the health status of the servers is checked in real time by the service address gateway while detecting the response delay of all servers.
Preferably, the high availability of the service address gateway cluster is further ensured by adopting a raft protocol, and meanwhile, a load balancing scheduling algorithm based on response delay is embedded in the service address gateway, so that the effectiveness is improved.
(3) The service address gateway assembles all healthy IP addresses into a third IP address list; and the service address gateway carries out priority order on all the IP addresses in the third IP address list through a load balancing scheduling algorithm based on response delay, and issues the IP address with the highest priority to the SDK of the terminal equipment through DNS analysis equipment. The DNS resolution device includes a DNS authoritative server and a self-research DNS resolution server, which are not described herein with reference to the first embodiment.
In practical applications, there may be thousands of terminal devices, or even more, so that there may be a plurality of terminal devices requesting to establish a TCP long connection service at the same time, or even a large number of terminal devices. If a large number of TCP long connection services are concentrated on the same server, cluster load imbalance, TCP long connection service delay increase, connection instability, and other situations may result. Therefore, in order to reasonably distribute the huge number of TCP long connection service requests to the servers, a special load balancing scheduling algorithm based on response delay is embedded and used in the service address gateway, so that the problem of cluster load imbalance can be effectively solved, the load of the whole cluster is always basically stable, and a foundation is laid for the whole high availability of the service.
The load balancing scheduling algorithm based on response delay specifically includes:
when the third IP address list is in the third IP address list, the real-time delay time L of one server cut Greater than the minimum delay time L among all servers min When the duration reaches the time length T, the server is adjusted as the target, and the server with the minimum delay time is used as the reference, and the splitting weight of the target adjustment server is calculated according to the following formula (a):
Figure BDA0003656094260000091
wherein M, T are constants, and M>1; w represents the splitting weight of the target adjustment server; w 0 Representing a splitting weight unit; l is min Represents the minimum delay time among all servers; l represents the average delay time of the target adjustment server within the time length T; n denotes an artificially set adjustment factor. The adjustment factor N may be a fixed constant and may be a variable.
Preferably, the adjustment factor N is a variable, and is a dynamically adjusted value, which is used to make a compromise between fast load shedding adjustment and shedding steady state, and can avoid that the service address gateway is in a mediation state immediately after slight fluctuation of response delay, so as to make the service address gateway fatigue for load balancing; the problem that the delay difference is larger and larger due to insufficient adjustment force of the formula (a) when the delay difference between the servers is large can also be solved.
As will be analyzed below by the flow adjustment process of two servers in the cluster, when the delay of the first server (i.e. the target adjustment server) is significantly higher than that of the second server (i.e. the server with the smallest delay time) (in actual production, the delay of the first server is usually set to be >2 times that of the second server, and the duration of 30s is an adjustment limit), the value of W in the above formula (1) (i.e. the splitting weight of the first server) needs to be adjusted to be reduced. And further, the delay of the first server is reduced again, and the delays of the two servers are returned to the basically equal state. When the adjustment factor N is larger, the adjustment speed is faster, and in an extreme case, when N is infinite, W becomes infinitesimal. The server will not substantially redistribute the traffic at this point. However, sometimes in a production environment, a short spike phenomenon is very normal, so that an additional condition of "and the duration reaches the time length T" is added to the starting condition of the load balancing scheduling algorithm, and unnecessary adjustment caused by the short spike phenomenon is avoided.
Specifically, when the third IP address list is displayed, the real-time delay time L of one server cut Greater than the minimum delay time L among all servers min When the duration reaches the duration T, the shunting weight of the target adjustment server is calculated according to the formula (a); and the adjustment factor N in formula (a) is a variable, specifically as follows:
when the value of B is 0-20%, N is 2; when B is 20% to 50%, N is 1, and when B is 50% to 100%, N is 0.5.
Wherein B represents a dynamic delay adjustment factor, which is calculated in real time as the following formula (B):
Figure BDA0003656094260000101
wherein L is cut Representing a real-time delay time of the destination adjustment server; l is a radical of an alcohol min Represents the minimum delay time among all servers; l is max To the eyesThe adjustment server initiates a maximum delay time since the adjustment of the shunt weight.
Preferably, the parameter M >1.5 and the duration T > 20(s).
In one embodiment, the parameter M is 2 and the duration T is 30(s), but the values of the parameter M and the duration T are not limited thereto.
(4) And the SDK of the terminal equipment and a server corresponding to the IP address establish TCP long connection service.
(5) When the TCP long connection service is disconnected, the service address gateway carries out priority sequence on the rest IP addresses except the original IP address, and the IP address with the highest priority is sent to the SDK of the terminal equipment through the DNS analysis equipment. The reasons for the disconnection of the TCP long connection service include, but are not limited to, sudden reasons such as failure and network interruption, and may also be normal reasons such as restart.
By the load balancing scheduling algorithm, the address gateway server can adjust the shunting weight of each downstream server in real time, so that the load of the whole TCP long connection service cluster is always basically stable, the load balancing problem and the fault transfer problem of the TCP service cluster can be effectively solved, and a foundation is laid for high availability of the whole service.
The invention also protects a high-availability connection system of the cloud platform TCP long connection service, which mainly comprises DNS analysis equipment, a server, a service address gateway and an SDK of terminal equipment.
The service address gateway is connected with a plurality of servers deployed in a cluster and used for registering the IP address of each server, checking the health state of each server in real time and detecting the response delay of the server.
In addition, the service address gateway is configured to assemble all healthy IP addresses into a third IP address list, perform priority order on all IP addresses in the third IP address list through a load balancing scheduling algorithm based on response delay, and issue an IP address with the highest priority to the SDK of the terminal device through the DNS resolution device; when the TCP long connection service is disconnected unexpectedly, priority sequences are carried out on the rest IP addresses except the original IP address, and the IP address with the highest priority is sent to the SDK of the terminal equipment through the DNS analysis equipment. Wherein, the original IP address refers to the IP address used in the TCP long connection service before disconnection.
The above description is only an embodiment of the present invention, but the design concept of the present invention is not limited thereto, and any insubstantial modifications made by using this concept shall fall within the scope of the present invention.

Claims (10)

1. A high-availability connection method of a cloud platform TCP long connection service is characterized by comprising the following steps:
(1) deploying a plurality of servers by adopting a cluster to construct a TCP long connection service cluster;
(2) registering the IP addresses of all the servers to a service address gateway, and checking the health state of the servers in real time by the service address gateway;
(3) the SDK of the terminal equipment obtains at least one healthy IP address from the service address gateway through DNS analysis;
(4) and the SDK of the terminal equipment and a server corresponding to the IP address establish TCP long connection service.
2. The high-availability connection method for the cloud platform TCP long connection service according to claim 1, characterized in that: in the step (3), the service address gateway sends the plurality of IP addresses to DNS analysis equipment to form a first IP address list; the DNS analysis equipment issues the first IP address list to the SDK of each terminal device; in the step (4), the SDK of the terminal device selects an IP address from the first IP address list to establish the TCP long connection service.
3. The high-availability connection method for the cloud platform TCP long connection service according to claim 2, characterized by further comprising:
when the TCP long connection service is disconnected, the SDK of the terminal equipment polls the IP addresses in the first IP address list one by one and tries to reestablish the TCP long connection;
when the TCP long connection service cannot be reestablished after the IP addresses in the first IP address list are polled one by one, DNS analysis is carried out again, and a second IP address list is obtained; and then the SDK of the terminal equipment selects an IP address from the second IP address list to establish the TCP long connection service.
4. The high-availability connection method for the cloud platform TCP long connection service according to claim 1, characterized in that, between the step (2) and the step (3), the method further comprises that a service address gateway initiates a probe of response delay for all servers; in the step (3), the service address gateway assembles all healthy IP addresses into a third IP address list; and the service address gateway performs priority sequence on all the IP addresses in the third IP address list through a load balancing scheduling algorithm based on response delay, and issues the IP address with the highest priority to the SDK of the terminal equipment through the DNS analysis equipment.
5. The high-availability connection method for the cloud platform TCP long connection service according to claim 1, wherein the load balancing scheduling algorithm based on response delay is specifically:
when the third IP address list is in the third IP address list, the real-time delay time L of one server cut Greater than the minimum delay time L of all servers min When the duration reaches the duration T, the server is adjusted as the target, and the server with the minimum delay time is used as the reference, and the splitting weight of the target adjustment server is calculated according to the following formula:
Figure FDA0003656094250000021
wherein M, T are constants, and M>1; w represents the splitting weight of the target adjustment server; w 0 Representing a splitting weight unit; l is min Represents the minimum delay time among all servers; l denotes the destination adjustment serverAverage delay time over a duration T; n denotes an adjustment factor.
6. The high-availability connection method for the cloud platform TCP long connection service according to claim 5, characterized in that the setting method of the adjustment factor N specifically comprises:
calculating the dynamic delay adjustment factor B in real time according to the following formula:
Figure FDA0003656094250000022
wherein L is cut Representing a real-time delay time of the destination adjustment server; l is a radical of an alcohol min Represents the minimum delay time among all servers; l is max Adjusting the maximum delay time since the server starts the shunting weight adjustment for the purpose;
when B is 0-20%, N is 2; when B is 20% to 50%, N is 1, and when B is 50% to 100%, N is 0.5.
7. The high-availability connection method for the cloud platform TCP long connection service according to claim 4, characterized by further comprising: when the TCP long connection service is disconnected, the service address gateway carries out priority sequence on the rest IP addresses except the original IP address, and the IP address with the highest priority is issued to the SDK of the terminal equipment through the DNS analysis equipment.
8. The high-availability connection method for the cloud platform TCP long connection service according to any one of claims 1-7, characterized in that the DNS resolution device comprises a DNS authoritative server and a self-developed DNS resolution server; the step (3) specifically comprises: the SDK of the terminal equipment sends a TCP long service connection request to a DNS authoritative server; the DNS authoritative server obtains a CNAME record from a self-research DNS analysis server and returns the CNAME record to the SDK of the terminal equipment; the SDK of the terminal equipment inquires a self-research DNS analysis server; and the self-research DNS analysis server acquires at least one IP address from the service address gateway and sends the IP address to the SDK of the terminal equipment.
9. A high-availability connection system of a cloud platform TCP long connection service is characterized in that: the system comprises DNS analysis equipment, a server, a service address gateway and an SDK of terminal equipment;
the service address gateway is connected with a plurality of servers deployed in a cluster and used for registering the IP address of each server and checking the health state of each server in real time;
the SDK of the terminal equipment is connected with a service address gateway through DNS analysis equipment and used for acquiring a first IP address list from the service address gateway and selecting one IP address from the first IP address list to establish TCP long connection service;
the SDK of the terminal equipment is used for trying to reestablish the TCP long connection service in a mode of polling the IP address list one by one when the TCP long connection service is disconnected; and when the polling fails one by one, performing DNS analysis again through DNS analysis equipment to obtain a second IP address list, and selecting one IP address from the second IP address list to establish TCP long connection service.
10. A high-availability connection system of a cloud platform TCP long connection service is characterized in that: the system comprises DNS analysis equipment, a server, a service address gateway and an SDK of terminal equipment;
the service address gateway is connected with a plurality of servers deployed in a cluster and used for registering the IP address of each server, checking the health state of each server in real time and detecting the response delay of the server;
the service address gateway is used for gathering all healthy IP addresses into a third IP address list, carrying out priority sequence on all the IP addresses in the third IP address list through a load balancing scheduling algorithm based on response delay, and issuing the IP address with the highest priority to the SDK of the terminal equipment through DNS analysis equipment; when the TCP long connection service is disconnected, priority order is carried out on the rest IP addresses except the original IP address, and the IP address with the highest priority is sent to the SDK of the terminal equipment through the DNS analysis equipment.
CN202210559817.7A 2022-05-23 2022-05-23 High-availability connection method and system for cloud platform TCP long connection service Active CN114938373B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210559817.7A CN114938373B (en) 2022-05-23 2022-05-23 High-availability connection method and system for cloud platform TCP long connection service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210559817.7A CN114938373B (en) 2022-05-23 2022-05-23 High-availability connection method and system for cloud platform TCP long connection service

Publications (2)

Publication Number Publication Date
CN114938373A true CN114938373A (en) 2022-08-23
CN114938373B CN114938373B (en) 2023-11-03

Family

ID=82864434

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210559817.7A Active CN114938373B (en) 2022-05-23 2022-05-23 High-availability connection method and system for cloud platform TCP long connection service

Country Status (1)

Country Link
CN (1) CN114938373B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050005006A1 (en) * 2003-07-01 2005-01-06 International Business Machines Corporation System and method for accessing clusters of servers from the internet network
CN103124265A (en) * 2013-01-31 2013-05-29 深信服网络科技(深圳)有限公司 Method for visiting websites and gateway device
CN105279156A (en) * 2014-05-29 2016-01-27 腾讯科技(深圳)有限公司 Network information communication method and network information browsing device
CN107124453A (en) * 2016-11-30 2017-09-01 西安大唐电信有限公司 Platform Interworking GateWay stacks the SiteServer LBS and video call method of deployment
CN107483260A (en) * 2017-08-28 2017-12-15 北京三快在线科技有限公司 Fault handling method and device, electronic equipment
CN107580046A (en) * 2017-08-31 2018-01-12 北京奇虎科技有限公司 Long connection service system and method
CN107689878A (en) * 2016-08-04 2018-02-13 创盛视联数码科技(北京)有限公司 TCP length connection SiteServer LBSs based on name scheduling
CN111741039A (en) * 2019-03-25 2020-10-02 阿里巴巴集团控股有限公司 Session request processing method and device and electronic equipment
CN111970362A (en) * 2020-08-17 2020-11-20 上海势航网络科技有限公司 Vehicle networking gateway clustering method and system based on LVS
CN112769976A (en) * 2021-01-13 2021-05-07 网宿科技股份有限公司 Domain name resolution method and system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050005006A1 (en) * 2003-07-01 2005-01-06 International Business Machines Corporation System and method for accessing clusters of servers from the internet network
CN103124265A (en) * 2013-01-31 2013-05-29 深信服网络科技(深圳)有限公司 Method for visiting websites and gateway device
CN105279156A (en) * 2014-05-29 2016-01-27 腾讯科技(深圳)有限公司 Network information communication method and network information browsing device
CN107689878A (en) * 2016-08-04 2018-02-13 创盛视联数码科技(北京)有限公司 TCP length connection SiteServer LBSs based on name scheduling
CN107124453A (en) * 2016-11-30 2017-09-01 西安大唐电信有限公司 Platform Interworking GateWay stacks the SiteServer LBS and video call method of deployment
CN107483260A (en) * 2017-08-28 2017-12-15 北京三快在线科技有限公司 Fault handling method and device, electronic equipment
CN107580046A (en) * 2017-08-31 2018-01-12 北京奇虎科技有限公司 Long connection service system and method
CN111741039A (en) * 2019-03-25 2020-10-02 阿里巴巴集团控股有限公司 Session request processing method and device and electronic equipment
CN111970362A (en) * 2020-08-17 2020-11-20 上海势航网络科技有限公司 Vehicle networking gateway clustering method and system based on LVS
CN112769976A (en) * 2021-01-13 2021-05-07 网宿科技股份有限公司 Domain name resolution method and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CHUNG,JY: "Content-based distribution for load sharing in locally clustered web servers", 《LECTURE NOTES IN COMPUTER SCIENCE》 *
汪建球,张忠能: "分布式Web服务器中负载均衡的实现", 计算机工程, no. 15 *

Also Published As

Publication number Publication date
CN114938373B (en) 2023-11-03

Similar Documents

Publication Publication Date Title
WO2020253266A1 (en) Method for providing edge service, apparatus and device
CN109274707B (en) Load scheduling method and device
US10135882B1 (en) Multiple-master DNS system
US9778999B2 (en) Adaptive private network with geographically redundant network control nodes
CN108809847B (en) Method, device and network system for realizing load balance
US10924372B2 (en) Computing system providing enhanced point of presence (PoP) server selection based upon network health metrics and related methods
EP2227884B1 (en) Method for distributing messages to destination nodes
EP3152886A1 (en) Load balancing with layered edge servers
CN101989951A (en) Method, system and equipment for selecting service node
JP2004032758A (en) Router interface backup execution method by vrrp (virtual router redundancy protocol)
CN111385203B (en) Data transmission method, device and equipment based on hybrid cloud and storage medium
CN105721328B (en) VRRP load balancing method, device and router
CN106375355B (en) Load balancing processing method and device
EP1744520B1 (en) Method and apparatus for selecting a group leader
CN114938373A (en) High-availability connection method and system for cloud platform TCP long connection service
CN112087382B (en) Service routing method and device
CN111880932A (en) Data storage method and device based on multiple network ports
JP6223151B2 (en) Distribution server distribution system, distribution server management device, and reception device
CN115373843A (en) Method, device and medium for dynamically pre-judging optimal path equipment
CN114024971B (en) Service data processing method, kubernetes cluster and medium
JP5894981B2 (en) Accessing a network of nodes distributed across a communication architecture using a topology server with multiple criteria selection
CN111328033B (en) Short message load transmission method and system
KR101957239B1 (en) Method and apparatus for processing tasks
CN114079637B (en) Service processing method and system based on mobile edge calculation
US20230396677A1 (en) Computing power information processing method, first network device, and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant