Method and device for server cluster to manage multiple connections of clients, management system and storage medium

By generating route identifiers in the server cluster and assigning fixed client connections, the complexity of managing the same client connection is solved, improving the operating efficiency and stability of the server cluster in high-concurrency scenarios.

CN121887847APending Publication Date: 2026-04-17ZHIDAO NETWORK TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHIDAO NETWORK TECH (BEIJING) CO LTD
Filing Date
2025-11-04
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In existing technologies, when server clusters handle multiple client connections, it is difficult to achieve unified lifecycle management of connections from the same client, leading to resource contention, processing latency, and high communication overhead, which affects the operating efficiency and stability in high-concurrency scenarios.

Method used

By deploying a server cluster and a forwarding service at the cluster inlet, the source network address and source port number are extracted to generate a routing identifier. Based on the routing identifier, connection requests are fixedly assigned to the target running unit, and a dedicated connection group is established within the target running unit to perform unified lifecycle management.

Benefits of technology

This allows all connections from the same client to be handled by the same running unit, avoiding connections being distributed across different nodes, reducing system complexity and communication overhead, and improving operating efficiency and stability in high-concurrency scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121887847A_ABST
    Figure CN121887847A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method and device for a server cluster to manage multiple connections of clients, a management system and a storage medium, and relates to the technical field of computer networks. The method comprises the following steps: deploying a server cluster consisting of a plurality of operation units, and deploying a forwarding service at a cluster entry; receiving a transport layer connection request initiated by a target client through the forwarding service, and extracting a source network address and a source port number; generating a routing identifier according to the source network address and the source port number; fixedly distributing the connection request to a target operation unit based on the routing identifier, and establishing an exclusive connection group of the target client in the target operation unit; and performing unified life cycle management on all connections in the exclusive connection group. Uniform life cycle management is carried out on all connections in the exclusive connection group, centralized state control over multiple connections of the same client can be achieved, state synchronization and information interaction between nodes are not needed, and the operation efficiency and stability in a high-concurrency scene are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer network technology, and more specifically, to a method, apparatus, management system, and storage medium for server-side cluster management of multiple client connections. Background Technology

[0002] Currently, in the field of computer network technology, with the widespread adoption of internet applications, servers need to efficiently handle a large number of connection requests initiated by clients. Client devices (such as mobile terminals and IoT devices) often establish multiple TCP connections to support different business needs, such as real-time data transmission and file uploads. These multi-connection operations lead to challenges for servers, including resource contention, processing latency, and complex connection management.

[0003] Related technologies employ server-side cluster deployment combined with a load balancing mechanism based on round-robin or random allocation of connection requests. The load balancer at the cluster ingress receives TCP connection requests from clients. The load balancer distributes new connection requests to different running units within the cluster according to a pre-defined, simple strategy, thereby quickly distributing the connection load across multiple nodes.

[0004] In the process of implementing the embodiments of this application, at least the following problems were found in the related technology:

[0005] Because connection requests are randomly or sequentially distributed to different nodes based on load balancing algorithms, multiple TCP connections from the same client may be distributed across different server nodes, making it difficult for the server to perform unified lifecycle management for all connections from the same client. Especially during operations such as connection timeout control and retransmission processing, frequent state synchronization and information exchange between different nodes are required. This not only increases system complexity but also introduces high communication overhead and latency, impacting the system's operating efficiency and stability in high-concurrency scenarios and making it difficult to meet today's extremely demanding business requirements for real-time performance and efficiency. Summary of the Invention

[0006] This application provides a method, apparatus, management system, and storage medium for server-side cluster management of multiple client connections.

[0007] A first aspect of this application provides a method for managing multiple client connections in a server cluster, comprising:

[0008] Deploy a server cluster consisting of multiple running units, and deploy a forwarding service at the cluster entry point;

[0009] The forwarding service receives transport layer connection requests initiated by the target client and extracts the source network address and source port number.

[0010] Generate a route identifier based on the source network address and source port number;

[0011] Connection requests are fixedly assigned to the target running unit based on the routing identifier, and a dedicated connection group for the target client is established within the target running unit;

[0012] Perform unified lifecycle management on all connections within the dedicated connection group.

[0013] In one optional embodiment of this application, the running unit includes a physical node, a virtual machine, and / or a container group.

