Session holding method, device, equipment, medium and product

By mapping sockets to sockets of the first container instance in a cloud container environment and forwarding UDP packets using container instances with stateless workloads, the problem of UDP session maintenance in a cloud container environment is solved, the stability of audio and video calls is achieved and the operation and maintenance costs are reduced.

CN120499159APending Publication Date: 2025-08-15AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510642591.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-19
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

In a cloud container environment, real-time audio and video calling applications cannot maintain UDP sessions, resulting in interruption of audio and video streams or inability to establish calls.

Method used

By mapping the sockets of the cloud container cluster to the sockets of the first container instance, the container instance of the stateless workload is used to forward UDP data packets, and the common maintenance of multi-protocol sessions is achieved.

Benefits of technology

It solves the problem of UDP session maintenance in cloud container environment, realizes the stability of audio and video calls, and reduces operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120499159A_ABST
    Figure CN120499159A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a session keeping method and device, equipment, a medium and a product, and the method comprises the steps: determining a first container instance which builds transmission control connection with a client and first socket information of the first container instance, building the first socket information and second socket information of a cloud container cluster, the mapping relation between the first socket information and the second socket information and the third socket information of the public network corresponding to the second socket information; sending the third socket information to the client; and forwarding the user datagram protocol data packet sent by the client to the first container instance through the second container instance according to the mapping relationship. According to the technical scheme provided by the embodiment of the invention, the problem that cloud container session maintenance cannot be realized at present is solved, the UDP data packets of the client can be uniformly forwarded to the first container instance through the container instance for forwarding according to the socket mapping relationship by mapping the socket of the cloud container cluster to the socket of the first container instance, and the user experience is improved. Therefore, multi-protocol sessions can be maintained together.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of cloud container technology, and in particular to a session persistence method, apparatus, device, medium, and product. Background Art

[0002] With the widespread application of cloud container technology, many computer systems have migrated from direct server deployment to cloud container environments. Relying on the flexibility, scalability, high availability, and recoverability of cloud containers, they can reduce costs and improve operation and maintenance efficiency. However, some systems cannot operate normally after migrating to the cloud container environment because their original architectural design relies on the characteristics of physical servers. For example, real-time audio and video call applications use the TCP (Transmission Control Protocol) protocol for signaling interaction and the UDP (User Datagram Protocol) protocol for streaming media transmission. It is impossible to maintain a UDP session on a cloud container, that is, it is impossible to keep the UDP data packet sending destination as the same "container instance", resulting in problems such as audio and video stream interruption during the audio and video call or even the inability to establish a call. Summary of the Invention

[0003] Embodiments of the present invention provide a session maintenance method, apparatus, device, medium, and product. By mapping the IP and port of a cloud container cluster to the IP and port of a first container instance, and using a container instance for forwarding to uniformly forward the client's UDP data packets to the first container instance according to the socket mapping relationship, multi-protocol sessions can be maintained together.

[0004] In a first aspect, an embodiment of the present invention provides a session maintenance method, the method comprising:

[0005] Determine a first container instance for establishing a transmission control connection with the client, wherein the first container instance is used for a business access service;

[0006] Determine the first socket information of the first container instance, establish a mapping relationship between the first socket information, the second socket information of the first computing node of the cloud container cluster associated with the first container instance, and the third socket information of the public network corresponding to the second socket information, and write the mapping relationship into the forwarding table;

[0007] Sending the third socket information to the client, so that the client sends a User Datagram Protocol data packet to the public network address corresponding to the third socket information;

[0008] Forwarding the User Datagram Protocol data packet sent by the client to the first container instance through the second container instance according to the mapping relationship in the forwarding table, wherein the second container instance is used for forwarding service;

[0009] The first container instance and the second container instance are container instances of stateless workloads.

[0010] In a second aspect, an embodiment of the present invention provides a session persistence device, the device comprising:

[0011] a container instance determination module, configured to determine a first container instance for establishing a transmission control connection with a client, wherein the first container instance is used for a business access service;

