Network connection live-migration method and corresponding apparatus

By creating and replacing sockets during application migration, the network connection interruption problem when the application is migrated from the IPv4 network to the IPv6 network is solved, and the application is stable and efficient.

WO2025044080A1PCT designated stage expired Publication Date: 2025-03-06HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/077921
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-28
Filing Date
2024-02-21
Publication Date
2025-03-06

AI Technical Summary

Technical Problem

When an application migrates from an IPv4 network to an IPv6 network, the network connection is interrupted, causing the application to be unable to connect to the locations it ran before the migration, reducing the operation efficiency of the application.

Method used

By obtaining the configuration information of the target application, a second socket is created for connecting to the second server in the IPv6 network and replacing the first socket with the second socket, so that the target application points to the second socket with a file descriptor, thereby keeping the application's network connection stable.

Benefits of technology

It realizes that when the application's network connection is hotly migrated, keeping the application connected to the location where it was run before the migration continues to run, improving the application's operation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024077921_06032025_PF_FP_ABST
    Figure CN2024077921_06032025_PF_FP_ABST
Patent Text Reader

Abstract

A network connection live-migration method, which is applied to a client. A target application is run on the client, and the target application calls a first socket by means of a file descriptor, so as to make the client be connected to a first serving end in a first network. The client is to be migrated to a second network, and there is a second serving end in the second network that is used for receiving an access request of the target application. The method comprises: acquiring configuration information of a target application, wherein the configuration information comprises access information of a client in a second network, and access information of a second server in the second network; creating a second socket on the basis of the configuration information, wherein the second socket is used for the client to connect to the second serving end in the second network; and replacing a first socket with the second socket, so as to make the target application use a file descriptor to point to the second socket, wherein the file descriptor is used for calling the second socket to access the second serving end when the client runs the target application in the second network.
Need to check novelty before this filing date? Find Prior Art

Description

A method and corresponding device for network connection hot migration

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on August 31, 2023, with application number 202311117582.7 and invention name “A method for application migration and corresponding device”, the entire contents of which are incorporated by reference into this application.

