Business migration method, device and equipment, readable storage medium and program product

By conducting migration negotiation and session migration between the source NAT gateway and the destination NAT gateway, the problem of interruption flow during business migration is solved and the continuity of network communication is improved.

CN119561973APending Publication Date: 2025-03-04CHINA TELECOM CLOUD TECH CO LTD

Patent Information

Application Number
CN202411742741.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

In the prior art, when both primary and secondary NAT gateways fail, short-term outages may occur during service migration, affecting the continuity of network communication.

Method used

By conducting migration negotiation between the source NAT gateway and the destination NAT gateway, after confirming that the network connection status is normal, the destination session is determined based on the identification information, and migrate it to the destination NAT gateway, and finally send a session migration completion message to the control device to migrate the traffic of the source NAT gateway to the destination NAT gateway.

Benefits of technology

It reduces the flow interruption phenomenon during business migration, improves the continuity of network communication, and ensures traffic stability during NAT gateway failover.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119561973A_ABST
    Figure CN119561973A_ABST
Patent Text Reader

Abstract

The invention relates to a service migration method, device and equipment, a readable storage medium and a program product, and is applied to a source NAT gateway, the method comprises the following steps: firstly, receiving address information of a target NAT gateway and identification information of a to-be-migrated target instance, and then carrying out migration negotiation with the target NAT gateway, the migration negotiation is used for determining the network connection state of the source NAT gateway and the target NAT gateway, if the migration negotiation result indicates that the network connection state of the source NAT gateway and the target NAT gateway is normal, a target session to be migrated in the target instance is determined according to the identification information, and finally, the target session is migrated to the target NAT gateway according to the address information. And sending a session migration completion message to the control device, so that the control device migrates the traffic of the source NAT gateway to the destination NAT gateway. By adopting the method, the flow cutoff phenomenon in the service migration process can be reduced, and the continuity of network communication is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication network technology, and in particular to a service migration method, device, equipment, readable storage medium and program product. Background Art

[0002] In the existing cluster mode deployment, a single cluster usually only supports the deployment of two NAT (Network Address Translation) gateways. The two NAT gateways are in active and standby mode. The sessions between the two NAT gateways in the same cluster are synchronized in real time to ensure that when one NAT gateway fails, the other NAT gateway can take over the current traffic.

[0003] However, if both the active and standby NAT gateways fail, business migration is required to migrate the business to the NAT gateway of another cluster. However, the current migration method may cause a short-term interruption during the migration process, affecting the continuity of network communication. Summary of the invention

[0004] Based on this, it is necessary to provide a service migration method, device, equipment, readable storage medium and program product for improving the continuity of network communications in response to the above technical problems.

[0005] In a first aspect, the present application provides a service migration method, which is applied to a source NAT gateway, and the method includes:

[0006] Receive the address information of the destination NAT gateway and the identification information of the target instance to be migrated;

[0007] Perform migration negotiation with the destination NAT gateway. The migration negotiation is used to determine the network connection status between the source NAT gateway and the destination NAT gateway.

[0008] If the migration negotiation result indicates that the network connection status between the source NAT gateway and the destination NAT gateway is normal, determine the target session to be migrated in the target instance according to the identification information;

[0009] The target session is migrated to the destination NAT gateway according to the address information, and a session migration completion message is sent to the control device so that the control device can migrate the traffic of the source NAT gateway to the destination NAT gateway.

[0010] In one embodiment, performing migration negotiation with a destination NAT gateway includes:

[0011] Send a migration negotiation request message to the destination NAT gateway, and receive a migration negotiation request response message returned by the destination NAT gateway;

[0012] If a migration negotiation request response message is received, a migration negotiation completion message is sent to the destination NAT gateway, and a migration negotiation completion response message returned by the destination NAT gateway is received;

[0013] If a migration negotiation completion response message is received, it is determined that the migration negotiation result is that the network connection status between the source NAT gateway and the destination NAT gateway is normal.

[0014] In one embodiment, migrating the target session to the destination NAT gateway according to the address information includes:

[0015] Generate UDP packets according to the target session and address information, each UDP packet including a preset number of target sessions;

[0016] Send the UDP packet to the destination NAT gateway.

[0017] In a second aspect, the present application provides a service migration method, which is applied to a control device, and the method includes:

[0018] Send the address information of the destination NAT gateway and the identification information of the target instance to be migrated;

[0019] Receive a session migration completion message and determine whether the target session has been successfully migrated;

[0020] If the target session is successfully migrated, the traffic of the source NAT gateway is migrated to the destination NAT gateway.