[0012] A mapping relationship determination module is configured to determine first socket information of a first container instance, establish a mapping relationship between the first socket information, second socket information of a first computing node of a cloud container cluster associated with the first container instance, and third socket information of a public network corresponding to the second socket information, and write the mapping relationship into a forwarding table;

[0013] A socket information sending module, configured to send the third socket information to the client, so that the client sends a user datagram protocol data packet to the public network address corresponding to the third socket information;

[0014] a data packet forwarding module, configured to forward a user datagram protocol data packet sent by the client to the first container instance through the second container instance according to a mapping relationship in the forwarding table, wherein the second container instance is used for forwarding service;

[0015] The first container instance and the second container instance are container instances of stateless workloads.

[0016] In a third aspect, an embodiment of the present invention further provides a computer device, comprising:

[0017] one or more processors;

[0018] a memory for storing one or more programs;

[0019] When the one or more programs are executed by one or more processors, the one or more processors implement the session persistence method provided by any embodiment of the present invention.

[0020] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the session persistence method provided by any embodiment of the present invention.

[0021] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the session persistence method provided by any embodiment of the present invention.

[0022] The embodiments of the above invention have the following advantages or beneficial effects:

[0023] In an embodiment of the present invention, a first container instance is determined to establish a transmission control connection with a client, wherein the first container instance is used for business access services; first socket information of the first container instance is determined, and a mapping relationship is established between the first socket information, the second socket information of the first computing node of the cloud container cluster associated with the first container instance, and the third socket information of the public network corresponding to the second socket information, and the mapping relationship is written into a forwarding table; the third socket information is sent to the client so that the client sends a user datagram protocol data packet to the public network address corresponding to the third socket information; the user datagram protocol data packet sent by the client is forwarded to the first container instance by the second container instance according to the mapping relationship in the forwarding table, wherein the second container instance is used for forwarding services; wherein the first container instance and the second container instance are container instances of stateless workloads. The technical solution of the embodiment of the present invention solves the current problem of cloud container session persistence. By mapping the socket of the cloud container cluster to the socket of the first container instance, the container instance used for forwarding can uniformly forward the client's UDP data packet to the first container instance according to the socket mapping relationship, so as to achieve multi-protocol session co-preservation. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 This is a flow chart of a session maintenance method provided by an embodiment of the present invention;

[0025] Figure 2 This is a flow chart of a session maintenance method provided by an embodiment of the present invention;

[0026] Figure 3 is a schematic diagram of a session maintenance method provided by an embodiment of the present invention;

[0027] Figure 4 This is a flow chart of a session maintenance method provided by an embodiment of the present invention;

[0028] Figure 5 This is a structural diagram of a session persistence device provided by an embodiment of the present invention;

[0029] Figure 6 It is a structural diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0030] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all structures.

[0031] Figure 1 This is a flowchart of a session persistence method provided by an embodiment of the present invention. This embodiment is applicable to session persistence scenarios in a cloud container environment. The method can be performed by a session persistence device, which can be implemented in software and / or hardware and integrated into a computer device with application development capabilities.

[0032] like Figure 1 As shown, the session maintenance method of this embodiment includes the following steps:

[0033] S110: Determine a first container instance for establishing a transmission control connection with the client.

[0034] In real-time audio and video call applications, the Transmission Control Protocol (TCP) is used for signaling interaction, and the User Datagram Protocol (UDP) is used for streaming media transmission.

[0035] The client can establish a transport control connection with the first container instance through the container service component of the business access service in the cloud container cluster associated with the first container instance. The transport control connection may include but is not limited to WebSocket and HTTP connections.

[0036] The first container instance is used for service access services and is a container instance of a stateless workload. Specifically, the stateless workload component associated with the first container instance can maintain at least one container instance. Upon receiving information or instructions sent by a client over a TCP connection, the first container instance is determined as a container instance among the at least one container instance through load balancing.

[0037] This embodiment uses stateless workloads to maintain multiple container instances instead of a single container instance, which can simplify operation and maintenance.