[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on December 28, 2023, with application number 202311840896.X and invention name “A method and corresponding device for hot migration of network connections”, the entire contents of which are incorporated by reference into this application. Technical Field

[0003] The present application relates to the field of communication technology, and in particular to a method and corresponding device for hot migration of a network connection. Background Art

[0004] With the development of the Internet Protocol (IP), IPv4 addresses have become depleted. Cloud vendors are now promoting IPv6. However, because IPv4 has been around for decades, most applications and networks have not considered IPv6 and only support IPv4.

[0005] For the current IPv4 network, you can enable IPv4 / IPv6 dual stack by replacing switches and routers, gradually making network connections capable of supporting IPv6. This will also allow applications running on the IPv4 network to migrate from the IPv4 network to the IPv6 network.

[0006] Since there are no IPv4 addresses or routes in the IPv6 network, when an application is migrated from an IPv4 network to an IPv6 network, the network connection will be interrupted. The client running the application needs to establish a new network connection with the corresponding server in the IPv6 network before the application can be restarted and run again. It cannot continue to run at the location where it was running before the network connection hot migration, which reduces the application's operating efficiency.

[0007] Summary of the Invention

[0008] This application provides a method for hot migration of network connections, which is used to maintain the connection to the location where the application was running before the migration when the application's network connection is hot migrated, thereby improving the application's operating efficiency. This application also provides corresponding devices, systems, computer-readable storage media, and computer program products.

[0009] The first aspect of the present application provides a method for hot migration of a network connection, which is applied to a client, wherein a target application is running on the client, and the target application calls a first socket through a file descriptor so that the client is connected to a first server in a first network, wherein the client is to be migrated to a second network, and there is a second server in the second network for receiving access requests from the target application; the method includes: obtaining configuration information of the target application; wherein the configuration information includes access information of the client in the second network, and access information of the second server in the second network; creating a second socket according to the configuration information, the second socket is used for the client to connect to the second server in the second network, and the second server is the first server migrated from the first network to the second network; replacing the first socket with the second socket so that the target application uses the file descriptor to point to the second socket; wherein the file descriptor is used for the client to call the second socket to access the second server when running the target application in the second network.

[0010] In the present application, the first network and the second network can be the same network, or different networks. When the first network and the second network are different, for example, the first network can be an internet protocol version 4 (internet protocol version 4, IPv4) network, and the second network can be an internet protocol version 6 (internet protocol version 6, IPv6) network. The network migration can be to migrate from an IPv4 network to an IPv6 network, or to migrate inside an IPv4 network, or inside an IPv6 network, of course, it can also be to migrate inside other networks, or to migrate from an IPv4 network / IPv6 network to other networks, or to migrate from other networks to an IPv4 network / IPv6 network. In the present application, migration inside the same network refers to changing the IP address and port number of the connection in the same network.

[0011] In this first aspect, network connection hot migration refers to the hot migration of the client's network connection, which is to migrate a connected client from the first server of the first network to the second server of the second network, or from the first server of the first network to the second server of the first network. In other words, the client is hot migrated from the connection with the first server. After the hot migration is completed, the client is connected to the second server. The second server can be the first server that is migrated from the first network to the second network. The device itself has not changed, only the access information connected to the client has changed. Of course, the second server can also be another server running the target application, no longer the original first server.

[0012] In this application, the client and the server (the first server and / or the second server) can be deployed on the cloud, and the client and the server can be virtual machines (VMs), containers or hosts.

[0013] In this application, a file descriptor (fd) can be a handle represented by an unsigned integer, and a process uses it to identify an open file. A file descriptor is associated with a file object that includes relevant information, wherein the relevant information can be the open mode of the file, the location type of the file, the initial type of the file, etc., which are also referred to as the context of the file. A file descriptor can be understood as an index that can point to the socket used for communication.

[0014] In this application, a socket is a basic operating unit of network communication that supports the Transmission Control Protocol / Internet Protocol (TCP / IP) and can be used for two-way communication between processes on different hosts.

[0015] In the first aspect, a connection is established between the client and the second server through a second socket, and then the first socket is replaced by the second socket, so that the target application uses a file descriptor to point to the second socket. Because the file descriptor of the target application does not change after the hot migration of the network connection, the target application can continue to run in the migrated network using the file descriptor after the hot migration of the network connection. If the second server is the first server that has been migrated to the second network, the business of the target application can continue to run at the location before the migration without having to start from the beginning, thereby reducing the risk of the business corresponding to the target application being interrupted due to the hot migration of the network connection and improving the operating efficiency of the application.

[0016] In one possible implementation, the above step of: replacing the first socket with the second socket so that the target application uses the file descriptor to point to the second socket, includes: replacing the first socket with the second socket to update the correspondence between the file descriptor and the first socket to the correspondence between the file descriptor and the second socket, so that the target application uses the file descriptor to point to the second socket.

[0017] In this possible implementation, the fd and socket are mapped. If the first socket is replaced with the second socket, the mapping between the target application's fd and the first socket will be updated to the mapping between the target application's fd and the second socket. This allows the client to accurately access the second server when running the target application after hot migration.

[0018] In one possible implementation, the configuration information further includes application information of the target application, and the method further includes:

[0019] The target application is determined according to the application information of the target application.

[0020] In this possible implementation, the application information of the target application may be an identifier of the target application. Sending the application information of the target application in the configuration information can improve the accuracy of the hot migration.

[0021] In one possible implementation, when the client's access information on the second network contains multiple address information, the configuration information also includes existing connection information between the client and the first server on the first network; the method also includes: determining the address information of the client on the second network based on the address information of the client in the existing connection information.

[0022] In this possible implementation, the address information may include an Internet Protocol (IP) address and a port number. A difference in either the IP address or the port number indicates a different address information. If the access information for the client in the configuration information includes multiple address information, the client needs to use existing connections to determine the address information suitable for migration. For example, the address information with the same port number as the existing connection is selected as the address information of the client on the second network. This improves the efficiency of hot migration.

[0023] In one possible implementation, when the access information of the second server in the second network contains multiple address information, the configuration information also includes the existing connection information between the client and the first server in the first network; the method also includes: determining the address information of the second server in the second network based on the address information of the first server in the existing connection information.

[0024] In this possible implementation, the address information of the second server in the second network is determined by the address information of the first server in the existing connection, thereby improving the efficiency of hot migration.

[0025] In one possible implementation, the access information of the client on the second network includes the Internet Protocol IP address and port number of the client on the second network; the above step: creating a second socket according to the configuration information includes: creating a second socket; binding the second socket and the IP address and port number of the client on the second network.

[0026] In one possible design, the creation of the second socket and the binding process can be implemented by the migration thread.

[0027] In this application, the migration thread (socket migrate thread) can enter and exit the kernel of the client, so that the second socket creation and subsequent other contents related to the second socket can be completed in the kernel state.

[0028] In this possible implementation, after creating the second socket, the second socket is bound to the IP address and port number of the client in the second network, as well as the IP address and port number of the first server in the second network. This can migrate the client to the second network and increase the speed at which subsequent clients access the second server.

[0029] In one possible implementation, after creating the second socket according to the configuration information, the method further includes:

[0030] Using the second socket, the first server is connected to the second server according to the access information of the first server in the second network.

[0031] In this possible implementation, the migration thread may establish a connection between the client and the second server through the second socket, thereby improving the efficiency of hot migration of the network connection.

[0032] In one possible implementation, the above step of replacing the first socket with the second socket includes: determining the file descriptor of the target application based on the access information of the client in the first network and the access information of the first server in the first network; and replacing the first socket pointed to by the file descriptor with the second socket.

[0033] In this possible implementation, the file descriptor of the current target application communication can be determined using the client's access information in the first network and the first server's access information in the first network. Thus, the corresponding first socket can be found, and then the socket replacement can be completed. By searching for the first socket by file descriptor, the first socket can be found quickly and accurately.

[0034] In a possible implementation, after replacing the first socket with the second socket, the method further includes: releasing the first socket. Optionally, the first socket may be released by exiting the migration thread.

[0035] In this possible implementation, the migration thread can exit after completing the hot migration of the network connection, thereby releasing the first socket and the resources used by the migration thread, thereby improving resource utilization.

[0036] In a possible implementation, after obtaining the configuration information of the target application, the method further includes: pausing the target application; after replacing the first socket with the second socket, the method further includes: restoring the target application to a running state.

[0037] In this possible implementation, the "pause" time is very short and can be understood as the black hole time of hot migration. This pause does not cause business interruption. On the contrary, this short pause prevents the generation of new messages during hot migration of network connections, thus avoiding data discontinuity caused by connection migration.

[0038] In a possible implementation, before obtaining configuration information of the target application of the network connection to be migrated, the method further includes: loading a migration module; after restoring the target application to a running state through the migration module, the method further includes: unloading the migration module.

[0039] In this possible implementation, the migration module can be used to start a migration thread for accessing the client kernel. When the network connection needs to be migrated, the migration module is loaded. After the migration is completed, the migration module is unloaded, which can improve the resource utilization of the client.

[0040] A second aspect of the present application provides a method for hot migration of a network connection, which is applied to a server, where a target application is running on the server, and the target application calls a first socket through a file descriptor to connect the server to a first client in a first network, wherein the server is to be migrated to a second network, and there is a second client in the second network for sending an access request to the target application; the method includes: obtaining configuration information of the target application; wherein the configuration information includes access information of the server in the second network, and access information of the second client in the second network; creating a second socket according to the configuration information, the second socket being used for the server to connect to the second client in the second network, the second client being the first client migrated from the first network to the second network; replacing the first socket with the second socket so that the target application uses a file descriptor to point to the second socket; wherein the file descriptor is used for the server to call the second socket to communicate with the second client when running the target application in the second network.

[0041] Optionally, the second client may be the first client migrated from the first network. Of course, the second client may also be another client running the target application.

[0042] In this second aspect, hot migration of a network connection refers to hot migration of a server's network connection, which is migrating a connected server from a first client on a first network to a second client on a second network, or vice versa. In other words, the server migrates from being connected to the first client, and after the migration, the server connects to the second client. The first client and the second client on the same network can be two different devices, or they can be the same device but with different IP addresses and port numbers.

[0043] In the second aspect, a connection is established between the server and the second client via a second socket, and then the first socket is replaced with the second socket so that the file descriptor of the target application points to the second socket. Because the file descriptor of the target application does not change after the hot migration of the network connection, the target application can be continued to run in the migrated network using the file descriptor after the hot migration of the network connection. When the second client is the first client migrated from the first network, the business of the target application can continue to run at the location before the migration without having to start from the beginning, thereby reducing the risk of the business corresponding to the target application being interrupted due to the hot migration of the network connection and improving the operating efficiency of the application.

[0044] In one possible implementation, the above step of: replacing the first socket with the second socket so that the target application uses the file descriptor to point to the second socket, includes: replacing the first socket with the second socket to update the correspondence between the file descriptor and the first socket to the correspondence between the file descriptor and the second socket, so that the target application uses the file descriptor to point to the second socket.

[0045] In this possible implementation, the fd and socket are mapped. If the first socket is replaced with the second socket, the mapping between the target application's fd and the first socket will be updated to the mapping between the target application's fd and the second socket. This allows the target application to communicate accurately with the second client when running on the server after hot migration.

[0046] In one possible implementation, the configuration information further includes application information of the target application, and the method further includes:

[0047] The target application is determined according to the application information of the target application.

[0048] In this possible implementation, the application information of the target application may be an identifier of the target application. Sending the application information of the target application in the configuration information can improve the accuracy of the hot migration.

[0049] In one possible implementation, when the server's access information in the second network contains multiple address information, the configuration information also includes existing connection information between the server and the first client in the first network; the method also includes: determining the address information of the server in the second network based on the address information of the server in the existing connection information.

[0050] In this possible implementation, the address information of the server in the second network is determined by the address information of the server in the existing connection, thereby improving the efficiency of hot migration.

[0051] In one possible implementation, when the access information of the second client in the second network contains multiple address information, the configuration information also includes the existing connection information between the server and the first client in the first network; the method also includes: determining the address information of the second client in the second network based on the address information of the first client in the existing connection information.

[0052] In this possible implementation, the address information of the second client in the second network is determined by the address information of the first client in the existing connection, thereby improving the efficiency of hot migration.

[0053] In one possible implementation, the access information of the server in the second network includes the Internet Protocol IP address and port number of the server in the second network; the above step: creating a second socket according to the configuration information includes: creating a second socket; binding the second socket to the IP address and port number of the server in the second network.

[0054] In this possible implementation, after creating the second socket, the second socket is bound to the IP address and port number of the server in the second network, and the IP address and port number of the first client in the second network are bound. This can migrate the server to the second network and also increase the speed of subsequent communication between the server and the second client.

[0055] In one possible implementation, the method further includes: creating a listening socket, the listening socket being used to listen to the port indicated by the IP address and port number of the server in the second network; and using a second socket to connect to a second client, the second client being the client that sends the target application access request intercepted by the listening socket.

[0056] In this possible implementation, the listening socket is used to obtain the second client requesting to establish a connection with the server by listening to the server's IP address and port number, thereby enabling the server to establish a connection with the second client and then establish a connection with the second client through the second socket. Alternatively, the listening socket may be replaced with the second socket to establish a connection between the second socket and the second client. In this way, the connection between the server and the second client can be quickly established.

[0057] In one possible implementation, the above step of replacing the first socket with the second socket includes: determining the IP address and port number of the first client in the first network based on the IP address and port number of the second client in the second network, and the IP address and port number of the server in the second network; determining the file descriptor of the target application based on the IP address and port number of the first client in the first network, and the IP address and port number of the server in the first network; and replacing the first socket pointed to by the file descriptor with the second socket.

[0058] In this possible implementation, the IP address and port number of the first client in the first network can be obtained through the correspondence between the IP address and port number of the server and the first client in the first network and the IP address and port number of the server and the second client in the second network. In this way, the file descriptor of the target application can be quickly determined based on the IP address and port number of the first client in the first network and the IP address and port number of the server in the first network, thereby improving the speed of hot migration of network connections.

[0059] In a possible implementation, after replacing the first socket with the second socket, the method further includes: releasing the first socket. Optionally, the first socket may be released by exiting the migration thread.

[0060] In this possible implementation, the migration thread can exit after completing the hot migration of the network connection, thereby releasing the first socket and the resources used by the migration thread, thereby improving resource utilization.

[0061] In a possible implementation, after obtaining the configuration information of the target application, the method further includes: pausing the target application; after replacing the first socket with the second socket, the method further includes: restoring the target application to a running state.

[0062] In this possible implementation, the "pause" time is very short and can be understood as the black hole time of hot migration. This pause does not cause business interruption. On the contrary, this short pause prevents the generation of new messages during hot migration of network connections, thus avoiding data discontinuity caused by connection migration.

[0063] In a possible implementation, before obtaining configuration information of the target application of the network connection to be migrated, the method further includes: loading a migration module; after restoring the target application to a running state through the migration module, the method further includes: unloading the migration module.

[0064] In this possible implementation, when the network connection needs to be migrated, the migration module is loaded, and after the migration is completed, the migration module is unloaded, which can improve the resource utilization of the client.

[0065] According to a third aspect of the present application, a client is provided. A target application is running on the client. The target application calls a first socket through a file descriptor to connect the client to a first server in a first network. The client is to be migrated to a second network. A second server for receiving access requests from the target application exists in the second network. The client includes:

[0066] An acquiring unit, configured to acquire configuration information of a target application; wherein the configuration information includes access information of the client on the second network and access information of the second server on the second network;

[0067] The first processing unit is configured to create a second socket according to the configuration information, where the second socket is used for the client to connect to the second server in the second network;

[0068] The second processing unit is used to replace the first socket with the second socket so that the target application uses a file descriptor to point to the second socket; wherein the file descriptor is used by the client to call the second socket to access the second server when running the target application on the second network.

[0069] In one possible implementation, the second processing unit is specifically used to replace the first socket with the second socket to update the correspondence between the file descriptor and the first socket to the correspondence between the file descriptor and the second socket, so that the target application uses the file descriptor to point to the second socket.

[0070] In a possible implementation manner, the acquiring unit is further configured to determine the target application according to the application information of the target application when the configuration information further includes application information of the target application.

[0071] In one possible implementation, the acquisition unit is also used to determine the address information of the client in the second network based on the address information of the client in the existing connection information when there are multiple address information in the access information of the client in the second network, and the configuration information also includes the existing connection information between the client and the first server in the first network.

[0072] In one possible implementation, the acquisition unit is also used to determine the address information of the second server in the second network based on the address information of the first server in the existing connection information when there are multiple address information in the access information of the second server in the second network, and the configuration information also includes the existing connection information between the client and the first server in the first network.

[0073] In one possible implementation, the first processing unit is specifically configured to create a second socket when the access information of the client in the second network includes the Internet Protocol IP address and port number of the client in the second network; and bind the second socket and the IP address and port number of the client in the second network.

[0074] In a possible implementation, the first processing unit is further configured to use the second socket to connect to the second server according to access information of the second server in the second network.

[0075] In one possible implementation, the second processing unit is specifically configured to determine a file descriptor of a target application based on access information of the client in the first network and access information of the first server in the first network; and replace the first socket pointed to by the file descriptor with the second socket.

[0076] In a possible implementation, the second processing unit is further configured to release the first socket.

[0077] In a possible implementation, the first processing unit is further configured to, after obtaining the configuration information of the target application, suspend the operation of the target application through the migration module;

[0078] The second processing unit is further configured to restore the target application to a running state after replacing the first socket with the second socket.

[0079] In a possible implementation, the first processing unit is further configured to load a migration module before obtaining configuration information of a target application of a network connection to be migrated;

[0080] The second processing unit is further configured to uninstall the migration module after the target application is restored to a running state through the migration module.

[0081] A fourth aspect of the present application provides a server, wherein a target application runs on the server, and the target application calls a first socket through a file descriptor to connect the server to a first client in a first network, wherein the server is to be migrated to a second network, and a second client for sending an access request to the target application exists in the second network, and the server includes:

[0082] An acquiring unit, configured to acquire configuration information of a target application; wherein the configuration information includes access information of the server on the second network and access information of the second client on the second network;

[0083] The first processing unit is configured to create a second socket according to the configuration information, wherein the second socket is used for the server to connect to the second client in the second network;

[0084] The second processing unit is used to replace the first socket with the second socket so that the target application uses a file descriptor to point to the second socket; wherein the file descriptor is used by the server to call the second socket to communicate with the second client when the target application runs on the second network.

[0085] In one possible implementation, the second processing unit is configured to replace the first socket with the second socket to update the correspondence between the file descriptor and the first socket to the correspondence between the file descriptor and the second socket, so that the target application uses the file descriptor to point to the second socket.

[0086] In a possible implementation manner, the acquiring unit is further configured to determine the target application according to the application information of the target application when the configuration information further includes application information of the target application.

[0087] In one possible implementation, the acquisition unit is also used to determine the address information of the client in the second network based on the address information of the client in the existing connection information when there are multiple address information in the access information of the client in the second network, and the configuration information also includes the existing connection information between the client and the first server in the first network.

[0088] In one possible implementation, the acquisition unit is also used to determine the address information of the second server in the second network based on the address information of the first server in the existing connection information when there are multiple address information in the access information of the second server in the second network, and the configuration information also includes the existing connection information between the client and the first server in the first network.

[0089] In one possible implementation, the first processing unit is specifically used to create a second socket when the access information of the server in the second network includes the Internet Protocol IP address and port number of the server in the second network; and bind the second socket to the IP address and port number of the server in the second network.

[0090] In one possible implementation, the first processing unit is also used to create a listening socket, which is used to listen to the port indicated by the IP address and port number of the server in the second network; and use the second socket to connect to the second client, which is the client that requests to connect to the IP address and port of the server in the second network heard by the listening socket.

[0091] In one possible implementation, the second processing unit is specifically used to: determine the IP address and port number of the first client in the first network based on the IP address and port number of the second client in the second network, and the IP address and port number of the server in the second network; determine the file descriptor of the target application based on the IP address and port number of the first client in the first network, and the IP address and port number of the server in the first network; and replace the first socket pointed to by the file descriptor with the second socket.

[0092] In a possible implementation, the second processing unit is further configured to release the first socket after the first socket is replaced by the second socket.

[0093] In a possible implementation, the first processing unit is further configured to suspend the target application after obtaining the configuration information of the target application;

[0094] The second processing unit is further configured to restore the target application to a running state after replacing the first socket with the second socket.

[0095] In a possible implementation, the first processing unit is further configured to load the migration module after obtaining configuration information of the target application;

[0096] The second processing unit is further configured to uninstall the migration module after restoring the target application to a running state.

[0097] In a fifth aspect, the present application provides a computer device, which may be a client, comprising a communication interface, a processor, and a memory. The communication interface and the processor are coupled to the memory, and the memory is used to store programs or instructions. When the program or instructions are executed by the processor, the computer device executes the method in the aforementioned first aspect or any possible implementation of the first aspect.

[0098] In a sixth aspect of the present application, a computer device is provided, which may be a server. The server may include at least one processor, a memory, and a communication interface. The processor is coupled to the memory and the communication interface. The memory is configured to store instructions, the processor is configured to execute the instructions, and the communication interface is configured to communicate with other network elements under the control of the processor. When executed by the processor, the instructions cause the computer device to perform the method of the second aspect or any possible implementation of the second aspect.

[0099] In the seventh aspect of the present application, a chip system is provided, which includes one or more interface circuits and one or more processors; the interface circuits and the processors are interconnected by lines; the interface circuits are used to receive signals from the client's memory and send signals to the processor, and the signals include computer instructions stored in the memory; when the processor executes the computer instructions, the client executes the method in the aforementioned first aspect or any possible implementation of the first aspect.

[0100] In an eighth aspect of the present application, a chip system is provided, which includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through lines; the interface circuit is used to receive signals from the memory of the server and send signals to the processor, and the signals include computer instructions stored in the memory; when the processor executes the computer instructions, the server executes the method in the aforementioned second aspect or any possible implementation of the second aspect.

[0101] The ninth aspect of the present application provides a computer-readable storage medium having a computer program or instruction stored thereon. When the computer program or instruction runs on a computer device, the computer device executes the method in the aforementioned first aspect or any possible implementation of the first aspect.

[0102] The tenth aspect of the present application provides a computer-readable storage medium having a computer program or instruction stored thereon. When the computer program or instruction runs on a computer device, the computer device executes the method in the aforementioned second aspect or any possible implementation of the second aspect.

[0103] In an eleventh aspect, the present application provides a computer device program product, which includes a computer device program code. When the computer device program code is executed on a computer device, the computer device executes the method in the aforementioned first aspect or any possible implementation of the first aspect.

[0104] The twelfth aspect of the present application provides a computer device program product, which includes a computer device program code. When the computer device program code is executed on a computer device, the computer device executes the method in the aforementioned second aspect or any possible implementation of the second aspect.

[0105] In a thirteenth aspect of the present application, a cloud system is provided, comprising: a client, a first server, and a second server, wherein the client and the first server are located on a first network, and the second server is located on a second network. The client is configured to execute the method of the first aspect or any possible implementation of the first aspect, so that the client's network connection is hot migrated from the first server to the second server.

[0106] In a fourteenth aspect, the present application provides a cloud system, comprising: a server, a first client, and a second client, wherein the server and the first client are located in a first network, and the second client is located in a second network; the server is used to execute the method in the aforementioned second aspect or any possible implementation of the second aspect, so that the network connection of the server is hot migrated from the first client to the second client.

[0107] Among them, the technical effects brought about by the third aspect, fifth aspect, seventh aspect, ninth aspect, eleventh aspect and thirteenth aspect or any possible implementation method thereof can be referred to the technical effects brought about by the first aspect or different possible implementation methods of the first aspect, and will not be repeated here.

[0108] Among them, the technical effects brought about by the fourth aspect, the sixth aspect, the eighth aspect, the tenth aspect, the twelfth aspect and the fourteenth aspect or any possible implementation method thereof can be referred to the technical effects brought about by the second aspect or different possible implementation methods of the second aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0109] FIG1A is a schematic diagram of a cloud system according to an embodiment of the present application;