[0021] In one embodiment, migrating traffic from a source NAT gateway to a destination NAT gateway includes:

[0022] Switch the route between the security gateway and the source NAT gateway to the destination NAT gateway;

[0023] Switch the route between the source NAT gateway and the host to the destination NAT gateway.

[0024] In one embodiment, determining whether the target session is successfully migrated includes:

[0025] Obtain a first number of target sessions of a source NAT gateway;

[0026] Obtain a second number of sessions migrated to the destination NAT gateway;

[0027] If the first number is equal to the second number, it is determined that the target session migration is successful.

[0028] In one embodiment, the method further comprises:

[0029] If a new session is detected for the target instance, the new session will be created and migrated to the destination NAT gateway based on the address information.

[0030] In a third aspect, the present application also provides a service migration device, which is applied to a source NAT gateway, and the device includes:

[0031] A first receiving module, used to receive the address information of the destination NAT gateway and the identification information of the target instance to be migrated;

[0032] A negotiation module, used for performing migration negotiation with a destination NAT gateway, wherein the migration negotiation is used for determining a network connection status between a source NAT gateway and a destination NAT gateway;

[0033] A determination module, configured to determine a target session to be migrated in a target instance according to the identification information if the migration negotiation result indicates that the network connection status between the source NAT gateway and the destination NAT gateway is normal;

[0034] The first migration module is used to migrate the target session to the destination NAT gateway according to the address information, and send a session migration completion message to the control device so that the control device can migrate the traffic of the source NAT gateway to the destination NAT gateway.

[0035] In a fourth aspect, the present application further provides a service migration device, which is applied to a control device, and the device includes:

[0036] A first sending module, used for sending the address information of the destination NAT gateway and the identification information of the target instance to be migrated;

[0037] A second receiving module is used to receive a session migration completion message and determine whether the target session is successfully migrated;

[0038] The second migration module is used to migrate the traffic of the source NAT gateway to the destination NAT gateway if the target session migration is successful.

[0039] In a fifth aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the service migration method described in any one of the first and second aspects is implemented.

[0040] In a sixth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the service migration method described in any one of the first and second aspects above is implemented.

[0041] In a seventh aspect, the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the service migration method described in any one of the first and second aspects above.

[0042] The above-mentioned service migration method, device, equipment, readable storage medium and program product are applied to the source NAT gateway. First, the address information of the destination NAT gateway and the identification information of the target instance to be migrated are received, and then, the migration negotiation is performed with the destination NAT gateway, wherein the migration negotiation is used to determine the network connection status of the source NAT gateway and the destination NAT gateway. If the migration negotiation result indicates that the network connection status of the source NAT gateway and the destination NAT gateway is normal, the target session to be migrated in the target instance is determined according to the identification information. Finally, the target session is migrated to the destination NAT gateway according to the address information, and a session migration completion message is sent to the control device so that the control device can migrate the traffic of the source NAT gateway to the destination NAT gateway. In this way, when the traffic of the source NAT gateway needs to be migrated, when it is determined that the network connection status of the source NAT gateway and the destination NAT gateway is normal, the target session is first migrated to the destination NAT gateway, and then the traffic is migrated, which can reduce the flow interruption phenomenon during the service migration process and improve the continuity of network communication. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0044] FIG1 is an application environment diagram of a service migration method in one embodiment;

[0045] FIG2 is a schematic diagram of a process flow of a service migration method in an embodiment;

[0046] FIG3 is a flow chart of a migration negotiation step in a service migration method according to an embodiment;

[0047] FIG4 is a flow chart of message transmission in a migration negotiation step according to an embodiment;

[0048] FIG5 is a flow chart of a target session migration step in a service migration method according to an embodiment;

[0049] FIG6 is a schematic diagram of a flow chart of a service migration method in another embodiment;

[0050] 7 is a flowchart of the steps of determining whether the target session migration is successful in another embodiment;

[0051] FIG8 is a schematic diagram of cluster deployment before service migration in one embodiment;

[0052] FIG9 is a flow chart of a traffic migration step in a service migration method according to an embodiment;

[0053] FIG10 is a schematic diagram of cluster deployment after service migration in one embodiment;

[0054] FIG11 is a schematic diagram of a flow chart of a service migration method in another embodiment;

[0055] FIG12 is a structural block diagram of a service migration device in one embodiment;

[0056] FIG13 is a structural block diagram of a service migration device in another embodiment;

