Gateway switching method, gateway switching system, gateway controller, and gateway

CN117240902BActive Publication Date: 2026-09-04HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210628406.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-06
Publication Date
2026-09-04
Estimated Expiration
2042-06-06

AI Technical Summary

Technical Problem

[0005]但是,上述方式在连接建立前进行负载均衡,连接建立后不再有能力重新进行AG的负载均衡,而云桌面是一种传输数据量不定的系统,随用户使用场景不同传输数据量不同,对AG的负载压力也不同

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117240902B_ABST
    Figure CN117240902B_ABST
Patent Text Reader

Abstract

The application provides a gateway switching method, a gateway switching system, a gateway controller and a gateway. In an embodiment, the method is applied to the gateway switching system, the system comprises the gateway controller, a first gateway and a second gateway, and the method comprises the following steps: the gateway controller acquires a load parameter of the first gateway, a plurality of long connections are established between the first gateway and a plurality of clients; the gateway controller sends a connection migration instruction to the first gateway according to the load parameter of the first gateway, the connection migration instruction comprises an address of the second gateway, the connection migration instruction indicates that at least one long connection is switched, and the plurality of long connections comprise the at least one long connection; and the first gateway sends the address of the second gateway to a client corresponding to the at least one long connection, so that the client corresponding to the at least one long connection establishes a long connection with the second gateway. Thus, the gateway switching can be realized in the process of the long connection between the client and the gateway by the technical scheme provided in the embodiment of the application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and in particular to a gateway switching method, a gateway switching system, a gateway controller, and a gateway. Background Technology

[0002] With the advent of the cloud era, the way we work is also gradually evolving. From traditional fixed PC (personal computer) work and mobile PC work, it has gradually evolved into cloud-based work, which is currently mainly achieved through cloud desktops.

[0003] Currently, clients connect to cloud desktops via access gateways (AGs). Once the connection is established, the cloud desktop transmits heartbeats and data streams over this connection, which persists until the client disconnects—a so-called persistent connection. One AG can support N persistent connections, thus requiring load balancing of the AG.

[0004] To address the load balancing issue, multiple Access Controllers (AGs) periodically report their load to the management system. When a client requests access to the cloud desktop server, the management system selects a low-load AG for allocation based on the load situation. The client then establishes a long-lived connection with the assigned AG, thereby achieving load balancing among different AGs.

[0005] However, the above method performs load balancing before the connection is established. After the connection is established, it is no longer able to re-load balance the AG. Cloud desktops are systems with variable data transmission volumes, which vary depending on the user's usage scenario, thus placing different load pressures on the AG. When there are many cloud desktop connections on the same AG, if all users are engaged in high-pressure scenarios, such as watching live streams, the user experience of all users connected to that AG will be affected.

[0006] The information disclosed in this background section is intended only to enhance the understanding of the overall background of the invention and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention

[0007] This invention provides a gateway switching method, a gateway switching system, a gateway controller, and a gateway, which can realize gateway switching during a long connection between a client and a gateway.

[0008] In a first aspect, embodiments of the present invention provide a gateway switching method, which is applied to a gateway switching system. The gateway switching system includes a gateway controller, a first gateway, and a second gateway. The method includes: the gateway controller obtaining load parameters of the first gateway, wherein the first gateway has established multiple long connections with multiple clients; the gateway controller sending a connection migration instruction to the first gateway according to the load parameters of the first gateway, wherein the migration instruction includes the address of the second gateway and the connection migration instruction instructs switching at least one long connection, wherein the multiple long connections include at least one long connection; and the first gateway sending the address of the second gateway to the clients corresponding to at least one long connection, so that the clients corresponding to at least one long connection establish a long connection with the second gateway.

[0009] In this solution, after a gateway establishes multiple long connections, the gateway controller monitors the gateway's load in real time and controls the migration of long connections to other gateways based on the gateway's load. This migration of long connections during the long connection process ensures load balancing and improves the user experience.

[0010] In one possible implementation, the load parameters of the first gateway include the parameters of the first gateway itself.

[0011] In this implementation, in one example, the gateway controller sends a connection migration instruction to the first gateway based on the load parameters of the first gateway. This includes: the gateway controller determining the load value of the first gateway based on the load parameters of the first gateway, and sending a connection migration instruction to the first gateway when the load value is higher than the load threshold.

[0012] In this solution, when the gateway is under high load, the long-lived connections of that gateway are migrated to other gateways with lower load, thereby improving the user experience.

[0013] In one possible implementation, the load parameters of the first gateway include the load parameters of multiple long-lived connections.

[0014] In this implementation, in one example, the load parameters of multiple long connections include latency; the gateway controller sends a connection migration instruction to the first gateway based on the load parameters of the first gateway, including: the gateway controller determines that the latency value of at least one of the multiple long connections is greater than the latency threshold, and sends a connection migration instruction to the first gateway.

[0015] In this solution, the latency of long-lived connections and the number of long-lived connections with high latency are considered together. When the latency of long-lived connections on the gateway is high and the number of long-lived connections with high latency is large, it indicates that the message forwarding speed of the gateway is low and the user experience may be poor. At this time, a connection migration command is sent to the gateway to improve the latency of long-lived connections on the gateway and improve the user experience.

[0016] In one possible implementation, the first gateway sends the address of the second gateway to at least one client corresponding to a long connection, including: the first gateway sending the address of the second gateway to a service controller, the service controller being connected to multiple servers, and the multiple servers communicating with multiple clients through a network.

[0017] In this solution, the gateway forwards business plane messages between the client and the server, while the client and the server communicate via other networks to exchange control plane messages. This separation of business plane messages and control plane messages prevents intrusion and modification of the gateway's business plane forwarding logic, thus ensuring network security.

[0018] In one possible implementation, at least one client includes the target client, and the method further includes:

[0019] The first gateway receives a connection termination request sent by the target client; the first gateway terminates the long-term connection with the target client based on the connection termination request.

[0020] In this solution, after a long-lived connection migration is successful, the gateway will dismantle the migrated long-lived connection, thereby improving the latency of the unmigrated long-lived connections within the gateway and ensuring user experience.

[0021] In one possible implementation, the client is a cloud desktop client.

[0022] In this solution, the client is a cloud desktop client. When a large number of cloud desktops make concurrent long connections to the same gateway, dynamic load balancing of the gateway is implemented during the long connection process to ensure the user experience of the cloud desktop for end users.

[0023] In one possible implementation, the connection migration instruction further includes a long connection selection strategy, which indicates a method for selecting at least one long connection from a plurality of long connections; the method further includes: a first gateway selecting at least one long connection from a plurality of long connections according to the long connection selection strategy.

[0024] In this solution, the gateway controller does not need to decide which long-lived connections to migrate. Instead, the gateway executes the long-lived connection selection strategy determined by the gateway controller. This not only reduces the decision-making burden on the gateway controller to a certain extent, but also allows the gateway to migrate long-lived connections with poor link conditions based on the actual situation of the long-lived connections, ensuring user experience.

[0025] Secondly, embodiments of the present invention provide a gateway switching method, which is applied to a gateway controller. The method includes: obtaining load parameters of a first gateway, wherein the first gateway has established multiple long connections with multiple clients; and sending a connection migration instruction to the first gateway according to the load parameters of the first gateway, so that the first gateway sends the address of a second gateway to at least one client corresponding to a long connection. The migration instruction includes the address of the second gateway, and the multiple long connections include at least one long connection.

[0026] The effectiveness of this solution is described above and will not be repeated here.

[0027] In one possible implementation, the load parameters of the first gateway include the parameters of the first gateway itself.

[0028] In this implementation, in one example, a connection migration instruction is sent to the first gateway based on the load parameters of the first gateway, including: determining the load value of the first gateway based on the load parameters of the first gateway, and sending a connection migration instruction to the first gateway when the load value is higher than the load threshold.

[0029] The effectiveness of this solution is described above and will not be repeated here.

[0030] In one possible implementation, the load parameters of the first gateway include the load parameters of multiple long-lived connections.

[0031] In this implementation, in one example, the load parameters of multiple long connections include latency; the gateway controller sends a connection migration instruction to the first gateway based on the load parameters of the first gateway, including: the gateway controller determines that the latency value of at least one of the multiple long connections is greater than the latency threshold, and sends a connection migration instruction to the first gateway.

[0032] The effectiveness of this solution is described above and will not be repeated here.

[0033] In one possible implementation, the client is a cloud desktop client.

[0034] The effectiveness of this solution is described above and will not be repeated here.

[0035] In one possible implementation, the connection migration instruction also includes a long connection selection strategy, which indicates a scheme for selecting at least one long connection from a plurality of long connections, so that the first gateway selects at least one long connection from the plurality of long connections according to the long connection selection strategy.

[0036] The effectiveness of this solution is described above and will not be repeated here.

[0037] Thirdly, embodiments of the present invention provide a gateway switching method, which is applied to a first gateway. The method includes: receiving a connection migration instruction sent by a gateway controller, the connection migration instruction including the address of a second gateway; sending the address of the second gateway to at least one client corresponding to a long connection, so that at least one client establishes a long connection with the second gateway, the first gateway establishing multiple long connections with multiple clients, the multiple long connections including at least one long connection.

[0038] In one possible implementation, sending the address of the second gateway to at least one client corresponding to a long connection includes: sending the address of the second gateway to a service controller, the service controller being connected to multiple servers, and the multiple servers communicating with multiple clients through a network.