[0110] FIG1B is another schematic diagram of the structure of the cloud system provided in an embodiment of the present application;

[0111] FIG2A is a schematic diagram of an architecture of network connection hot migration provided by an embodiment of the present application;

[0112] FIG2B is a schematic diagram of an embodiment of a method for hot migration of a network connection provided in an embodiment of the present application;

[0113] FIG2C is a schematic diagram of another architecture of network connection hot migration provided by an embodiment of the present application;

[0114] FIG2D is a schematic diagram of another embodiment of a method for hot migration of a network connection provided in an embodiment of the present application;

[0115] FIG3 is another schematic diagram of the architecture of network connection hot migration provided by an embodiment of the present application;

[0116] FIG4 is a schematic diagram of an embodiment of a method for hot migration of a network connection provided in an embodiment of the present application;

[0117] FIG5 is a schematic diagram of an information structure provided in an embodiment of the present application;

[0118] FIG6 is a schematic diagram of another embodiment of a method for hot migration of a network connection provided in an embodiment of the present application;

[0119] FIG7 is a schematic diagram of another information structure provided in an embodiment of the present application;

[0120] FIG8 is a schematic diagram of a structure of a client provided in an embodiment of the present application;

[0121] FIG9 is a schematic diagram of a structure of a server provided in an embodiment of the present application;

[0122] FIG10 is a schematic diagram of the structure of the client / server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0123] The following describes the embodiments of the present application in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present application, rather than all the embodiments. Those skilled in the art will appreciate that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0124] The terms "first," "second," and the like in the specification and claims of this application and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatus.

[0125] Embodiments of the present application provide a method for hot migration of network connections. This method allows the application to continue running at the location it was at before the migration, even if the application's network connection is migrated, thereby improving the application's operational efficiency. This application also provides corresponding devices, systems, computer-readable storage media, and computer program products. These are described in detail below.

[0126] To facilitate understanding, the technology and background involved in the embodiments of this application are explained below.

[0127] Virtualization is a resource management technology that abstracts and transforms a host's physical resources, such as computing, networking, and storage, to create a more tangible representation. This breaks down the barriers between the host's physical structure and allows users to utilize these resources in a more efficient manner than their original configuration. Virtualized resources are not restricted by the configuration, location, or physical configuration of existing physical resources.

[0128] Physical machine (PM): A physical resource used to host virtualization technology. A host is also called a physical machine. Typically, a physical server is used to deploy virtual instances. A physical machine has multiple physical devices. For example, a physical server has physical devices such as a processor and memory. Multiple virtual instances can be deployed on a single host. Multiple virtual instances deployed on the same host share the host's physical resources. Depending on the usage scenario, a single host can host virtual instances belonging to only one user or multiple users.

[0129] A resource pool is a collection of various hardware and software resources involved in a cloud computing data center. Generally, by resource type, the resources in a resource pool can be divided into computing resources, storage resources, and network resources.

[0130] A virtual instance runs on the host's operating system. The virtual instance itself has its own operating system, which runs applications that implement user services. Virtual instances can use the host's hardware resources and are isolated from each other. Typically, virtual instances can be virtual machines or containers.

[0131] A virtual machine (VM) is a complete computer system that uses virtualization technology to simulate the full functionality of a hardware system and runs in a completely isolated environment. A subset of the VM's instructions can be processed on the host computer, while other instructions can be executed in an emulated manner. A VM is also called a virtual server.

[0132] A virtual machine can be considered a collection of several virtual devices, which is a complete computer system with complete hardware system functions and running in a completely isolated environment. Virtual devices are virtualized based on physical devices that can share resources using virtualization technology. For example, a virtual processor virtualized based on a processor using virtualization technology is a virtual device. For another example, a training card virtualized based on a field-programmable gate array (FPGA) using virtualization technology is also a virtual device.