[0057] FIG. 14 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0059] The service migration method provided in the embodiment of the present application can be applied in the application environment as shown in Figure 1. Among them, the source NAT gateway 102 can communicate with the destination NAT gateway 104 through the network. The control device 106 can communicate with the source NAT gateway 102 and the destination NAT gateway 104 through the network. Among them, the source NAT gateway 102 and the destination NAT gateway 104 have the function of processing network data packet conversion and routing, such as IP address conversion, and can be a physical hardware device or a network cloud service deployed in a cloud environment. The control device 106 can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0060] In an exemplary embodiment, as shown in FIG2 , a service migration method is provided, which is described by taking the method applied to the source NAT gateway in FIG1 as an example, and includes the following steps 201 to 204. Among them:

[0061] Step 201: Receive the address information of the destination NAT gateway and the identification information of the target instance to be migrated.

[0062] When the source NAT gateway in the cluster environment needs to perform service migration, for example, when the source NAT gateway fails or the service load is too large, the service of the source NAT gateway can be migrated to the destination NAT gateway by controlling the device to trigger the migration command. The destination NAT gateway is also the NAT gateway that receives the service traffic of the source NAT gateway. The address information of the destination NAT gateway can be the VIP (Virtual IP) address of the cluster where the destination NAT gateway is located, and the identification information of the target instance to be migrated can be the name of the NAT instance of the session to be migrated.

[0063] Optionally, when it is determined that the source NAT gateway requires business migration, the control device is used to cooperate with the migration instance and related configurations within the instance, and then check whether the configuration migration to other clusters is successful. If the configuration migration is successful, the address information of the destination NAT gateway and the identification information of the target instance to be migrated are sent to the data plane of the source NAT gateway. The data plane of the source NAT gateway receives the instructions of the control device and saves the address information of the destination NAT gateway and the identification information of the target instance.

[0064] Step 202: Perform migration negotiation with the destination NAT gateway.

[0065] Among them, migration negotiation is used to determine the network connection status of the source NAT gateway and the destination NAT gateway. After the source NAT gateway saves the address information of the destination NAT gateway, since the source NAT gateway and the destination NAT gateway are not in the same cluster, in order to determine whether the networks between the source NAT gateway and the destination NAT gateway in different clusters are interconnected, the source NAT gateway and the destination NAT gateway can perform migration negotiation by sending messages to each other.

[0066] Step 203: If the migration negotiation result indicates that the network connection status between the source NAT gateway and the destination NAT gateway is normal, determine the target session to be migrated in the target instance according to the identification information.

[0067] Among them, the target session can be all sessions under the target instance to be migrated determined according to the identification information. The session is used to store the status information of TCP, UDP and other data streams when they first enter the NAT gateway. The session mainly includes the source and destination IP addresses, source and destination PORT addresses, protocols, and virtual private cloud ID information.

[0068] Step 204: migrate the target session to the destination NAT gateway according to the address information, and send a session migration completion message to the control device so that the control device can migrate the traffic of the source NAT gateway to the destination NAT gateway.

[0069] After determining the target session, the target session of the source NAT gateway can be migrated to the destination NAT gateway according to the address information of the destination NAT gateway, that is, the target session is sent to the destination NAT gateway. Then a migration completion message is sent to the control device, and the control device determines whether the target session is successfully migrated. If the target session is successfully migrated, the control device migrates the traffic of the source NAT gateway to the destination NAT gateway to complete the migration process of the service.

[0070] In the above embodiment, first, the address information of the destination NAT gateway and the identification information of the target instance to be migrated are received, and then, migration negotiation is performed with the destination NAT gateway, wherein the migration negotiation is used to determine the network connection state of the source NAT gateway and the destination NAT gateway, and if the migration negotiation result indicates that the network connection state of the source NAT gateway and the destination NAT gateway is normal, the target session to be migrated in the target instance is determined according to the identification information, and finally, the target session is migrated to the destination NAT gateway according to the address information, and if the target session is successfully migrated, the flow of the source NAT gateway is migrated to the destination NAT gateway. In this way, when the flow of the source NAT gateway needs to be migrated, when it is determined that the network connection state of the source NAT gateway and the destination NAT gateway is normal, the target session is first migrated to the destination NAT gateway, and then the flow is migrated, which can reduce the flow interruption phenomenon in the service migration process and improve the continuity of network communication.

[0071] In one embodiment, the process of performing migration negotiation with the destination NAT gateway in step 202 is shown in FIG. 3 and includes:

[0072] Step 301: Send a migration negotiation request message to a destination NAT gateway, and receive a migration negotiation request response message returned by the destination NAT gateway.

