Container migration method, device, computer equipment and storage medium

By performing data pre-migration and switching based on heartbeat link information during the container migration process, the problem of business interruption in traditional container migration methods is solved, and efficient hot migration of containers and service continuity are achieved.

CN117170799BActive Publication Date: 2025-09-16CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310827172.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-06
Publication Date
2025-09-16
Estimated Expiration
2043-07-06

AI Technical Summary

Technical Problem

Traditional container migration methods lead to business interruptions and unavailability of intermediate data, resulting in service discontinuity and resource waste.

Method used

By pre-migrating data between the source container and the target container, including container backup data and incremental data migration, combined with the heartbeat link information of the business side link, switching to the target container while maintaining the business link, full intermediate data transfer is achieved.

Benefits of technology

It achieves hot migration optimization of containers, avoids business interruption, ensures service continuity and utilization of intermediate data, and improves migration efficiency and resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117170799B_ABST
    Figure CN117170799B_ABST
Patent Text Reader

Abstract

The present application relates to a container migration method, apparatus, computer equipment, storage medium and computer program product. The method comprises: obtaining a target migration task; the target migration task is used to hot migrate the source container in the cloud platform container management system, and a business side link has been established between the source container and the linked container; executing a pre-migration subtask to pre-migrate data between the source container and the target container; after completing the pre-migration of the container backup data, executing a switching subtask, according to the heartbeat link information of the business side link, while maintaining the business link that exists and is being processed in the source container, the business side link is switched to between the target container and the linked container, and the business intermediate state data of the source container is migrated to the target container. The use of this method can realize the full transfer of intermediate state information of the container and the utilization of intermediate state data, avoid the interruption of the business caused by container migration, and ensure the continuity of the service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a container migration method, apparatus, computer equipment, storage medium, and computer program product. Background Art

[0002] With the development of cloud computing, container technology has emerged. This development has made cloud native a mainstream approach to cloud-based application development, deployment, and operation. Kubernetes, a leading distributed architecture solution for container orchestration and scheduling, has become a mainstream container technology solution and is widely used. Consequently, there is a need for live migration of containers on Kubernetes.

[0003] However, traditional technologies usually adopt the method of disconnecting and re-establishing the link. Disconnecting the link established by the stateful container will cause business interruption, resulting in discontinuous service provision, and the intermediate state data of the previous business cannot be used after the link is re-established. Summary of the Invention

[0004] Based on this, it is necessary to provide a container migration method, device, computer equipment, storage medium and computer program product that can ensure service continuity in response to the above technical problems.

[0005] In a first aspect, the present application provides a container migration method, the method comprising:

[0006] Obtain a target migration task; the target migration task is used to hot migrate the source container in the cloud platform container management system, a business-side link has been established between the source container and the link container, and the target migration task includes a pre-migration subtask and a switching subtask;

[0007] Executing the pre-migration subtask to pre-migrate data between the source container and the target container; the data pre-migration includes migration of container backup data and migration of incremental data of the source container;

[0008] After completing the pre-migration of the container backup data, the switching subtask is executed. According to the heartbeat link information of the business side link, while maintaining the business link that exists and is being processed in the source container, the business side link is switched between the target container and the link container, and the business intermediate data of the source container is migrated to the target container.

[0009] In one embodiment, executing the pre-migration subtask to pre-migrate data between the source container and the target container includes:

[0010] Obtaining initial migration instruction information and incremental migration instruction information from the pre-migration subtask;

[0011] Migrating the container backup data of the source container to the target container according to the first migration instruction information;

[0012] Synchronize the container incremental data of the source container to the target container according to a preset time interval in the incremental migration instruction information.

[0013] In one embodiment, before the step of executing the switching subtask, the method further includes:

[0014] Detecting a network connection status between a server corresponding to the source container and a server corresponding to the target container, and determining whether the source container and the target container are in a network connectivity state;

[0015] When the source container and the target container are in network connectivity, the switching subtask is executed.

[0016] In one embodiment, the switching of the business side link between the target container and the link container based on the heartbeat link information of the business side link while maintaining the business link that exists and is being processed in the source container, and migrating the business intermediate state data of the source container to the target container includes:

[0017] Acquire heartbeat link cycle information and heartbeat interval information from the heartbeat link information of the service side link;

[0018] Determine a trigger time for migrating the intermediate state data of the service according to the heartbeat link cycle information, and determine a migration time range for migrating the intermediate state data of the service according to the heartbeat interval information;

[0019] According to the trigger time and the migration time range, while maintaining the business link that exists and is being processed in the source container, the business-side link is switched to between the target container and the link container, and the business intermediate state data of the source container is migrated to the target container.

[0020] In one embodiment, determining the triggering time for migrating service intermediate data according to the heartbeat link cycle information includes:

[0021] According to the heartbeat link cycle information, a start time of a new heartbeat link cycle is obtained as a trigger time for migrating the intermediate state data of the service;