[0133] Containers provide a lightweight virtual runtime environment. Containers can be obtained by packaging all the code, libraries, and dependencies of the user's application into an image. When the image is executed, the image runs in the virtual runtime environment. At this time, the container is a runtime instance of the image, similar to a lightweight sandbox, which can be started, started, stopped, and deleted. The image does not share the host's memory, processor (such as the central processing unit (CPU)), and disk resources with other images, achieving container isolation between the image and the host, and between the image and other images, ensuring that the process in the container cannot monitor any process or resources outside the container. Container technologies include Docker, Kubernetes, CoreOS, and other container technologies.

[0134] The virtualization technology introduced above is usually applied to a cloud system, which can be a public cloud, a private cloud, or a hybrid cloud. For more information about the cloud system, please refer to Figure 1A.

[0135] As shown in Figure 1A, a structure of the cloud system provided in an embodiment of the present application may include: a terminal device 01, a scheduling node 02, a working node cluster 03, and a working node cluster 04. Communication connections can be established between the client 01 and the scheduling node 02, between the scheduling node 02 and the working node cluster 03, between the scheduling node 02 and the working node cluster 04, and between the working node cluster 03 and the working node cluster 04. For example, a communication connection can be established between the terminal device 01 and the scheduling node 02 through a network. Optionally, the network can be a local area network, the Internet, or other networks. In a cloud computing scenario, the network can also be a virtual private network (VPC), which is not limited in the embodiment of the present application.

[0136] In this implementation, cloud system operators can interact with scheduling node 02 via terminal device 01. For example, operators can send cloud system deployment instructions to scheduling node 02 via terminal device 01, instructing scheduling node 02 to deploy the cloud system based on the resources of scheduling node 02, worker node cluster 03, and worker node cluster 04. The cloud system manages the resources of worker node cluster 03 and worker node cluster 04 and provides cloud services to tenants based on the resources of worker node cluster 03 and worker node cluster 04.

[0137] Optionally, the terminal device 01, also referred to as user equipment (UE), mobile station (MS), mobile terminal (MT), etc., is a device that includes wireless communication functionality (providing voice / data connectivity to users), for example, a handheld device with wireless connection functionality. Currently, some examples of terminal devices include: mobile phones, tablet computers, laptops, PDAs, notebook computers, wireless routers, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving cars, wireless terminals in the Internet of Vehicles, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, or wireless terminals in smart homes.

[0138] The scheduling node 02 can be a cloud server or a cloud physical machine, or a cloud server cluster or a physical machine cluster composed of several cloud servers, or a cloud computing service center. The functions of the scheduling node can be implemented by software or hardware.

[0139] As an example of a software functional unit, a scheduling node may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, a scheduling node may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.

[0140] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Inter-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.

[0141] As an example of a hardware functional unit, a scheduling node may include at least one computing device, such as a server. Alternatively, the scheduling node may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0142] The multiple computing devices included in a scheduling node can be distributed in the same zone or in different zones. The multiple computing devices included in a scheduling node can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in a scheduling node can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.

[0143] Worker node cluster 03 and worker node cluster 04 can be a server cluster consisting of several servers, or a cloud computing service center. A large number of basic resources owned by a cloud service provider are deployed in the cloud computing service center. For example, computing resources, storage resources, and network resources are deployed in the cloud computing service center.

[0144] It should be noted that the scheduling node 02, working node cluster 03 and working node cluster 04 in this implementation environment can also be implemented through other resource platforms besides the cloud computing service center, and this embodiment of the application does not specifically limit it.

[0145] It should be understood that the above content is an illustrative description of the cloud system provided in the embodiment of the present application, and does not constitute a limitation on the application scenarios of the deployment method of the cloud resource management system. Ordinary technicians in this field know that as business needs change, its application scenarios can be adjusted according to application needs.

[0146] In the embodiments of the present application, the architecture of the cloud system can also be understood with reference to Figure 1B . As shown in Figure 1B , the cloud system includes a cloud platform and basic resources. The cloud platform includes a cloud platform manager, and the scheduling node described above can be the cloud platform manager in Figure 1B . The basic resources can include multiple servers, each of which can be a worker node, or each server can include multiple worker nodes.

[0147] The working node in FIG1B may be a computing device card or a virtual machine (VM), wherein the computing device card may be at least one of a central processing unit (CPU), a graphics processing unit (GPU), and a neural network processing unit (NPU).

[0148] The cloud platform manager maintains or regularly collects information about each worker node in the underlying resources, such as resource usage (resource utilization rate or resource idle rate) on each worker node. This information can be used as auxiliary decision-making information when allocating query requests.

[0149] The cloud platform manager receives requests from users and then executes the corresponding tasks. Alternatively, the cloud platform manager assigns the tasks to one or more worker nodes in the cloud system, which then execute the tasks. After the worker nodes complete the tasks, the cloud platform manager returns the results to the user.

[0150] The above-mentioned cloud system provided in the embodiment of the present application can be configured using the Internet Protocol (internet protocol, IP) to realize Internet communication. Early equipment and configuration may adopt a version configuration, such as: adopting the fourth version of the Internet Protocol (internet protocol version 4, IPv4). Later equipment and configuration may adopt another version configuration, such as: adopting the sixth version of the Internet Protocol (internet protocol version 6, IPv6). In the embodiment of the present application, taking IPv4 and IPv6 as examples, the network for adopting IPv4 communication is called an IPv4 network, and the network for adopting IPv6 communication is called an IPv6 network. In an IPv4 network, the IP address and port number of the IPv4 network are used for communication between the client and the server; in an IPv6 network, the IP address and port number of the IPv6 network are used for communication between the client and the server.

[0151] Considering that the number of IPv4 network addresses is decreasing and the IPv6 network is developing vigorously, the applications of the IPv4 network will be migrated to the IPv6 network. Application migration involves not only data migration but also network connection migration. The embodiment of the present application provides a solution for hot migration of the corresponding network connection during application migration, including: a client migration solution and a server migration method, which are introduced below.

[0152] The architecture of hot migration of client network connections can be understood by referring to FIG. 2A .

[0153] As shown in Figure 2A, the client and the first server are in a connected state in a first network (for example, an IPv4 network). Both the client and the first server are running a target application. When hot migration of the network connection does not occur, the target application calls the first socket through a file descriptor to enable the client to connect to the first server in the first network and exchange data generated by the operation of the target application.

[0154] When the client is to be migrated to a second network (e.g., an IPv4 network or an IPv6 network), a second server for receiving a target application access request exists in the second network. The process of hot migration of the client's network connection from the first network to the second network can be understood with reference to FIG2B . As shown in FIG2B , an embodiment of a method for hot migration of a network connection provided in an embodiment of the present application includes:

[0155] 201. The client obtains configuration information of the target application.

[0156] The configuration information includes access information of the client on the second network and access information of the second server on the second network.

[0157] Optionally, the configuration information may further include application information of the target application. The application information of the target application may be an identifier of the target application. In this way, the client may determine the target application according to the application information of the target application.

[0158] Optionally, when the client's access information in the second network contains multiple address information, the configuration information also includes the existing connection information between the client and the first server in the first network; in this way, the client can determine the address information of the client in the second network based on the address information of the client in the existing connection information.

[0159] In the embodiment of the present application, the address information may include an IP address and a port number. A difference in either the IP address or the port number indicates a different address information. If the access information for the client in the configuration information includes multiple address information, the client needs to use the existing connection to determine the address information suitable for migration, such as selecting the address information with the same port number as the existing connection as the address information of the client in the second network.

[0160] Optionally, when the access information of the second server in the second network contains multiple address information, the configuration information also includes the existing connection information between the client and the first server in the first network; the client can determine the address information of the second server in the second network based on the address information of the first server in the existing connection information.

[0161] It should be noted that in the embodiment of the present application, the configuration information for client hot migration can be user-configured, and the target application, the access information of the client in the second network, and the access information of the second server in the second network can all be user-configured.

[0162] 202. The client creates a second socket according to the configuration information.

[0163] The second socket is used for the client to connect to the second server in the second network, and the second server is the first server that migrated from the first network to the second network.

[0164] 203. Replace the first socket with the second socket so that the target application points to the second socket using the file descriptor.

[0165] The file descriptor is used by the client to call the second socket to access the second server when the target application is running on the second network.

[0166] Optionally, step 203 may involve replacing the first socket with the second socket to update the correspondence between the file descriptor and the first socket to a correspondence between the file descriptor and the second socket, so that the target application uses the file descriptor to point to the second socket. Because fd and socket correspond to each other, if the first socket is replaced with the second socket, the correspondence between the target application's fd and the first socket will be updated to a correspondence between the target application's fd and the second socket. In this way, after hot migration, the client can accurately access the second server when running the target application.

[0167] It should be noted that the first network and the second network can be the same network or different networks. When the first network and the second network are different, the first network can be an Internet Protocol version 4 (IPv4) network, and the second network can be an Internet Protocol version 6 (IPv6) network. The network migration can be from an IPv4 network to an IPv6 network, or it can be migration within an IPv4 network, or migration within an IPv6 network, and of course, it can also be migration within other networks, or migration from an IPv4 network / IPv6 network to other networks, or migration from other networks to an IPv4 network / IPv6 network. In this application, migration within the same network refers to changing the IP address and port number of the connection in the same network.

[0168] In the scenarios shown in Figures 2A and 2B, network connection hot migration refers to the hot migration of the client's network connection, which is to migrate a connected client from the first server of the first network to the second server of the second network, or from the first server of the first network to the second server of the first network. In other words, the client migrates from the connection with the first server, and after the hot migration is completed, the client connects to the second server. The second server can be the first server that migrates from the first network to the second network. The device itself has not changed, only the access information connected to the client has changed. Of course, the second server can also be another server running the target application, no longer the original first server.

[0169] In this application, the client and the server (the first server and / or the second server) can be deployed on the cloud, and the client and the server can be virtual machines (VMs), containers or hosts.