[0073] Among them, the source NAT gateway can send a negotiation request message to the destination NAT gateway according to the address information of the destination NAT gateway, and then wait to receive the migration negotiation request message returned by the destination NAT gateway. At the same time, the migration negotiation request message and the migration negotiation request response message of the source NAT gateway and the destination NAT gateway can also carry corresponding status information, so that the source NAT gateway and the destination NAT gateway can exchange the status information required for the migration negotiation process and prepare for business migration.

[0074] Step 302: If a migration negotiation request response message is received, a migration negotiation completion message is sent to the destination NAT gateway, and a migration negotiation completion response message returned by the destination NAT gateway is received.

[0075] After the source NAT gateway receives the migration negotiation request response message, it sends a migration negotiation completion message to the destination NAT gateway. After receiving the migration negotiation completion message, the destination NAT gateway returns a migration negotiation completion response message and prepares to receive the session to be migrated from the source NAT gateway.

[0076] Step 303: If a migration negotiation completion response message is received, it is determined that the migration negotiation result is that the network connection status between the source NAT gateway and the destination NAT gateway is normal.

[0077] If the source NAT gateway receives the migration negotiation completion response message, the migration negotiation ends, and it can be determined that the migration negotiation is successful, that is, the network connection status between the source NAT gateway and the destination NAT gateway is normal. Optionally, the flow chart of the migration negotiation message between the source NAT gateway and the destination NAT gateway is shown in Figure 4. If the source NAT gateway or the destination NAT gateway does not receive the corresponding message during the migration negotiation, it returns a network abnormality to the control device and ends the service migration.

[0078] In the above embodiment, the network status between the source NAT gateway and the destination NAT gateway is determined through the migration negotiation between the source NAT gateway and the destination NAT gateway, and the status information required in the migration process can be exchanged to prepare for the service migration.

[0079] In one embodiment, the migration process of the target session in step 204 is shown in FIG. 5 and includes:

[0080] Step 501: Generate a UDP message according to the target session and address information.

[0081] Step 502: Send the UDP message to the destination NAT gateway.

[0082] Among them, each UDP message includes a preset number of target sessions. Optionally, the data structure of the corresponding target instance is found in the source NAT gateway, and a pointer array is added to the data structure, pointing to the head pointer of the target session structure stored in each thread. Finally, the traversal is sent in sequence, and each traversed target session is sent to the destination NAT gateway through the UDP message TLV format. Optionally, the preset number can be 5, that is, each UDP message stores 5 session structures, and finally sent to the destination NAT gateway.

[0083] In the above embodiment, five target sessions can be transmitted through one message transmission, while ensuring the quantity, the normal operation of the service is not blocked, and the performance is higher than that of transmitting one target session through one message, and the real-time migration performance of the target session is high.

[0084] In an exemplary embodiment, as shown in FIG6 , a service migration method is provided, which is described by taking the method applied to the control device in FIG1 as an example, and includes the following steps 601 to 603. Among them:

[0085] Step 601: Send the address information of the destination NAT gateway and the identification information of the target instance to be migrated.

[0086] After the control device triggers the migration command, it sends the NAT instance configuration of the source NAT gateway and the related configuration of the rules under the NAT instance to the destination NAT gateway of the receiving cluster, and then checks whether the related configuration is successfully sent. If it is successfully sent, the address information of the destination NAT gateway and the identification information of the target instance to be migrated are sent to the source NAT gateway. If the related configuration is not sent successfully, the service migration is terminated, and no command is sent to the source NAT gateway.

[0087] Step 602: Receive a session migration completion message and determine whether the target session is successfully migrated.

[0088] Optionally, you can check whether the migration session is successful by querying the command of the migration session. If the migrated session on the destination NAT gateway is completely consistent with the target session on the source NAT gateway, it can be determined that the target session migration is successful. If not consistent, the target session migration is unsuccessful, and the current service migration is terminated. The control device sends an instruction to end the migration to the data plane of the source NAT gateway to end the current service migration. At the same time, the destination NAT gateway rolls back the relevant configuration of the NAT instance.

[0089] Step 603: If the target session migration is successful, the traffic of the source NAT gateway is migrated to the destination NAT gateway.