[0038] S120. Determine the first socket information of the first container instance, establish a mapping relationship between the first socket information, the second socket information of the first computing node of the cloud container cluster associated with the first container instance, and the third socket information of the public network corresponding to the second socket information, and write the mapping relationship into the forwarding table.

[0039] The first socket information of the first container instance includes Internet address information of the first container instance and port information for listening to UDP data packets.

[0040] An idle first computing node is determined among idle computing nodes in the cloud container cluster associated with the first container instance, and second socket information of the first computing node is determined, where the second socket information includes internet address information and port information of the first computing node. Third socket information of the public network corresponding to the second socket information is determined based on a preset mapping relationship between public network sockets and node sockets.

[0041] A mapping relationship between the first socket information, the second socket information, and the third socket information is established, and the mapping relationship is written into the forwarding table in the form of a forwarding record. In this embodiment, a forwarding service based on a forwarding table is used to isolate the original business access service in a proxy manner. The forwarding service uses the forwarding table to dynamically maintain forwarding rules and determine the first socket information of the first container instance for directed forwarding. The forwarding service's forwarding table can be stored in a unified location, such as a preset database, including but not limited to a Redis database, Memcached, and Aerospike database.

[0042] S130: Send the third socket information to the client, so that the client sends a User Datagram Protocol data packet to the public network address corresponding to the third socket information.

[0043] The first container instance transmits the third socket information through the container service component of the service access service to the client, causing the client to send a User Datagram Protocol data packet to the public network address corresponding to the third socket information. After the client sends the UDP data packet to the public network address corresponding to the third socket information, the public network forwards the data packet to the compute node corresponding to the second socket information corresponding to the third socket information via a load balancer or other device. The container service component responsible for forwarding services in the cloud container cluster then performs further processing.

[0044] S140: Forward the User Datagram Protocol data packet sent by the client to the first container instance through the second container instance according to the mapping relationship in the forwarding table.

[0045] The second container instance is used for the forwarding service and is a container instance for a stateless workload. A UDP packet is sent, via the container service component for the forwarding service, to a container instance in at least one forwarding service container instance for the stateless workload of the forwarding service. This container instance is the second container instance.

[0046] For example, the forwarding table is shown in Table 1.

[0047] Table 1

[0048] Public IP Public network port Node IP Node Port Target IP Destination Port 10.xxx.xxx.1 30110 82.xxx.xxx.1 30110 172.xxx.xxx.1 40039 10.xxx.xxx.2 30111 82.xxx.xxx.2 30111 172.xxx.xxx.2 40053 ... ... ... ... ... ...

[0049] The second container instance used for forwarding service can query the mapping relationship record in the forwarding table based on the source IP and port of the UDP data packet. A row of data in the forwarding table represents a mapping relationship record, and determines the socket information of the target container instance corresponding to the node IP and node port of the first computing node with the same source IP and port in the mapping relationship, that is, the IP and port of the first container instance of the business access service. The second container instance forwards the UDP data packet to the first container instance.

[0050] The technical solution of this embodiment is to determine a first container instance that establishes a transmission control connection with a client, wherein the first container instance is used for business access services; determine the first socket information of the first container instance, and establish a mapping relationship between the first socket information, the second socket information of the first computing node of the cloud container cluster associated with the first container instance, and the third socket information of the public network corresponding to the second socket information, and write the mapping relationship into a forwarding table; send the third socket information to the client so that the client sends a user datagram protocol data packet to the public network address corresponding to the third socket information; forward the user datagram protocol data packet sent by the client to the first container instance according to the mapping relationship in the forwarding table by the second container instance, wherein the second container instance is used for forwarding services; wherein the first container instance and the second container instance are container instances of stateless workloads. The technical solution of the embodiment of the present invention solves the current problem of cloud container session persistence. By mapping the socket of the cloud container cluster to the socket of the first container instance, the container instance used for forwarding can uniformly forward the client's UDP data packet to the first container instance according to the socket mapping relationship, so as to achieve multi-protocol session co-preservation.

[0051] Figure 2 This is a flowchart of a session persistence method provided in an embodiment of the present invention. This embodiment, which shares the same inventive concept as the session persistence method described in the previous embodiment, further describes the process of sending data packets. This method can be performed by a session persistence device, which can be implemented in software and / or hardware and integrated into a computer device with application development capabilities.