[0022] The determining of the migration time range of the intermediate state data of the migration service according to the heartbeat interval information includes:

[0023] With respect to the start time of the new heartbeat link cycle, a time interval corresponding to the new heartbeat link cycle is determined according to the heartbeat interval information, and is used as a migration time range for the intermediate state data of the migration service.

[0024] In one embodiment, switching the service-side link to between the target container and the link container according to the trigger time and the migration time range while maintaining the service link that exists and is being processed in the source container, and migrating the service intermediate state data of the source container to the target container includes:

[0025] At the start time of the new heartbeat link cycle, maintaining the service link that exists and is being processed in the source container, and synchronizing the network configuration parameters of the source container to the target container;

[0026] During a time interval corresponding to the new heartbeat link period, the service-side link is switched to between the target container and the link container according to the network configuration parameters of the source container, and the incremental service intermediate state data in the source container is migrated to the target container.

[0027] In one embodiment, after the step of migrating the intermediate service data of the source container to the target container, the method further includes:

[0028] When the file directory in the source container is verified to be consistent with the file directory in the target container, the service link existing in and being processed in the source container is released.

[0029] In a second aspect, the present application further provides a container migration device, comprising:

[0030] A target migration task acquisition module is configured to acquire a target migration task; the target migration task is configured to hot migrate a source container in a cloud platform container management system, wherein a service-side link has been established between the source container and the linked container, and the target migration task includes a pre-migration subtask and a switching subtask;

[0031] A data pre-migration module is used to execute the pre-migration subtask and perform data pre-migration between the source container and the target container; the data pre-migration includes migration of container backup data and migration of incremental data of the source container;

[0032] A business intermediate data migration module is configured to execute the switching subtask after completing the pre-migration of the container backup data, and switch the business side link between the target container and the link container based on the heartbeat link information of the business side link while maintaining the business link that exists and is being processed in the source container, and migrate the business intermediate data of the source container to the target container.

[0033] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:

[0034] Obtain a target migration task; the target migration task is used to hot migrate the source container in the cloud platform container management system, a business-side link has been established between the source container and the link container, and the target migration task includes a pre-migration subtask and a switching subtask;

[0035] Executing the pre-migration subtask to pre-migrate data between the source container and the target container; the data pre-migration includes migration of container backup data and migration of incremental data of the source container;

[0036] After completing the pre-migration of the container backup data, the switching subtask is executed. According to the heartbeat link information of the business side link, while maintaining the business link that exists and is being processed in the source container, the business side link is switched between the target container and the link container, and the business intermediate data of the source container is migrated to the target container.

[0037] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:

[0038] Obtain a target migration task; the target migration task is used to hot migrate the source container in the cloud platform container management system, a business-side link has been established between the source container and the link container, and the target migration task includes a pre-migration subtask and a switching subtask;

[0039] Executing the pre-migration subtask to pre-migrate data between the source container and the target container; the data pre-migration includes migration of container backup data and migration of incremental data of the source container;

[0040] After completing the pre-migration of the container backup data, the switching subtask is executed. According to the heartbeat link information of the business side link, while maintaining the business link that exists and is being processed in the source container, the business side link is switched between the target container and the link container, and the business intermediate data of the source container is migrated to the target container.

[0041] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0042] Obtain a target migration task; the target migration task is used to hot migrate the source container in the cloud platform container management system, a business-side link has been established between the source container and the link container, and the target migration task includes a pre-migration subtask and a switching subtask;

[0043] Executing the pre-migration subtask to pre-migrate data between the source container and the target container; the data pre-migration includes migration of container backup data and migration of incremental data of the source container;

[0044] After completing the pre-migration of the container backup data, the switching subtask is executed. According to the heartbeat link information of the business side link, while maintaining the business link that exists and is being processed in the source container, the business side link is switched between the target container and the link container, and the business intermediate data of the source container is migrated to the target container.

[0045] The above-mentioned container migration method, device, computer equipment, storage medium and computer program product obtain a target migration task, which is used to hot migrate the source container in the cloud platform container management system. A business side link has been established between the source container and the linked container. The target migration task includes a pre-migration subtask and a switching subtask, and then the pre-migration subtask is executed to pre-migrate data between the source container and the target container. The data pre-migration includes the migration of container backup data and the migration of incremental data of the source container. After completing the pre-migration of the container backup data, the switching subtask is executed. According to the heartbeat link information of the business side link, while maintaining the business link that exists and is being processed in the source container, the business side link is switched to between the target container and the linked container, and the business intermediate state data of the source container is migrated to the target container, thereby realizing hot migration container optimization in the cloud platform container management system. The data pre-migration method and the intermediate state data transfer based on the heartbeat link information can be combined to achieve the purpose of transferring the full amount of intermediate state information of the container and utilizing the intermediate state data, avoiding the interruption of the container migration on the business and ensuring the continuity of the service. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 Schematic diagram of a process for migrating containers in one embodiment;