[0039] In one possible implementation, at least one client includes a target client, and the method further includes: receiving a connection termination request sent by the target client; and terminating the long-term connection with the target client according to the connection termination request.

[0040] In one possible implementation, the connection migration instruction further includes a long connection selection strategy, which indicates a scheme for selecting at least one long connection from a plurality of long connections; the method further includes: selecting at least one long connection from a plurality of long connections according to the long connection selection strategy.

[0041] Fourthly, embodiments of the present invention provide a gateway switching system, which may include a gateway controller and a first gateway, wherein the system is used to execute the method provided in the first aspect, the gateway controller is used to execute the method provided in the second aspect, and the first gateway is used to execute the method provided in the third aspect.

[0042] The gateway switching system performs the same functions as the method provided in the first aspect, and achieves the same beneficial effects, so it will not be repeated here.

[0043] The gateway controller in the gateway switching system performs the same functions as the method provided in the second aspect, and achieves the same beneficial effects, so it will not be repeated here.

[0044] The first gateway in the gateway switching system performs the same function as the method provided in the third aspect, and achieves the same beneficial effect, so it will not be repeated here.

[0045] Fifthly, embodiments of the present invention provide a gateway controller, comprising: a plurality of modules, each module being used to execute various steps in the gateway switching method provided in the second aspect of the present invention; the division of modules is not limited herein. For the specific functions performed by each module in this gateway controller and the beneficial effects achieved, please refer to the functions of each step in the gateway switching method provided in the second aspect of the present invention, which will not be repeated here.

[0046] For example, the gateway controller includes a communication module and a processing module. The communication module is used to obtain the load parameters of a first gateway, which has established multiple long-lived connections with multiple clients. The processing module is used to send a connection migration instruction to the first gateway based on the load parameters of the first gateway, so that the first gateway sends the address of a second gateway to at least one client corresponding to a long-lived connection. The migration instruction includes the address of the second gateway, and the multiple long-lived connections include at least one long-lived connection.

[0047] Sixthly, embodiments of the present invention provide a gateway, comprising: a plurality of modules, each module being used to execute various steps in the gateway switching method provided in the third aspect of the present invention; the division of modules is not limited herein. For the specific functions performed by each module in this gateway controller and the beneficial effects achieved, please refer to the functions of each step in the gateway switching method provided in the third aspect of the present invention, which will not be repeated here.

[0048] For example, the gateway includes a communication module and a processing module. The communication module receives a connection migration instruction sent by the gateway controller, which includes the address of the second gateway. The processing module sends the address of the second gateway to at least one client corresponding to a long-lived connection, so that at least one client establishes a long-lived connection with the second gateway. The gateway establishes multiple long-lived connections with multiple clients, and the multiple long-lived connections include at least one long-lived connection.

[0049] In a seventh aspect, embodiments of the present invention provide a computer cluster including at least one computing device, each computing device including a processor and a memory; the processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device to cause the computing device cluster to perform the method provided in the first aspect, or the method provided in the second aspect, or the method provided in the third aspect.

[0050] The memory can be integrated into the chip or processor, or it can be separate from the chip or processor.

[0051] Eighthly, embodiments of the present invention provide a computer storage medium storing instructions that, when executed on a computer, cause the computer to perform the method provided in the second aspect or the method provided in the third aspect. Attached Figure Description

[0052] Figure 1 This is a system architecture diagram of a gateway switching system provided in an embodiment of the present invention;

[0053] Figure 2a This is a schematic diagram of a gateway switching scheme provided by an embodiment of the present invention. Figure 1 ;

[0054] Figure 2b This is a schematic diagram of a gateway switching scheme provided in an embodiment of the present invention;

[0055] Figure 2c This is a schematic diagram of a gateway switching scheme provided by an embodiment of the present invention. Figure 3 ;

[0056] Figure 3 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention;

[0057] Figure 4 yes Figure 1 A flowchart illustrating the gateway switching scheme of the provided gateway switching system;

[0058] Figure 5 This is a flowchart illustrating the first gateway switching method provided in an embodiment of the present invention;

[0059] Figure 6 This is a flowchart illustrating the second gateway switching method provided in an embodiment of the present invention;

[0060] Figure 7 This is a flowchart illustrating the third gateway switching method provided in this embodiment of the invention;

[0061] Figure 8 This is a schematic diagram of the structure of a gateway controller provided in an embodiment of the present invention;

[0062] Figure 9 This is a schematic diagram of the structure of a gateway provided in an embodiment of the present invention;

[0063] Figure 10 This is a schematic diagram of the structure of a gateway switching system provided in an embodiment of the present invention. Detailed Implementation

[0064] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be described below with reference to the accompanying drawings.

[0065] In the description of the embodiments of the present invention, the words "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Rather, the use of the words "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a specific manner.

[0066] In the description of the embodiments of this invention, the term "and / or" is merely a description of the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, B existing alone, and A and B existing simultaneously. Furthermore, unless otherwise stated, the term "multiple" means two or more. For example, multiple systems refer to two or more systems, and multiple terminals refer to two or more terminals.

[0067] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.

[0068] With the advent of the cloud era, the way we work is also gradually evolving. From traditional fixed PC office work and mobile PC office work, it has gradually evolved into cloud office work, which is currently mainly achieved through cloud desktops.

[0069] Currently, clients connect to cloud desktops via access gateways (AGs). Once the connection is established, the cloud desktop transmits heartbeats and data streams over that connection, which persists until the client disconnects—a so-called persistent connection. One AG can support N persistent connections, thus requiring load balancing of the AGs.

[0070] To address the load balancing issue, multiple Access Controllers (AGs) periodically report their load to the management system. When a client requests access to the cloud desktop server, the management system selects a low-load AG for allocation based on the load situation. The client then establishes a long-lived connection with the assigned AG, thereby achieving load balancing among different AGs.

[0071] However, the above method performs load balancing before the connection is established. After the connection is established, it is no longer able to re-load balance the AG. Cloud desktops are systems with variable data transmission volumes, which vary depending on the user's usage scenario, thus placing different load pressures on the AG. When there are many cloud desktop connections on the same AG, if all users are engaged in high-pressure scenarios, such as watching live streams, the user experience of all users connected to that AG will be affected.

[0072] Based on the above-mentioned technical problems, this embodiment of the invention proposes that the client switch gateways during long-term connections to achieve load balancing.

[0073] Based on the above ideas, this invention provides a gateway switching system. Figure 1This is a system architecture diagram of a gateway switching system provided in an embodiment of the present invention. Figure 1 As shown, the system includes: a client layer, a server layer, a gateway layer, a gateway controller, and a service controller. In this embodiment of the invention, the gateway switching system can implement a single cloud service or multiple cloud services. For example, cloud services include cloud query, cloud storage, cloud computing, cloud security, cloud office, etc. This embodiment of the invention does not specifically limit the content and types of cloud services; they can be determined based on actual needs.

[0074] The client layer can connect to the gateway layer via network 1, and the gateway layer can connect to the server layer via network 2. Communication of business plane messages (business data between the client and server) is achieved through networks 1 and 2. The server layer and client layer can also connect via network 5, enabling communication of control plane messages (other than business plane messages) between them. These control plane messages are used to control the client to perform a specific operation, or the server to perform a specific operation. It should be noted that control plane messages are separated from business plane messages; control instructions are sent via control plane messages to avoid intruding into or modifying the gateway's business plane message forwarding logic. Furthermore, control plane messages are messages sent by the service controller to the server layer. Additionally, the gateway controller and gateway layer are connected via network 3, the service controller can connect to the server layer via network 4, the gateway layer can connect to the service controller via network 6, the service controller interacts directly with the client layer via network 7, and the gateway controller interacts directly with the client layer via network 8. It should be noted that the network connection methods described above are merely examples. Provided that business plane messages and control plane messages communicate through different networks, this embodiment of the invention does not impose any limitations on how the client layer, server layer, gateway layer, gateway controller, and service controller are connected. The specific details can be determined based on actual needs. Figure 1 This is merely an example and does not constitute a specific limitation; the system may also include more than [previous examples]. Figure 1 More or less network in the middle.

[0075] Here, network 1 can be a wired network or a wireless network. For example, a wired network can be a cable network, a fiber optic network, a Digital Data Network (DDN), etc., while a wireless network can be a telecommunications network, an intranet, the Internet, a Local Area Network (LAN), a Wide Area Network (WAN), a Wireless Local Area Network (WLAN), a Metropolitan Area Network (MAN), a Public Service Telephone Network (PSTN), a Bluetooth network, a ZigBee network, a Global System for Mobile Communications (GSM), a CDMA (Code Division Multiple Access) network, a CPRS (General Packet Radio Service) network, etc., or any combination thereof. It is understandable that Network 1 can use any known network communication protocol to achieve communication between different client layers and gateways. The aforementioned network communication protocol can be various wired or wireless communication protocols, such as Ethernet, Universal Serial Bus (USB), FireWire, Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), New Radio (NR), Bluetooth, Wireless Fidelity (Wi-Fi), and other communication protocols.

[0076] Networks 2, 3, 4, 5, 6, 7, and 8 are similar to Network 1 and will not be described further. In practical applications, Network 1 can be a public network, i.e., the Internet, such as a wide area network (WAN) or external network. Network 2 can be a private network of an enterprise or company developing the server-side layer, referring to a local interconnected network created under a router or switch, such as an intranet or local area network, thereby ensuring data security. Networks 3, 4, 5, 6, 7, and 8 can be either public or private networks, with private networks being preferred.

