Network connection thermal migration method and corresponding device

By obtaining configuration information in the application, creating and replacing sockets, the problem of connection interruption when migrating from IPv4 to IPv6 network is solved, and the continuous operation and operation efficiency of the application is improved.

CN119544824APending Publication Date: 2025-02-28HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311840896.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-08-31
Filing Date
2023-12-28
Publication Date
2025-02-28

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 configuration information of the target application, a second socket is created and replacing the first socket with it, the target application points to the second socket with a file descriptor, thereby keeping the application running continuously after the network connection is hotly migrated.

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 CN119544824A_ABST
    Figure CN119544824A_ABST
Patent Text Reader

Abstract

The invention provides a network connection live migration method, which comprises the following steps that: a client is connected with a server in a first network through a first socket when running a target application, and a second socket for being connected with a server migrated to a second network can be created; and replacing the first socket pointed by the file descriptor of the target application with the second socket so as to enable the file descriptor to point to the second socket, thereby realizing network connection live migration of the client. Similarly, the server can also realize network connection thermal migration by replacing sockets. Therefore, the client / server can call the second socket to communicate with the server / client in a new network through the unchanged file descriptor after network connection live migration, and the service of the application is kept to be connected at the position before migration and continuously run, so that the risk of service interruption caused by network connection live migration is reduced, and the service efficiency is improved. And the operation efficiency of the target application is improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims the priority of 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”, all contents of which are incorporated by reference in this application. Technical Field

[0002] 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

[0003] With the development of Internet Protocol (IP), the addresses of Internet Protocol version 4 (IPv4) network have been exhausted, and now all cloud vendors are promoting Internet Protocol version 6 (IPv6) network. However, since IPv4 has been developed for decades, most applications (APPs) and networks have not considered IPv6 and only support IPv4.

[0004] For the current IPv4 network, you can enable IPv4 / IPv6 dual stack by replacing switches and routers, so that network connections can gradually support IPv6. In this way, applications running on IPv4 networks will also migrate from IPv4 networks to IPv6 networks.

[0005] Since there are no IPv4 addresses or routes in the IPv6 network, the network connection will be interrupted when the application is migrated from the IPv4 network to the IPv6 network. 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 operating efficiency of the application. Summary of the invention

[0006] The present application provides a method for hot migration of network connection, which is used to keep the application connected to the location where it was running before migration when the network connection of the application is hot migrated, thereby improving the running efficiency of the application. The present application also provides corresponding devices, systems, computer-readable storage media, computer program products, etc.

[0007] 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 comprises: obtaining configuration information of the target application; wherein the configuration information comprises 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 being used for the client to connect to the second server in the second network, the second server being 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 the target application is running in the second network.

[0008] In the present application, the first network and the second network can be the same network, or different networks, and 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 to migrate inside an IPv6 network, of course, also 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.

[0009] In the first aspect, network connection hot migration refers to the hot migration of the client's network connection, which is to migrate the client in a connected state 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 in the first network, that is, the client performs hot migration 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, but the access information connected to the client has changed. Of course, the second server can also be other servers running the target application, no longer the original first server.

[0010] In the present 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 (VM), containers or hosts.

[0011] In the present application, a file descriptor (fd) can be a handle represented by an unsigned integer, which is used by a process to identify an open file. A file descriptor is associated with a file object including relevant information, wherein the relevant information may be an open mode of the file, a location type of the file, an 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 a socket used for communication.

[0012] In the present application, a socket is a basic operation 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.

[0013] In the first aspect, a connection is established between the client and the second server through the second socket, and then the first socket is replaced by the second socket, so that the target application uses the 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 to run the target application in the migrated network after the hot migration of the network connection. If the second server is the first server that is migrated to the second network, the business of the target application can be connected to the position before the migration and continue to run without starting 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 operation efficiency of the application.

[0014] In one possible implementation, the above step: 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.

[0015] In this possible implementation, fd and socket correspond to each other. If the first socket is replaced by 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, the client can accurately access the second server when running the target application after hot migration.

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

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

[0018] In this possible implementation, the application information of the target application may be an identifier of the target application, and the application information of the target application is sent in the configuration information, which can improve the accuracy of the hot migration.