[0047] Figure 2 is a schematic diagram of a container architecture in one embodiment;

[0048] Figure 3 Schematic diagram of the process of migrating intermediate business data in one embodiment;

[0049] Figure 4 Schematic diagram of a container migration process in one embodiment;

[0050] Figure 5 is a flow chart of a container migration method according to another embodiment;

[0051] Figure 6 is a structural block diagram of a container migration device in one embodiment;

[0052] Figure 7 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0054] With the development of cloud computing and the application of virtualization technology, virtualization live migration has become a key technology for cloud services. It is also crucial for ensuring flexible deployment and high availability of communications services. Live migration of virtual machines preserves the entire operating state of a virtual machine and allows for rapid restoration to a different hardware platform. After restoration, the virtual machine continues to run smoothly, with users noticing any difference.

[0055] The emergence and development of container technology has made cloud native a mainstream approach to cloud-based application development, deployment, and operation. Kubernetes, a leading distributed architecture solution for container orchestration and scheduling, has gradually become a mainstream solution for using container technology and is widely used. As a result, there is a demand for hot migration of containers on Kubernetes, but there is still no good implementation solution for hot migration.

[0056] In the traditional method, it is necessary to disconnect the original link of the stateful container, then re-establish the link based on the migrated container and restart the session. After the stateful container establishes the link, the disconnection of the state link will cause business interruption and result in discontinuous service provision. Moreover, after the stateful link is rebuilt, the intermediate state data of the previous business cannot be used. However, the generated intermediate state data is valuable to the business service, resulting in a certain degree of waste of resources.

[0057] In one embodiment, Figure 1 As shown, a container migration method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, such as a cloud platform container management system, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0058] Step 101: Obtain target migration task;

[0059] The target migration task may be used to perform hot migration of the source container in the cloud platform container management system. The target migration task may include a pre-migration subtask and a switching subtask.

[0060] As an example, the source container may be a stateful container, that is, a service-side link, such as a stateful link, has been established between the source container and the link container.

[0061] In actual applications, containers can be hot migrated in the cloud platform container management system in response to user requests or when preset migration conditions are triggered. That is, a target migration task for the source container can be obtained to hot migrate the statefully linked source container.

[0062] Specifically, as communication network elements (NEs) become increasingly cloud-native, cloud data centers host containers for various cloud services. These containers can be centrally scheduled based on Kubernetes, the cloud platform's container management system. For example, Kubernetes can orchestrate and manage NE containers. By obtaining target migration tasks, stateful containers (i.e., source containers) can be hot migrated within the Kubernetes environment.

[0063] Step 102: Execute the pre-migration subtask to pre-migrate data between the source container and the target container.

[0064] The target container may be a newly created container for the target migration task, which may be used for hot migration of the source container.

[0065] As an example, data pre-migration may include migration of container backup data and migration of incremental data of the source container.

[0066] In a specific implementation, the first migration instruction information and the incremental migration instruction information can be obtained from the pre-migration subtask, and then the container backup data of the source container can be migrated to the target container according to the first migration instruction information. For example, a full backup of the link, storage, and content information can be performed for the first time. Then, the container incremental data of the source container can be synchronized to the target container according to the preset time interval in the incremental migration instruction information, such as performing incremental backup at every preset time interval.

[0067] Step 103: After completing the pre-migration of the container backup data, execute the switching subtask. According to the heartbeat link information of the business side link, while maintaining the business link that exists and is being processed in the source container, switch the business side link between the target container and the link container, and migrate the business intermediate data of the source container to the target container.

[0068] The heartbeat link information may include heartbeat link cycle information and heartbeat interval information, such as the start time of the heartbeat link cycle and the heartbeat interval time.

[0069] After completing the pre-migration of the container backup data, the trigger time for migrating the business intermediate data can be determined based on the heartbeat link information of the business side link and the heartbeat link cycle information, and the migration time range for migrating the business intermediate data can be determined based on the heartbeat interval information. Then, according to the trigger time and migration time range, while maintaining the business link that exists and is being processed in the source container, the business side link can be switched between the target container and the linked container, and the business intermediate data of the source container can be migrated to the target container.

[0070] In one example, if Figure 2 As shown, migration can be triggered at the beginning of a new heartbeat link cycle by keeping the source container (such as Figure 2 The existing and processing link in container A) synchronizes the network configuration parameters of the source container to the target container (such as Figure 2 Container A'), such as the IP address, can complete the service side link switching within the heartbeat interval (such as Figure 2 There is a state link between container B and container A'), and the files of the source container are migrated to incrementally migrate the source files (ie, business intermediate state data) to the target container.

[0071] In another example, in a Kubernetes environment, by adopting the container migration method of the present application to hot migrate stateful containers (i.e., source containers), hot migration of cloud-native containers of communication network elements can be achieved without affecting the business, effectively enhancing the high availability and resource scheduling flexibility of cloud-native network elements, ensuring the high reliability of the business of network element containers, and meeting business requirements such as online upgrades of underlying infrastructure, avoiding the impact of container migration and copy management on business interruptions.