[0077] The client layer includes multiple clients. Figure 1 N clients are shown, denoted as client 1, client 2, ..., client N. In this embodiment of the invention, the clients are used to provide services to users and implement business operations.

[0078] A client can be understood as an application used to implement a business function. Typically, one client is used to implement one business function, such as cloud desktop or cloud conferencing. Different clients can implement the same business function or different business functions. This embodiment of the invention does not intend to limit the business functions implemented by the client; the specific functions can be determined based on actual needs. For example, the client layer is a collection of clients used to implement cloud office solutions. Here, cloud office solutions can include cloud desktops and cloud applications, where cloud applications can be applications that can run in the cloud, such as cloud conferencing or cloud-based e-commerce platforms. For example, a client can be a cloud desktop client.

[0079] In practical applications, the client is installed on an electronic device, and the user runs the client through the device, enabling it to provide services and meet different business needs. Of course, in some cases, the electronic device may have a browser installed, allowing the user to access the client through the browser.

[0080] The server-side layer includes multiple servers. Figure 1 The diagram shows n servers, denoted as Server 1, Server 2, ..., Server n. In this embodiment of the invention, the servers are used to provide services to the clients and implement business logic.

[0081] It should be noted that the server communicates with the client via a gateway in the gateway layer for business plane messages, and with the client via a different network for control plane messages. For example... Figure 1 As shown, the server layer and the client layer communicate via network 2, the gateway layer and network 1 for business plane messages, and via network 5 for control plane messages.

[0082] In this embodiment of the invention, the server can be understood as an application that provides services to the client. Different servers may provide the same service or different services, depending on the business requirements of the client connected to the server. This embodiment of the invention does not intend to limit the services provided by the server; the specific services can be determined based on actual needs.

[0083] In practical applications, the server is installed on electronic devices, which can then run the server to provide services to clients and meet different business needs.

[0084] To better understand the client and server mentioned in the embodiments of the present invention, the following description is provided in conjunction with specific application scenarios.

[0085] Example 1: The client-side implementation is a virtual cloud desktop, such as a cloud desktop application. This application can be understood as an application developed by a developer to implement a virtual cloud desktop. A server-side application can be a single virtual cloud desktop. In practical applications, after authentication, the user connects to the server-side application (virtual cloud desktop) on the client side (cloud desktop application) and controls its operation by inputting commands (e.g., keyboard input, mouse clicks). The server-side application (virtual cloud desktop) operates according to the input commands and compresses the current desktop information into a desktop data stream (business plane message) which is then sent to the client. The returned desktop information is then displayed on the client-side application's screen, forming a human-computer interaction process.

[0086] In practical applications, an electronic device can virtualize several virtual cloud desktops, with each virtual cloud desktop acting as a server. Another electronic device can install a client or access the client through a browser.

[0087] It should be noted that in this application scenario, one client connects to one server. However, the electronic device on which the client resides can connect to multiple servers.

[0088] Example 2: The client implements a cloud conferencing service, such as a cloud conferencing application. This application can be understood as an application developed by a developer to implement cloud conferencing. A server can be a virtual meeting room. In practical applications, multiple clients (cloud conferencing applications) connect to a single server (virtual meeting room) after authentication.

[0089] In one scenario, when a cloud meeting is an audio meeting, when a client (cloud meeting application) captures a user's voice, the client will send the captured user's voice (business message) to the server (virtual meeting room). The server (virtual meeting room) will then send the current audio data stream (business message) to other clients (cloud meeting applications), so that the audio can be played through the microphones of the other clients (cloud meeting applications).

[0090] In another scenario, when a client (cloud conferencing application) uploads a meeting file by inputting operation commands (such as keyboard input or mouse clicks), the client will upload the meeting file (business-side message) to the server (virtual meeting room). The server (virtual meeting room) will then send the meeting file to other clients (cloud conferencing applications), making it easier for other clients (cloud conferencing applications) to operate and view the meeting file.

[0091] In another scenario, when a client (cloud conferencing application) shares its screen by inputting operation commands (such as clicking the mouse), the client uploads the current screen content (business message) to the server (virtual meeting room). The server (virtual meeting room) then sends the current screen content to other clients (cloud conferencing applications), thereby displaying the current screen content on the displays of the other clients (cloud conferencing applications), thus achieving screen sharing.

[0092] In practical applications, one electronic device can simulate several virtual meeting rooms, with each virtual meeting room acting as a server. Another electronic device can install a client application or access the client application via a browser.

[0093] It should be noted that in this application scenario, multiple clients connect to one server.

[0094] In one example, the electronic device involved in this solution can be a mobile phone, tablet computer, server, etc. This embodiment of the invention does not impose specific limitations on this; the specific electronic device can be determined based on actual needs.

[0095] The gateway layer includes multiple gateways. Figure 1 M gateways are shown, denoted as Gateway 1, Gateway 2, ..., Gateway M. In this embodiment of the invention, the gateways are used to implement communication of business plane messages between the client layer and the server layer. It should be noted that the gateways in this embodiment of the invention are specifically designed for long-lived connections and generally do not involve short-lived connections. For example, the protocol for long-lived connections can be TCP. This embodiment of the invention does not intend to limit the protocol for long-lived connections; the specific protocol can be determined based on actual needs.

[0096] In this embodiment of the invention, each gateway in the gateway layer periodically reports its load status to the gateway controller. For example, the period can be 1 second, 1 minute, or 1 hour. This embodiment of the invention does not impose a specific limitation on this, and the length of the period can be determined according to actual needs.

[0097] It should be noted that a long-lived connection established by a gateway represents a connection link between the client and the server, and includes at least the client's address and the server's address.

[0098] The gateway controller manages the various gateways in the gateway layer. In this embodiment of the invention, the gateway controller can control the gateways to perform long-lived connection migration. Additionally, it can assign a gateway to a client when the client requests one.

[0099] According to one feasible implementation, the gateway controller makes gateway allocation decisions based on the load reported by each gateway in the gateway layer, thereby achieving load balancing before long-lived connections.

[0100] For example, the gateway controller will assign a gateway to the client that requests a gateway based on the load of each gateway in the gateway layer, and send the address of the gateway to the client. The client will then establish a long-lived connection with the gateway based on the address of the assigned gateway.

[0101] According to one feasible implementation, the gateway controller makes long-term connection migration decisions based on the load reported by each gateway in the gateway layer. When the gateway load is high, a low-load gateway is selected for the long-term connection of the high-load gateway. Under the control of the gateway controller, the high-load gateway notifies the client of the long-term connection with high load to perform gateway migration. Thus, during the long-term connection between the client and the gateway, the high-load gateway is switched to the low-load gateway, realizing gateway switching and thereby achieving load balancing.

[0102] The service controller is used to manage the various servers in the server layer.

[0103] In one feasible implementation, the service controller is used to assign servers to clients. For example, the service controller assigns a server to a client based on the client's request for server allocation and sends the server's address to the client. The client then establishes a connection with the server through a gateway in the gateway layer based on the server's address.

[0104] In one feasible implementation, the service controller receives messages sent by the gateway layer and forwards them to the server layer, which then forwards them to the client layer. Here, the messages sent by the gateway layer are control plane messages. Figure 1As shown, messages from the gateway layer are sent to the service controller via network 6. The service controller then sends the gateway layer messages to the server layer via network 4. Finally, the server layer sends the gateway layer messages to the client layer via network 5.

[0105] It should be noted that gateway controllers and service controllers can be computer clusters composed of electronic devices. A gateway can be a single gateway or a cluster of gateways.

[0106] Next, based on the functions of the client layer, server layer, gateway layer, gateway controller, and service controller, this section describes in detail how the gateway switching system achieves a long-term connection between the client (referred to as the target client for ease of description and distinction) and the server (referred to as the target server for ease of description and distinction) through the gateway (referred to as the target gateway for ease of description and distinction).

[0107] 1) The target client requests the service controller to allocate a server. Based on the address of the target server sent by the service controller, a connection request is generated (for ease of description and distinction, it is referred to as a client connection request).

[0108] In practical applications, when the target client is started for the first time, it requests the allocation of a server from the service controller. At this time, the service controller will allocate a server (i.e., the target server) and send the address of the target server to the target client.

[0109] like Figure 1 As shown, the target client can request the allocation of a server from the service controller via network 7.

[0110] 2) The target client sends the client connection request to the gateway controller.

[0111] Because the target client and the gateway in the gateway layer have not yet established a persistent connection. For example... Figure 1 As shown, the target client can send a client connection request to the gateway controller via network 8.

[0112] 3) The gateway controller will assign a gateway (i.e., the target gateway) to the target client based on the load of each gateway in the gateway layer, and send the address of the target gateway to the target client.

[0113] Because the target client and the target server have not yet established a connection. Figure 1 As shown, the gateway controller can send the address of the target gateway to the target client via network 8.

[0114] 4) The target client generates a gateway connection request based on the address of the target gateway (for ease of description and distinction, this is referred to as a client connection request).

[0115] Here, the gateway connection request includes the address of the target server.

[0116] like Figure 1 As shown, the target client can send a client connection request to the target gateway via network 1.

[0117] 5) The target gateway establishes a long connection with the target client based on the client's connection request; and generates a connection notification instruction for the target server based on the client's connection request, and sends the connection notification instruction to the service controller, which then sends the connection notification to the target server.