[0019] In one possible implementation, when there are multiple address information in the access information of the client in the second network, 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 client in the second network based on the address information of the client in the existing connection information.

[0020] In this possible implementation, the address information may include an Internet Protocol (IP) address and a port number. Any difference in the IP address and the port number indicates 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. In this way, the efficiency of hot migration can be improved.

[0021] In one possible implementation, when there are multiple address information in the access information of the second server in the second network, 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.

[0022] 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, so that the efficiency of hot migration can be improved.

[0023] In one possible implementation, 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; 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 in the second network.

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

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

[0026] 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, and the IP address and port number of the first server in the second network. This can migrate the client to the second network and also increase the speed at which subsequent clients access the second server.

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

[0028] Using the second socket, connecting to the second server according to the access information of the first server in the second network.

[0029] 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.

[0030] In one possible implementation, the above step: 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; replacing the first socket pointed to by the file descriptor with the second socket.

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

[0032] 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.

[0033] 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.

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

[0035] In this possible implementation, the "pause" time is very short, which 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 network connections, thus avoiding data discontinuity caused by connection migration.

[0036] In a possible implementation, before obtaining the 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.

[0037] 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.

[0038] The second aspect of the present application provides a method for hot migration of network connections, 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 a target application access request; the method comprises: obtaining configuration information of the target application; wherein the configuration information comprises 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 a 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 the 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 the target application is running in the second network.

[0039] 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.

[0040] In the second aspect, network connection hot migration refers to the network connection hot migration of the server, which is to migrate the server in a connected state from the first client of the first network to the second client of the second network, or from the first client of the first network to the second client in the first network, that is, the server migrates from the connection with the first client, and after the migration, the server connects with the second client. The first client and the second client in the same network can be two different devices, or they can be the same device but with different IP addresses and port numbers.

[0041] In the second aspect, a connection is established between the server and the second client 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. 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 to run 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 business of the target application can be connected to the position before the migration and continue to run without starting 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 operation efficiency of the application.

[0042] In one possible implementation, the above step: 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.

[0043] In this possible implementation, fd and socket correspond to each other. If the first socket is replaced by 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, the server can accurately communicate with the second client when running the target application after hot migration.

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

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

[0046] In this possible implementation, the application information of the target application may be an identifier of the target application, and the application information of the target application is sent in the configuration information, which can improve the accuracy of the hot migration.

[0047] In one possible implementation, when there are multiple address information in the access information of the server in the second network, 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 server in the second network based on the address information of the server in the existing connection information.

[0048] 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, so that the efficiency of hot migration can be improved.

[0049] In one possible implementation, when there are multiple address information in the access information of the second client in the second network, 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.

[0050] 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. In this way, the efficiency of hot migration can be improved.

[0051] 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 and the IP address and port number of the server in the second network.

[0052] 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 allows the server to be migrated to the second network, and also increases the speed of subsequent communication between the server and the second client.

[0053] 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; using a second socket to connect to a second client, the second client being the client sending the target application access request intercepted by the listening socket.

[0054] In this possible implementation, the listening socket is used to learn the second client requesting to establish a connection with the server by listening to the IP address and port number of the server, so that the server can establish a connection with the second client, and then establish a connection with the second client through the second socket. Alternatively, the listening socket can be replaced by the second socket to achieve the 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.

[0055] In a possible implementation, the above step: 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; replacing the first socket pointed to by the file descriptor with the second socket.

[0056] 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.

[0057] 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.

[0058] 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.

[0059] In a possible implementation, after acquiring 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.

[0060] In this possible implementation, the "pause" time is very short, which 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 network connections, thus avoiding data discontinuity caused by connection migration.

[0061] In a possible implementation, before obtaining the 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.

[0062] 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.

[0063] According to a third aspect of the present application, a client is provided. A target application is run 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. The client is to be migrated to a second network. A second server for receiving an access request of the target application exists in the second network. The client includes:

[0064] An acquisition unit, 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;

[0065] A first processing unit, used for creating a second socket according to the configuration information, the second socket being used for the client to connect to the second server in the second network;

[0066] 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.

[0067] In one possible implementation, the second processing unit 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.

[0068] 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.

[0069] In a 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.