[0052] like Figure 2 As shown, the session maintenance method of this embodiment includes the following steps:

[0053] S210: Determine a first container instance for establishing a transmission control connection with the client.

[0054] S220. Determine the first socket information of the first container instance, establish a mapping relationship between the first socket information, the second socket information of the first computing node of the cloud container cluster associated with the first container instance, and the third socket information of the public network corresponding to the second socket information, and write the mapping relationship into the forwarding table.

[0055] The first computing node can be determined from idle computing nodes. In an optional embodiment, the process of determining the first computing node of the cloud container cluster associated with the first container instance can be to determine at least one idle second computing node in the cloud container cluster associated with the first container instance; and determine a second computing node as the first computing node from the at least one second computing node.

[0056] Specifically, based on the idle status of each compute node in the cloud container cluster, the compute node's socket information can be written to an idle resource pool. The nodes in the idle resource pool serve as the second compute nodes, and a compute node is randomly selected from the second compute nodes as the first compute node. Subsequently, the second socket information of the first compute node is dynamically bound to the first socket information of the first container instance to generate a mapping relationship representing the forwarding rule.

[0057] S230: Send the third socket information to the client, so that the client sends a User Datagram Protocol data packet to the public network address corresponding to the third socket information.

[0058] S240. Expose the port range of the User Datagram Protocol to the outside of the cloud container cluster through the first container service component, so that the client sends a User Datagram Protocol data packet to the first container service component through the port range.

[0059] like Figure 3 As shown, the container service component of the forwarding service is the first container service component, which exposes the service interface outside the cloud container cluster. The method of exposing the internal services of the cluster to the outside of the cluster is used, such as the "node port method" to expose the used UDP network protocol port range segment, so that the client outside the cloud container cluster can access any node of the cloud container cluster through the port segment, send UDP data packets to the first container service component through the port range segment, and access the stateless workload of the forwarding service in the UDP protocol manner. At the same time, the container service component of the forwarding service uses the Cluster method to expose the used HTTP port, so that other stateless workload components in the cloud container cluster can access the stateless workload of the forwarding service through the internal domain name.

[0060] S250: Forward the User Datagram Protocol data packet to the second container instance through load balancing via the first container service component.

[0061] The first container service component forwards the User Datagram Protocol data packet to the second container instance through the load balancing strategy of the container service, such as the polling strategy, the least connection strategy and the weighted polling strategy.

[0062] S260: Forward the User Datagram Protocol data packet sent by the client to the first container instance through the second container instance according to the mapping relationship in the forwarding table.

[0063] As the transmission control connection between the client and the cloud container cluster is started and disconnected, the mapping records in the forwarding table are added and deleted accordingly.

[0064] In an optional embodiment, when the transport control connection between the client and the first container instance is disconnected, the mapping relationship containing the first socket address information of the first container instance in the forwarding table is deleted. After the mapping relationship is deleted, the first socket information is unbound from the second socket information, thereby immediately releasing the UDP port of the first container after a transaction is completed, dynamically allocating it, and preventing port idleness.

[0065] The technical solution of this embodiment is as follows: determining a first container instance that establishes a transmission control connection with a client; determining first socket information of the first container instance, and establishing a mapping relationship between the first socket information, second socket information of the first computing node of the cloud container cluster associated with the first container instance, and third socket information of the public network corresponding to the second socket information, and writing the mapping relationship into a forwarding table; sending the third socket information to the client, so that the client sends a user datagram protocol data packet to the public network address corresponding to the third socket information; exposing the port range segment of the user datagram network protocol to the outside of the cloud container cluster through the first container service component, so that the client sends the user datagram protocol data packet to the first container service component through the port range segment; forwarding the user datagram protocol data packet to the second container instance through load balancing by the first container service component; and forwarding the user datagram protocol data packet sent by the client to the first container instance through the second container instance according to the mapping relationship in the forwarding table. The technical solution of the embodiment of the present invention solves the current problem of being unable to achieve cloud container session persistence. By mapping the socket of the cloud container cluster to the socket of the first container instance, the client's UDP data packet is uniformly forwarded to the first container instance according to the socket mapping relationship through the container instance used for forwarding, so as to achieve the common maintenance of multi-protocol sessions. By introducing a set of forwarding services and their supporting stateless workloads and container service components, the network part and the business access service are isolated from the outside world to a certain extent. Since the forwarding service itself does not require session persistence, a stateless workload component can be used to maintain the second container instances of multiple forwarding services, which will not affect the expansion and contraction of the container environment and greatly reduces the operation and maintenance costs.