[0072] Compared with traditional methods, the technical solution of this embodiment adopts a full and subsequent incremental migration method to pre-migrate or back up key containers in advance, thereby ensuring data availability and completing data transfer within one heartbeat interval. It realizes the full transfer of intermediate information of the container and the utilization of intermediate data, and can ensure service continuity.

[0073] In the above container migration method, by obtaining the target migration task and then executing the pre-migration subtask, data is pre-migrated between the source container and the target container, and then after completing the pre-migration of the container backup data, the switching subtask is executed. According to the heartbeat link information of the business side link, while maintaining the business link that exists and is being processed in the source container, the business side link is switched to between the target container and the link container, and the business intermediate state data of the source container is migrated to the target container, realizing the hot migration container optimization in the cloud platform container management system. The data pre-migration method and the intermediate state data transfer based on the heartbeat link information can be combined to achieve the purpose of transferring the full amount of intermediate state information of the container and utilizing the intermediate state data, avoiding the interruption of the container migration on the business and ensuring the continuity of the service.

[0074] In one embodiment, executing the pre-migration subtask to pre-migrate data between the source container and the target container may include the following steps:

[0075] From the pre-migration subtask, obtain the first migration indication information and the incremental migration indication information; according to the first migration indication information, migrate the container backup data of the source container to the target container; according to the preset time interval in the incremental migration indication information, synchronize the container incremental data of the source container to the target container.

[0076] In actual applications, the copy of the source container (i.e., the source container) can be synchronized to the server where the target container is located at regular intervals. By performing a full backup of the link, storage, and content information for the first time, that is, according to the first migration instruction information, the container backup data of the source container is migrated to the target container, and incremental backups can be performed at intervals of T1 thereafter, that is, according to the preset time interval in the incremental migration instruction information, the container incremental data of the source container is synchronized to the target container.

[0077] In this embodiment, by obtaining the first migration indication information and the incremental migration indication information from the pre-migration subtask, and then migrating the container backup data of the source container to the target container according to the first migration indication information, and then synchronizing the container incremental data of the source container to the target container according to the preset time interval in the incremental migration indication information, key containers can be pre-migrated or backed up in advance based on the full and subsequent incremental migration methods, thereby ensuring data availability and improving container migration efficiency.

[0078] In one embodiment, before the step of executing the switching subtask, the following steps may be further included:

[0079] detecting a network connection status between a server corresponding to the source container and a server corresponding to the target container, and determining whether the source container and the target container are in a network connectivity state; and executing the switching subtask if the source container and the target container are in a network connectivity state.

[0080] In a specific implementation, by detecting the network connectivity between the target server and the source server (i.e., detecting the network connection status between the server corresponding to the source container and the server corresponding to the target container), such as by using the ping command or Telnet command, the switching subtask can be executed when it is determined that the network connectivity is guaranteed, such as triggering migration at the beginning of a new heartbeat link cycle.

[0081] In this embodiment, by detecting the network connection status between the server corresponding to the source container and the server corresponding to the target container, it is determined whether the source container and the target container are in a network connectivity state. Then, when the source container and the target container are in a network connectivity state, the switching subtask step is executed. This can trigger migration when the network connectivity of the newly created container is guaranteed in advance, thereby improving the efficiency of container migration.

[0082] In one embodiment, Figure 3 As shown, the switching of the business side link between the target container and the link container based on the heartbeat link information of the business side link while maintaining the business link that exists and is being processed in the source container, and migrating the business intermediate state data of the source container to the target container may include the following steps:

[0083] Step 301: Acquire heartbeat link cycle information and heartbeat interval information from the heartbeat link information of the service side link;

[0084] Step 302: determining a trigger time for migrating the intermediate state data of the service according to the heartbeat link cycle information, and determining a migration time range for migrating the intermediate state data of the service according to the heartbeat interval information;

[0085] Step 303: According to the trigger time and the migration time range, while maintaining the business link that exists and is being processed in the source container, switch the business side link to between the target container and the link container, and migrate the business intermediate data of the source container to the target container.

[0086] For example, Figure 4 As shown, the container migration method of the present application is mainly based on the source container (i.e., source container), the target container (i.e., target container), and the server where the target container is located. The migration can be triggered at the beginning of a new heartbeat link cycle (i.e., the trigger time of migrating the intermediate data of the business). By maintaining the source container service request (i.e., maintaining the business link that exists and is being processed in the source container) and updating the IP address, such as synchronizing the network-related configuration parameters of the source container to the target container, the link between the source container and the link container can be disconnected, and the business side link switching can be completed within the heartbeat interval (i.e., the migration time range of migrating the intermediate data of the business), that is, the business side link is switched between the target container and the link container, and the source copy files and incremental layer files of the source container are migrated, such as link-related information, storage-related information, memory-related information, etc., so that the business service can be restored after the migration of the latest incremental layer is completed.