[0170] In this application, a file descriptor (fd) can be a handle represented by an unsigned integer, and a process uses it to identify an open file. A file descriptor is associated with a file object that includes relevant information, wherein the relevant information can be the open mode of the file, the location type of the file, the initial type of the file, etc., which are also referred to as the context of the file. A file descriptor can be understood as an index that can point to the socket used for communication.

[0171] In the embodiment of the present application, a socket is a basic operating unit for network communication that supports the Transmission Control Protocol / Internet Protocol (TCP / IP) and can be used for bidirectional communication between processes on different hosts.

[0172] In this scenario, a connection is established between the client and the second server through a second socket, and then the first socket is replaced with the second socket, so that the target application uses a file descriptor to point to the second socket. Because the file descriptor of the target application does not change after the hot migration of the network connection, the file descriptor can be used to continue running the target application in the migrated network after the hot migration of the network connection. If the second server is the first server that has been migrated to the second network, the business of the target application can continue to run at the location before the migration without having to start from scratch, thereby reducing the risk of the business corresponding to the target application being interrupted due to the hot migration of the network connection and improving the operating efficiency of the application.

[0173] The architecture of hot migration of network connections on the server side can be understood by referring to FIG2C .

[0174] As shown in Figure 2C, the server and the first client are in a connected state in a first network (for example, an IPv4 network). Both the server and the first client are running a target application. When hot migration of the network connection does not occur, the target application calls the first socket through a file descriptor to connect the server to the first client in the first network and exchange data generated by the operation of the target application.

[0175] When the server is ready to migrate to the second network, there is a second client in the second network for sending a target application access request. The process of hot migration of the network connection of the server from the first network to the second network can be understood with reference to FIG2D . As shown in FIG2D , an embodiment of a method for hot migration of the network connection provided in an embodiment of the present application includes:

[0176] 211. The server obtains the configuration information of the target application.

[0177] The configuration information includes access information of the server on the second network and access information of the second client on the second network.

[0178] Optionally, the configuration information may further include application information of the target application. The application information of the target application may be an identifier of the target application. In this way, the client may determine the target application according to the application information of the target application.

[0179] Optionally, when the server's access information on the second network contains multiple address information, the configuration information also includes existing connection information between the server and the first client on the first network; the server can determine the server's address information on the second network based on the server's address information in the existing connection information.

[0180] Optionally, when the access information of the second client in the second network contains multiple address information, the configuration information also includes the existing connection information between the server and the first client in the first network; in this way, the server can determine the address information of the second client in the second network based on the address information of the first client in the existing connection information.

[0181] It should be noted that in the embodiment of the present application, the configuration information for the hot migration of the server can be user-configured, and the target application, the access information of the server in the second network, and the access information of the second client in the second network can all be user-configured.

[0182] 212. The server creates a second socket based on the configuration information.

[0183] The second socket is used for the server to connect to the second client in the second network, and the second client is the first client that migrates from the first network to the second network.

[0184] 213. The server replaces the first socket with the second socket so that the target application uses the file descriptor to point to the second socket.

[0185] The file descriptor is used by the server to call the second socket to communicate with the second client when the target application is running on the second network.

[0186] Optionally, step 213 may include replacing the first socket with the second socket to update the correspondence between the file descriptor and the first socket to the correspondence between the file descriptor and the second socket, so that the target application uses the file descriptor to point to the second socket. Because the fd and the socket are corresponding, if the first socket is replaced with the second socket, the correspondence between the target application's fd and the first socket will be updated to the correspondence between the target application's fd and the second socket. In this way, after the hot migration, when the server runs the target application, it can accurately communicate with the second client.

[0187] In the scenarios shown in Figures 2C and 2D, network connection hot migration refers to the hot migration of the server's network connection, which is to migrate the connected server from the first client on the first network to the second client on the second network, or from the first client on the first network to the second client on the first network. In other words, the server migrates from the connection with the first client, and after the hot migration is completed, the server connects to the second client. Optionally, the second client can be the first client migrated from the first network, or of course, the second client can also be another client running the target application.

[0188] In this scenario, a connection is established between the server and the second client through a second socket, and then the first socket is replaced with the second socket so that the file descriptor of the target application points to the second socket. Because the file descriptor of the target application does not change after the hot migration of the network connection, the file descriptor can be used to continue running the target application in the migrated network after the hot migration of the network connection. When the second client is the first client migrated from the first network, the target application's business can continue to run at the location before the migration without having to start from scratch, thereby reducing the risk of the target application's corresponding business being interrupted due to the hot migration of the network connection and improving the application's operating efficiency.

[0189] In the embodiment of the present application, the architecture of target application migration in the client and server can be understood by referring to Figure 3.

[0190] As shown in Figure 3, the architecture includes a migration management node 300, a client 301, and a server 302. The migration management node 300 can be the scheduling node described above. Both the client 301 and the server 302 can be physical machines, or hosts, virtual machines, or containers on physical machines.

[0191] It should be noted that the architecture may also include other clients and servers. For ease of explanation, only one client and one server are shown here.

[0192] Migration management node 300 coordinates hot migration of network connections between clients and servers. For example, upon notifying the server that it is ready, it notifies the client to begin establishing a new connection; or upon notifying the client that all connections have been completed, it notifies the server that reestablishment has been completed. Migration management node 300 also determines the target application for network connection migration, which can be one or more targets.

[0193] The client 301 may include a migration management module 3011, a migration module 3012, kernel and user-mode applications (eg, application 1, application 2, and application 3); wherein the migration management module 3011 may be located in user mode, and the migration module 3012 may be located in the kernel.

[0194] The migration management module 3011 can communicate with the migration management node 300 and determine the target application on the client whose network connection is to be migrated, such as application 1, based on the information sent by the migration management node 300; then determine the migration task of the application 1 according to the instructions of the migration management node 300, and send the migration task to the migration module 3012.

[0195] The migration module 3012 can perform hot migration of network connections according to the migration task. Taking migration from an IPv4 network to an IPv6 network as an example, the migration module 3012 can create a migration thread (socket migration thread) through the kernel when the client 301 is connected to the first server in the IPv4 network through the first socket. The hot migration of the network connection does not change the file descriptor of the target application. Therefore, if the server 302 is the first server migrated from the first network, the target application can continue to run in the migrated network using the file descriptor. The target application can continue to run in the same location as before the migration without having to start over. This reduces the risk of interruption of the target application's business due to the hot migration of the network connection, and improves the application's operating efficiency.

[0196] Similarly, if the server is to be migrated, the migration module 3012 can create a migration thread through the kernel when the server 302 is connected to the first client in the IPv4 network through the first socket, and create a listening socket through the migration thread, and listen to the port indicated by the IPv6 address and port number of the server in the IPv6 network through the listening socket. When the client 301 in the IPv6 network requests to establish a connection with the IPv6 address and port, a second socket is generated, and the listening socket is replaced by the second socket. In this way, the connection between the server 302 and the client 301 can be realized through the second socket, and then the first socket is replaced by the second socket, so that the file descriptor of the target application points to the second socket; wherein, the file descriptor of the target application is used by the server to call the second socket to communicate with the second client when the target application is running on the second network. Because the file descriptor of the target application does not change after the hot migration of the network connection, after the hot migration of the network connection, if the client 301 is the first client migrated from the first network, the file descriptor can be used to continue running the target application in the migrated network. The business of the target application can continue to run at the location before the migration without having to start from the beginning, thereby reducing the risk of interruption of the business corresponding to the target application due to the hot migration of the network connection and improving the operating efficiency of the application.

[0197] It should be noted that the above-mentioned migration management module 3011 and migration module 3012 can both be implemented through software. The migration management module 3011 or the migration module 3012 can be dynamically loaded. The migration management module 3011 or the migration module 3012 can be loaded when there is a migration demand, and can be deleted when not needed, which can save memory. After the above-mentioned network migration is completed, the migration thread can exit.

[0198] The above introduces the architecture of network connection hot migration. The following describes the method of network connection hot migration provided by the embodiment of the present application from the perspective of the client in conjunction with the accompanying drawings.

[0199] A target application is running on the client, and the target application calls a first socket through a file descriptor to connect the client to a first server in a first network. The client is to be migrated to a second network, and a second server for receiving access requests from the target application exists in the second network.

[0200] As shown in FIG4 , an embodiment of a network migration method provided in an embodiment of the present application includes:

[0201] 401. The client obtains the configuration information of the target application.

[0202] The client currently maintains a network connection with the first server through the first socket.

[0203] This step is combined with the structure of FIG. 3 , and may be that the migration module 3012 obtains the migration task of the network connection to be migrated from the migration management module 3011 .

[0204] The configuration information includes the access information of the client on the second network and the access information of the second server on the second network. The configuration information may also include the access information of the client on the first network and the access information of the first server on the first network, and may also include application information. In the embodiment of the present application, the access information of the client or the server on the first network or the second network may include an IP address and a port number.

[0205] In the embodiment of the present application, the first network is an IPv4 network, and the second network is an IPv6 network. This configuration information may include the IP address and port number obtained by the client in the IPv4 network, which can be represented by (client IPv4 address + port number). The client may also obtain the IP address and port number of the first server in the IPv4 network through the first socket, which can be represented by (server IPv4 address + port number). This configuration information may also include the task configuration and address configuration contained in the migration task issued by the migration management module.

[0206] It should be noted that before the migration management module sends the task configuration and address configuration, the migration management node usually obtains the existing connection information between the client and the first server, and then instructs the migration management module to determine the corresponding task configuration and address configuration based on the existing connection information.

[0207] Refer to Figure 5 for a more detailed explanation of task configuration. As shown in Figure 5, a task may have multiple server IPv6 addresses on the IPv6 network. Each server IPv6 address will have a corresponding client IPv6 address and port number, based on the existing connection information and the client IPv6 address on the IPv6 network. The port number indicates the corresponding port. The port number is typically the same as the port number of the existing connection, but it can be different.

[0208] In Figure 5, a task has the IPv6 addresses of server1, server2, and server3. The IPv6 addresses of client1, client2, and client3 are also associated with the IPv6 addresses of server1. Although the client IPv6 addresses of the IPv6 network associated with the IPv6 addresses of server2 and server3 are not shown in Figure 5, this does not affect the fact that the IPv6 network also has client IPv6 addresses associated with the IPv6 addresses of server2 and server3.