[0118] Here, the connection notification command from the target server is sent to the service controller as control plane information, and the service controller forwards it to the target server. For example... Figure 1 As shown, the target gateway can send the connection notification command of the target server to the service controller through network 6, and the service controller can forward it to the target server through network 4.

[0119] 6) Based on the connection notification instruction, the target server sends a gateway connection request (referred to as a server connection request for ease of description and distinction) to the target gateway.

[0120] 7) The target gateway establishes a long connection with the target server based on the server connection request; after establishing long connections with the target client and the target server, it generates a connection success message and notifies the target client and the target server.

[0121] 8) The target client communicates and verifies with the target server through the target gateway. After successful verification, the target gateway's address is recorded in the gateway list, and business plane messages are sent and received through the target gateway.

[0122] like Figure 1 As shown, the target gateway can perform communication verification through network 1, the target gateway, and network 2.

[0123] In one example, communication verification is a heartbeat verification, and the specific process is as follows:

[0124] The target client sends a heartbeat packet to the target server through the target gateway; after receiving the heartbeat packet, the target server generates a first response message and sends it to the target client through the target gateway; after receiving the first response message, the target client generates a second response message and sends it to the target server through the target gateway; after receiving the second response message, the target server sends a communication verification success message to the first client through the target gateway.

[0125] Subsequently, if the target client loses connection with the target gateway, it will query the gateway list, re-establish a long connection with the target gateway, and continue to communicate with the target server through the target gateway.

[0126] Following the above method, establish multiple long-lived connections between the target clients and the target gateway. For example... Figure 2a As shown, assume there are 6 target clients, referred to as target client 1, target client 2, ..., target client 6, and there are long-lived connections between the 6 target clients and the target gateway.

[0127] It is worth noting that, such as Figure 2b As shown, a long-lived connection between a target server and a target client is suitable for cloud desktop scenarios. Figure 2c As shown, a target server can maintain long-term connections with multiple target clients, which can be used in cloud conferencing scenarios.

[0128] Correspondingly, the target gateway has multiple long-lived connections. If all target clients are engaged in high-pressure scenarios, such as watching live streams, the user experience of all connections to the target gateway will be affected.

[0129] After establishing multiple long-lived connections, the target gateway will report its load status to the gateway controller at preset intervals, such as 1 second, 1 minute, and 1 hour. The gateway controller then controls the migration of several long-lived connections from the target gateway to other gateways with lower loads (referred to as destination gateways for ease of description and distinction).

[0130] For example, such as Figure 2a As shown, target client 1, target client 2, ..., target client 6 are all permanently connected to the target gateway. If target client 2, target client 3, and target client 5 need to switch gateways, the address of the destination gateway will be notified to target client 2, target client 3, and target client 5. Target client 2, target client 3, and target client 5 will then switch gateways and establish a permanent connection with the destination gateway.

[0131] The gateway switching scheme provided in this embodiment of the invention will be described next. Taking the example of a target gateway having multiple long-lived connections, where these connections need to be migrated to the destination gateway, the gateway switching will be explained.

[0132] 1) The gateway controller makes long-lived connection migration decisions based on the load information reported by each gateway in the gateway layer. It can determine whether a long-lived connection in the target gateway needs to be migrated. When it determines that a long-lived connection in the target gateway needs to be migrated, it sends a connection migration command to the target gateway. The connection migration command includes the address of the destination gateway. Here, the connection migration command instructs the target gateway to migrate the long-lived connection.

[0133] 2) Based on the connection migration command, the target gateway determines the long connection to be migrated (referred to as the target long connection for ease of description and distinction) and the address of the destination gateway; for any target long connection, the address of the destination gateway is sent to the target client corresponding to the target long connection.

[0134] like Figure 2b and Figure 2c As shown, the target gateway sends the address of the destination gateway to the service controller, which then forwards it to the target server, which in turn forwards it to the target client.

[0135] It should be understood that, considering that the address of the destination gateway is not the data required by the client and server to implement business operations (i.e., it is not a business plane message but a control plane message), for security reasons, the destination gateway can send its address to the service controller, which will then send it to the target server. Finally, the target server will notify the target client of the destination gateway's address, thus ensuring network security.

[0136] 3) The target client performs gateway migration based on the address of the destination gateway, switching the gateway of the long connection from the target gateway to the destination gateway.

[0137] Refer to the process described above where the target client connects to the target gateway. After connecting to the target gateway and verifying communication with the target server through the target gateway, business plane messages are sent and received through the target gateway.

[0138] Additionally, the target client updates its gateway list, deleting information related to the target gateway and recording its own information. Subsequently, if the target client loses its connection with the target gateway, it queries the gateway list, re-establishes a persistent connection with the target gateway, and continues communication with the target server through the target gateway.

[0139] In summary, in this embodiment of the invention, after a gateway establishes multiple long connections, the gateway controller monitors the load of the gateway in real time and controls the migration of the long connections of the gateway to other gateways based on the load of the gateway. During the long connection process, the migration of long connections of the gateway is realized, ensuring load balancing and thus improving the user experience.

[0140] The above is an introduction to the gateway switching system involved in this solution. The following sections will describe the various components of the gateway switching system.

[0141] The structure of the aforementioned electronic device will be described next.

[0142] Figure 3 A schematic diagram of the structure of an electronic device is shown. (For example...) Figure 3As shown, the electronic device 300 includes a processor 301, a memory 302, and a network interface 303. The processor 301, memory 302, and network interface 303 can be connected via a bus or other means. In this embodiment, the processor 301 is the computing and control core of the electronic device 300. For example, the processor 301 can process received data to fulfill different business requirements. The memory 302 is used to store programs and data. For example, it stores the client application or the server application. The memory 302 may include volatile memory, such as high-speed random-access memory (RAM), and may also include non-volatile memory, such as at least one disk storage device. The network interface 303 is used to send and receive data, for example, sending data processed by the processor 301 to other electronic devices 300, or receiving data sent by other electronic devices 300.

[0143] It is understood that the processor in the embodiments of the present invention includes at least a central processing unit (CPU), and may also include other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.

[0144] In addition, the gateway controller and service controller are computer clusters composed of electronic devices. The structure of these electronic devices is described in the aforementioned electronic device 300 and will not be repeated here. A gateway can be a single gateway or a cluster of gateways; the structure of the gateway can be referenced from the structure of the aforementioned electronic devices and will not be repeated here.

[0145] The above is an introduction to the gateway switching system involved in this solution, and its various components. The following is based on the above... Figure 1 The gateway switching system described in [the document] is for... Figure 4 The gateway switching scheme shown is described in detail.

[0146] Step S401. Based on the load information reported by each of the multiple gateways, the gateway controller determines the high-load gateway among the multiple gateways and generates a connection migration instruction for the high-load gateway.

[0147] In practical applications, multiple gateways periodically report load information to the gateway controller. This load information describes the gateway's load status for the current period. Load information can include the operating parameters (indicating the current operating status of the long-lived connection) for each long-lived connection. For example, these operating parameters might include the round-trip time (RTT), traffic per unit time, CPU utilization, memory usage, and message forwarding duration for each long-lived connection. Load information can also include the gateway's own operating parameters (indicating the current operating status of the gateway). For example, these operating parameters might include the number of long-lived connections, CPU utilization, memory usage, traffic per unit time, and message forwarding duration. RTT refers to the time required for data to travel from one end of the network (e.g., a client) to another end (e.g., a server). The message forwarding duration for a long-lived connection indicates the time required for processing and sending a received service-plane message. The message forwarding duration for a gateway indicates the time required for processing and sending a received service-plane message. It should be noted that the message forwarding time of the gateway reflects the overall processing status of the gateway for business plane messages.

[0148] The connection migration instruction is used to instruct a high-load gateway to migrate some long-lived connections. It can include the addresses of low-load gateways among multiple gateways, the addresses of high-load gateways among multiple gateways, and a long-lived connection selection strategy. Here, the long-lived connection selection strategy indicates how to select the long-lived connections to be migrated.

[0149] In practical applications, the gateway controller periodically checks whether a gateway needs to perform a long-term connection migration. For any given period, based on the load information and migration strategy reported by the gateway, it determines whether the gateway is a high-load gateway. If so, the gateway is designated as a high-load gateway requiring long-term connection migration, and a connection migration command for the high-load gateway is generated. Here, the current period can be understood as the time interval between the current detection moment and the last detection moment, such as 5 seconds, 1 minute, or 5 minutes. A period that is too long may result in untimely gateway switching, while a period that is too short may result in excessively frequent gateway switching. The specific period length can be set according to the actual situation.

[0150] The migration strategy indicates whether a high-load gateway needs to migrate long-lived connections. Specifically, the migration strategy can be to migrate when a single migration metric meets the migration condition, when any one of multiple migration metrics meets the corresponding migration condition, or when multiple migration metrics simultaneously meet the corresponding migration condition. In practical applications, multiple migration metrics have different priorities, and the migration metric is determined sequentially according to its priority to determine whether the migration condition is met. In this embodiment, the migration condition can be a migration metric value greater than or equal to a migration metric threshold. Of course, this migration condition is merely an example, and the specific condition can be determined based on actual needs. Here, the migration metric reflects the gateway's operational status, indicating its load level, and thus measuring whether long-lived connections established by the gateway need to be migrated. Therefore, when the migration strategy is met, it can be considered that the gateway's overall message forwarding speed is poor and its load is high, which will affect the user experience, thus requiring the migration of long-lived connections of the high-load gateway.