[0087] In this embodiment, the heartbeat link cycle information and the heartbeat interval information are obtained from the heartbeat link information of the business side link, and then the trigger time for migrating the business intermediate state data is determined according to the heartbeat link cycle information, and the migration time range for migrating the business intermediate state data is determined according to the heartbeat interval information. Then, according to the trigger time and the migration time range, while maintaining the business link that exists and is being processed in the source container, the business side link is switched between the target container and the link container, and the business intermediate state data of the source container is migrated to the target container. The data transfer can be completed within one heartbeat interval, thereby realizing the transfer of the full amount of intermediate state information of the container and the utilization of the intermediate state data, and ensuring the continuity of the service.

[0088] In one embodiment, determining the triggering time for migrating service intermediate data according to the heartbeat link cycle information may include the following steps:

[0089] According to the heartbeat link cycle information, a start time of a new heartbeat link cycle is obtained as a trigger time for migrating the intermediate state data of the service;

[0090] The determining of the migration time range of the intermediate state data of the migration service according to the heartbeat interval information includes:

[0091] With respect to the start time of the new heartbeat link cycle, a time interval corresponding to the new heartbeat link cycle is determined according to the heartbeat interval information, and is used as a migration time range for the intermediate state data of the migration service.

[0092] In one example, the start time of a new heartbeat link cycle can be determined for the current moment based on the heartbeat link cycle information of the business side link, which can be used as the trigger time for migrating the intermediate state data of the business, so as to trigger the migration at the start time of a new heartbeat link cycle; the time interval corresponding to the new heartbeat link cycle can be determined based on the start time of the new heartbeat link cycle according to the heartbeat interval information of the business side link, which can be used as the migration time range for migrating the intermediate state data of the business, so as to complete the data transfer within one heartbeat interval.

[0093] In this embodiment, the start time of the new heartbeat link cycle is obtained based on the heartbeat link cycle information, which is used as the trigger time for migrating the intermediate data of the business. In addition, the time interval corresponding to the new heartbeat link cycle is determined based on the heartbeat interval information as the migration time range for migrating the intermediate data of the business. This can help to accurately execute the container migration process and improve the efficiency of container migration.

[0094] In one embodiment, switching the service-side link to between the target container and the link container according to the trigger time and the migration time range while maintaining the service link that exists and is being processed in the source container, and migrating the service intermediate state data of the source container to the target container may include the following steps:

[0095] At the start time of the new heartbeat link cycle, the service link that exists and is being processed in the source container is maintained, and the network configuration parameters of the source container are synchronized to the target container. Within a time interval corresponding to the new heartbeat link cycle, the service-side link is switched between the target container and the link container according to the network configuration parameters of the source container, and incremental service intermediate state data in the source container is migrated to the target container.

[0096] In actual applications, migration can be triggered at the beginning of a new heartbeat link cycle while ensuring the network connectivity of the newly created container in advance. By maintaining the existing and being processed links (that is, the business links that exist and are being processed in the source container), the network configuration parameters (such as the IP address) of the source container (that is, the source container) are synchronized to the target container. The data transfer can be completed within a heartbeat interval (that is, the time interval), thereby ensuring the consistency of the IP address and the continuity of the service.

[0097] For example, migration can be triggered at the beginning of a new heartbeat link cycle, and the heartbeat link duration can be T2. By maintaining the existing processing link, the source container network configuration (including IP address) is synchronized to the target container, the business side link switching is completed within the heartbeat interval, and the file migration of the source container is performed, and the source files are incrementally migrated.

[0098] In this embodiment, by maintaining the service link that exists and is being processed in the source container at the start of a new heartbeat link cycle, the network configuration parameters of the source container are synchronized to the target container. Then, within the time interval corresponding to the new heartbeat link cycle, the service-side link is switched between the target container and the link container according to the network configuration parameters of the source container, and the incremental service intermediate data in the source container is migrated to the target container. This ensures the consistency of the IP address and the continuity of the service.

[0099] In one embodiment, after the step of migrating the intermediate service data of the source container to the target container, the following steps may be further included:

[0100] When the file directory in the source container is verified to be consistent with the file directory in the target container, the service link existing in and being processed in the source container is released.

[0101] In one example, after the latest incremental layer migration is completed, the target container file directory can be checked to see if it is consistent with the source container. If they are consistent, the verification is completed, the migration is ended, and the held links are released. That is, when the file directory in the source container is checked to be consistent with the file directory in the target container, the business links that exist and are being processed in the source container are released.

[0102] In order to enable those skilled in the art to better understand the above steps, Figure 4 The embodiment of the present application is illustrated by an example, but it should be understood that the embodiment of the present application is not limited to this.

[0103] Step 1: By regularly synchronizing the copy of the source container to the server where the target container is located, a full backup of the link, storage, and content information can be performed the first time, and then incremental backups can be performed at intervals of T1.