[0070] 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.

[0071] In one possible implementation, 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.

[0072] 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.

[0073] In a possible implementation, the second processing unit is specifically used 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; and replace the first socket pointed to by the file descriptor with the second socket.

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

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

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

[0077] 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;

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

[0079] A fourth aspect of the present application provides a server, on which a target application is running, 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 a target application access request exists in the second network, and the server includes:

[0080] An acquisition unit, 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;

[0081] A first processing unit, used for 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;

[0082] 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.

[0083] In one possible implementation, 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.

[0084] 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.

[0085] In a 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.

[0086] 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.

[0087] 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.

[0088] 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.

[0089] 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; replace the first socket pointed to by the file descriptor with the second socket.

[0090] In a possible implementation, the second processing unit is further configured to release the first socket after replacing the first socket with the second socket.

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

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

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

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

[0095] 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, 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 server executes the method in the aforementioned first aspect or any possible implementation of the first aspect.

[0096] 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 used to store instructions, the processor is used to execute the instructions, and the communication interface is used to communicate with other network elements under the control of the processor. When the instruction is executed by the processor, the processor executes the method in the second aspect or any possible implementation of the second aspect.

[0097] 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 circuit and the processor are interconnected by lines; the interface circuit is 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.

[0098] 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 a memory on the server side 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 side executes the method in the aforementioned second aspect or any possible implementation of the second aspect.

[0099] The ninth aspect of the present application provides a computer-readable storage medium on which a computer program or instruction is stored. When the computer program or instruction 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.

[0100] The tenth aspect of the present application provides a computer-readable storage medium on which a computer program or instruction is stored. When the computer program or instruction 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.

[0101] In an eleventh aspect of the present application, there is provided 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.

[0102] 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.

[0103] 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 in a first network, and the second server is located in a second network. The client is used to execute the method in the aforementioned first aspect or any possible implementation of the first aspect, so that the network connection of the client is hot migrated from the first server to the second server.

[0104] In a fourteenth aspect, the present application provides a cloud system, including: 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.

[0105] Among them, the technical effects brought about by the third aspect, the fifth aspect, the seventh aspect, the ninth aspect, the eleventh aspect and the thirteenth aspect or any possible implementation method thereof can refer 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.

[0106] 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 refer 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

[0107] Figure 1A A schematic diagram of the structure of a cloud system provided in an embodiment of the present application;

[0108] Figure 1BAnother structural diagram of the cloud system provided in an embodiment of the present application;

[0109] Figure 2A A schematic diagram of an architecture of network connection hot migration provided in an embodiment of the present application;

[0110] Figure 2B A schematic diagram of an embodiment of a method for hot migration of a network connection provided in an embodiment of the present application;

[0111] Figure 2C Another schematic diagram of the architecture of network connection hot migration provided in an embodiment of the present application;

[0112] Figure 2D A schematic diagram of another embodiment of the method for hot migration of network connections provided in an embodiment of the present application;

[0113] Figure 3 Another schematic diagram of the architecture of network connection hot migration provided in an embodiment of the present application;

[0114] Figure 4 A schematic diagram of an embodiment of a method for hot migration of a network connection provided in an embodiment of the present application;

[0115] Figure 5 A schematic diagram of an information structure provided for an embodiment of the present application;

[0116] Figure 6 A schematic diagram of another embodiment of the method for hot migration of network connections provided in an embodiment of the present application;

[0117] Figure 7 Another information structure diagram provided for an embodiment of the present application;

[0118] Figure 8 A schematic diagram of the structure of a client provided in an embodiment of the present application;

[0119] Fig. 9 A schematic diagram of the structure of a server provided in an embodiment of the present application;

[0120] Fig.10 A schematic diagram of the structure of the client / server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0121] The following describes the embodiments of the present application in conjunction with the accompanying drawings. Obviously, the described embodiments are only embodiments of a part of the present application, rather than all embodiments. It is known to those skilled in the art 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.

[0122] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be 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" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0123] The embodiment of the present application provides a method for hot migration of network connection, which is used to keep the application connected to the location where it was running before migration when the network connection of the application is migrated, thereby improving the operation efficiency of the application. The present application also provides corresponding devices, systems, computer-readable storage media, computer program products, etc. The following are detailed descriptions.