[0066] Figure 4This is a flowchart of a session persistence method provided in an embodiment of the present invention. This embodiment, which shares the same inventive concept as the session persistence method described in the previous embodiment, further describes the process of establishing a transmission control connection. This method can be performed by a session persistence device, which can be implemented in software and / or hardware and integrated into a computer device with application development capabilities.

[0067] like Figure 4 As shown, the session maintenance method of this embodiment includes the following steps:

[0068] S310. Expose the transmission control protocol to the outside of the cloud container cluster through the gateway entry component, so that the client sends request information for establishing a transmission control connection to the gateway entry component.

[0069] like Figure 3 As shown, the business access service is a business server deployed in a non-containerized manner. It uses the cloud container's gateway entry component to expose HTTP and WebSocket protocols outside the cluster, allowing access via specific ports using HTTP or WebSocket protocols. The gateway entry component must be used in conjunction with the container service component. Clients access the business access service using HTTP or WebSocket protocols, sending a request to establish a transport control connection to the cloud container cluster's gateway entry component, namely the business access service gateway entry.

[0070] S320: Forward the request information to the second container service component through the gateway entry component.

[0071] The gateway entry component, namely the service access service gateway entry, forwards the request information for establishing a transmission control connection to the container service component of the service access service, namely the second container service component.

[0072] S330. Send the request information to the stateless workload component for the business access service through the second container service component, and determine the first container instance in at least one third container instance for the business access service through the stateless workload component for the business access service, so that the client establishes a transmission control connection with the first container instance.

[0073] The request message can be the first step in the three-way handshake process. The second container service component sends the request message to the stateless workload component for the service access service. The stateless workload component forwards the request message to one of at least one third container instance for the service access service, namely, the first container instance, through load balancing. The client and the first container instance establish a transport control connection after completing all handshake message exchanges during the handshake process, forwarded by the gateway entry component and the container service component for the service access service.

[0074] In an optional embodiment, determining the first container instance in at least one third container instance for the business access service through a stateless workload component for the business access service may be performed by determining a container instance as the first container instance in at least one third container instance for the business access service based on a cloud container polling load balancing method through a stateless workload component for the business access service.

[0075] Cloud container polling load balancing distributes client requests to backend container instances in a sequential and circular manner, ensuring that each instance handles a relatively balanced number of requests.

[0076] S340: Determine a first container instance for establishing a transmission control connection with the client.

[0077] The first container instance is used for business access services, and the first container instance is a container instance for a stateless workload.

[0078] S350. Determine the first socket information of the first container instance, establish a mapping relationship between the first socket information, the second socket information of the first computing node of the cloud container cluster associated with the first container instance, and the third socket information of the public network corresponding to the second socket information, and write the mapping relationship into the forwarding table.

[0079] S360: Send the third socket information to the client, so that the client sends the User Datagram Protocol data packet to the public network address corresponding to the third socket information.

[0080] S370: Forward the User Datagram Protocol data packet sent by the client to the first container instance through the second container instance according to the mapping relationship in the forwarding table.

[0081] The second container instance is used for forwarding services, and the second container instance is a container instance for a stateless workload.