[0014] In an optional embodiment of this application, generating a route identifier based on the source network address and source port number includes:

[0015] Concatenate the source network address and the source port number into a string;

[0016] Perform a hash operation on the concatenated result;

[0017] Output the hash value as the route identifier.

[0018] In an optional embodiment of this application, the connection request is fixedly assigned to the target running unit based on the routing identifier, including:

[0019] Predefined spatial partitioning rules for route identifiers;

[0020] Establish a mapping relationship between the partitions of the routing identifiers and the operating units;

[0021] When the routing identifier falls into a specific partition, the connection request is directed to the corresponding execution unit.

[0022] In an optional embodiment of this application, the predefined spatial partitioning rules for route identifiers further include:

[0023] Identify the device type to which the source network address belongs;

[0024] The size of the routing identifier space partition is adjusted according to the priority coefficient of the device type; among them, the partition expansion ratio of high-priority devices shall not be less than the preset value.

[0025] In an optional embodiment of this application, unified lifecycle management is performed on all connections within the dedicated connection group, including:

[0026] Monitor the data activity status of each connection within the dedicated connection group;

[0027] When the duration of no data transmission exceeds the idle threshold, the connection is marked as pending recycling.

[0028] Perform resource release operations on connections that are in a pending reclamation state.

[0029] In an optional embodiment of this application, the forwarding service includes:

[0030] Ingress controller for reverse proxy servers and / or container orchestration platforms.

[0031] A second aspect of this application provides an apparatus for managing multiple client connections in a server cluster, including a processor and a memory storing program instructions. The processor is configured to execute the method for managing multiple client connections in a server cluster as described in the first aspect of this application when running the program instructions.

[0032] A third aspect of this application provides a management system, including:

[0033] The system itself; and,

[0034] As in the second aspect of the embodiments of this application, the device for managing multiple connections of a server cluster client is installed on the management system body.

[0035] A fourth aspect of the embodiments of this application provides a computer-readable storage medium storing program instructions, which, when executed, cause a computer to perform a method for managing multiple client connections in a server cluster as described in the first aspect of the embodiments of this application.

[0036] The method, apparatus, management system, and storage medium for managing multiple client connections in server-side clusters provided in this application have the following advantages:

[0037] This application embodiment deploys a server cluster consisting of multiple running units and a forwarding service at the cluster entry point. This cluster mode addresses the limitation of single-node resources and processing capacity, improving the overall data processing capability of the system. The forwarding service receives transport layer connection requests from target clients and extracts the source network address and source port number, providing a unique identifier for subsequent connection allocation. A routing identifier is generated based on the source network address and source port number, ensuring that connection requests from the same client have a traceable and unified identifier. Connection requests are fixedly allocated to target running units based on the routing identifier, and a dedicated connection group is established. This ensures that all TCP connections from the same client are handled by the same running unit, avoiding connections being distributed across different nodes. Unified lifecycle management is performed on all connections within the dedicated connection group, enabling centralized state control of multiple connections from the same client without requiring state synchronization and information exchange between nodes. This reduces system complexity and communication overhead, improves operational efficiency and stability in high-concurrency scenarios, and supports dynamic expansion of cluster resources. Attached Figure Description

[0038] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0039] Figure 1 This is a schematic diagram of a method for managing multiple client connections in a server cluster, provided in an embodiment of this application.

[0040] Figure 2 This is a schematic diagram of a server cluster management client multi-connection device provided in an embodiment of this application.

[0041] Figure label:

[0042] 800: Server-side cluster management device for multiple client connections; 801: Processor; 802: Memory; 803: Communication interface; 804: Bus. Detailed Implementation

[0043] To make the technical solutions and advantages of the embodiments of this application clearer, the exemplary embodiments of this application will be described in further detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not an exhaustive list of all embodiments. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other.