[0124] To facilitate understanding, the technology and background involved in the embodiments of the present application are first explained below.

[0125] Virtualization is a resource management technology that abstracts and transforms the various physical resources of the host, such as computing resources, network resources, and storage resources, to break the inseparable barriers between the physical structures of the host, so that users can use these resources in a better way than the original configuration. The resources used through virtualization are called virtualized resources, which are not restricted by the construction method, setting region or physical configuration of existing physical resources.

[0126] Host (physical machine, PM): A physical resource used to carry virtualization technology. A host is also called a physical machine. Usually, a host used to deploy a virtual instance is a physical server. A physical machine has multiple physical devices. For example, a physical server has physical devices such as a processor and a memory. Multiple virtual instances can be deployed in a host, and multiple virtual instances deployed on the same host share the physical resources of the host. According to different usage scenarios, a host can deploy virtual instances belonging to only one user, or it can deploy virtual instances belonging to multiple users.

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

[0128] The virtual instance runs on the host's operating system, and the virtual instance itself is equipped with an operating system. The operating system of the virtual instance runs an application program, which is used to implement the user's business. The virtual instance can use the hardware resources of the host, and different virtual instances are isolated from each other. Generally, the virtual instance can be a virtual machine or a container.

[0129] Virtual machine (VM): refers to a complete computer system that is simulated by virtualization technology and has complete hardware system functions and runs in a completely isolated environment. Some instruction subsets of the virtual machine can be processed in the host machine (host), and other instructions can be executed in a simulated manner. A virtual machine is also called a virtual server.

[0130] A virtual machine can be considered as 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 based on virtualization technology. For example, a virtual processor virtualized based on a processor based on virtualization technology is a virtual device. For another example, a training card virtualized based on a field-programmable gate array (FPGA) based on virtualization technology is also a virtual device.

[0131] Containers provide a lightweight virtual operating 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 operating 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, and implements 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.

[0132] The virtualization technology introduced above is usually applied to cloud systems, which can be public clouds, private clouds, or hybrid clouds. For more information about cloud systems, see Figure 1A To understand.

[0133] like Figure 1AAs shown, a structure of a 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. A communication connection 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 (virtual private cloud, VPC), which is not limited by the embodiment of the present application.

[0134] In this implementation environment, the operation and maintenance personnel of the cloud system can interact with the scheduling node 02 through the terminal device 01. For example, the operation and maintenance personnel can send an instruction to deploy the cloud system to the scheduling node 02 through the terminal device 01, so as to instruct the scheduling node 02 to deploy the cloud system based on the resources of the scheduling node 02, the working node cluster 03 and the working node cluster 04. The cloud system is used to manage the resources of the working node cluster 03 and the working node cluster 04, and provide cloud services to tenants based on the resources of the working node cluster 03 and the working node cluster 04.

[0135] Optionally, the terminal device 01, also known as user equipment (UE), mobile station (MS), mobile terminal (MT), etc., is a device including a wireless communication function (providing voice / data connectivity to users), for example, a handheld device with a wireless connection function. At present, some examples of terminal devices are: mobile phones, tablet computers, laptops, PDAs, notebook computers, wireless routers, mobile internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self driving, wireless terminals in 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, etc.

[0136] The scheduling node 02 may be a cloud server or a cloud physical machine, or a cloud server cluster or a physical machine cluster consisting of several cloud servers, or a cloud computing service center. The function of the scheduling node may be implemented by software or hardware.

[0137] As an example of a software functional unit, the scheduling node may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the above computing instance may be one or more. For example, the 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 data centers with close geographical locations. Among them, usually a region may include multiple AZs.

[0138] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in one region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.

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

[0140] The multiple computing devices included in the scheduling node can be distributed in the same area or in different areas. The multiple computing devices included in the scheduling node can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the scheduling node can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0141] The working node cluster 03 and the working node cluster 04 may be a server cluster composed 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.

[0142] It should be noted that the scheduling node 02, working node cluster 03 and working node cluster 04 in the implementation environment can also be implemented through other resource platforms besides the cloud computing service center, and the embodiments of the present application do not specifically limit them.