[0209] In addition, the migration management module can also indicate the IPv6 address + port number to be used after the client's network connection is hot migrated to the IPv6 network through address configuration.

[0210] 402. The client suspends the target application.

[0211] The process of step 402 may be that the migration module sends information to the user state to notify the target application in the user state to suspend.

[0212] In the embodiment of the present application, the "pause" time is very short and can be understood as the black hole time of hot migration. This pause does not cause business interruption. On the contrary, this short pause prevents new messages from being generated during hot migration of the network connection, thereby avoiding the problem of data discontinuity caused by connection migration.

[0213] 403. Client creates second socket.

[0214] The second socket is used for the client to connect to the second server in the second network.

[0215] The process of creating the second socket can be that the migration module starts a migration thread, and then the migration thread obtains the task of the target application of the network connection to be migrated and the access information of the client and server in the second network, and creates a second socket (AF_INET6socket) according to the task. The process of creating the second socket can be completed in the kernel.

[0216] 404. The client binds the second socket and the IP address and port number of the client in the second network.

[0217] This step may be that the migration thread in the kernel binds the second socket (AF_INET6socket) to the IP address and port number of the client in the IPv6 network, for example, binding the second socket (AF_INET6socket) to the IPv6 address and port number of client1. The port number of the client in the second network may be the same as the port number of the client in the first network.

[0218] 405. The client connects to the second server using the second socket.

[0219] This step may be that the migration thread uses the second socket (AF_INET6socket) to connect to the server1 IPv6 address and returns successfully.

[0220] The second server is the first server that migrates from the first network to the second network.

[0221] 406. The client replaces the first socket with the second socket.

[0222] This step may be to determine the file descriptor of the target application according to the access information of the client in the first network and the access information of the first server in the first network through a migration thread; and replace the first socket pointed to by the file descriptor with the second socket through the migration thread.

[0223] The access information of the client on the first network and the access information of the first server on the first network can be used to determine the file descriptor of the current target application communication, so that the corresponding first socket can be found and the socket replacement can be completed. By searching for the first socket by file descriptor, the first socket can be found quickly and accurately.

[0224] The socket replacement process refers to replacing all socket-related structures and data, and exchanging the structure and data of the first socket to the structure of the second socket newly created by the migration thread.

[0225] In the embodiment of the present application, if the task indicates that the network connections of multiple applications need to be migrated, the above-mentioned processes from 403 to 406 can be repeated.

[0226] 407. The client restores the target application to running state.

[0227] After completing the aforementioned tasks, the migration thread can exit after completing the hot migration of the network connection, thereby releasing the first socket and the resources used by the migration thread, thereby improving resource utilization. After the migration thread exits, the migration module can notify the migration management module of the completion of the migration. The migration management module can then send a notification to the migration management node, which can then notify the first server and / or the second server of the message.

[0228] It should be noted that the above steps 402, 404, 405 and 407 may be optional steps.

[0229] FIG4 above describes the process of migrating the network connection of the target application on the client side. The following describes the process of migrating the network connection of the target application on the server side.

[0230] The server is based on target application migration, and the network connection is migrated from the first network to the second network. In the first network, when the server runs the target application, it connects to the first client through the first socket, and the file descriptor of the target application points to the first socket.

[0231] As shown in FIG6 , another embodiment of the network migration method provided in an embodiment of the present application includes:

[0232] 601. The server obtains the configuration information of the target application.

[0233] The server currently maintains a network connection with the first client through the first socket.

[0234] This step is combined with the structure of FIG3 , and may be that the migration module obtains the migration task of the network connection to be migrated from the migration management module.

[0235] The configuration information includes access information of the server in the second network and access information of the first client in the second network.

[0236] In the embodiment of the present application, an example is given in which the first network is an IPv4 network and the second network is an IPv6 network; the configuration information may include the task configuration and address configuration contained in the migration task issued by the migration management module.

[0237] It should be noted that before the migration management module sends the task configuration and address configuration, the migration management node usually obtains the existing connection information between the server and the first client, and then instructs the migration management module to determine the corresponding task configuration and address configuration based on the existing connection information.

[0238] Refer to Figure 7 for a more detailed explanation of task configuration. As shown in Figure 7, a task can have multiple mappings, where the server IPv6 address + port number and the client IPv6 address + port number are used as keys, and the server IPv4 address + port number and the client IPv4 address + port number are used as values. For example, in Figure 7, {server1 IPv6 address + port number, client1 IPv6 address + port number} and {server1 IPv4 address + port number, client1 IPv4 address + port number} form a mapping; {server2 IPv6 address + port number, client2 IPv6 address + port number} and {server2 IPv4 address + port number, client2 IPv4 address + port number} form a mapping; and {server3 IPv6 address + port number, client3 IPv6 address + port number} and {server3 IPv4 address + port number, client3 IPv4 address + port number} form a mapping.

[0239] The address configuration can include the IPv6 address and port number required for the server to migrate to IPv6.

[0240] 602. The server suspends the target application.

[0241] The process of step 602 may be that the migration module sends information to the user state to notify the target application in the user state to suspend.

[0242] In the embodiment of the present application, the "pause" time is very short and can be understood as the black hole time of hot migration. This pause does not cause business interruption. On the contrary, this short pause prevents new messages from being generated during hot migration of the network connection, thereby avoiding the problem of data discontinuity caused by connection migration.

[0243] The server will also start the migration thread.

[0244] 603. The server creates a listening socket.

[0245] The process of creating the listening socket may be completed by the migration thread. The listening socket is used to listen to the port indicated by the IP address and port number of the server in the second network to learn the second client requesting to establish a connection with the server.

[0246] 604. The server creates a second socket.

[0247] The process of creating the second socket can be completed by the migration thread. The second socket can be represented as AF_INET6 socket. The second socket is used for the server to connect to the second client in the second network. The second client can be the first client migrated from the first network to the second network.

[0248] 605. The server binds the second socket to the server's IP address and port number in the second network.

[0249] In an embodiment of the present application, after creating the second socket, the second socket is bound to the IP address and port number of the server in the second network, so that the server can be migrated to the second network and the speed of subsequent communication between the server and the second client can be increased.

[0250] 606. Connect to the second client using the second socket via the migration thread.

[0251] The second client is a client that requests to connect to the IP address and port of the server in the second network as monitored by the listening socket.

[0252] 607. The server determines the file descriptor of the target application.

[0253] The file descriptor is used to identify the first socket.

[0254] Step 607 may include: determining the IP address and port number of the first client in the first network based on the IP address and port number of the second client in the second network and the IP address and port number of the server in the second network; and determining the file descriptor of the target application based on the IP address and port number of the first client in the first network and the IP address and port number of the server in the first network. Step 607 may be performed by the migration thread.

[0255] This process can use the mapping relationship shown in Figure 7 above. For example: the access information of the server in the IPv6 network is server2 IPv6 address + port number, and the IP address and port number of the second client in the second network are client2 IPv6 address + port number. Then, it can be determined that the access information of the first client in the IPv4 network is client2 IPv4 address + port number. Based on the client2 IPv4 address + port number and the server2 IPv4 address + port number of the server in the IPv4 network, the above file descriptor can be determined.

[0256] 608. Replace the first socket indicated by the file descriptor with the second socket.

[0257] Step 608 may be to replace the first socket pointed to by the file descriptor with the second socket by migrating the thread.

[0258] The above steps 603 to 608 can all be completed by the migration thread.

[0259] The socket replacement process refers to replacing all socket-related structures and data, and exchanging the structure and data of the first socket to the structure of the second socket newly created by the migration thread.

[0260] In the embodiment of the present application, if the task indicates that the network connections of multiple applications need to be migrated, the above-mentioned processes 603 to 608 can be repeated.

[0261] 609. The server restores the target application to the running state.

[0262] After the above tasks are completed, the migration thread can exit, the migration module can notify the migration management module to complete the migration, and the migration management module can send a notification to the migration management node, which can notify the first client and / or the second client of the message.

[0263] It should be noted that the above steps 602, 603, 604, 606, 607 and 609 may all be optional steps.

[0264] This embodiment of the application utilizes the shared memory space of processes / threads in kernel space, and the fact that applications, when communicating over the network, operate only on file descriptors and are unaware of the actual socket structure. After the application is live migrated, a background kernel thread reestablishes the connection and replaces the original application's first socket. When the application is re-run, it uses the replaced second socket to continue communication over the original connection, without interrupting services for the network connection live migration.

[0265] The above-mentioned network connection hot migration of the present application can be performed after the process hot migration. The user can realize the hot migration of the process and network connection through a migration instruction, so that the user can hot migrate the target application from the IPv4 network to the IPv6 network with "one click" and keep the business of the target application uninterrupted.

[0266] The embodiments of Figures 4 to 7 above are introduced based on the example that the first network is an IPv4 network and the second network is an IPv6 network. In fact, when the second network is an IPv4 network, the processes of Figures 4 to 7 above can also be performed. It is only necessary to replace the new IPv6 address or port with a new IPv4 address or port, and change the newly created socket from AF_INET6 to AF_INET. For other processes, please refer to the previous content for understanding.

[0267] The network connection hot migration solution provided in the embodiment of the present application does not require the addition of additional equipment, is simple to deploy, and has low cost. It only requires replacing the socket, is imperceptible to the user's APP, and does not require any modification; there is no performance loss in the transmission phase.

[0268] The above describes the method for hot migration of network connections. The following describes the client and server provided in the embodiment of the present application with reference to the accompanying drawings.

[0269] As shown in FIG8 , an embodiment of the present application provides a client 80, on which a target application is running. The target application calls a first socket through a file descriptor to connect the client to a first server in a first network. The client is to be migrated to a second network, and a second server for receiving access requests from the target application exists in the second network. A structure of the client 80 includes:

[0270] The acquisition unit 801 is configured to acquire configuration information of a target application; wherein the configuration information includes access information of the client in the second network and access information of the second server in the second network.