[0044] This application proposes a management system including a cluster deployment module, a forwarding service module, a route identifier generation module, a connection allocation module, and a lifecycle management module. The cluster deployment module deploys a cluster of multiple running units on the server side. These running units include physical nodes, virtual machines, and / or container groups to address the resource constraints of a single node. The forwarding service module is deployed at the cluster ingress, using a reverse proxy server (such as Nginx) or a container orchestration platform ingress controller (such as Kubernetes Ingress). It receives transport layer connection requests from target clients, extracts the source network address and source port number, and forwards the data. The route identifier generation module concatenates the source network address and source port number into a string and generates a route identifier through hashing, providing a unique identifier for connection allocation. The connection allocation module predefines spatial partitioning rules for route identifiers, establishes a mapping relationship between partitions and running units, and consistently allocates connection requests to target running units, establishing a dedicated connection group for the target client within each unit. The lifecycle management module monitors the data activity status of each connection within the dedicated connection group, marks timed-out connections as pending reclamation, and performs resource release operations, including sending connection termination instructions, reclaiming port and memory resources, and / or updating status records. The management system also includes a processor, which is communicatively connected to the above modules and is used to control the above modules to perform the above actions.

[0045] Figure 1 This is a schematic diagram of a method for managing multiple connections to a server cluster provided in this application embodiment. Any of the following methods can be executed in the management system or in a server or terminal device that communicates with the management system.

[0046] Based on the structure of the management system described above, such as Figure 1 As shown in the embodiment of this application, a method for managing multiple client connections in a server cluster is provided, including:

[0047] S01 deploys a server cluster consisting of multiple running units and deploys a forwarding service at the cluster entry point.

[0048] In this step, in a traditional data center environment, a server cluster can be built using physical servers, with multiple physical nodes as running units. Nginx is deployed at the cluster entry point as a forwarding service, and Nginx's high-performance reverse proxy capabilities are used to enable traffic access.

[0049] In this step, in a containerized deployment scenario, a server cluster consisting of multiple container groups can be created based on the Kubernetes platform. Kubernetes Ingress is deployed at the cluster entry point as a forwarding service, and the entry point management of the container group cluster is achieved through the Ingress controller.

[0050] S02, receive the transport layer connection request initiated by the target client through the forwarding service, and extract the source network address and source port number.

[0051] In this step, when the forwarding service is Nginx, the built-in variable remote is used by configuring the server block of Nginx. a The `ddr` function retrieves the source network address of the target client and the source port number via `remote_port`, enabling the extraction of client identification information from transport layer connection requests. When the forwarding service is Kubernetes Ingress, a specific annotation is added to the Ingress resource configuration, allowing Ingress to parse and extract the source network address and source port number from the TCP packet header when receiving client connection requests, preserving the client's original connection information.

[0052] S03, Generate a route identifier based on the source network address and source port number.

[0053] In this step, the extracted source network address and source port number are concatenated into a string to form a unified character sequence. A hash operation is then performed on the concatenated result, and the resulting hash value is used as a routing identifier for subsequent connection allocation. Alternatively, the source network address and source port number can be standardized first, then concatenated into a string according to a preset format, and finally a hash algorithm is used to calculate a unique routing identifier, providing an identification basis for the targeted allocation of connection requests.

[0054] S04: Based on the routing identifier, the connection request is fixedly assigned to the target running unit, and a dedicated connection group for the target client is established within the target running unit.

[0055] In this step, spatial partitioning rules for route identifiers are predefined, dividing the hash value range of route identifiers into multiple intervals. A mapping relationship is established between each interval and the running units in the server cluster. When a route identifier falls into a specific partition, the connection request is forwarded to the corresponding running unit, and a dedicated connection group for the target client is created within that unit. Alternatively, based on the number and load of running units in the server cluster, partitioning rules for route identifiers can be predefined to establish a dynamic mapping between route identifier partitions and running units. When a route identifier meets specific partitioning conditions, the connection request is fixedly assigned to the corresponding running unit, and a dedicated connection group is created within that unit to manage client connections.

[0056] S05 performs unified lifecycle management on all connections within a dedicated connection group.

[0057] In this step, within the target operating unit, the data activity status of all connections within the dedicated connection group is periodically monitored. When a connection is found to have no data transmission for a duration exceeding a preset idle threshold, the connection is marked as awaiting recycling. Subsequently, resource release operations are performed on connections in the awaiting recycling state. Alternatively, a dedicated connection management module can perform real-time data activity status monitoring of connections within the dedicated connection group. When it is found that a connection has reached an idle threshold due to no data transmission, the connection is immediately marked as awaiting recycling, and resource release operations such as sending connection termination commands, reclaiming port and memory resources, and updating connection group status records are executed sequentially.