[0090] After confirming that the target session migration is successful, the traffic of the source NAT gateway is migrated to the destination NAT gateway. The traffic migration is mainly achieved by switching the route. Optionally, the route between other devices and the source NAT gateway can be switched to the destination NAT gateway. Optionally, after the traffic migration is completed, the control device checks whether the traffic after the migration is normal. If it is normal, the control device sends an instruction to end the traffic migration to the data plane of the source NAT gateway, and the current traffic migration is completed. If it is not normal, the control device sends an instruction to end the migration to the data plane of the source NAT gateway to end the current traffic migration. At the same time, the destination NAT gateway rolls back the relevant configuration of the NAT instance and migrates the migrated traffic back to the source NAT gateway.

[0091] Optionally, after the target session migration is completed, it is determined whether the target session migration is successful. The determination steps are shown in FIG7 and include:

[0092] Step 701: Obtain a first number of target sessions of a source NAT gateway.

[0093] Step 702: Obtain a second number of sessions migrated to the destination NAT gateway.

[0094] The number of target sessions to be migrated on the source NAT gateway is obtained as a first number, and then a second number of new sessions established according to the migrated target sessions on the destination NAT gateway is obtained.

[0095] Step 703: If the first number is equal to the second number, it is determined that the target session migration is successful.

[0096] If the target session migration is successful, the control device migrates the traffic. If the target session migration is unsuccessful, that is, the first quantity and the second quantity are not equal, the migration is terminated, and the destination NAT gateway is notified to roll back the relevant configuration of the NAT instance, and an end command is sent to the source NAT gateway to end the migration.

[0097] In the above embodiment, whether the target session migration is successful is determined based on the number of sessions after migration, and traffic migration is performed based on the success of the session migration, thereby reducing the delay of NAT gateway service migration and the risk of data loss.

[0098] In an embodiment of the present application, as shown in FIG8 , the cluster deployment mode of the source NAT gateway before the service migration is performed, after the target session migration is successful, the steps of migrating the traffic of the source NAT gateway to the destination NAT gateway are shown in FIG9 , including:

[0099] Step 901: Switch the route between the security gateway and the source NAT gateway to the destination NAT gateway.

[0100] Among them, the route between the security gateway and the source NAT gateway is switched to the security gateway to the destination NAT gateway, that is, after the service sent by the client reaches the public network gateway, it is forwarded to the security gateway, and then forwarded to the destination NAT gateway by the security gateway.

[0101] Step 902: Switch the route between the source NAT gateway and the host machine to the destination NAT gateway.

[0102] The route between the source NAT gateway and the host is switched to the route from the destination NAT gateway to the host, that is, after the service request sent by the client reaches the destination NAT gateway, it is forwarded to the host and then reaches the virtual machine VM. Optionally, the cluster deployment mode after migration is shown in FIG10 .

[0103] In the above embodiment, the traffic of the source NAT gateway is migrated to the destination NAT gateway, thereby ensuring the continuity and stability of the network communication process.

[0104] Optionally, during the migration process, the method further includes: if it is detected that a new session exists in the target instance, migrating the new session to the destination NAT gateway according to the address information.

[0105] If during the traffic migration process, it is detected that the source NAT gateway has received new traffic and established a new session, in order to ensure that the traffic is lossless, the new session will be migrated to the destination NAT gateway according to the address information to ensure that the traffic continues to flow.

[0106] In an embodiment of the present application, as shown in FIG11 , a flow chart of a method for service migration provided in an embodiment of the present application is shown. The method includes the following steps:

[0107] 1. Control the device to trigger the one-key migration command to start business migration.

[0108] 2. The control device sends the NAT instance configuration of the source NAT gateway and the related configuration of the rules under the NAT instance to the destination NAT gateway of the receiving cluster.

[0109] 3. The control device checks whether the relevant configuration is sent successfully. If it is sent successfully, execute step 4. If it is not sent successfully, end the migration and there is no need to send a migration command to the source NAT gateway.

[0110] 4. The control device sends a migration command to the source NAT gateway. The migration command carries the address information (VIP) of the destination NAT gateway and the identification information (name) of the target instance to be migrated.

[0111] 5. The source NAT gateway saves the name of the target instance and the VIP of the destination NAT gateway, and sends a migration negotiation message to the destination NAT gateway.

[0112] 6. The source NAT gateway determines whether the migration negotiation is successful. If successful, step 7 is executed. If unsuccessful, the migration is terminated. After obtaining the migration negotiation result, the control device notifies the destination NAT gateway to roll back the configuration and sends a migration termination command to the source NAT gateway.

[0113] 7. The source NAT gateway migrates the target session to the destination NAT gateway.

[0114] 8. The control device determines whether the target session migration is successful. If the target session migration is successful, step 9 is executed. If the target session migration is unsuccessful, the migration is terminated, the destination NAT gateway is notified to roll back the configuration, and a migration termination command is sent to the source NAT gateway.