[0271] The first processing unit 802 is configured to create a second socket according to the configuration information, where the second socket is used for the client to connect to the second server in the second network.

[0272] The second processing unit 803 is used to replace the first socket with the second socket so that the target application uses a file descriptor to point to the second socket; wherein the file descriptor is used by the client to call the second socket to access the second server when running the target application on the second network.

[0273] Optionally, the second processing unit 803 is specifically configured to replace the first socket with the second socket to update the correspondence between the file descriptor and the first socket to the correspondence between the file descriptor and the second socket, so that the target application uses the file descriptor to point to the second socket.

[0274] Optionally, the acquiring unit 801 is further configured to determine the target application according to the application information of the target application when the configuration information further includes application information of the target application.

[0275] Optionally, the acquisition unit 801 is also used to determine the address information of the client in the second network based on the address information of the client in the existing connection information when there are multiple address information in the access information of the client in the second network, and the configuration information also includes the existing connection information between the client and the first server in the first network.

[0276] Optionally, the acquisition unit 801 is also used to determine the address information of the second server in the second network based on the address information of the first server in the existing connection information when there are multiple address information in the access information of the second server in the second network, and the configuration information also includes the existing connection information between the client and the first server in the first network.

[0277] Optionally, the first processing unit 802 is specifically configured to create a second socket when the access information of the client in the second network includes the Internet Protocol IP address and port number of the client in the second network; and bind the second socket and the IP address and port number of the client in the second network.

[0278] Optionally, the first processing unit 802 is further configured to use the second socket to connect to the second server according to access information of the second server in the second network.

[0279] Optionally, the second processing unit 803 is specifically configured to determine a file descriptor of the target application according to the access information of the client in the first network and the access information of the first server in the first network; and replace the first socket pointed to by the file descriptor with the second socket.

[0280] Optionally, the second processing unit 803 is further configured to release the first socket.

[0281] Optionally, the first processing unit 802 is further configured to suspend the target application after obtaining the configuration information of the target application.

[0282] The second processing unit 803 is further configured to restore the target application to a running state after replacing the first socket with the second socket.

[0283] Optionally, the first processing unit 802 is further configured to load a migration module before obtaining configuration information of the target application.

[0284] The second processing unit 803 is further configured to uninstall the migration module after the target application is restored to the running state through the migration module.

[0285] In the embodiment of the present application, the operations performed by each unit in the client are similar to the description of the steps performed by the client in the embodiments shown in Figures 2A to 7 above, and will not be repeated here.

[0286] As shown in FIG9 , an embodiment of the present application provides a server 90, on which a target application is running. The target application calls a first socket through a file descriptor to connect the server to a first client in a first network. The server is to be migrated to a second network, and a second client for sending a target application access request exists in the second network. A structure of the server 90 includes:

[0287] The acquisition unit 901 is configured to acquire configuration information of a target application; wherein the configuration information includes access information of the server in the second network and access information of the second client in the second network.

[0288] The first processing unit 902 is configured to create a second socket according to the configuration information, where the second socket is used for the server to connect to the second client in the second network.

[0289] The second processing unit 903 is used to replace the first socket with the second socket so that the target application uses a file descriptor to point to the second socket; wherein the file descriptor is used by the server to call the second socket to communicate with the second client when the target application runs on the second network.

[0290] Optionally, the second processing unit 903 is configured to replace the first socket with the second socket to update the correspondence between the file descriptor and the first socket to the correspondence between the file descriptor and the second socket, so that the target application uses the file descriptor to point to the second socket.

[0291] Optionally, the acquiring unit 901 is further configured to determine the target application according to the application information of the target application when the configuration information further includes application information of the target application.

[0292] Optionally, the acquisition unit 901 is also used to determine the address information of the client in the second network based on the address information of the client in the existing connection information when there are multiple address information in the access information of the client in the second network, and the configuration information also includes the existing connection information between the client and the first server in the first network.

[0293] Optionally, the acquisition unit 901 is also used to determine the address information of the second server in the second network based on the address information of the first server in the existing connection information when there are multiple address information in the access information of the second server in the second network, and the configuration information also includes the existing connection information between the client and the first server in the first network.

[0294] Optionally, the first processing unit 902 is specifically configured to create a second socket when the access information of the server in the second network includes the Internet Protocol IP address and port number of the server in the second network; and bind the second socket to the IP address and port number of the server in the second network.

[0295] Optionally, the first processing unit is also used to create a listening socket, which is used to listen to the port indicated by the IP address and port number of the server in the second network; and use the second socket to connect to the second client, which is the client that requests to connect to the IP address and port of the server in the second network heard by the listening socket.

[0296] Optionally, the second processing unit is specifically used to: determine the IP address and port number of the first client in the first network based on the IP address and port number of the second client in the second network, and the IP address and port number of the server in the second network; determine the file descriptor of the target application based on the IP address and port number of the first client in the first network, and the IP address and port number of the server in the first network; replace the first socket pointed to by the file descriptor with the second socket.

[0297] Optionally, the first processing unit 902 is further configured to, after obtaining the configuration information of the target application, suspend the running of the target application through the migration module;

[0298] The second processing unit 903 is further configured to restore the target application to a running state after replacing the first socket with the second socket.

[0299] Optionally, the first processing unit 902 is further configured to load a migration module after obtaining configuration information of the target application.

[0300] The second processing unit 903 is further configured to uninstall the migration module after restoring the target application to the running state.

[0301] In the embodiment of the present application, the operations performed by each unit in the server are similar to the description of the steps performed by the server in the embodiments shown in Figures 2A to 7 above, and will not be repeated here.

[0302] In addition, a structure of a computer device provided in an embodiment of the present application can also be understood by referring to Figure 10. The computer device can be a client / server. As shown in Figure 10, the client / server 100 provided in an embodiment of the present application includes: a processor 1001, a communication interface 1002, a memory 1003 and a bus 1004. The processor 1001, the communication interface 1002 and the memory 1003 are interconnected via the bus 1004. In an embodiment of the present application, the processor 1001 is used to control and manage the actions of the client / server 100. For example, the processor 1001 is used to generate a second socket and replace the first socket with the second socket. The communication interface 1002 is used to support the client / server 100 to communicate. For example, the communication interface 1002 can execute the step of obtaining information from the migration management node. The memory 1003 is used to store the program code and data of the client / server 100.

[0303] The processor 1001 may be a central processing unit (CPU), a general-purpose processor (GPOR), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic device (PLD), a transistor logic device (TLD), a hardware component, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. A processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like. The bus 1004 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, for example. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG. 10 shows only one thick line, but this does not imply that there is only one bus or only one type of bus.

[0304] In another embodiment of the present application, a computer-readable storage medium is further provided, in which computer-executable instructions are stored. When the processor of a computer device executes the computer-executable instructions, the computer device executes the steps performed by the client in Figures 2A to 7 above.

[0305] In another embodiment of the present application, a computer-readable storage medium is also provided, in which computer-executable instructions are stored. When the processor of a computer device executes the computer-executable instructions, the computer device executes the steps performed by the server in Figures 2A to 7 above.

[0306] In another embodiment of the present application, a computer program product is further provided. The computer program product includes computer program code. When the computer program code is executed on a computer, the computer device executes the steps executed by the client in Figures 2A to 7 above.

[0307] In another embodiment of the present application, a computer program product is further provided. The computer program product includes computer program code. When the computer program code is executed on a computer, the computer device executes the steps executed by the server in Figures 2A to 7 above.

[0308] In another embodiment of the present application, a chip system is also provided, which includes one or more interface circuits and one or more processors; the interface circuits and the processors are interconnected by lines; the interface circuits are used to receive signals from the memory of the computer device and send signals to the processor, and the signals include computer instructions stored in the memory; when the processor executes the computer instructions, the computer device executes the steps performed by the client in Figures 2A to 7 above. In one possible design, the chip system may also include a memory, which is used to store program instructions and data necessary for the client. The chip system can be composed of chips, or it can include chips and other discrete devices.

[0309] In another embodiment of the present application, a chip system is also provided, which includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected by lines; the interface circuit is used to receive signals from the memory of the computer device and send signals to the processor, and the signals include computer instructions stored in the memory; when the processor executes the computer instructions, the computer device executes the steps performed by the server in Figures 2A to 7 above. In one possible design, the chip system may also include a memory, which is used to store program instructions and data necessary for the server. The chip system can be composed of chips, or it can include chips and other discrete devices.

[0310] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0311] The units described as separate components may or may not be physically separate, and 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0312] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in whole or in part through software, hardware, firmware, or any combination thereof.

[0313] When software is used to implement the integrated unit, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)).

Claims

1. A method for hot migration of a network connection, characterized in that: The method is applied to a client, a target application is running on the client, the target application calls a first socket through a file descriptor so that the client is connected to a first server in a first network, wherein the client is to be migrated to a second network, and a second server for receiving an access request of the target application exists in the second network, and the method includes: Acquire configuration information of the target application, the configuration information including access information of the client on the second network and access information of the second server on the second network; Creating a second socket according to the configuration information, where the second socket is used for the client to connect to the second server in the second network; The first socket is replaced with the second socket so that the target application uses the file descriptor to point to the second socket; wherein the file descriptor is used by the client to call the second socket to access the second server when the target application runs on the second network.

2. The method according to claim 1, characterized in that The replacing the first socket with the second socket so that the target application points to the second socket using the file descriptor comprises: The first socket is replaced with the second socket to update the correspondence between the file descriptor and the first socket to the correspondence between the file descriptor and the second socket, so that the target application uses the file descriptor to point to the second socket.

3. The method according to claim 1 or 2, characterized in that: The configuration information also includes application information of the target application, and the method further includes: The target application is determined according to the application information of the target application.

4. According to the method according to any one of claims 1 to 3, when the access information of the client in the second network contains multiple address information, the configuration information also includes the existing connection information between the client and the first server in the first network; the method further includes: The address information of the client in the second network is determined according to the address information of the client in the existing connection information.