[0058] The method for managing multiple client connections using a server-side cluster, as provided in this application, deploys a server-side cluster consisting of multiple running units and a forwarding service at the cluster entry point. This cluster approach addresses the limitations of single-node resources and processing capabilities, improving the overall data processing capacity of the system. The forwarding service receives transport layer connection requests from target clients and extracts the source network address and source port number, providing a unique identifier for subsequent connection allocation. A routing identifier is generated based on the source network address and source port number, ensuring that connection requests from the same client have a traceable and unified identifier. Connection requests are fixedly allocated to target running units based on the routing identifier, and a dedicated connection group is established. This ensures that all TCP connections from the same client are handled by the same running unit, preventing connections from being distributed across different nodes. Unified lifecycle management is performed on all connections within the dedicated connection group, enabling centralized state control of multiple connections from the same client without requiring state synchronization and information exchange between nodes. This reduces system complexity and communication overhead, improves operational efficiency and stability in high-concurrency scenarios, and supports dynamic expansion of cluster resources.

[0059] Optionally, the running unit includes physical nodes, virtual machines, and / or container groups.

[0060] In this embodiment, within a traditional enterprise server room, multiple independent physical servers are deployed as server-side clusters, each with independent hardware resources to directly run server-side programs and handle client connection requests. Alternatively, virtualization technology can be used to create multiple isolated virtual machines on the same physical server as server-side clusters, each with an independent operating system and server-side program, forming a server-side cluster to manage multiple client connections. Furthermore, a container orchestration platform can be used to deploy server-side clusters consisting of multiple container groups, each containing multiple container instances running the same service, enabling flexible scaling of the server-side cluster through the rapid deployment capabilities of containers.

[0061] In this way, since physical nodes have independent hardware resources and can provide stable computing power, virtual machines can create multiple isolated running environments on the same physical hardware through virtualization technology, enabling flexible allocation of resources. Container groups can quickly deploy and expand service instances with the help of container orchestration technology. Through diverse combinations of running units, the server cluster can flexibly combine different types of running units according to different business needs and resource conditions, thereby improving the flexibility and adaptability of cluster deployment. This facilitates efficient management of multiple client connections in different hardware environments and application scenarios, while also helping to optimize resource utilization and reduce system deployment and maintenance costs.

[0062] Optionally, generating a route identifier based on the source network address and source port number includes: concatenating the source network address and source port number into a string; performing a hash operation on the concatenation result; and outputting the hash value as the route identifier.

[0063] In this embodiment, the server-side program can programmatically concatenate the extracted source network address and source port number into a single string in sequence. For example, the source network address "192.168.1.100" and the source port number "8080" can be concatenated into "192.168.1.1008080". Then, a hash function is called to process this concatenated string, and the generated hash value is used as a routing identifier for subsequent connection allocation. Alternatively, the source network address and source port number can be standardized first to ensure a consistent format. Then, a specific concatenation operator is used to concatenate them into a string. Finally, a hash algorithm is used to calculate the hash value, which serves as a unique routing identifier, providing an identification basis for the targeted forwarding of connection requests.

[0064] By concatenating the source network address and source port number, the unique identifier of the client connection can be integrated into a unified character sequence, providing a foundation for subsequent processing. A hash operation is performed on the concatenated result, utilizing the mapping characteristics of hash algorithms to convert the long string into a fixed-length hash value, facilitating storage and fast retrieval. The output hash value serves as a routing identifier, ensuring that each client's connection request has a unique and compact identifier. Through these operations, efficient routing and fixed allocation of client connection requests can be achieved based on the routing identifier, ensuring that multiple connections from the same client are directed to the same runtime unit. This lays the foundation for establishing dedicated connection groups within the target runtime unit and performing unified lifecycle management. Furthermore, the efficiency of hash operations helps improve the cluster's response speed and allocation efficiency when handling a large number of connection requests.

[0065] Optionally, the connection request is fixedly assigned to the target running unit based on the routing identifier, including: predefining the spatial partitioning rules of the routing identifier; establishing the mapping relationship between the partitions of the routing identifier and the running units; and directing the connection request to the corresponding running unit when the routing identifier falls into a specific partition.