[0151] Specifically, in the current period, for a given gateway, the gateway controller determines the migration metric for the current period based on the load information reported by the gateway during that period. Based on the migration metric and the migration policy, it determines whether the gateway is a high-load gateway.

[0152] In one feasible implementation, the load information includes the operating parameter values ​​of the gateway itself.

[0153] In one example, the migration metric can be the gateway's load value; correspondingly, the migration metric threshold is the load threshold. The load threshold can be understood as the upper limit of the gateway's load value.

[0154] The load value is used to describe the gateway's load. A higher load value indicates a higher gateway load. Here, the gateway load can be understood as a measure of the gateway's workload, usually defined as the average number of threads in the run queue over a specific time interval, mainly determined by CPU utilization, memory usage, etc.

[0155] Specifically, in the current period, for a given gateway, the gateway controller determines the gateway's load value in the current period based on the load information reported by the gateway within that period. If the load value is greater than or equal to the load threshold, the gateway is determined to be a high-load gateway; otherwise, the gateway is determined to be a low-load gateway.

[0156] For example, the load value can be obtained from the value of a single operating metric or a weighted average of multiple operating metrics. The single operating metric can be CPU utilization or memory utilization, and the multiple operating metrics can be CPU utilization, memory utilization, etc. This embodiment of the invention does not impose specific limitations; the specific values ​​can be determined based on actual circumstances.

[0157] It should be noted that the load information may include the load information of multiple moments in the current period. In this case, the load value of the current period is the average of the load values ​​of multiple moments.

[0158] In one example, the migration metric can be the number of long-lived connections the gateway has in the current period; correspondingly, the migration metric threshold indicates the number of long-lived connections the gateway can accept in a period. Here, a higher number of long-lived connections indicates that the gateway needs to process more business plane messages and has a higher load, thus it can be used as a migration metric.

[0159] For example, the number of long connections can be the total number of long connections per core, sum1. In one possible case, sum1 = (current number of long connections of connection type 1 + current number of long connections of connection type 2) / number of CPU cores. Here, connection type 1 can be a web connection, such as accessing the client through a browser; connection type 2 can be a local connection, such as installing the client on a mobile phone.

[0160] In one example, a migration metric can be the gateway's bandwidth percentage within the current period, such as the ratio of traffic per unit time to the gateway's bandwidth. Correspondingly, the migration metric threshold is the bandwidth percentage, indicating the upper limit of the bandwidth percentage that the gateway can accept. Here, a higher bandwidth percentage indicates that the gateway needs to process and forward more business plane messages, resulting in a higher load, and therefore can be used as a migration metric.

[0161] In one example, the migration metric can be the message forwarding duration per unit time within the current period; correspondingly, the migration metric threshold is the duration threshold, indicating the upper limit of message forwarding duration per unit time that the gateway can accept. Here, a longer message forwarding duration indicates that the gateway takes longer to process forwarded business plane messages, reflecting a heavier workload and higher load on the gateway, and therefore can be used as a migration metric. It should be noted that the load information includes the message forwarding duration for multiple units of time within the current period; in this case, the message forwarding duration per unit time in the current period is the average of the message forwarding durations for multiple units of time.

[0162] In one feasible implementation, the load information includes load parameters for each long connection, such as the RTT for each long connection.

[0163] In one example, the migration metric can be the number of timeout connections the gateway makes in the current period, indicating the number of long connections exceeding the latency threshold. Correspondingly, the migration metric threshold indicates the upper limit of the number of timeout connections the gateway can accept within a period. Here, the number of timeout connections indicates that the longer the gateway takes to process and forward business plane messages, the more workload and load the gateway experiences, thus making it a suitable migration metric.

[0164] In one example, the migration metric can be the proportion of time-out connections for the gateway in the current period, indicating the ratio of the number of long connections exceeding the latency threshold to the total number of long connections. Correspondingly, the migration metric threshold indicates the upper limit of the proportion of time-out connections that the gateway can accept. Here, a higher proportion of time-out connections indicates that the gateway takes longer to process and forward business plane messages, reflecting a heavier workload and higher load on the gateway, and therefore can be used as a migration metric.

[0165] For example, with a current period of 5 minutes, migration is performed when the ratio of the number of long connections with an RTT exceeding Kms within 5 minutes to the total number of long connections is greater than or equal to the migration metric threshold of 30%.

[0166] According to one feasible implementation, the long-lived connection selection strategy can be to migrate connections proportionally. The connection migration ratio indicates the ratio of the number of long-lived connections selected for migration to the total number of long-lived connections.

[0167] In one example, several migration metrics and their respective ranges and migration ratios are pre-defined. In practice, for any migration metric, optionally, the range containing the migration metric for the current period is determined from the multiple ranges, and the migration ratio corresponding to that range is used as the connection migration ratio in the long-connection selection strategy. Optionally, the connection migration ratio = (current period migration metric - migration metric threshold) / migration metric threshold. Furthermore, when there are multiple migration metrics, the connection migration ratio comprehensively considers the connection migration ratios of each migration metric; for example, it can be the average, or different weights can be assigned to different migration metrics for a weighted average.

[0168] According to one feasible implementation, the long-connection selection strategy includes migrating long-connections whose selection parameter values ​​are higher than a selection parameter threshold. The selection parameter indicates the metric for selecting long-connections. For example, it could be the long-connection latency, message processing time, or load. The method for determining the long-connection load value can refer to the method described above for determining the gateway load value.

[0169] It should be noted that the migration metric in the migration strategy provided in this embodiment of the invention can be arbitrarily combined with the selection parameters in the long connection selection strategy. This embodiment of the invention does not impose specific limitations on this, and the migration metric and selection parameters can be combined according to actual needs.

[0170] Step S402. The gateway controller sends a connection migration command to the high-load gateway.

[0171] Step S403. The high-load gateway determines the long connection selection strategy and the address of the low-load gateway based on the connection migration instruction; based on the long connection selection strategy, it determines several target long connections that need to be migrated and generates a gateway switching instruction for any target long connection.

[0172] In practical applications, after receiving a connection migration instruction, the high-load gateway parses the instruction to obtain the long connection selection strategy and the address of the low-load gateway. Then, based on the load of each long connection and the long connection selection strategy, the high-load gateway determines several target long connections. The processing of each target long connection is the same. This embodiment of the invention only uses one target long connection as an example for illustration.

[0173] According to one feasible implementation, the long connection selection strategy can be to migrate according to the proportion of connection migration.

[0174] Optionally, the long-lived connection selection strategy also includes selection parameters. Here, the ratio of the target number of long-lived connections for the high-load gateway to the total number of long-lived connections for the high-load gateway is the connection migration ratio.

[0175] Specifically, based on the selected parameter values, multiple long connections are sorted in descending order to obtain a sorted sequence. From the sorted sequence, several long connections that match the migration ratio are selected as target long connections.

[0176] For example, the parameter is selected as the load of the long-lived connection. In the specific implementation, the load value of the long-lived connection is determined based on the running parameter value of the long-lived connection; the long-lived connections are sorted according to the size of the load value, and the long-lived connections with the highest adaptation connection migration ratio are selected as the target long-lived connections.

[0177] For example, assuming a migration rate of 30% and 100 long connections on a high-load gateway, then 30 long connections need to be migrated. Specifically, the long connections are sorted in descending order of their load values, and the top 30 long connections are selected as the target long connections.

[0178] Furthermore, when multiple selection parameters are involved, in one example, the long-connection selection strategy includes migrating the long connections selected by each of the multiple selection parameters based on a migration ratio. In another example, the long-connection selection strategy includes migrating the same long connections selected by each of the multiple selection parameters based on a migration ratio.

[0179] For example, suppose there are 3 selection parameters, referred to as X1, X2, and X3, and 10 long connections, referred to as LC1, LC2, ..., LC10. The 5 long connections selected by X1 are LC1, LC2, LC3, LC4, and LC5, the 6 long connections selected by X2 are LC1, LC2, LC3, LC4, LC5, and LC6, and the 4 long connections selected by X3 are LC1, LC2, LC3, and LC4. Then there can be 4 target long connections, namely LC1, LC2, LC3, and LC4, or there can be 6, namely LC1, LC2, LC3, LC4, LC5, and LC6.

[0180] According to one feasible implementation, the long-connection selection strategy includes migrating long connections whose selection parameter values ​​are higher than a selection parameter threshold. Correspondingly, the long-connection selection strategy includes selection parameters and selection parameter thresholds.

[0181] For example, if the parameter is set to the latency of a long-lived connection, the high-load gateway determines the current latency value of each long-lived connection and selects those with a latency greater than or equal to the threshold as target long-lived connections. It should be noted that high latency could be due to either a high gateway load and low message forwarding speed, or a link failure in the long-lived connection. Therefore, migrating long-lived connections with high latency to other gateways can not only reduce the gateway load and improve its message forwarding speed, but may also mitigate link failures in the long-lived connections.

[0182] Furthermore, when there are multiple selection parameters, in one example, the long-connection selection strategy includes migrating the long connections selected by each of the multiple selection parameters based on a parameter threshold. In another example, the long-connection selection strategy includes migrating the same long connections selected by each of the multiple selection parameters based on a parameter threshold.

[0183] Step S404: The high-load gateway sends a gateway switching instruction to the service controller, wherein the gateway switching instruction includes the address of the low-load gateway.

[0184] The gateway switching instruction includes the address of the low-load gateway, which is used to notify the client to switch the long-connection gateway to the low-load gateway.