[0082] The technical solution of this embodiment is to expose the transmission control protocol outside the cloud container cluster through the gateway entry component, so that the client sends a request message for establishing a transmission control connection to the gateway entry component; forwards the request message to the second container service component through the gateway entry component; sends the request message to the stateless workload component for business access service through the second container service component, and determines the first container instance in at least one third container instance for business access service through the stateless workload component for business access service, so that the client establishes a transmission control connection with the first container instance; determines the first container instance for establishing a transmission control connection with the client; the first container instance is used for business access service, and the first container instance is stateless A container instance for a stateful workload; determining the first socket information of the first container instance, and establishing a mapping relationship between the first socket information, the second socket information of the first computing node of the cloud container cluster associated with the first container instance, and the third socket information of the public network corresponding to the second socket information, and writing the mapping relationship into a forwarding table; sending the third socket information to the client so that the client sends a user datagram protocol data packet to the public network address corresponding to the third socket information; forwarding the user datagram protocol data packet sent by the client to the first container instance through the second container instance according to the mapping relationship in the forwarding table; wherein the second container instance is used for forwarding service, and the second container instance is a container instance for stateless workload. The technical solution of the embodiment of the present invention solves the problem that cloud container session persistence cannot be achieved at present. By mapping the socket of the cloud container cluster to the socket of the first container instance, the container instance used for forwarding forwards the client's UDP data packet to the first container instance according to the socket mapping relationship, so as to achieve the common maintenance of multi-protocol sessions, and through the cooperation of the gateway entry component and the container instance component, the business access service is isolated from the outside of the cluster.

[0083] Figure 5 This is a schematic diagram of the structure of a session persistence device provided by an embodiment of the present invention. This embodiment is applicable to session persistence scenarios in a cloud container environment. The session persistence device can be implemented in software and / or hardware and integrated into a computer terminal device with application development capabilities.

[0084] like Figure 5 As shown, the session maintaining device includes: a container instance determining module 410 , a mapping relationship determining module 420 , a socket information sending module 430 and a data packet forwarding module 440 .

[0085] Among them, the container instance determination module 410 is used to determine the first container instance for establishing a transmission control connection with the client, wherein the first container instance is used for business access service; the mapping relationship determination module 420 is used to determine the first socket information of the first container instance, and establish a mapping relationship between the first socket information, the second socket information of the first computing node of the cloud container cluster associated with the first container instance, and the third socket information of the public network corresponding to the second socket information, and write the mapping relationship into the forwarding table; the socket information sending module 430 is used to send the third socket information to the client, so that the client sends the user datagram protocol data packet to the public network address corresponding to the third socket information; the data packet forwarding module 440 is used to forward the user datagram protocol data packet sent by the client to the first container instance through the second container instance according to the mapping relationship in the forwarding table, wherein the second container instance is used for forwarding service; wherein the first container instance and the second container instance are container instances of stateless workloads.

[0086] The technical solution of this embodiment is to determine a first container instance that establishes a transmission control connection with a client, wherein the first container instance is used for business access services; determine the first socket information of the first container instance, and establish a mapping relationship between the first socket information, the second socket information of the first computing node of the cloud container cluster associated with the first container instance, and the third socket information of the public network corresponding to the second socket information, and write the mapping relationship into a forwarding table; send the third socket information to the client so that the client sends a user datagram protocol data packet to the public network address corresponding to the third socket information; forward the user datagram protocol data packet sent by the client to the first container instance according to the mapping relationship in the forwarding table by the second container instance, wherein the second container instance is used for forwarding services; wherein the first container instance and the second container instance are container instances of stateless workloads. The technical solution of the embodiment of the present invention solves the current problem of cloud container session persistence. By mapping the socket of the cloud container cluster to the socket of the first container instance, the container instance used for forwarding can uniformly forward the client's UDP data packet to the first container instance according to the socket mapping relationship, so as to achieve multi-protocol session co-preservation.

[0087] In an optional implementation, the mapping relationship determination module 420 is further configured to:

[0088] Determine at least one idle second computing node in the cloud container cluster associated with the first container instance; and determine a second computing node among the at least one second computing node as the first computing node.

[0089] In an optional embodiment, the device further comprises:

[0090] The data packet sending module is used to expose the port range segment of the user datagram network protocol to the outside of the cloud container cluster through the first container service component, so that the client can send the user datagram protocol data packet to the first container service component through the port range segment; and forward the user datagram protocol data packet to the second container instance through the first container service component through load balancing.