[0066] In this embodiment, the server cluster supports dynamically expanding the number of nodes (running units). When the resource utilization (such as CPU, memory, and number of connections) of existing running units in the cluster exceeds a preset threshold, the system automatically triggers a node expansion process to avoid service response delays due to excessive load. Alternatively, administrators can manually initiate expansion operations according to business needs, such as increasing the number of running units before an expected traffic peak to improve the cluster's concurrent processing capabilities. When expanding the number of nodes (running units) in the server cluster, the forwarding service reallocates the mapping relationship between the partitions of the routing identifier and the nodes (running units). Specifically, when the server cluster needs to dynamically add running units, the forwarding service reallocates the mapping relationship between the partitions of the routing identifier and the nodes based on a consistent hashing algorithm. First, the newly added running unit is added to the hash ring, and then the mapping position of the routing identifier on the hash ring is recalculated. Only the partition mapping relationship affected by the newly added node is adjusted to ensure that connection requests are allocated to the corresponding running unit according to the new mapping rules. When the number of running units in the server cluster is dynamically expanded, the forwarding service can automatically regenerate the spatial partitioning rules of the routing identifier after detecting the change in the number of nodes. The original partitions are split proportionally according to the number of new nodes, a new mapping relationship between the partitions and the running units is established, and the mapping table is updated so that new connection requests are allocated to the target running unit according to the new rules.

[0067] In this embodiment, during server cluster deployment, the hash value space of the routing identifier can be pre-divided into several continuous intervals, for example, partitioned according to the high-order byte of the hash value. Each interval corresponds to a running unit, and a mapping table between routing identifier partitions and running units is established in the forwarding service. When a client connection request is received, the request is forwarded to the corresponding running unit according to the interval to which the generated routing identifier belongs. Alternatively, based on the number of running units in the server cluster, a consistent hashing algorithm can be used to predefine the spatial partitioning rules of the routing identifier, dividing the hash ring into partitions equal to the number of running units, with each partition corresponding to a running unit. The mapping relationship between partitions and running units is maintained in the forwarding service, and when a routing identifier falls into a certain partition, the connection request is directed to the corresponding running unit.

[0068] In this way, by predefining spatial partitioning rules for route identifiers and establishing a mapping relationship between route identifier partitions and runtime units, each route identifier can be assigned to a specific runtime unit. When a route identifier falls into a specific partition, the connection request is directed to the corresponding runtime unit. Through the structured partitioning of the route identifier space, a deterministic mapping from connection requests to runtime units is achieved. This ensures that connection requests from the same client are consistently assigned to the same runtime unit because they share the same route identifier. This provides a foundation for establishing dedicated connection groups within the target runtime unit and performing unified lifecycle management. Furthermore, the predefined partitioning rules and mapping relationships make the connection allocation process more orderly, helping to improve the efficiency of the server cluster in managing multiple client connections and reducing the overhead of inter-node state synchronization caused by chaotic connection allocation.

[0069] Optionally, the predefined spatial partitioning rules for routing identifiers may also include: identifying the device type to which the source network address belongs; adjusting the spatial partition size of the routing identifier according to the priority coefficient of the device type; wherein the partition expansion ratio of high-priority devices is not less than a preset value.

[0070] In this embodiment, the device type can be identified by parsing the MAC address prefix of the source network address. For example, a certain type of industrial control equipment can be pre-defined as having a high-priority device type, while ordinary office equipment can be defined as having a low-priority type. Then, based on the priority coefficient corresponding to the device type, the size of the routing identifier space partition is adjusted proportionally to ensure that the partition expansion ratio of high-priority devices meets the requirement of not being lower than a preset value. Alternatively, the device type can be determined by parsing the device identifier field in the source network address. For example, the device type label can be extracted from the extended packet attached to the source network address, identifying devices with labels such as medical equipment as high-priority types and home devices as low-priority types. Then, the routing identifier space partition is dynamically adjusted according to different priority coefficients to ensure that the partition expansion ratio of high-priority devices meets the preset requirements.