[0185] Furthermore, assuming one client connects to one server, knowing the server's address also reveals the client's address; therefore, the gateway switching command only needs to include the server's address. If multiple clients connect to one server, and all long-lived client connections to the server need to switch to the second gateway, then the gateway switching command only needs to include the server's address. However, if only some long-lived client connections to the server need to switch to the second gateway, knowing the server's address doesn't reveal the client's address; therefore, the gateway switching command also includes both the server's and client's addresses, thus forwarding the gateway control command to the client through the service controller and the server.

[0186] Considering that gateway switching commands are not data required for client and server business implementation, and are therefore control plane messages, for security reasons, high-load gateways can send gateway switching commands to the service controller, which then forwards them to the server. Finally, the server notifies the client of the address of the low-load gateway in the gateway switching command. It should be noted that control plane messages and business plane messages are separated; commands go through the control plane to avoid intruding on or modifying the gateway's business plane forwarding logic.

[0187] Step S405. The service controller sends a gateway switching command to the server.

[0188] Step S406. The server notifies the client of the address of the low-load gateway.

[0189] In practical applications, the server will parse the gateway switching command to obtain the address of the low-load gateway.

[0190] Step S407. The client sends a first connection request to the low-load gateway.

[0191] Step S408. The low-load gateway establishes a long-lived connection with the client based on the first connection request.

[0192] Step S409. The low-load gateway sends a connection notification instruction to the service controller.

[0193] It should be noted that the first connection request includes the server's address. Therefore, the low-load gateway will parse the first connection request to obtain the client's address and the server's address. Based on the client's address, it will establish a long-lived connection with the client, and based on the server's address, it will generate a connection notification instruction. The connection notification instruction includes the server's address and the low-load gateway's address, and is used to notify the server to establish a long-lived connection with the low-load gateway.

[0194] Step S410. The service controller sends a connection notification instruction to the server.

[0195] Step S411. The server sends a second connection request to the low-load gateway.

[0196] Step S412. The low-load gateway establishes a long connection with the server based on the second connection request.

[0197] Step S413. The low-load gateway sends a connection success message to the client.

[0198] Step S414. The client performs communication verification with the server through the low-load gateway. After the communication verification is successful, the long connection with the high-load gateway is terminated.

[0199] Additionally, the client updates the gateway list, removing information about high-load gateways and recording information about low-load gateways. Subsequently, if the client interrupts its connection with a low-load gateway, the next time the client is used, it queries the gateway list and resumes communication with the server through the low-load gateway.

[0200] Communication verification is heartbeat verification; please refer to the above for details, which will not be repeated here.

[0201] In one example, the specific process of a client interrupting its connection with a high-load gateway is as follows:

[0202] After successful communication verification, the client generates and sends a connection termination request to the high-load gateway. Upon receiving the connection termination request, the high-load gateway terminates its connection with the client, generates and sends gateway termination information to the client, and upon receiving the gateway termination information, the client terminates its connection with the high-load gateway.

[0203] Additionally, the high-load gateway will be removed after the client disconnects from the high-load gateway.

[0204] It's important to note that the process of switching from a high-load gateway to a low-load gateway is isolated from the business plane. Therefore, while the client is not switched to a low-load gateway, it can continue to receive business plane messages from the high-load gateway. After switching to a low-load gateway, the client sends business plane messages to the low-load gateway. For example, if the client is a virtual machine and the user is watching a TV series, the client doesn't need to constantly send video requests to the server. While the long-term connection with the high-load gateway is not interrupted, the client receives and caches video data forwarded from the server by the high-load gateway. During the gateway switchover, because the long-term connection with the high-load gateway is not interrupted, the client can still receive video data forwarded by the high-load gateway. After switching to a low-load gateway, i.e., when both the client and server are connected to the low-load gateway and can communicate normally, the client receives video data forwarded from the server by the low-load gateway.

[0205] Step S415. The client updates the gateway list. After the connection with the low-load gateway is interrupted, a long connection is re-established with the low-load gateway based on the updated gateway list.

[0206] In summary, in the process of achieving load balancing, firstly, the gateway controller needs to generate connection migration instructions, so that the gateway can migrate long connections based on the connection migration instructions; secondly, the gateway needs to generate gateway switching instructions, so that the client can switch gateways based on the gateway switching instructions.

[0207] Next, based on the gateway switching scheme described above, the first gateway switching method provided by the embodiments of the present invention will be introduced. It is understood that this method is another expression of the gateway switching scheme described above, and the two are combined. This method is proposed based on the gateway switching scheme described above, and some or all of its content can be found in the description of the gateway switching scheme above.

[0208] Please see Figure 5 , Figure 5 This is a flowchart illustrating the first gateway switching method provided in this embodiment of the invention. It can be understood that this method can be executed through the aforementioned gateway switching system. Figure 5 As shown, the gateway switching method includes:

[0209] Step 501: The gateway controller obtains the load parameters of the first gateway. The first gateway establishes multiple long connections with multiple clients.

[0210] In practical applications, the first gateway is the gateway assigned by the gateway controller when a client requests to establish a long-term connection with the gateway.

[0211] Here, the first gateway can correspond to the aforementioned target gateway, or, correspond to Figure 4 The diagram shows a high-load gateway. The first gateway establishes long-lived connections with multiple clients to forward business plane messages.

[0212] Additionally, it's worth noting that the client communicates with the server via the first gateway for business-plane messages. Therefore, the first gateway also establishes long-lived connections with multiple servers to forward business-plane messages between them and the clients. In some scenarios, such as cloud desktops, one server connects to one client through the first gateway; in other scenarios, such as cloud conferencing, one server connects to multiple clients through the first gateway.

[0213] According to one feasible implementation, the load parameters include the load parameters of multiple long connections, that is, the operating parameters of each of the long connections mentioned above. For details, please refer to the description of step S401 above, which will not be repeated here.

[0214] Furthermore, the load parameters also include the gateway's own parameters, namely the gateway's own operating parameters, as detailed in the description of step S401 above, which will not be repeated here.

[0215] In practical applications, the first gateway periodically uploads the load parameter values ​​to the gateway controller.

[0216] In practical applications, the client is used to implement cloud services, such as a cloud desktop client or a cloud conferencing client. Correspondingly, the gateway controller corresponds to one or more cloud services.

[0217] Step 502: The gateway controller sends a connection migration instruction to the first gateway based on the load parameters of the first gateway. The migration instruction includes the address of the second gateway and indicates that at least one long connection should be switched. Multiple long connections include at least one long connection.

[0218] In practical applications, when the overall message forwarding speed of the first gateway is poor and the load is high, it will affect the user experience. At this time, a connection migration command is sent to the first gateway, which will migrate the long connection to the second gateway, thereby reducing the load of the first gateway and ensuring the message forwarding speed of the long connection in the first gateway that has not been migrated, thus ensuring the user experience.

[0219] According to one feasible implementation, the gateway controller determines whether to send a connection migration instruction to the first gateway based on a migration policy. The migration policy indicates whether the first gateway needs to perform a persistent connection migration. The migration policy includes several migration metrics and corresponding migration conditions for each metric. The migration metrics reflect the gateway's operational status, thereby measuring whether it needs to migrate its own established persistent connections.

[0220] In practical applications, the gateway controller determines the migration metric of the first gateway based on its load parameters, and then determines whether to send a connection migration command to the first gateway based on the migration metric and the migration policy.

[0221] In practical applications, when the migration strategy is met, if the overall message forwarding speed of the gateway is considered to be poor and the load is high, it will affect the user experience. In this case, it is necessary to send a connection migration command to the first gateway.

[0222] In one feasible implementation, the load parameters of the first gateway include the parameters of the first gateway itself.

[0223] In one example, multiple migration metrics can be the gateway's load value, the number of long-lived connections, the bandwidth percentage, the message forwarding duration per unit time, the number of connections that have exceeded the timeout period, or the proportion of connections that have exceeded the timeout period; correspondingly, the migration condition is that the migration metric value is greater than the migration metric threshold.

[0224] It should be noted that when the migration metric is the load value, the migration metric threshold is the load threshold. In some possible implementations, the migration strategy is to migrate when the load value is greater than the load threshold. In this case, the gateway controller determines the load value of the first gateway based on its load parameters, and sends a connection migration command to the first gateway when the load value exceeds the load threshold.

[0225] In one feasible implementation, the load parameters of the first gateway include the load parameters of multiple long-lived connections.

[0226] In one example, the migration metric can be the number of timeout connections or the proportion of timeout connections on the gateway; correspondingly, the migration condition is that the migration metric is greater than the migration metric threshold.

[0227] In some possible implementations, the migration strategy is to migrate when the number of timeout long connections or the proportion of timeout long connections exceeds a load threshold. Specifically, the gateway controller sends a connection migration instruction to the first gateway based on the load parameters of the first gateway when it determines that the latency of at least one long connection among multiple long connections is greater than the latency threshold.

[0228] For details of the migration strategy, please refer to the description of step S401 above, which will not be repeated here.

[0229] The connection migration instruction instructs the first gateway to migrate part or all of its long-lived connection to the second gateway. In a specific implementation, it includes at least the address of the second gateway and the address of the first gateway. Here, the address of the first gateway indicates the destination of the recipient of the connection migration instruction, and the address of the second gateway indicates the address of the gateway to which the long-lived connection needs to be migrated.