[0091] In an optional embodiment, the device further comprises:

[0092] A transmission control connection establishment module is used to expose the transmission control protocol outside the cloud container cluster through a gateway entry component, so that the client sends a request message for establishing a transmission control connection to the gateway entry component; forwards the request message to the second container service component through the gateway entry component; sends the request message to the stateless workload component for business access service through the second container service component, and determines the first container instance in at least one third container instance for business access service through the stateless workload component for business access service, so that the client establishes a transmission control connection with the first container instance.

[0093] In an optional embodiment, the transmission control connection establishment module is further used to determine a container instance as the first container instance in at least one third container instance for the service access service based on a cloud container polling load balancing method through a stateless workload component for the service access service.

[0094] In an optional embodiment, the device further comprises:

[0095] The mapping relationship deletion module is configured to delete the mapping relationship including the first socket address information of the first container instance in the forwarding table when the transmission control connection between the client and the first container instance is disconnected.

[0096] The session maintaining device provided by the embodiment of the present invention can execute the session maintaining method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0097] Figure 6 A schematic structural diagram of a computer device provided in an embodiment of the present invention. Figure 6 A block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 6 The computer device 12 shown is only an example and should not limit the functionality and scope of use of the embodiments of the present invention. The computer device 12 can be any terminal device with computing capabilities, such as an intelligent controller, a server, a mobile phone, or other terminal devices.

[0098] like Figure 6As shown, computer device 12 is implemented as a general-purpose computing device. Components of computer device 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 that connects various system components (including system memory 28 and processing unit 16).

[0099] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0100] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0101] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be configured to read and write non-removable, non-volatile magnetic media ( Figure 6 Not shown, often called a "hard drive"). Although Figure 6 Not shown, a magnetic disk drive for reading and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present invention.

[0102] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0103] The computer device 12 may also communicate with one or more external devices 14 (e.g., a keyboard, a pointing device, a display 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with the other modules of the computer device 12 via the bus 18. It should be understood that although Figure 6 Not shown, other hardware and / or software modules may be used in conjunction with the computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RFID systems, tape drives, and data backup storage systems.

[0104] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the session maintenance method provided in the embodiment of the present invention, which includes:

[0105] Determine a first container instance for establishing a transmission control connection with the client, wherein the first container instance is used for a business access service;

[0106] Determine the first socket information of the first container instance, establish a mapping relationship between the first socket information, the second socket information of the first computing node of the cloud container cluster associated with the first container instance, and the third socket information of the public network corresponding to the second socket information, and write the mapping relationship into the forwarding table;

[0107] Sending the third socket information to the client, so that the client sends a User Datagram Protocol data packet to the public network address corresponding to the third socket information;

[0108] Forwarding the User Datagram Protocol data packet sent by the client to the first container instance through the second container instance according to the mapping relationship in the forwarding table, wherein the second container instance is used for forwarding service;

[0109] The first container instance and the second container instance are container instances of stateless workloads.

[0110] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the session persistence method provided in any embodiment of the present invention is implemented. The method includes:

[0111] Determine a first container instance for establishing a transmission control connection with the client, wherein the first container instance is used for a business access service;

[0112] Determine the first socket information of the first container instance, establish a mapping relationship between the first socket information, the second socket information of the first computing node of the cloud container cluster associated with the first container instance, and the third socket information of the public network corresponding to the second socket information, and write the mapping relationship into the forwarding table;

[0113] Sending the third socket information to the client, so that the client sends a User Datagram Protocol data packet to the public network address corresponding to the third socket information;

[0114] Forwarding the User Datagram Protocol data packet sent by the client to the first container instance through the second container instance according to the mapping relationship in the forwarding table, wherein the second container instance is used for forwarding service;

[0115] The first container instance and the second container instance are container instances of stateless workloads.

[0116] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.

[0117] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0118] Program code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0119] The computer program code for performing the operations of the present invention can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, Python, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0120] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the session maintenance method provided in any embodiment of the present application.