[0071] In this way, when predefining the space partitioning rules for routing identifiers, since different types of devices have different service quality requirements, high-priority devices usually require more stable connection management and resource guarantees. Therefore, we can first identify the device type to which the source network address belongs, and then adjust the size of the routing identifier space partition according to the priority coefficient of the device type, with the partition expansion ratio of high-priority devices not less than the preset value. By dynamically adjusting the partition size in conjunction with the priority of the device type, the routing identifier space partition corresponding to high-priority devices can obtain a larger allocation ratio, thus making it more likely that connection requests from high-priority devices will be consistently allocated to the same running unit. This optimizes the connection management strategy for devices of different priorities, ensuring the connection stability and resource utilization of high-priority devices, while also enabling flexible configuration of routing identifier space partitions based on differences in device type, improving the adaptability of the server cluster to different types of client devices and the efficiency of resource allocation.

[0072] Optionally, unified lifecycle management is performed on all connections within the dedicated connection group, including: monitoring the data activity status of each connection within the dedicated connection group; marking the connection as pending reclamation when the duration of continuous data transmission exceeds the idle threshold; and performing resource release operations on connections in the pending reclamation state.

[0073] In this embodiment, unified lifecycle management is performed on all connections within the dedicated connection group, including: detecting packet loss events during data transmission; and triggering a retransmission mechanism to resend the lost data when a packet loss event occurs. Specifically, in the dedicated connection group management module of the target operating unit, a sequence number mechanism for data transmission can be maintained for each connection. When the server sends data to the client, a unique sequence number is attached to each data packet. After receiving the data, the client returns acknowledgment information containing the sequence number. The management module detects packet loss events by comparing the continuity of the sent sequence number and the received acknowledgment sequence number. If a sequence number is found to be unacknowledged, it is determined to be a packet loss, and a retransmission mechanism is triggered to resend the corresponding lost data. Alternatively, during the connection data transmission process of the operating unit, a time-based packet loss detection mechanism can be started. After the server sends data, a timer with a preset time interval is set for each data packet. If the timer expires without receiving an acknowledgment response from the client, it is determined that the data packet has been lost. At this time, a retransmission mechanism is triggered to extract the corresponding lost data from the sending buffer and resend it, and the timer is reset to ensure reliable data transmission.

[0074] In this embodiment, when a server node (running unit) performs lifecycle management on a connection to the same client, there is no need for state synchronization between nodes (running units), reducing cluster resource overhead. Specifically, in a server cluster composed of physical nodes, each running unit deploys an independent connection state management module. Once a connection to the same client is fixedly assigned to that running unit, all lifecycle management operations for the connection (such as state monitoring, timeout marking, and resource release) are completed in the local module. Connection state data is stored in the running unit's local memory or database, eliminating the need to send state synchronization requests to other physical nodes and avoiding resource overhead caused by cross-node communication. In a server cluster composed of container groups, connections to the same client can also be fixedly assigned to a specific container group through a forwarding service. Each running unit within that container group maintains its own connection state record table. When performing connection lifecycle management, it directly reads and updates the state information (such as data activity time and recycling mark) in the local record table. All operations are completed within the container group without interacting with the running units of other container groups, thereby reducing the overall communication resource consumption of the cluster.

[0075] In this embodiment, a connection monitoring module is deployed in the target operating unit. This module periodically scans all connections within a dedicated connection group, determining their activity status by detecting whether a connection is transmitting or receiving data. When a connection has not transmitted data for a period of time and the duration exceeds a preset idle threshold, the connection is automatically marked as pending reclamation. Subsequently, a resource release process is triggered, sending a connection termination command to the client and reclaiming related resources. Alternatively, a status record table can be maintained for each dedicated connection group in the connection management component of the operating unit, recording the last data transmission time of each connection in real time. When the component detects that the interval between the last data transmission time of a connection and the current time exceeds the idle threshold, it immediately marks the connection as pending reclamation in the status record table, and then performs resource release operations according to preset rules, including reclaiming the port and memory resources occupied by the connection and updating the status record.

[0076] In this way, after multiple connections from the same client are fixedly assigned to the same running unit and a dedicated connection group is established, these connections need to be managed efficiently to avoid idle connections occupying resources for a long time. Therefore, the data activity status of each connection is monitored first to keep track of connection usage in real time. When the duration of no data transmission exceeds a preset idle threshold, the connection is marked as pending reclamation to prepare for subsequent resource release. Then, resource release operations are performed on the connections in the pending reclamation state, such as sending connection termination commands and reclaiming port and memory resources. Through the above method, invalid connections can be cleaned up in a timely manner, releasing occupied system resources, improving resource utilization, reducing system overhead caused by invalid connections, optimizing the operating efficiency of the server cluster, ensuring system stability in high-concurrency scenarios, and eliminating the need for state synchronization between different nodes, thus reducing system complexity.