[0230] Furthermore, the connection migration instruction also includes a long connection selection strategy. This strategy indicates the method for selecting the long connection to be migrated from multiple long connections.

[0231] According to one feasible implementation, the long connection selection strategy can be to select long connections whose migration selection parameter value is greater than the selection parameter threshold.

[0232] According to one feasible implementation, the long connection selection strategy can be to migrate long connections according to the connection migration ratio.

[0233] Here, the long-connection selection strategy also includes selection parameters. Specifically, based on the magnitude of the selection parameter values, multiple long connections are sorted, and several long connections that are suitable for the migration ratio are selected from the sorted sequence as the long connections to be migrated.

[0234] The selected parameters can be the latency of the long connection, the message processing time per unit time of the long connection, or the load of the long connection. Furthermore, this embodiment of the invention does not intend to limit the kernel or number of selected parameters. When there are multiple selected parameters, long connections selected based on each selected parameter can be migrated, or the same long connections selected based on these parameters can be migrated.

[0235] For details, please refer to the description of step S403 above, which will not be repeated here.

[0236] It should be noted that the migration metric in the migration strategy and the selection parameters in the long connection selection strategy can be combined arbitrarily. This embodiment of the invention does not impose specific limitations on this. In practice, the migration metric in the migration strategy and the selection parameters in the long connection selection strategy can be set arbitrarily according to actual needs.

[0237] Step 503: The first gateway sends the address of the second gateway to at least one client corresponding to the long connection, so that at least one client corresponding to the long connection establishes a long connection with the second gateway.

[0238] In this solution, considering that the long connection between the first gateway and the client is used to forward service plane messages, while the address of the second gateway is not for service plane messages but for control plane messages, if the control plane messages and service plane messages use the same long connection to establish the link, it may affect the security of the service plane message forwarding logic. Therefore, this solution proposes to separate control plane messages and service plane messages to avoid intrusion and modification of the gateway's service plane forwarding logic.

[0239] Specifically, the first gateway sends the address of the second gateway to the service controller. The service controller is connected to multiple servers, and the multiple servers communicate with multiple clients through the gateway, thereby forwarding the address of the second gateway to the client through the service controller and the servers, thus achieving the separation of business plane messages and control plane messages.

[0240] In practical applications, the first gateway generates a gateway switching instruction based on the address of the second gateway, forwards the instruction to the service controller, and then forwards it to the server. The server parses the instruction and notifies connected clients of the second gateway's address. Here, if one client connects to one server, knowing the server's address reveals the client's address; therefore, the gateway switching instruction only needs to include the server's address. If multiple clients connect to one server, and all long-term connections of clients connected to the server need to switch to the second gateway, then the gateway switching instruction only needs to include the server's address. However, if only some long-term connections of clients connected to the server need to switch, knowing the server's address doesn't reveal the addresses of the clients requiring gateway switching; therefore, the gateway switching instruction needs to include both the server's and client's addresses, thus notifying clients of the second gateway's address through the service controller and the server.

[0241] After the client establishes a long connection with the second gateway and successfully communicates with the server through the second gateway (i.e., the communication verification is successful), the first gateway needs to tear down the client's long connection and stop forwarding business plane messages for the client whose long connection has been migrated. The process of tearing down the long connection for each client is the same for the first gateway. The following explanation uses a single client as an example. For ease of description and distinction, this client will be referred to as the target client.

[0242] Specifically, the first gateway receives a connection termination request sent by the target client; and terminates the long connection with the target client according to the connection termination request. Subsequently, the target client forwards business plane messages through the second gateway.

[0243] Therefore, in this solution, after a gateway establishes multiple long connections, the gateway controller monitors the gateway's load in real time and controls the migration of the long connections of the gateway to other gateways based on the gateway's load. During the long connection process, the migration of long connections of the gateway is realized to ensure load balancing, thereby improving the user experience.

[0244] Next, based on the gateway switching scheme described above, a second gateway switching method provided by the embodiments of the present invention will be introduced. It is understood that this method is another expression of the gateway switching scheme described above, and the two are combined. This method is proposed based on the gateway switching scheme described above, and some or all of its content can be found in the description of the gateway switching scheme above.

[0245] Please see Figure 6 , Figure 6 This is a flowchart illustrating the second gateway switching method provided in this embodiment of the invention. It can be understood that this method can be executed by the aforementioned gateway controller. Figure 6As shown, the gateway switching method includes:

[0246] Step 601: Obtain the load parameters of the first gateway. The first gateway has established multiple long connections with multiple clients.

[0247] For details, please refer to the description of step 501 above, which will not be repeated here.

[0248] Step 602: Based on the load parameters of the first gateway, send a connection migration instruction to the first gateway so that the first gateway sends the address of the second gateway to at least one client corresponding to a long connection. The migration instruction includes the address of the second gateway, and the multiple long connections include at least one long connection.

[0249] For details, please refer to the description of step 502 above, which will not be repeated here.

[0250] Therefore, in this solution, after a gateway establishes multiple long connections, the gateway controller monitors the gateway's load in real time and controls the migration of the long connections of the gateway to other gateways based on the gateway's load. During the long connection process, the migration of long connections of the gateway is realized to ensure load balancing, thereby improving the user experience.

[0251] Next, based on the gateway switching scheme described above, a third gateway switching method provided by the embodiments of the present invention will be introduced. It is understood that this method is another expression of the gateway switching scheme described above, and the two are combined. This method is proposed based on the gateway switching scheme described above, and some or all of its content can be found in the description of the gateway switching scheme above.

[0252] Please see Figure 7 , Figure 7 This is a flowchart illustrating the third gateway switching method provided in this embodiment of the invention. It can be understood that this method can be executed by the aforementioned gateway controller. Figure 7 As shown, the gateway switching method includes:

[0253] Step 701: Receive a connection migration instruction sent by the gateway controller. The connection migration instruction includes the address of the second gateway.

[0254] For details regarding the gateway controller generating connection migration instructions, please refer to steps 501 and 502 above.

[0255] Step 702: Send the address of the second gateway to at least one client corresponding to a long connection, so that at least one client establishes a long connection with the second gateway. The first gateway establishes multiple long connections with multiple clients, and the multiple long connections include at least one long connection.

[0256] For details, please refer to the description of step 503 above, which will not be repeated here.

[0257] Therefore, in this solution, after a gateway establishes multiple long connections, the gateway controller monitors the gateway's load in real time and controls the migration of the long connections of the gateway to other gateways based on the gateway's load. During the long connection process, the migration of long connections of the gateway is realized to ensure load balancing, thereby improving the user experience.

[0258] Next, based on the gateway switching scheme described above, the structure of a gateway controller provided by an embodiment of the present invention will be introduced.

[0259] Figure 8 This is a structural example diagram of a gateway controller provided in an embodiment of the present invention. Figure 8 The gateway controller includes:

[0260] The communication module 801 is used to obtain the load parameters of the first gateway, and the first gateway has established multiple long connections with multiple clients.

[0261] The processing module 802 is configured to send a connection migration instruction to the first gateway according to the load parameters of the first gateway, so that the first gateway sends the address of the second gateway to at least one client corresponding to a long connection. The migration instruction includes the address of the second gateway, and the multiple long connections include the at least one long connection.

[0262] In one possible implementation, the load parameters of the first gateway include the parameters of the first gateway itself.

[0263] In this implementation, in one example, the communication module 801 is used to determine the load value of the first gateway based on the load parameters of the first gateway, and when the load value is higher than the load threshold, send a connection migration instruction to the first gateway.

[0264] In one possible implementation, the load parameters of the first gateway include the load parameters of the plurality of long-lived connections.

[0265] In this implementation, in one example, the load parameters of the plurality of long connections include latency; the processing module 802 is used to determine that the latency value of at least one of the plurality of long connections is greater than a latency threshold, and send a connection migration instruction to the first gateway.

[0266] In one possible implementation, the client is a cloud desktop client.

[0267] In one possible implementation, the connection migration instruction further includes a long connection selection strategy, which indicates a scheme for selecting at least one long connection from the plurality of long connections, so that the first gateway selects at least one long connection from the plurality of long connections according to the long connection selection strategy.

[0268] The specific functions implemented by the communication module 801 and the processing module 802 are described in the above description of steps 501 and 502, and will not be repeated here.

[0269] Next, based on the gateway switching scheme described above, the structure of a gateway provided by an embodiment of the present invention will be introduced.

[0270] Figure 9 This is a structural example diagram of a gateway controller provided in an embodiment of the present invention. Figure 9 The gateway includes:

[0271] The communication module 901 is used to receive a connection migration instruction sent by the gateway controller, wherein the connection migration instruction includes the address of the second gateway;

[0272] Processing module 902 is used to send the address of the second gateway to at least one client corresponding to a long connection, so that the at least one client establishes a long connection with the second gateway. The first gateway has established multiple long connections with multiple clients, and the multiple long connections include the at least one long connection.

[0273] In one possible implementation, the communication module 901 is used to send the address of the second gateway to the service controller, which is connected to multiple servers, and the multiple servers communicate with the multiple clients through a network.

[0274] In one possible implementation, the at least one client includes a target client, and the communication module is further configured to receive a connection interruption request sent by the target client;

[0275] The processing module 902 is also configured to interrupt the long connection with the target client according to the connection interruption request.

[0276] In one possible implementation, the connection migration instruction further includes a long connection selection strategy, which indicates a scheme for selecting at least one long connection from the plurality of long connections;