[0143] It should be understood that the above content is an exemplary 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. A person of ordinary skill in the art can know that as business needs change, its application scenarios can be adjusted according to application needs.

[0144] In the embodiment of the present application, the architecture of the cloud system can also be referred to in Figure 1B Understand. Figure 1B As shown in Figure 1, the cloud system includes a cloud platform and basic resources. The cloud platform includes a cloud platform manager. The scheduling nodes introduced above can be Figure 1B The basic resources may include multiple servers, each of which may be a working node, or each server may include multiple working nodes.

[0145] exist Figure 1B The working node in the system may be a computing device card or a virtual machine (VM). 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).

[0146] The cloud platform manager will maintain or regularly collect information about each work node in the basic resources, such as the resource usage on each work node (resource usage rate or resource idle rate), etc. This information can be used as auxiliary decision-making information when allocating query requests.

[0147] The cloud platform manager can receive requests from users, and then the cloud platform manager can execute the corresponding tasks. The cloud platform manager can also assign the tasks to one or more working nodes in the cloud system, and one or more working nodes can execute the corresponding tasks. After the working node completes the task, the cloud platform manager can return the result to the user.

[0148] 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: using the fourth version of the Internet Protocol (internet protocol version 4, IPv4). Later equipment and configuration may adopt another version configuration, such as: using 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 using IPv4 communication is called an IPv4 network, and the network for using 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.

[0149] Considering that the number of IPv4 network addresses is decreasing and the IPv6 network is being vigorously developed, 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 embodiments of the present application provide 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 respectively.

[0150] For the architecture of hot migration of client network connections, please refer to Figure 2A To understand.

[0151] like Figure 2A As shown, the client and the first server are in a connected state in a first network (for example, an IPv4 network), and 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 so that the client is connected to the first server in the first network, and exchanges data generated by the operation of the target application.

[0152] When the client is to be migrated to the second network (for example, IPv4 network or IPv6 network), there is a second server in the second network for receiving the target application access request; the network connection hot migration process of the client from the first network to the second network can be referred to Figure 2B To understand, such as Figure 2B As shown, an embodiment of the method for hot migration of network connection provided by the embodiment of the present application includes:

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

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

[0155] 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.

[0156] Optionally, when the client's access information 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; 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.

[0157] In the embodiment of the present application, the address information may include an IP address and a port number, and any difference in the IP address and the port number indicates 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.

[0158] Optionally, when there are multiple address information in the access information of the second server in the second network, 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.

[0159] 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.

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

[0161] 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.

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

[0163] 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.

[0164] Optionally, step 203 may be: 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 fd corresponds to the socket, if the first socket is replaced with the second socket, the correspondence between the fd of the target application and the first socket will be updated to the correspondence between the fd of the target application and the second socket. In this way, the second server can be accurately accessed when the client runs the target application after hot migration.