[0104] Step 2: You can check the network connectivity between the target server and the source server (for example, using ping or Telnet). Only proceed to step 3 if the connectivity in step 2 is guaranteed.

[0105] Step 3: You can trigger the migration at the start of a new heartbeat link cycle (for example, the heartbeat link duration can be T2), hold the existing link in progress, and synchronize the source container's network configuration (such as the IP address) to the target container;

[0106] Step 4: The business-side link switch can be completed within the heartbeat interval, and the source container files can be migrated to incrementally migrate the source files.

[0107] Step 5: After the latest incremental layer migration is complete, you can check whether the target container file directory is consistent with the source container. If they are consistent, the verification is complete, the migration ends, and the held link is released.

[0108] In an optional embodiment, the container migration method of the present application can be applied to the cloud-native deployment of communication network elements, which may involve research and verification of cloud-native business gateways, cloud-native base management and operation and maintenance technologies. The cloud-native deployment of communication network elements based on the technical solution of this embodiment does not require the use of manual experience for load prediction, and the impact of insufficient manual experience can be eliminated as much as possible; real-time predictions can be made based on load monitoring data, and changes in business container loads can be predicted. Real-time dynamic adjustment of resource scheduling and allocation can be made based on the cloud platform container management system. By decomposing the predicted value into trend components, periodic components, and data mutation item components, the cyclical and seasonal factors of the business are fully considered, effectively improving the prediction accuracy; data cleaning functions and training models can also be combined to eliminate the impact of accidental anomalies that may exist in the system on load prediction as much as possible; hybrid scheduling methods can also be combined to design a step-by-step dual-threshold adjustment between migrating containers or migrating virtual machines to quickly and efficiently realize the migration judgment of container or virtual machine loads.

[0109] In this embodiment, by releasing the business link that exists and is being processed in the source container when verifying that the file directory in the source container is consistent with the file directory in the target container, the integrity of the container data migration can be ensured.

[0110] In one embodiment, Figure 5 As shown, a flow chart of another container migration method is provided. In this embodiment, the method includes the following steps:

[0111] In step 501, a target migration task is obtained; the target migration task is used to perform a hot migration of a source container in the cloud platform container management system. A business-side link has been established between the source container and the linked container. In step 502, initial migration instruction information and incremental migration instruction information are obtained. According to the initial migration instruction information, the container backup data of the source container is migrated to the target container. According to the preset time interval in the incremental migration instruction information, the container incremental data of the source container is synchronized to the target container. In step 503, after completing the pre-migration of the container backup data, the network connection status between the server corresponding to the source container and the server corresponding to the target container is detected to determine whether the source container and the target container are in a network connection state. In step 504, if the source container and the target container are in a network connection state, the heartbeat link period information and heartbeat interval information are obtained from the heartbeat link information of the business-side link. In step 505, the trigger time for migrating the business intermediate state data is determined based on the heartbeat link period information, and the migration time range for migrating the business intermediate state data is determined based on the heartbeat interval information. In step 506, based on the trigger time and migration time range, while maintaining the business link that exists and is being processed in the source container, the business-side link is switched between the target container and the link container, and the source container's business intermediate state data is migrated to the target container. In step 507, after verifying that the file directory in the source container is consistent with the file directory in the target container, the business link that exists and is being processed in the source container is released. It should be noted that the specific definitions of the above steps can be found in the specific definitions of a container migration method above and will not be repeated here.

[0112] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed 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 portion of steps or stages in other steps.

[0113] Based on the same inventive concept, embodiments of the present application also provide a container migration device for implementing the aforementioned container migration method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more container migration device embodiments provided below can be found in the above-described limitations of the container migration method and will not be further elaborated here.

[0114] In one embodiment, Figure 6 As shown, a container migration device is provided, comprising:

[0115] Target migration task acquisition module 601 is used to acquire a target migration task; the target migration task is used to hot migrate a source container in the cloud platform container management system, where a service-side link has been established between the source container and the linked container, and the target migration task includes a pre-migration subtask and a switching subtask;

[0116] A data pre-migration module 602 is configured to execute the pre-migration subtask and perform data pre-migration between the source container and the target container; the data pre-migration includes migration of container backup data and migration of incremental data of the source container;

[0117] The business intermediate data migration module 603 is used to execute the switching subtask after completing the pre-migration of the container backup data. According to the heartbeat link information of the business side link, while maintaining the business link that exists and is being processed in the source container, the business side link is switched between the target container and the link container, and the business intermediate data of the source container is migrated to the target container.

[0118] In one embodiment, the data pre-migration module 602 includes:

[0119] A migration instruction information acquisition submodule, configured to acquire initial migration instruction information and incremental migration instruction information from the pre-migration subtask;

[0120] a first migration submodule, configured to migrate the container backup data of the source container to the target container according to the first migration instruction information;

[0121] The incremental migration submodule is configured to synchronize the incremental container data of the source container to the target container according to a preset time interval in the incremental migration instruction information.