[0277] The processing module 902 is further configured to select at least one long connection from the plurality of long connections according to the long connection selection strategy.

[0278] The specific functions implemented by the communication module 901 and the processing module 902 are described in the above description of steps 501, 502 and 503, and will not be repeated here.

[0279] Next, based on the gateway switching scheme described above, the structure of a gateway switching system provided by an embodiment of the present invention will be introduced.

[0280] Figure 10 This is a structural example diagram of a gateway switching system provided in an embodiment of the present invention. Figure 10 The gateway switching system includes:

[0281] Gateway controller 1001 is used to obtain the load parameters of the first gateway, the first gateway having established multiple long connections with multiple clients; according to the load parameters of the first gateway, it sends a connection migration instruction to the first gateway, the migration instruction including the address of the second gateway, the connection migration instruction indicating the switching of at least one long connection, the multiple long connections including the at least one long connection;

[0282] The first gateway 1002 is used to send the address of the second gateway to the client corresponding to the at least one long connection, so that the client corresponding to the at least one long connection can establish a long connection with the second gateway.

[0283] Specifically, the gateway controller 1001 includes the aforementioned communication module 801 and processing module 802. For details, please refer to the above description of the communication module 801 and processing module 802, which will not be repeated here.

[0284] Specifically, the first gateway 1002 includes the aforementioned communication module 901 and processing module 902. For details, please refer to the above description of the communication module 901 and processing module 902, which will not be repeated here.

[0285] It is understood that the processor in the embodiments of the present invention can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor can be a microprocessor or any conventional processor.

[0286] The method steps in the embodiments of the present invention can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an ASIC.

[0287] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0288] It is understood that the various numerical designations used in the embodiments of the present invention are merely for descriptive convenience and are not intended to limit the scope of the embodiments of the present invention.

Claims

1. A gateway switching method, characterized in that, The method is applied to a gateway switching system, the gateway switching system including a gateway controller, a first gateway, and a second gateway, and the method includes: The gateway controller obtains the load parameters of the first gateway, and the first gateway establishes multiple long connections with multiple clients; The gateway controller sends a connection migration instruction to the first gateway based on the load parameters of the first gateway. The migration instruction includes the address of the second gateway and indicates that at least one long connection should be switched. The multiple long connections include the at least one long connection. The first gateway sends the address of the second gateway to the client corresponding to the at least one long connection, so that the client corresponding to the at least one long connection establishes a long connection with the second gateway. The first gateway sends the address of the second gateway to the client through a first network. The first gateway and the client communicate business data through a second network different from the first network.

2. The method according to claim 1, characterized in that, The gateway controller sends a connection migration command to the first gateway based on the load parameters of the first gateway, including: The gateway controller determines the load value of the first gateway based on the load parameters of the first gateway. When the load value is higher than the load threshold, it sends a connection migration command to the first gateway.

3. The method according to claim 1 or 2, characterized in that, The load parameters of the first gateway include the load parameters of the multiple long connections.

4. The method according to claim 3, characterized in that, The load parameters of the multiple long connections include latency; the gateway controller sends a connection migration instruction to the first gateway based on the load parameters of the first gateway, including: The gateway controller determines that the latency value of at least one of the multiple long connections is greater than a latency threshold, and sends a connection migration instruction to the first gateway.

5. The method according to any one of claims 1 to 4, characterized in that, The first gateway sends the address of the second gateway to the client corresponding to the at least one long connection, including: The first gateway sends the address of the second gateway to the service controller, which is connected to multiple servers, and the multiple servers communicate with the multiple clients through the network.

6. The method according to any one of claims 1 to 5, characterized in that, The at least one client includes a target client, and the method further includes: The first gateway receives a connection interruption request sent by the target client; The first gateway terminates the long-lived connection with the target client based on the connection interruption request.

7. The method according to any one of claims 1 to 6, characterized in that, The client is a cloud desktop client.

8. The method according to any one of claims 1 to 7, characterized in that, The connection migration instruction further includes a long connection selection strategy, which indicates a scheme for selecting at least one long connection from the plurality of long connections; the method further includes: The first gateway selects at least one long connection from the plurality of long connections according to the long connection selection strategy.

9. A gateway switching method, characterized in that, The method is applied to a gateway controller, and the method includes: Obtain the load parameters of the first gateway, which has established multiple long connections with multiple clients; Based on the load parameters of the first gateway, a connection migration instruction is sent to the first gateway, so that the first gateway sends the address of the second gateway to at least one client corresponding to a long connection. The migration instruction includes the address of the second gateway, and the multiple long connections include the at least one long connection. The first gateway sends the address of the second gateway to the client through a first network. The first gateway and the client communicate business data through a second network different from the first network.

10. The method according to claim 9, characterized in that, The step of sending a connection migration instruction to the first gateway based on the load parameters of the first gateway includes: Based on the load parameters of the first gateway, determine the load value of the first gateway. When the load value is higher than the load threshold, send a connection migration command to the first gateway.

11. The method according to claim 9 or 10, characterized in that, The load parameters of the first gateway include the load parameters of the multiple long connections.

12. The method according to claim 11, characterized in that, The load parameters of the multiple long connections include latency; the step of sending a connection migration instruction to the first gateway based on the load parameters of the first gateway includes: If the latency value of at least one of the multiple long connections is determined to be greater than the latency threshold, a connection migration instruction is sent to the first gateway.

13. The method according to any one of claims 9 to 12, characterized in that, The client is a cloud desktop client.

14. The method according to any one of claims 9 to 13, characterized in that, The connection migration instruction also includes a long connection selection strategy, which indicates a scheme for selecting at least one long connection from the plurality of long connections, so that the first gateway selects at least one long connection from the plurality of long connections according to the long connection selection strategy.

15. A gateway switching method, characterized in that, The method is applied to a first gateway, and the method includes: Receive a connection migration instruction sent by the gateway controller, the connection migration instruction including the address of the second gateway; The address of the second gateway is sent to at least one client corresponding to a long connection, so that the at least one client establishes a long connection with the second gateway. The first gateway has multiple long connections with multiple clients, and the multiple long connections include the at least one long connection. The first gateway sends the address of the second gateway to the client through a first network. The first gateway and the client communicate business data through a second network different from the first network.

16. The method according to claim 15, characterized in that, Sending the address of the second gateway to at least one client corresponding to a long connection includes: The address of the second gateway is sent to the service controller, which is connected to multiple servers, and the multiple servers communicate with the multiple clients through the network.

17. The method according to claim 15 or 16, characterized in that, The at least one client includes a target client, and the method further includes: Receive the connection interruption request sent by the target client; The long-lived connection with the target client is terminated based on the connection interruption request.

18. The method according to any one of claims 15 to 17, characterized in that, The connection migration instruction also includes a long connection selection strategy, which indicates a scheme for selecting at least one long connection from the plurality of long connections; The method further includes: According to the long connection selection strategy, at least one long connection is selected from the plurality of long connections.

19. A gateway switching system, characterized in that, The system includes: A gateway controller is used to obtain the load parameters of a first gateway, which has established multiple long connections with multiple clients; based on the load parameters of the first gateway, a connection migration instruction is sent to the first gateway, the migration instruction including the address of a second gateway, the connection migration instruction indicating the switching of at least one long connection, and the multiple long connections including the at least one long connection. The first gateway is used to send the address of the second gateway to the client corresponding to the at least one long connection, so that the client corresponding to the at least one long connection establishes a long connection with the second gateway. The first gateway sends the address of the second gateway to the client through a first network. The first gateway and the client communicate business data through a second network different from the first network.

20. A gateway controller, characterized in that, include: The communication module is used to obtain the load parameters of the first gateway, which establishes multiple long connections with multiple clients. The processing module is configured to send a connection migration instruction to the first gateway according to the load parameters of the first gateway, so that the first gateway sends the address of the second gateway to at least one client corresponding to a long connection. The migration instruction includes the address of the second gateway, and the multiple long connections include the at least one long connection. The first gateway sends the address of the second gateway to the client through a first network. The first gateway and the client communicate business data through a second network different from the first network.

21. A gateway, characterized in that, include: A communication module is used to receive a connection migration instruction sent by the gateway controller, wherein the connection migration instruction includes the address of the second gateway; The processing module is used to send the address of the second gateway to at least one client corresponding to a long connection, so that the at least one client establishes a long connection with the second gateway. The gateway has established multiple long connections with multiple clients, and the multiple long connections include the at least one long connection. The first gateway sends the address of the second gateway to the client through a first network. The first gateway and the client communicate business data through a second network different from the first network.

22. A computing device cluster, characterized in that, It includes at least one computing device, each computing device including a processor and memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device to cause the cluster of computing devices to perform the method as described in any one of claims 1 to 8, or the method as described in any one of claims 9 to 14, or the method as described in any one of claims 15 to 18.

23. A computer storage medium storing instructions that, when executed on a computer, cause the computer to perform the method as claimed in any one of claims 1 to 8, or the method as claimed in any one of claims 9 to 14, or the method as claimed in any one of claims 15 to 18.

24. A computer program product comprising instructions which, when executed on a computer, cause the computer to perform the method as claimed in any one of claims 1 to 8, or the method as claimed in any one of claims 9 to 14, or the method as claimed in any one of claims 15 to 18.

Citation Information

Patent Citations

  • Method for establishing tunnel from SGSN to service gateway

    CN101330425A

  • Gateway switching management method and device based on Internet of Things, equipment and storage medium

    CN112822735A