[0115] 9. Control device migration traffic. If a new session is detected, migrate the new session to the destination NAT gateway.

[0116] 10. The control device determines whether the traffic migration is successful. If the traffic migration is successful, the migration ends and an end command is sent to the source NAT gateway. If the traffic migration is not successful, the migration ends, the destination NAT gateway is notified to roll back the configuration, the migrated traffic is migrated back to the source NAT gateway, and an end migration command is sent to the source NAT gateway.

[0117] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0118] Based on the same inventive concept, the embodiment of the present application also provides a service migration device for implementing the service migration method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more service migration device embodiments provided below can refer to the limitations on the service migration method above, and will not be repeated here.

[0119] In an exemplary embodiment, as shown in FIG. 12 , a service migration device 1200 is provided, which is applied to a source NAT gateway and includes: a first receiving module, a negotiation module, a determination module and a first migration module, wherein:

[0120] A first receiving module, used to receive the address information of the destination NAT gateway and the identification information of the target instance to be migrated;

[0121] A negotiation module, used for performing migration negotiation with a destination NAT gateway, wherein the migration negotiation is used for determining a network connection status between a source NAT gateway and a destination NAT gateway;

[0122] A determination module, configured to determine a target session to be migrated in a target instance according to the identification information if the migration negotiation result indicates that the network connection status between the source NAT gateway and the destination NAT gateway is normal;

[0123] The first migration module is used to migrate the target session to the destination NAT gateway according to the address information, and send a session migration completion message to the control device so that the control device can migrate the traffic of the source NAT gateway to the destination NAT gateway.

[0124] In one of the embodiments, the negotiation module is specifically used to send a migration negotiation request message to the destination NAT gateway and receive a migration negotiation request response message returned by the destination NAT gateway; if a migration negotiation request response message is received, a migration negotiation completion message is sent to the destination NAT gateway and a migration negotiation completion response message is received returned by the destination NAT gateway; if a migration negotiation completion response message is received, it is determined that the migration negotiation result is that the network connection status between the source NAT gateway and the destination NAT gateway is normal.

[0125] In one of the embodiments, the first migration module is specifically configured to generate UDP packets according to the target session and address information, each UDP packet including a preset number of target sessions; and send the UDP packets to the destination NAT gateway.

[0126] Each module in the above-mentioned service migration device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0127] In an exemplary embodiment, as shown in FIG. 13 , a service migration apparatus 1300 is provided, which is applied to a control device and includes: a first receiving module, a negotiation module, a determination module and a first migration module, wherein:

[0128] A first sending module, used for sending the address information of the destination NAT gateway and the identification information of the target instance to be migrated;

[0129] A second receiving module is used to receive a session migration completion message and determine whether the target session is successfully migrated;

[0130] The second migration module is used to migrate the traffic of the source NAT gateway to the destination NAT gateway if the target session migration is successful.

[0131] In one of the embodiments, the second migration module is specifically used to switch the route between the security gateway and the source NAT gateway to the destination NAT gateway; and switch the route between the source NAT gateway and the host machine to the destination NAT gateway.

[0132] In one embodiment, the second receiving module is specifically used to obtain a first number of target sessions of the source NAT gateway; obtain a second number of sessions migrated to the destination NAT gateway; if the first number is equal to the second number, it is determined that the target session migration is successful.

[0133] In one of the embodiments, the device further includes a detection module for migrating the new session to a destination NAT gateway according to the address information if a new session is detected in the target instance.

[0134] Each module in the above-mentioned service migration device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0135] In an exemplary embodiment, a computer device is provided, which may be a network device, and its internal structure diagram may be shown in FIG14. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store network data packet data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a service migration method is implemented.

[0136] Those skilled in the art will understand that the structure shown in FIG. 14 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0137] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: receiving address information of a destination NAT gateway and identification information of a target instance to be migrated; performing migration negotiation with the destination NAT gateway, wherein the migration negotiation is used to determine the network connection status of the source NAT gateway and the destination NAT gateway; if the migration negotiation result indicates that the network connection status of the source NAT gateway and the destination NAT gateway is normal, determining the target session to be migrated in the target instance according to the identification information; migrating the target session to the destination NAT gateway according to the address information, and sending a session migration completion message to a control device, so that the control device can migrate the traffic of the source NAT gateway to the destination NAT gateway.