[0122] In one embodiment, the apparatus further comprises:

[0123] a network connectivity status determination module, configured to detect the network connectivity status between the server corresponding to the source container and the server corresponding to the target container, and determine whether the source container and the target container are in a network connectivity status;

[0124] The switching execution module is configured to execute the switching subtask when the source container and the target container are in a network connected state.

[0125] In one embodiment, the service intermediate data migration module 603 includes:

[0126] A period information and interval information acquisition submodule, configured to acquire heartbeat link period information and heartbeat interval information from the heartbeat link information of the service side link;

[0127] A trigger time and migration time range determination submodule, configured to determine a trigger time for migrating service intermediate state data according to the heartbeat link cycle information, and to determine a migration time range for migrating service intermediate state data according to the heartbeat interval information;

[0128] The migration processing submodule is configured to switch the business-side link between the target container and the link container according to the trigger time and the migration time range, while maintaining the business link that exists and is being processed in the source container, and migrate the business intermediate state data of the source container to the target container.

[0129] In one embodiment, the trigger time and migration time range determination submodule includes:

[0130] A starting time obtaining unit, configured to obtain a starting time of a new heartbeat link cycle according to the heartbeat link cycle information as a triggering time for migrating the intermediate state data of the service;

[0131] The trigger time and migration time range determination submodule includes:

[0132] The time interval obtaining unit is configured to determine, based on the heartbeat interval information and the start time of the new heartbeat link cycle, a time interval corresponding to the new heartbeat link cycle as a migration time range for the intermediate state data of the migration service.

[0133] In one embodiment, the migration processing submodule includes:

[0134] a network configuration parameter synchronization unit, configured to maintain the service link existing and being processed in the source container at the start time of the new heartbeat link cycle, and synchronize the network configuration parameters of the source container to the target container;

[0135] The time interval migration unit is configured to switch the service-side link to between the target container and the link container according to the network configuration parameters of the source container within the time interval corresponding to the new heartbeat link period, and migrate the incremental service intermediate state data in the source container to the target container.

[0136] In one embodiment, the apparatus further comprises:

[0137] The checking module is configured to release the business link that exists and is being processed in the source container when checking that the file directory in the source container is consistent with the file directory in the target container.

[0138] Each module in the container migration device described above can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor within a computer device in hardware form, or stored in a computer device memory in software form, allowing the processor to call and execute the corresponding operations of each module.

[0139] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are 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 and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. 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 in a wired or wireless manner. The wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a container migration method is implemented.

[0140] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution 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 component arrangement.

[0141] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0142] Obtain a target migration task; the target migration task is used to hot migrate the source container in the cloud platform container management system, a business-side link has been established between the source container and the link container, and the target migration task includes a pre-migration subtask and a switching subtask;

[0143] Executing the pre-migration subtask to pre-migrate data between the source container and the target container; the data pre-migration includes migration of container backup data and migration of incremental data of the source container;

[0144] After completing the pre-migration of the container backup data, the switching subtask is executed. According to the heartbeat link information of the business side link, while maintaining the business link that exists and is being processed in the source container, the business side link is switched between the target container and the link container, and the business intermediate data of the source container is migrated to the target container.

[0145] In one embodiment, when the processor executes the computer program, it also implements the steps of the container migration method in the other embodiments described above.

[0146] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0147] Obtain a target migration task; the target migration task is used to hot migrate the source container in the cloud platform container management system, a business-side link has been established between the source container and the link container, and the target migration task includes a pre-migration subtask and a switching subtask;

[0148] Executing the pre-migration subtask to pre-migrate data between the source container and the target container; the data pre-migration includes migration of container backup data and migration of incremental data of the source container;

[0149] After completing the pre-migration of the container backup data, the switching subtask is executed. According to the heartbeat link information of the business side link, while maintaining the business link that exists and is being processed in the source container, the business side link is switched between the target container and the link container, and the business intermediate data of the source container is migrated to the target container.

[0150] In one embodiment, when the computer program is executed by a processor, the steps of the container migration method in the other embodiments described above are also implemented.

[0151] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0152] Obtain a target migration task; the target migration task is used to hot migrate the source container in the cloud platform container management system, a business-side link has been established between the source container and the link container, and the target migration task includes a pre-migration subtask and a switching subtask;

[0153] Executing the pre-migration subtask to pre-migrate data between the source container and the target container; the data pre-migration includes migration of container backup data and migration of incremental data of the source container;

[0154] After completing the pre-migration of the container backup data, the switching subtask is executed. According to the heartbeat link information of the business side link, while maintaining the business link that exists and is being processed in the source container, the business side link is switched between the target container and the link container, and the business intermediate data of the source container is migrated to the target container.

[0155] In one embodiment, when the computer program is executed by a processor, the steps of the container migration method in the other embodiments described above are also implemented.

[0156] 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 the relevant laws, regulations and standards of relevant countries and regions.