[0165] 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 (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 to migrate inside an IPv6 network, and of course, 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.

[0166] Should Figure 2A and Figure 2BIn the scenario shown, network connection hot migration refers to the client's network connection hot migration, which is to migrate the 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 in the first network, that is, the client migrates from the connection with the first server, and after the hot migration is completed, the client connects with 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, but 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.

[0167] In the present 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 (VM), containers or hosts.

[0168] In the present application, a file descriptor (fd) can be a handle represented by an unsigned integer, which is used by a process to identify an open file. A file descriptor is associated with a file object including relevant information, wherein the relevant information may be an open mode of the file, a location type of the file, an 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 a socket used for communication.

[0169] In the embodiment of the present application, a socket is a basic operation 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.

[0170] In this scenario, a connection is established between the client and the second server through the second socket, and then the first socket is replaced by the second socket, so that the target application uses the 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 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.

[0171] For the server-side network connection hot migration architecture, please refer to Figure 2C To understand.

[0172] like Figure 2C As shown, the server and the first client are in a connected state in a first network (for example, an IPv4 network), and 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 so that the server is connected to the first client in the first network, and exchanges data generated by the operation of the target application.

[0173] When the server is to be migrated to the second network, there is a second client in the second network for sending a target application access request. The network connection hot migration process of the server from the first network to the second network can be referred to in Figure 2D To understand, such as Figure 2D As shown, an embodiment of the method for hot migration of network connection provided by the embodiment of the present application includes:

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

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

[0176] 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.

[0177] Optionally, 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 server can determine the address information of the server in the second network based on the address information of the server in the existing connection information.

[0178] Optionally, 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; 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.

[0179] It should be noted that in the embodiment of the present application, the configuration information for the hot migration of the server can be configured by the user, 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 configured by the user.

[0180] 212. The server creates a second socket according to the configuration information.

[0181] 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.

[0182] 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.

[0183] 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.

[0184] 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 fd corresponds to the socket, if the first socket is replaced with the second socket, the correspondence between the fd of the target application and the first socket will be updated to the correspondence between the fd of the target application and the second socket. In this way, when the server runs the target application after hot migration, it can accurately communicate with the second client.

[0185] Should Figure 2C and Figure 2D In the scenario shown, network connection hot migration refers to the network connection hot migration of the server, which is to migrate the server in a connected state from the first client of the first network to the second client of the second network, or from the first client of the first network to the second client in the first network, that is, the server migrates from the connection with the first client, and after the hot migration is completed, the server connects with the second client. Optionally, the second client can be the first client migrated from the first network, and of course, the second client can also be other clients running the target application.

[0186] In this scenario, a connection is established between the server and the second client 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. 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 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.

[0187] In the embodiment of the present application, the architecture of target application migration in the client and the server can be referred to. Figure 3To understand.

[0188] like Figure 3 As shown, 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 host machines, virtual machines or containers on physical machines.

[0189] 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.

[0190] The migration management node 300 is used to coordinate the hot migration of the network connection between the client and the server, for example: after learning that the server is ready, it notifies the client to start establishing a new connection; or after learning that the client has completed all connections, it notifies the server that the connection reconstruction has been completed. The migration management node 300 can also determine the target application to migrate the network connection, and there should be one or more targets.

[0191] 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.

[0192] 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 application 1 based on the instructions of the migration management node 300, and send the migration task to the migration module 3012.

[0193] 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 is performed by using a socket to migrate the thread to generate a second socket, the second socket user connects the client 301 to the server 302 in the IPv6 network, and then replaces the first socket with the second socket, so that the file descriptor of the target file originally pointing to the first socket points to the second socket. In this way, when the target application is subsequently running, the client can call the second socket to access the server 302 through the file descriptor of the target file, and 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 server 302 is the first server migrated from the first network, the file descriptor can be used to continue to run the target application in the migrated network, and the business of the target application can be connected to the position before the migration and continue to run without starting 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 operation efficiency of the application.

[0194] 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. The listening socket listens to the port indicated by the IPv6 address and port number of the server in the IPv6 network. 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, and the business of the target application can continue to run at the location before the migration without starting from scratch, 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.

[0195] 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.

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

[0197] 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 access requests of the target application exists in the second network.

[0198] like Figure 4 As shown, an embodiment of the network migration method provided in the embodiment of the present application includes:

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

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

[0201] This step is combined with Figure 3 In the structure, the migration module 3012 may obtain the migration task of the network connection to be migrated from the migration management module 3011.

[0202] 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, whether it is the client or the server, the access information on the first network or the second network may include an IP address and a port number.

[0203] In the embodiment of the present application, the first network is an IPv4 network and the second network is an IPv6 network. The configuration information may include the IP address and port number of 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). The configuration information may also include the task configuration and address configuration contained in the migration task issued by the migration management module.

[0204] 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 according to the existing connection information.

[0205] For configuration of this task, please refer to Figure 5 To understand, such as Figure 5 As shown in the figure, under one task, there may be multiple server IPv6 addresses of IPv6 network. Under the corresponding server IPv6 address, according to the existing connection information and the client IPv6 address of the IPv6 network, there will be a corresponding client IPv6 address + port number. The port number is used to indicate the corresponding port. The port number is usually the same as the port number of the existing connection, but it can also be different.