5. The method according to any one of claims 1 to 4, characterized in that: When the access information of the second server in the second network contains multiple address information, the configuration information also includes existing connection information between the client and the first server in the first network; the method also includes: The address information of the second server in the second network is determined according to the address information of the first server in the existing connection information.

6. The method according to any one of claims 1 to 5, characterized in that: The access information of the client on the second network includes the Internet Protocol IP address and port number of the client on the second network; The step of creating a second socket according to the configuration information comprises: Create a second socket; Bind the second socket to the IP address and port number of the client on the second network.

7. The method according to any one of claims 1 to 6, characterized in that: After creating the second socket according to the configuration information, the method further includes: Using the second socket, connecting to the second server according to the access information of the second server in the second network.

8. The method according to any one of claims 1 to 7, characterized in that: After replacing the first socket with the second socket, the method further comprises: Release the first socket.

9. The method according to any one of claims 1 to 8, characterized in that: After obtaining the configuration information of the target application, the method further includes: Pause the target application; After replacing the first socket with the second socket, the method further comprises: The target application is restored to a running state.

10. A method for hot migration of a network connection, characterized in that: The method is applied to a server, a target application is running on the server, the target application calls a first socket through a file descriptor so that the server is connected to a first client in a first network, wherein the server is to be migrated to a second network, and a second client for sending an access request to the target application exists in the second network, and the method includes: Acquire configuration information of the target application; wherein the configuration information includes access information of the server in the second network and access information of the second client in the second network; Creating a second socket according to the configuration information, where the second socket is used for the server to connect to the second client in the second network; The first socket is replaced with the second socket so that the target application uses the file descriptor to point to the second socket; wherein the file descriptor is used by the server to call the second socket to communicate with the second client when the target application runs on the second network.

11. The method according to claim 10, characterized in that The replacing the first socket with the second socket so that the target application points to the second socket using the file descriptor comprises: The first socket is replaced with the second socket to update the correspondence between the file descriptor and the first socket to the correspondence between the file descriptor and the second socket, so that the target application uses the file descriptor to point to the second socket.

12. The method according to claim 10 or 11, characterized in that: The configuration information also includes application information of the target application, and the method further includes: The target application is determined according to the application information of the target application.

13. The method according to any one of claims 10 to 12, characterized in that: When the access information of the server in the second network contains multiple address information, the configuration information also includes existing connection information between the server and the first client in the first network; the method also includes: The address information of the server in the second network is determined according to the address information of the server in the existing connection information.

14. The method according to any one of claims 10 to 13, characterized in that: When the access information of the second client in the second network contains multiple address information, the configuration information also includes existing connection information between the server and the first client in the first network; the method also includes: The address information of the second client in the second network is determined according to the address information of the first client in the existing connection information.

15. The method according to any one of claims 10 to 14, characterized in that: The access information of the server in the second network includes the Internet Protocol IP address and port number of the server in the second network; The step of creating a second socket according to the configuration information comprises: Create a second socket; Bind the second socket to the IP address and port number of the server on the second network.

16. The method according to claim 15, characterized in that The method further comprises: Creating a listening socket, the listening socket being used to listen to the IP address of the server on the second network and the port indicated by the port number; The second socket is used to connect to the second client, where the second client is the client that sends the target application access request intercepted by the listening socket.

17. The method according to any one of claims 10 to 16, characterized in that: The replacing the first socket with the second socket comprises: Determine the IP address and port number of the first client in the first network according to the IP address and port number of the second client in the second network and the IP address and port number of the server in the second network; Determine the file descriptor of the target application according to the IP address and port number of the first client in the first network and the IP address and port number of the server in the first network; The first socket pointed to by the file descriptor is replaced with the second socket.

18. The method according to any one of claims 10 to 17, characterized in that: After replacing the first socket with the second socket, the method further comprises: Release the first socket.

19. The method according to any one of claims 10 to 18, characterized in that: After obtaining the configuration information of the target application, the method further includes: Pause the target application; After replacing the first socket with the second socket, the method further comprises: The target application is restored to a running state.

20. A client, characterized in that: A target application is running on the client, and the target application calls a first socket through a file descriptor so that the client is connected to a first server in a first network, wherein the client is to be migrated to a second network, and a second server for receiving an access request of the target application exists in the second network, and the client includes: An acquisition unit, configured to acquire configuration information of the target application; wherein the configuration information includes access information of the client in the second network and access information of the second server in the second network; A first processing unit, configured to create a second socket according to the configuration information, wherein the second socket is used for the client to connect to the second server in the second network; The second processing unit is used to replace the first socket with the second socket so that the target application uses the file descriptor to point to the second socket; wherein the file descriptor is used by the client to call the second socket to access the second server when the target application runs on the second network.

21. The client according to claim 20, characterized in that: The second processing unit is specifically used to replace the first socket with the second socket to update the correspondence between the file descriptor and the first socket to the correspondence between the file descriptor and the second socket, so that the target application uses the file descriptor to point to the second socket.

22. The client according to claim 20 or 21, characterized in that: The acquisition unit is further configured to determine the target application according to the application information of the target application when the configuration information further includes application information of the target application.

23. The client according to any one of claims 20 to 22, characterized in that: The acquisition unit is also used to determine the address information of the client in the second network according to the address information of the client in the existing connection information when there are multiple address information in the access information of the client in the second network, and the configuration information also includes the existing connection information between the client and the first server in the first network.

24. The client according to any one of claims 20 to 23, characterized in that: The acquisition unit is also used to determine the address information of the second server in the second network according to the address information of the first server in the existing connection information when there are multiple address information in the access information of the second server in the second network, and the configuration information also includes the existing connection information between the client and the first server in the first network.

25. The client according to any one of claims 20 to 24, characterized in that: The first processing unit is specifically used to create a second socket when the access information of the client in the second network includes the Internet Protocol IP address and port number of the client in the second network; and bind the second socket and the IP address and port number of the client in the second network.

26. The client according to any one of claims 20 to 25, characterized in that: The first processing unit is further configured to use the second socket to connect to the second server according to the access information of the second server in the second network.

27. The client according to any one of claims 20 to 26, characterized in that: The second processing unit is further used to release the first socket.

28. The client according to any one of claims 20 to 27, characterized in that: The first processing unit is further configured to suspend the target application after acquiring the configuration information of the target application; The second processing unit is further configured to restore the target application to a running state after replacing the first socket with the second socket.

29. A server, characterized in that: A target application is running on the server, and the target application calls a first socket through a file descriptor so that the server is connected to a first client in a first network, wherein the server is to be migrated to a second network, and a second client for sending an access request to the target application exists in the second network, and the server includes: An acquisition unit, configured to acquire configuration information of the target application; wherein the configuration information includes access information of the server in the second network and access information of the second client in the second network; A first processing unit, configured to create a second socket according to the configuration information, wherein the second socket is used for the server to connect to the second client in the second network; The second processing unit is used to replace the first socket with the second socket so that the target application uses the file descriptor to point to the second socket; wherein the file descriptor is used by the server to call the second socket to communicate with the second client when the target application runs on the second network.

30. The server according to claim 29, characterized in that: The second processing unit is used to replace the first socket with the second socket to update the correspondence between the file descriptor and the first socket to the correspondence between the file descriptor and the second socket, so that the target application uses the file descriptor to point to the second socket.

31. The server according to claim 29 or 30, characterized in that: The acquisition unit is further configured to determine the target application according to the application information of the target application when the configuration information further includes application information of the target application.

32. The server according to any one of claims 29 to 31, characterized in that: The acquisition unit is also used to determine the address information of the server in the second network according to the address information of the server in the existing connection information when there are multiple address information in the access information of the server in the second network, and the configuration information also includes the existing connection information between the server and the first client in the first network.

33. The server according to any one of claims 29 to 32, characterized in that: The acquisition unit is also used to determine the address information of the second client in the second network according to the address information of the first client in the existing connection information when there are multiple address information in the access information of the second client in the second network, and the configuration information also includes the existing connection information between the server and the first client in the first network.

34. The server according to any one of claims 29 to 33, characterized in that: The first processing unit is specifically used to create a second socket when the access information of the server in the second network includes the Internet Protocol IP address and port number of the server in the second network; and bind the second socket and the IP address and port number of the server in the second network.

35. The server according to claim 34, characterized in that: The first processing unit is also used to create a listening socket, which is used to listen to the port indicated by the IP address of the server in the second network and the port number; use the second socket to connect to the second client, and the second client is the client that sends the target application access request intercepted by the listening socket.

36. The server according to any one of claims 29 to 35, characterized in that: The second processing unit is specifically used for: Determine the IP address and port number of the first client in the first network according to the IP address and port number of the second client in the second network and the IP address and port number of the server in the second network; Determine the file descriptor of the target application according to the IP address and port number of the first client in the first network and the IP address and port number of the server in the first network; The first socket pointed to by the file descriptor is replaced with the second socket.

37. The server according to any one of claims 29 to 36, characterized in that: The second processing unit is further configured to release the first socket after replacing the first socket with the second socket.

38. The server according to any one of claims 29 to 37, characterized in that: The first processing unit is further configured to suspend the target application after acquiring the configuration information of the target application; The second processing unit is further configured to restore the target application to a running state after replacing the first socket with the second socket.

39. A computer device, characterized in that: include: A communication interface, a processor and a memory, wherein the communication interface and the processor are coupled to the memory, and the memory is used to store programs or instructions. When the programs or instructions are executed by the processor, the computer device executes the method according to any one of claims 1 to 9 or executes the method according to any one of claims 10 to 19.

40. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed on a computer device, the computer device is caused to perform the method according to any one of claims 1 to 19.

41. A computer program product, characterized in that The computer program product comprises a computer program code, which, when executed on a computer device, causes the computer device to perform the method according to any one of claims 1 to 19.

Citation Information

Patent Citations

  • Data processing method and related equipment

    CN110633127A

  • Method and system for network handover on transport layer

    CN113994650A

  • Data access device and method, readable medium and electronic equipment

    CN114637703A

  • Real time exchange of update information over a network using web sockets coupled to a message queue

    EP3786808A1

  • Method and apparatus for providing an extended socket API for application services

    US20130238806A1