[0157] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented 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 memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may 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 may include random access memory (RAM) or external cache memory, etc. By way of 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 the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.

[0158] The technical features of the above embodiments can be combined arbitrarily. In order 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 specification.

[0159] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A container migration method, characterized in that: The method comprises: Obtain a target migration task; the target migration task is used to hot migrate the source container in the cloud platform container management system, a business-side link has been established between the source container and the link container, and the target migration task includes a pre-migration subtask and a switching subtask; Executing the pre-migration subtask to pre-migrate data between the source container and the target container; the data pre-migration includes migration of container backup data and migration of incremental data of the source container; After completing the pre-migration of the container backup data, executing the switching subtask, according to the heartbeat link information of the business side link, while maintaining the business link that exists and is being processed in the source container, switching the business side link to between the target container and the link container, and migrating the business intermediate state data of the source container to the target container; including: obtaining heartbeat link cycle information and heartbeat interval information from the heartbeat link information of the business side link, determining the trigger time for migrating the business intermediate state data according to the heartbeat link cycle information, and determining the migration time range for migrating the business intermediate state data according to the heartbeat interval information, according to the trigger time and the migration time range, while maintaining the business link that exists and is being processed in the source container, switching the business side link to between the target container and the link container, and migrating the business intermediate state data of the source container to the target container.

2. The method according to claim 1, characterized in that The executing the pre-migration subtask to pre-migrate data between the source container and the target container includes: Obtaining initial migration instruction information and incremental migration instruction information from the pre-migration subtask; Migrating the container backup data of the source container to the target container according to the first migration instruction information; Synchronize the container incremental data of the source container to the target container according to a preset time interval in the incremental migration instruction information.

3. The method according to claim 1, characterized in that Before the step of executing the switching subtask, the method further includes: Detecting a network connection status between a server corresponding to the source container and a server corresponding to the target container, and determining whether the source container and the target container are in a network connectivity state; When the source container and the target container are in network connectivity, the switching subtask is executed.

4. The method according to claim 1, wherein The determining the triggering time of migrating the intermediate state data of the service according to the heartbeat link cycle information includes: According to the heartbeat link cycle information, a start time of a new heartbeat link cycle is obtained as a trigger time for migrating the intermediate state data of the service; The determining of the migration time range of the intermediate state data of the migration service according to the heartbeat interval information includes: With respect to the start time of the new heartbeat link cycle, a time interval corresponding to the new heartbeat link cycle is determined according to the heartbeat interval information, and is used as a migration time range for the intermediate state data of the migration service.

5. The method according to claim 4, characterized in that The step of switching the service-side link to between the target container and the link container according to the trigger time and the migration time range while maintaining the service link that exists and is being processed in the source container, and migrating the service intermediate state data of the source container to the target container includes: At the start time of the new heartbeat link cycle, maintaining the service link that exists and is being processed in the source container, and synchronizing the network configuration parameters of the source container to the target container; During a time interval corresponding to the new heartbeat link period, the service-side link is switched to between the target container and the link container according to the network configuration parameters of the source container, and the incremental service intermediate state data in the source container is migrated to the target container.

6. The method according to any one of claims 1 to 5, characterized in that After the step of migrating the intermediate service data of the source container to the target container, the method further includes: When the file directory in the source container is verified to be consistent with the file directory in the target container, the service link existing in and being processed in the source container is released.

7. A container migration device, characterized in that: The device comprises: A target migration task acquisition module is configured to acquire a target migration task; the target migration task is configured to hot migrate a source container in a cloud platform container management system, wherein a service-side link has been established between the source container and the linked container, and the target migration task includes a pre-migration subtask and a switching subtask; A data pre-migration module is used to execute the pre-migration subtask and perform data pre-migration between the source container and the target container; the data pre-migration includes migration of container backup data and migration of incremental data of the source container; a service intermediate state data migration module, configured to, after completing the pre-migration of the container backup data, execute the switching subtask, switch the service side link between the target container and the link container based on the heartbeat link information of the service side link while maintaining the service link that exists and is being processed in the source container, and migrate the service intermediate state data of the source container to the target container; The intermediate data migration module includes: A period information and interval information acquisition submodule, configured to acquire heartbeat link period information and heartbeat interval information from the heartbeat link information of the service side link; A trigger time and migration time range determination submodule, configured to determine a trigger time for migrating service intermediate state data according to the heartbeat link cycle information, and to determine a migration time range for migrating service intermediate state data according to the heartbeat interval information; The migration processing submodule is configured to switch the business-side link between the target container and the link container according to the trigger time and the migration time range, while maintaining the business link that exists and is being processed in the source container, and migrate the business intermediate state data of the source container to the target container.

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 6 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 6 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 6 are implemented.

Citation Information

Patent Citations

  • Container group migration method, electronic equipment and storage medium

    CN114816656A

  • Cloud security computing method and device based on cloud fault-tolerant technology, and storage medium

    CN114827148A