[0077] Optionally, the resource release operation includes: sending a connection termination command to the client; and / or, reclaiming the port and memory resources occupied by the connection; and / or, updating the status record of the dedicated connection group.

[0078] In this embodiment, after the target execution unit detects a connection in a pending recycling state, it sends a connection termination command to the client via the transport layer protocol, notifying the client to actively close the connection. Simultaneously, it releases the server port resources and allocated memory space occupied by the connection and marks the connection as closed in the status record of the dedicated connection group. Alternatively, when the execution unit performs resource release on a connection in a pending recycling state, it can first reclaim the port and memory resources occupied by the connection to ensure timely release of system resources, then update the status record of the dedicated connection group to clarify the resource recycling status of the connection, and finally send a connection termination command to the client to complete the connection closing process.

[0079] Thus, when connections within a dedicated connection group are in a pending reclaiming state, the system resources occupied by those connections need to be released in an orderly manner. Therefore, sending a connection termination command to the client allows both the client and server to be aware of the connection state change simultaneously, ensuring the proper handling of connection termination. Reclaiming port and memory resources promptly releases system resources occupied by invalid connections, avoiding resource waste and improving the resource utilization of the server cluster. Updating the state records of the dedicated connection group maintains the accuracy of the state information within the group, providing reliable data support for subsequent management of other connections within the dedicated connection group, and ensuring that the server's lifecycle management of multiple client connections can be carried out in an orderly and efficient manner.

[0080] Optionally, the forwarding service includes: a reverse proxy server and / or an ingress controller for a container orchestration platform.

[0081] In this embodiment, the reverse proxy server can be Nginx, and the container orchestration platform ingress controller can be Kubernetes Ingress. Deploying Nginx as a reverse proxy server at the server cluster ingress allows it to receive transport layer connection requests from target clients, extract the source network address and source port number, and allocate the connection request to the target runtime unit based on the routing identifier, thus managing multiple client connections. Alternatively, Kubernetes Ingress can be deployed as the ingress controller for the container orchestration platform in a Kubernetes-based containerized server cluster. Utilizing Ingress rule configuration, it can receive client connection requests, extract relevant network address and port information, and direct the request to the target runtime unit based on the routing identifier, completing the management of multiple client connections.

[0082] In this way, Nginx, as a reverse proxy server, possesses high-performance load balancing and reverse proxy capabilities, efficiently handling client connection requests and forwarding data. Meanwhile, Kubernetes Ingress, as the ingress controller for a container orchestration platform, enables unified management and traffic control of the server cluster ingress in a containerized deployment environment. This allows the forwarding service to choose the appropriate implementation method based on different deployment environments and business needs. When deploying multiple Pods using Kubernetes, Ingress is better suited to containerized cluster environments, while Nginx is suitable for traditional reverse proxy scenarios. This improves the flexibility and adaptability of the forwarding service, ensuring it can effectively extract source network addresses and source port numbers under different technical architectures and consistently allocate connection requests to the target runtime unit based on routing identifiers, providing stable and reliable forwarding support for managing multiple client connections in the server cluster.

[0083] Combination Figure 2 As shown in the illustration, this application provides a device 800 for managing multiple client connections in a server cluster, including a processor 801 and a memory 802. Optionally, the device may further include a communication interface 803 and a bus 804. The processor 801, communication interface 803, and memory 802 can communicate with each other via the bus 804. The communication interface 803 can be used for information transmission. The processor 801 can call logical instructions in the memory 802 to execute the method for managing multiple client connections in a server cluster according to the above embodiment.

[0084] Furthermore, the logic instructions in the aforementioned memory 802 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.

[0085] The memory 802, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this application. The processor 801 executes functional applications and data processing by running the program instructions / modules stored in the memory 802, that is, it implements the method of server cluster management of multiple client connections in the above embodiments.

[0086] The memory 802 may include a program storage area and a data storage area. The program storage area may store the operating system and application programs required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 802 may include high-speed random access memory and may also include non-volatile memory.