[0206] Figure 5 In a task, there are server1 IPv6 address, server2 IPv6 address and server3 IPv6 address. Among them, server1 IPv6 address also corresponds to client1 IPv6 address, client2 IPv6 address and client3 IPv6 address. Although the client IPv6 address of the IPv6 network under server2 IPv6 address and server3 IPv6 address is Figure 5 It is not shown in the figure, but it does not affect the fact that there are also client IPv6 addresses of the IPv6 network under the server2 IPv6 address and the server3 IPv6 address.

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

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

[0209] 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.

[0210] In the embodiment of the present application, the "pause" time is very short, which 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 when the network connection is hot migrated, thereby avoiding the problem of data discontinuity caused by connection migration.

[0211] 403. Client creates second socket.

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

[0213] The process of creating the second socket may 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 the server in the second network, and creates the second socket (AF_INET6 socket) according to the task. The process of creating the second socket may be completed in the kernel.

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

[0215] This step may be that the migration thread in the kernel binds the second socket (AF_INET6 socket) to the IP address and port number of the client in the IPv6 network, for example, the second socket (AF_INET6 socket) is bound to the IPv6 address and port number of client1, and 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.

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

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

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

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

[0220] 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 to replace the first socket pointed to by the file descriptor with the second socket through the migration thread.

[0221] The file descriptor of the current target application communication can be determined by using the access information of the client in the first network and the access information of the first server in the first network, so that the corresponding first socket can be found and then the socket replacement can be completed. By searching for the first socket through the file descriptor, the first socket can be found quickly and accurately.

[0222] 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.

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

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

[0225] After the above tasks are completed, 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, which can improve resource utilization. After the migration thread exits, 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 server and / or the second server of the message.

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

[0227] above Figure 4 The process of migrating the network connection of the target application on the client side is introduced. The following is a process of migrating the network connection of the target application on the server side.

[0228] The server is migrated based on the target application, 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 is connected to the first client through the first socket, and the file descriptor of the target application points to the first socket.

[0229] like Figure 6 As shown, another embodiment of the network migration method provided in the embodiment of the present application includes:

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

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

[0232] This step is combined with Figure 3 In the structure, the migration module may obtain the migration task of the network connection to be migrated from the migration management module.

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

[0234] 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 task configuration and address configuration contained in the migration task issued by the migration management module.

[0235] 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 according to the existing connection information.

[0236] For configuration of this task, please refer to Figure 7 To understand, such as Figure 7 As shown, under a task, there can be multiple pairs of mapping relationships, where the server IPv6 address + port number, client IPv6 address + port number can be used as the key (key), and the server IPv4 address + port number, client IPv4 address + port number can be used as the value (value). For example: Figure 7 In the figure, {server1 IPv6 address + port number, client1 IPv6 address + port number} and {server1 IPv4 address + port number, client1 IPv4 address + port number} are a mapping relationship, {server2 IPv6 address + port number, client2 IPv6 address + port number} and {server2 IPv4 address + port number, client2 IPv4 address + port number} are a mapping relationship, and {server3 IPv6 address + port number, client3 IPv6 address + port number} and {server3 IPv4 address + port number, client3 IPv4 address + port number} are a mapping relationship.

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

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

[0239] 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.

[0240] In the embodiment of the present application, the "pause" time is very short, which 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 when the network connection is hot migrated, thereby avoiding the problem of data discontinuity caused by connection migration.

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

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

[0243] The process of creating a listening socket may be completed by a 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 that requests to establish a connection with the server.

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

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

[0246] 605. The server binds the second socket and the IP address and port number of the server in the second network.

[0247] 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.

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

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

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

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

[0252] This step 607 may include: determining 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; determining 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. This step 607 may be completed by the migration thread.

[0253] This process can be done using the above Figure 7The mapping relationship shown, for example: the access information of the server in the IPv6 network is server2 IPv6 address + port number, 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.

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

[0255] The step 608 may be to replace the first socket pointed to by the file descriptor with the second socket by migrating the thread.

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

[0257] 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.

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

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

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

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

[0262] In the embodiment of the present application, the memory space of the process / thread in the kernel space is shared, and the application only operates on the file descriptor during network communication, and does not perceive the real structure of the socket. After the application is hot migrated, the connection is rebuilt through the background kernel thread and the first socket of the original application is replaced. When the application is restarted, the communication of the original connection can be maintained by using the replaced second socket, without interrupting the service for hot migration of the network connection.