[0138] In one embodiment, when the processor executes the computer program, the following steps are further implemented: sending a migration negotiation request message to the destination NAT gateway, and receiving a migration negotiation request response message returned by the destination NAT gateway; if a migration negotiation request response message is received, sending a migration negotiation completion message to the destination NAT gateway, and receiving a migration negotiation completion response message returned by the destination NAT gateway; if a migration negotiation completion response message is received, determining that the migration negotiation result is that the network connection status between the source NAT gateway and the destination NAT gateway is normal.

[0139] In one embodiment, when the processor executes the computer program, the following steps are also implemented: generating UDP messages according to the target session and address information, each UDP message including a preset number of target sessions; and sending the UDP message to the destination NAT gateway.

[0140] In one embodiment, when the processor executes the computer program, the following steps are also implemented: sending the address information of the destination NAT gateway and the identification information of the target instance to be migrated; receiving a session migration completion message, and determining whether the target session has been successfully migrated; if the target session has been successfully migrated, migrating the traffic of the source NAT gateway to the destination NAT gateway.

[0141] In one embodiment, when the processor executes the computer program, the following steps are also implemented: switching the route between the security gateway and the source NAT gateway to the destination NAT gateway; switching the route between the source NAT gateway and the host machine to the destination NAT gateway.

[0142] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining a first number of target sessions of the source NAT gateway; obtaining a second number of sessions migrated to the destination NAT gateway; if the first number is equal to the second number, determining that the target session migration is successful.

[0143] In one embodiment, when the processor executes the computer program, the following steps are also implemented: if it is detected that a new session exists in the target instance, the new session is migrated to the destination NAT gateway according to the address information.

[0144] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: receiving address information of a destination NAT gateway and identification information of a target instance to be migrated; performing migration negotiation with the destination NAT gateway, the migration negotiation being used to determine a network connection status between a source NAT gateway and a destination NAT gateway; if a migration negotiation result indicates that the network connection status between the source NAT gateway and the destination NAT gateway is normal, determining a target session to be migrated in the target instance according to the identification information; migrating the target session to the destination NAT gateway according to the address information, and sending a session migration completion message to a control device, so that the control device migrates traffic of the source NAT gateway to the destination NAT gateway.

[0145] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: sending a migration negotiation request message to the destination NAT gateway, and receiving a migration negotiation request response message returned by the destination NAT gateway; if a migration negotiation request response message is received, sending a migration negotiation completion message to the destination NAT gateway, and receiving a migration negotiation completion response message returned by the destination NAT gateway; if a migration negotiation completion response message is received, determining that the migration negotiation result is that the network connection status between the source NAT gateway and the destination NAT gateway is normal.

[0146] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: generating UDP messages according to the target session and address information, each UDP message including a preset number of target sessions; and sending the UDP message to the destination NAT gateway.

[0147] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: sending the address information of the destination NAT gateway and the identification information of the target instance to be migrated; receiving a session migration completion message, and determining whether the target session has been successfully migrated; if the target session has been successfully migrated, migrating the traffic of the source NAT gateway to the destination NAT gateway.

[0148] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: switching the route between the security gateway and the source NAT gateway to the destination NAT gateway; switching the route between the source NAT gateway and the host machine to the destination NAT gateway.

[0149] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a first number of target sessions of the source NAT gateway; obtaining a second number of sessions migrated to the destination NAT gateway; if the first number is equal to the second number, determining that the target session migration is successful.

[0150] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if it is detected that a new session exists in the target instance, the new session is migrated to the destination NAT gateway according to the address information.

[0151] In one embodiment, a computer program product is provided, including a computer program, which implements the following steps when executed by a processor: receiving address information of a destination NAT gateway and identification information of a target instance to be migrated; performing migration negotiation with the destination NAT gateway, the migration negotiation being used to determine the network connection status of the source NAT gateway and the destination NAT gateway; if the migration negotiation result indicates that the network connection status of the source NAT gateway and the destination NAT gateway is normal, determining a target session to be migrated in the target instance according to the identification information; migrating the target session to the destination NAT gateway according to the address information, and sending a session migration completion message to a control device, so that the control device can migrate the traffic of the source NAT gateway to the destination NAT gateway.

[0152] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: sending a migration negotiation request message to the destination NAT gateway, and receiving a migration negotiation request response message returned by the destination NAT gateway; if a migration negotiation request response message is received, sending a migration negotiation completion message to the destination NAT gateway, and receiving a migration negotiation completion response message returned by the destination NAT gateway; if a migration negotiation completion response message is received, determining that the migration negotiation result is that the network connection status between the source NAT gateway and the destination NAT gateway is normal.