[0087] This application provides a management system, including: a management system body, and the aforementioned device 800 for managing multiple client connections within a server cluster. The device 800 is installed within the management system body. This installation relationship is not limited to placement within the management system, but also includes installation and connections with other components of the management system, including but not limited to physical connections, electrical connections, or signal transmission connections. Those skilled in the art will understand that the device 800 can be adapted to any feasible management system body, thereby enabling other feasible embodiments.

[0088] This application provides a computer-readable storage medium storing computer-executable instructions configured to execute the above-described method for managing multiple connections to a server cluster client.

[0089] The technical solutions of this application embodiment can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in this application embodiment. The aforementioned storage medium can be a non-transitory storage medium, including: USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, and other media capable of storing program code.

[0090] The technical solutions of this application embodiment can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in this application embodiment. The aforementioned storage medium can be a non-transitory storage medium, including: USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, and other media capable of storing program code.

[0091] The foregoing description and accompanying drawings fully illustrate embodiments of this application to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the terminology used in this application is for describing embodiments only and is not intended to limit the claims. As used in the description of embodiments and claims, the singular forms “a,” “an,” and “the” are intended to equally include the plural forms unless the context clearly indicates otherwise. Similarly, the term “and / or,” as used herein, means including one or more of the associated listed items and all possible combinations thereof. Additionally, when used in this application, the term "comprise" and its variations "comprises" and / or "comprising" refer to the presence of stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, or apparatus that includes said element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., provided in the embodiments, if they correspond to the method section provided in the embodiments, then the relevant parts can be referred to the description of the method section.

[0092] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments provided herein can be implemented using electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0093] The methods and products (including but not limited to devices and equipment) disclosed in the embodiments herein can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units may be merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to implement this embodiment according to actual needs. In addition, the functional units in the embodiments of this application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0094] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description; sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

Claims

1. A method for managing multiple client connections in a server-side cluster, characterized in that, include: Deploy a server cluster consisting of multiple running units, and deploy a forwarding service at the cluster entry point; The forwarding service receives transport layer connection requests initiated by the target client and extracts the source network address and source port number. Generate a route identifier based on the source network address and source port number; Connection requests are fixedly assigned to the target running unit based on the routing identifier, and a dedicated connection group for the target client is established within the target running unit; Perform unified lifecycle management on all connections within the dedicated connection group.

2. The method according to claim 1, characterized in that, The running unit includes physical nodes, virtual machines, and / or container groups.

3. The method according to claim 1, characterized in that, Generate a route identifier based on the source network address and source port number, including: Concatenate the source network address and the source port number into a string; Perform a hash operation on the concatenated result; Output the hash value as the route identifier.

4. The method according to claim 1, characterized in that, Connection requests are consistently assigned to target execution units based on routing identifiers, including: Predefined spatial partitioning rules for route identifiers; Establish a mapping relationship between the partitions of the routing identifiers and the operating units; When the routing identifier falls into a specific partition, the connection request is directed to the corresponding execution unit.

5. The method according to claim 4, characterized in that, The predefined spatial partitioning rules for route identifiers also include: Identify the device type to which the source network address belongs; The size of the routing identifier space partition is adjusted according to the priority coefficient of the device type; among them, the partition expansion ratio of high-priority devices shall not be less than the preset value.

6. The method according to claim 1, characterized in that, Perform unified lifecycle management on all connections within the dedicated connection group, including: Monitor the data activity status of each connection within the dedicated connection group; When the duration of no data transmission exceeds the idle threshold, the connection is marked as pending recycling. Perform resource release operations on connections that are in a pending reclamation state.

7. The method according to any one of claims 1 to 6, characterized in that, Forwarding services include: Ingress controller for reverse proxy servers and / or container orchestration platforms.

8. A device for managing multiple client connections in a server-side cluster, comprising a processor and a memory storing program instructions, characterized in that, The processor is configured to, when running the program instructions, execute the method for managing multiple client connections in a server cluster as described in any one of claims 1 to 7.

9. A management system, characterized in that, include: The system itself; and, The device for managing multiple client connections in server clusters as described in claim 8 is installed on the management system body.

10. A computer-readable storage medium storing program instructions, characterized in that, When the program instructions are executed, they cause the computer to perform the method for managing multiple client connections in a server cluster as described in any one of claims 1 to 7.