[0121] The computer program product, during implementation, may be written in one or more programming languages, or a combination thereof, for performing the operations of the present invention. The programming languages include object-oriented programming languages such as Java, Smalltalk, Python, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0122] Those skilled in the art will appreciate that the modules or steps of the present invention described above can be implemented using a general-purpose computing device. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computer device, which can then be stored in a storage device and executed by the computing device. Alternatively, they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.

[0123] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.

Claims

1. A session maintenance method, characterized in that: include: Determine a first container instance for establishing a transmission control connection with a client, wherein the first container instance is used for a service access service; Determine the first socket information of the first container instance, establish a mapping relationship between the first socket information, the second socket information of the first computing node of the cloud container cluster associated with the first container instance, and the third socket information of the public network corresponding to the second socket information, and write the mapping relationship into the forwarding table; Sending the third socket information to the client, so that the client sends a User Datagram Protocol data packet to the public network address corresponding to the third socket information; forwarding the user datagram protocol data packet sent by the client to the first container instance according to the mapping relationship in the forwarding table through the second container instance, wherein the second container instance is used for forwarding service; The first container instance and the second container instance are container instances of stateless workloads.

2. The method according to claim 1, characterized in that The process of determining the first computing node of the cloud container cluster associated with the first container instance includes: Determine at least one idle second computing node in the cloud container cluster associated with the first container instance; One of the at least one second computing nodes is determined as a first computing node.

3. The method according to claim 1, characterized in that Before forwarding the user datagram protocol data packet sent by the client to the first container instance according to the mapping relationship in the forwarding table through the second container instance, the method further includes: Exposing a port range of the User Datagram Protocol (UDP) outside the cloud container cluster through the first container service component, so that the client sends the User Datagram Protocol data packet to the first container service component through the port range; The first container service component forwards the user datagram protocol data packet to the second container instance through load balancing.

4. The method according to claim 1, wherein Before determining the first container instance to establish a transmission control connection with the client, the method further includes: Exposing the transmission control protocol to the outside of the cloud container cluster through a gateway entry component, so that the client sends a request message for establishing a transmission control connection to the gateway entry component; Forwarding the request information to the second container service component through the gateway entry component; The request information is sent to a stateless workload component for a business access service through the second container service component, and the first container instance is determined in at least one third container instance for the business access service through the stateless workload component for the business access service, so that the client establishes a transmission control connection with the first container instance.

5. The method according to claim 4, characterized in that The determining, by the stateless workload component for the service access service, the first container instance in at least one third container instance for the service access service includes: A container instance is determined as the first container instance in at least one of the third container instances for the service access service through the stateless workload component for the service access service based on a cloud container polling load balancing method.

6. The method according to any one of claims 1 to 5, characterized in that: Also includes: When the transmission control connection between the client and the first container instance is disconnected, the mapping relationship including the first socket address information of the first container instance in the forwarding table is deleted.

7. A session maintaining device, characterized in that: include: a container instance determining module, configured to determine a first container instance for establishing a transmission control connection with a client, wherein the first container instance is used for a service access service; a mapping relationship determination module, configured to determine first socket information of the first container instance, establish a mapping relationship between the first socket information, second socket information of the first computing node of the cloud container cluster associated with the first container instance, and third socket information of the public network corresponding to the second socket information, and write the mapping relationship into a forwarding table; a socket information sending module, configured to send the third socket information to the client, so that the client sends a User Datagram Protocol data packet to a public network address corresponding to the third socket information; a data packet forwarding module, configured to forward the user datagram protocol data packet sent by the client to the first container instance through a second container instance according to the mapping relationship in the forwarding table, wherein the second container instance is used for forwarding service; The first container instance and the second container instance are container instances of stateless workloads.

8. A computer device, characterized in that: The computer device comprises: one or more processors; a memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the session persistence method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the session maintaining method according to any one of claims 1 to 6 is implemented.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the session maintaining method according to any one of claims 1 to 6.

Citation Information

Cited By

  • Distributed service management method and system

    CN120785883A