[0153] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: generating UDP messages according to the target session and address information, each UDP message including a preset number of target sessions; and sending the UDP message to the destination NAT gateway.

[0154] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: sending the address information of the destination NAT gateway and the identification information of the target instance to be migrated; receiving a session migration completion message, and determining whether the target session has been successfully migrated; if the target session has been successfully migrated, migrating the traffic of the source NAT gateway to the destination NAT gateway.

[0155] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: switching the route between the security gateway and the source NAT gateway to the destination NAT gateway; switching the route between the source NAT gateway and the host machine to the destination NAT gateway.

[0156] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a first number of target sessions of the source NAT gateway; obtaining a second number of sessions migrated to the destination NAT gateway; if the first number is equal to the second number, determining that the target session migration is successful.

[0157] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if it is detected that a new session exists in the target instance, the new session is migrated to the destination NAT gateway according to the address information.

[0158] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0159] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0160] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0161] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A service migration method, characterized in that: Applied to a source NAT gateway, the method includes: Receive the address information of the destination NAT gateway and the identification information of the target instance to be migrated; Performing migration negotiation with the destination NAT gateway, wherein the migration negotiation is used to determine the network connection status between the source NAT gateway and the destination NAT gateway; If the migration negotiation result indicates that the network connection status between the source NAT gateway and the destination NAT gateway is normal, determining the target session to be migrated in the target instance according to the identification information; The target session is migrated to the destination NAT gateway according to the address information, and a session migration completion message is sent to a control device so that the control device can migrate the traffic of the source NAT gateway to the destination NAT gateway.

2. The method according to claim 1, characterized in that The performing migration negotiation with the destination NAT gateway includes: Sending a migration negotiation request message to the destination NAT gateway, and receiving a migration negotiation request response message returned by the destination NAT gateway; If the migration negotiation request response message is received, sending a migration negotiation completion message to the destination NAT gateway, and receiving a migration negotiation completion response message returned by the destination NAT gateway; If the migration negotiation completion response message is received, it is determined that the migration negotiation result is that the network connection status between the source NAT gateway and the destination NAT gateway is normal.

3. The method according to claim 1, characterized in that Migrating the target session to the destination NAT gateway according to the address information includes: Generate a UDP message according to the target session and the address information, each of the UDP messages including a preset number of target sessions; The UDP message is sent to the destination NAT gateway.

4. A service migration method, characterized in that: Applied to a control device, the method comprises: Send the address information of the destination NAT gateway and the identification information of the target instance to be migrated; Receive a session migration completion message and determine whether the target session has been successfully migrated; If the target session is successfully migrated, the traffic of the source NAT gateway is migrated to the destination NAT gateway.

5. The method according to claim 4, characterized in that Migrating the traffic of the source NAT gateway to the destination NAT gateway includes: Switching the route between the security gateway and the source NAT gateway to the destination NAT gateway; The route between the source NAT gateway and the host machine is switched to the destination NAT gateway.

6. A service migration device, characterized in that: Applied to a source NAT gateway, the device comprises: A first receiving module, used to receive the address information of the destination NAT gateway and the identification information of the target instance to be migrated; A negotiation module, used for performing migration negotiation with the destination NAT gateway, wherein the migration negotiation is used to determine the network connection status between the source NAT gateway and the destination NAT gateway; A determination module, configured to determine a target session to be migrated in the target instance according to the identification information if the migration negotiation result indicates that the network connection status between the source NAT gateway and the destination NAT gateway is normal; The first migration module is used to migrate the target session to the destination NAT gateway according to the address information, and send a session migration completion message to the control device so that the control device can migrate the traffic of the source NAT gateway to the destination NAT gateway.

7. A service migration device, characterized in that: Applied to a control device, the device comprises: A first sending module, used for sending the address information of the destination NAT gateway and the identification information of the target instance to be migrated; A second receiving module is used to receive a session migration completion message and determine whether the target session is successfully migrated; The second migration module is used to migrate the traffic of the source NAT gateway to the destination NAT gateway if the target session migration is successful.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

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

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Switching method inside the system

    CN101188861A

  • Service access method, portal switching server and service access system

    CN101931999A

  • Renegotiation processing method and apparatus

    CN105704043A

  • Service switching method, context migration method and related equipment

    CN107027153A

  • Business processing method and device, storage medium and electronic equipment

    CN118740787A

Cited By

  • Session migration method and device, equipment, storage medium and program product

    CN120856760A

  • Session migration method, device, equipment, storage medium and program product

    CN120856760B