[0263] The above-mentioned network connection hot migration of the present application can be performed after the process hot migration. The user can implement the hot migration of the process and the network connection through a migration instruction once, 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.

[0264] above Figures 4 to 7 The embodiment of the present invention is described by taking the first network as an IPv4 network and the second network as an IPv6 network as an example. In fact, when the second network is an IPv4 network, the above operation can also be performed. Figures 4 to 7 The process only requires changing the new IPv6 address or port to a new IPv4 address or port, and changing the newly created socket from AF_INET6 to AF_INET. For other processes, refer to the previous content for understanding.

[0265] 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 the replacement of sockets, is not noticeable to the user's APP, and does not require any modification; there is no performance loss in the transmission phase.

[0266] The above introduces the method of hot migration of network connections. The following introduces the client and server provided in the embodiment of the present application in conjunction with the accompanying drawings.

[0267] like Figure 8 As shown, the client 80 provided in the embodiment of the present application has a target application running on the client 80, and the target application calls the first socket through a file descriptor so that the client is connected to the first server in the first network, wherein the client is to be migrated to the second network, and there is a second server in the second network for receiving the target application access request, and a structure of the client 80 includes:

[0268] The acquisition unit 801 is used 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.

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

[0270] The second processing unit 803 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.

[0271] 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.

[0272] 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.

[0273] Optionally, the acquisition unit 801 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.

[0274] 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.

[0275] 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.

[0276] 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.

[0277] Optionally, the second processing unit 803 is specifically configured to determine a file descriptor of a target application according to 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.

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

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

[0280] 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.

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

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

[0283] In the embodiment of the present application, the operations performed by each unit in the client are the same as those described above. Figures 2A to 7 The description of the steps executed by the client in the illustrated embodiment is similar and will not be repeated here.

[0284] like Fig. 9 As shown, the server 90 provided in the embodiment of the present application has a target application running on the server 90, and the target application calls the first socket through a file descriptor so that the server is connected to the first client in the first network, wherein the server is to be migrated to the second network, and there is a second client in the second network for sending a target application access request, and a structure of the server 90 includes:

[0285] The acquisition unit 901 is used 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.

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

[0287] The second processing unit 903 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.

[0288] Optionally, the second processing unit 903 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.

[0289] 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.

[0290] Optionally, the acquisition unit 901 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.

[0291] 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.

[0292] Optionally, the first processing unit 902 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.

[0293] 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; use the second socket to connect to the second client, and the second client 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.

[0294] 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.

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

[0296] 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.

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

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

[0299] In the embodiment of the present application, the operations performed by each unit in the server are the same as those described above. Figures 2A to 7 The description of the steps executed by the server in the illustrated embodiment is similar and will not be repeated here.

[0300] In addition, a structure of a computer device provided in an embodiment of the present application can also be referred to Fig.10 It is understood that the computer device can be a client / server, such as Fig.10 As shown, the client / server 100 provided in the 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.

[0301] Among them, processor 1001 can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the contents disclosed in this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and so on. Bus 1004 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

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

[0303] In another embodiment of the present application, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores computer-executable instructions. When a processor of a computer device executes the computer-executable instructions, the computer device executes the above Figures 2A to 7 The steps performed by the server in .

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

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

[0306] 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 through a line; the interface circuit is used to receive a signal from a memory of a computer device and send a signal to the processor, the signal including a computer instruction stored in the memory; when the processor executes the computer instruction, the computer device executes the above-mentioned Figures 2A to 7 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 may be composed of a chip, or may include a chip and other discrete devices.

[0307] 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 through a line; the interface circuit is used to receive a signal from a memory of a computer device and send a signal to the processor, the signal including a computer instruction stored in the memory; when the processor executes the computer instruction, the computer device executes the above-mentioned Figures 2A to 7 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 may be composed of a chip, or may include a chip and other discrete devices.

[0308] In the several embodiments provided in the present 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 only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, 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 interfaces, devices or units, which can be electrical, mechanical or other forms.

[0309] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0310] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated units may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.

[0311] When the integrated unit is implemented using software, 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 may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may 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 may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may 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 may 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 disk (SSD)), etc.

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.