Container migration method and device, electronic equipment and storage medium

CN122733418APending Publication Date: 2026-09-11TENCENT DIGITAL TIANJIN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510287129.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-11
Publication Date
2026-09-11

AI Technical Summary

Benefits of technology

本申请实施例提供的容器迁移方法,源主机中的源业务容器在接收到管理子节点发送的迁移指示后,根据预配置的目标迁移策略确定待迁移的业务数据,将业务数据保存到第一存储空间,当源主机的管理子节点确定业务数据存储到第一存储空间的情况下,将业务数据发送至目的主机,以使目的主机基于业务数据执行业务恢复操作。由于源业务容器待迁移的业务数据是基于源业务容器对应的目标子业务的数据迁移策略所确定的,相较于源业务容器中全量的数据迁移,基于目标子业务的数据迁移策略大大降低了容器迁移过程中需要迁移的数据量,提高了容器迁移的效率,有效降低了容器迁移的业务停机时间和迁移总时间。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122733418A_ABST
    Figure CN122733418A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a container migration method and device, electronic equipment and storage medium, which can be related to the fields of cloud computing, container technology, etc. The method comprises: a management sub-node of a source host in a business processing system receiving a container migration instruction, and sending a migration instruction to a source business container according to a container identifier contained in the container migration instruction, so that the source business container determines to-be-migrated business data according to a preconfigured target migration strategy after receiving the migration instruction, saves the business data to a first storage space shared between the management sub-node of the source host and the source business container, and sends the business data to a destination host when determining that the business data is stored in the first storage space, so that the destination host performs a business recovery operation based on the business data. Based on the method, the amount of data that needs to be migrated during the container migration process is greatly reduced, and the efficiency of the container migration is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of computer technology and may relate to fields such as cloud computing and container technology. Specifically, this application relates to a container migration method, apparatus, electronic device and storage medium. Background Technology

[0002] Containers are a lightweight virtualization technology that packages an application and its dependent runtime environment, libraries, configuration files, etc., together to form an independent, portable running unit. Due to their lightweight, portable, and easy-to-deploy characteristics, containers are widely used in various application scenarios, such as cloud computing, microservice architecture, continuous integration, and continuous delivery (CI / CD).

[0003] In the above application scenarios, in order to meet the needs of rapid business changes and expansion, containers need to be managed and scheduled flexibly. Taking container hot migration as an example, through hot migration, containers in the cluster can be redistributed and adjusted without affecting business, thereby improving the overall performance and reliability of the cluster.

[0004] During container hot migration, it is inevitable to pause business operations. However, minimizing downtime is crucial to ensuring the normal operation of services. Summary of the Invention

[0005] The purpose of this application is to provide a container migration method, apparatus, electronic device, and storage medium that can improve container migration efficiency and shorten service downtime. To achieve this purpose, the technical solutions provided by this application are as follows: On one hand, this application provides a container migration method, which is applied to a business processing system. The business processing system includes multiple business hosts, each of which includes a management sub-node and at least one business container for a sub-business. The method is executed by the management sub-node in the source host, which is any one of the multiple business hosts. The method includes: Receive a container migration instruction, wherein the container migration instruction includes the container identifier of the source service container where the service data to be migrated is located, and the identifier of the destination host; According to the container identifier, a migration instruction is sent to the source service container, so that after receiving the migration instruction, the source service container obtains a pre-configured target migration policy, determines the service data to be migrated according to the target migration policy, and saves the service data to a first storage space, wherein the first storage space is a shared storage space between the management sub-node of the source host and the source service container, and the target migration policy is a data migration policy for the target sub-service corresponding to the source service container; If it is determined that the source service container stores the service data in the first storage space, the service data is sent to the destination host according to the identifier of the destination host, so that the destination host performs a service recovery operation based on the service data.

[0006] On the other hand, this application embodiment also provides a container migration device, which is deployed in the management sub-node of the source host in the business processing system. The business processing system includes multiple business hosts, each of which includes a management sub-node and at least one business container for a sub-business. The source host is any one of the multiple business hosts. The device includes: The instruction receiving module is used to receive container migration instructions, wherein the container migration instructions include the container identifier of the source service container where the service data to be migrated is located, and the identifier of the destination host to which it is to be migrated; A migration instruction sending module is used to send a migration instruction to the source service container according to the container identifier, so that after receiving the migration instruction, the source service container obtains a pre-configured target migration strategy, determines the service data to be migrated according to the target migration strategy, and saves the service data to a first storage space, wherein the first storage space is a shared storage space between the management sub-node of the source host and the source service container, and the target migration strategy is a data migration strategy for the target sub-service corresponding to the source service container; The service data sending module is used to send the service data to the destination host according to the identifier of the destination host when it is determined that the source service container stores the service data in the first storage space, so that the destination host can perform a service recovery operation based on the service data.

[0007] Optionally, the service recovery operation is performed by the destination host in the following manner: The management sub-node of the destination host creates a second storage space and a new service container, wherein the second storage space is a shared storage space between the new service container and the management sub-node of the destination host; The management sub-node of the destination host stores the business data in the second storage space so that the new business container can perform business recovery based on the business data stored in the second storage space.

[0008] Optionally, the service recovery based on the service data stored in the second storage space is performed by the new service container in the following manner: If it is determined that the management sub-node of the target host stores the service data in the second storage space, a target recovery strategy is obtained, and service recovery is performed according to the target recovery strategy and the service data in the second storage space. The target recovery strategy is a recovery strategy for the service status of the target sub-service.

[0009] Optionally, the step of determining that the management sub-node of the destination host stores the business data in the second storage space is made by the new business container through the following methods: The second storage space is detected, and when the second identifier is detected, it is determined that the management sub-node of the destination host will store the business data in the second storage space. The device further includes a post-processing module, which can be used for: Upon receiving a migration completion indication from the management sub-node in the destination host, the source service container is deleted. The migration completion indication is sent by the management sub-node of the destination host when it determines that the second identifier in the second storage space has been deleted. The second identifier is deleted from the second storage space by the new service container after the service recovery is completed.

[0010] Optionally, the business processing system further includes a management host, and the new business container is created by the management sub-node of the destination host in the following manner: The system receives a container creation instruction sent by the management host; wherein the container creation instruction is sent by the management host when it determines that the container migration conditions are met and the destination host is the host to which the business data to be migrated is to be migrated. Based on the container creation instruction, determine the container configuration information of the source service container; Based on the container configuration information of the source service container, a new service container is created.

[0011] Optionally, the source service container stores the service data in the first storage space in the following manner: The first storage space is detected at preset time intervals; When a first identifier is detected in the first storage space, it is determined that the source service container stores the service data in the first storage space; The first identifier is an identifier created and saved in the first storage space after the source service container stores the service data in the first storage space.

[0012] Optionally, the conditions for satisfying container migration include any one of the following: Receive migration commands for the source service container; or The source host's operating parameters under each of at least one metric dimension are greater than the parameter threshold corresponding to that metric dimension; or The source business container has operating parameters in at least one metric dimension that are greater than the parameter threshold corresponding to that metric dimension.

[0013] On the other hand, this application embodiment also provides a container migration method, which is applied to a business processing system. The business processing system includes multiple business hosts, each of which includes a management sub-node and at least one business container for a sub-business. The method is executed by the management sub-node of the destination host, and the destination host is any one of the multiple business hosts. Receive service data sent by the management sub-node of the source host; wherein the source host is any service host among the plurality of service hosts other than the destination host; A new service container is created in the destination host so that the new service container can perform service recovery based on the service data; The service data is obtained by the management sub-node of the source host from the first storage space and sent to the management sub-node of the destination host according to the identifier of the destination host. The first storage space is a shared storage space between the management sub-node of the source host and the source service container. The service data in the first storage space is determined and saved by the source service container according to the pre-configured target migration policy after receiving the migration instruction. The migration instruction is sent by the management sub-node of the source host to the source service container after receiving the container migration instruction. The container migration instruction includes the container identifier of the source service container and the identifier of the destination host. The target migration policy is a data migration policy for the target sub-service corresponding to the source service container.

[0014] On the other hand, this application embodiment also provides a container migration device, which is deployed in the management sub-node of the destination host in a business processing system. The business processing system includes multiple business hosts, each of which includes a management sub-node and at least one business container for a sub-business. The destination host is any one of the multiple business hosts. A business data receiving module is used to receive business data sent by the management sub-node of the source host; wherein the source host is any business host other than the destination host among the plurality of business hosts; A container creation module is used to create a new service container in the destination host so that the new service container can perform service recovery based on the service data. The service data is obtained by the management sub-node of the source host from the first storage space and sent to the management sub-node of the destination host according to the identifier of the destination host. The first storage space is a shared storage space between the management sub-node of the source host and the source service container. The service data in the first storage space is determined and saved by the source service container according to the pre-configured target migration policy after receiving the migration instruction. The migration instruction is sent by the management sub-node of the source host to the source service container after receiving the container migration instruction. The container migration instruction includes the container identifier of the source service container and the identifier of the destination host. The target migration policy is a data migration policy for the target sub-service corresponding to the source service container.

[0015] Optionally, the service recovery operation is performed by the management sub-node of the destination host in the following manner: Create a second storage space and a new service container, wherein the second storage space is a shared storage space between the new service container and the management sub-node of the destination host; The business data is stored in the second storage space so that the new business container can perform business recovery based on the business data stored in the second storage space.

[0016] Optionally, the service recovery based on the service data stored in the second storage space is performed by the new service container in the following manner: If it is determined that the management sub-node of the target host stores the service data in the second storage space, a target recovery strategy is obtained, and service recovery is performed according to the target recovery strategy and the service data in the second storage space. The target recovery strategy is a recovery strategy for the service status of the target sub-service.

[0017] Optionally, the step of determining that the management sub-node of the destination host stores the business data in the second storage space is made by the new business container through the following methods: The second storage space is detected, and when the second identifier is detected, it is determined that the management sub-node of the destination host will store the business data in the second storage space. The method further includes: Upon receiving a migration completion indication from the management sub-node in the destination host, the source service container is deleted. The migration completion indication is sent by the management sub-node of the destination host when it determines that the second identifier in the second storage space has been deleted. The second identifier is deleted from the second storage space by the new service container after the service recovery is completed.

[0018] Optionally, the business processing system may further include a management host; The container creation module can be used for: The system receives a container creation instruction sent by the management host; wherein the container creation instruction is sent by the management host after determining that the container migration conditions are met and the destination host is the host to which the container is to be migrated. Based on the container creation instruction, determine the container configuration information of the source service container; Based on the container configuration information of the source service container, a new service container is created.

[0019] Optionally, the business data in the first storage space is saved by the source business container in the following way: The first storage space is detected at preset time intervals; When a first identifier is detected in the first storage space, it is determined that the source service container stores the service data in the first storage space; The first identifier is an identifier created and saved in the first storage space after the source service container stores the service data in the first storage space.

[0020] Optionally, the conditions for satisfying container migration include any one of the following: Received a migration command for the source service container; or The source host's operating parameters under each of at least one metric dimension are greater than the parameter threshold corresponding to that metric dimension; or The source business container has operating parameters in at least one metric dimension that are greater than the parameter threshold corresponding to that metric dimension.

[0021] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method provided in any optional embodiment of this application.

[0022] On the other hand, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method provided in any optional embodiment of this application.

[0023] On the other hand, embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the methods provided in any optional embodiment of this application.

[0024] The beneficial effects of the technical solution provided in this application are as follows: The container migration method provided in this application involves the source service container in the source host receiving a migration instruction from a management sub-node. The container determines the service data to be migrated based on a pre-configured target migration strategy and saves the service data to a first storage space. When the management sub-node of the source host determines that the service data is stored in the first storage space, it sends the service data to the destination host, enabling the destination host to perform service recovery operations based on the service data. Since the service data to be migrated from the source service container is determined based on the data migration strategy of the target sub-service corresponding to the source service container, compared to migrating all data in the source service container, the data migration strategy based on the target sub-service significantly reduces the amount of data that needs to be migrated during container migration, improves the efficiency of container migration, and effectively reduces service downtime and total migration time. Attached Figure Description

[0025] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.

[0026] Figure 1 A schematic diagram of the system architecture of a business processing system provided in this application embodiment; Figure 2 A schematic diagram illustrating container migration between service hosts provided in this application embodiment; Figure 3 A schematic flowchart illustrating a container migration method provided in an embodiment of this application; Figure 4 This is a schematic diagram illustrating the structure of the hot migration manager and hot migration plugin used in this application embodiment to achieve container hot migration. Figure 5 A schematic diagram illustrating the process of implementing container hot migration by working together with the hot migration plugin, as provided in this embodiment of the application; Figure 6 A schematic flowchart illustrating a container migration method provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a container migration device provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of a container migration device provided in an embodiment of this application; Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0027] The embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions of the embodiments of this application.

[0028] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in embodiments of this application mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, element, and / or component, but do not exclude implementation as other features, information, data, step, operation, element, component, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein indicates at least one of the items defined by the term; for example, “A and / or B” can be implemented as “A,” or as “B,” or as “A and B.” When describing multiple (two or more) items, if the relationship between the multiple items is not explicitly defined, the multiple items can refer to one, several or all of the multiple items. For example, the description of "parameter A includes A1, A2, A3" can be implemented as parameter A includes A1 or A2 or A3, or it can be implemented as parameter A includes at least two of the three items A1, A2 and A3.

[0029] To better understand and explain the methods provided in the embodiments of this application, some technical terms involved in the embodiments of this application will be explained and described below.

[0030] Containers: A lightweight, portable, and self-contained software packaging technology that allows applications and all their dependencies to be packaged into a single unit for consistent operation across different computing environments.

[0031] Container hot migration: a technology that migrates running containers from one host to another with minimal downtime, which is crucial for ensuring service continuity and high availability.

[0032] Kubernetes (K8s) is a container orchestration system that provides a convenient platform for configuring and managing a large number of containers within a cluster. Kubelet is an agent that runs on each worker node of the Kubernetes system, responsible for communicating with the control node, receiving and executing container deployment tasks, and managing the lifecycle of containers and resource usage on the node.

[0033] Container Runtime: A key component of container technology, responsible for managing the lifecycle of containers, including creating, starting, stopping, and deleting them. Container runtimes are typically used in conjunction with container orchestration systems (such as Kubernetes) or container engines (such as Docker) to provide a complete container management solution.

[0034] Checkpoint / Restore In Userspace (CRIU) technology primarily aims to allow users to perform operating system checkpoints and restore operations within user space. This technology can save and restore the running state of an application without restarting the system or applications, and is applicable to various scenarios such as disaster recovery backup, migration, debugging, and performance analysis.

[0035] Existing container hot migration solutions typically require saving and migrating all business data in the container. Since the process address space is virtual memory, memory data is usually discretely distributed in non-contiguous locations in physical memory. Therefore, it is difficult to collect this data during the migration process, which in turn affects the data transmission efficiency and leads to longer business downtime during container hot migration.

[0036] Based on this, this application provides a container migration method. After receiving a migration instruction, the source service container in the source host can determine the service data to be migrated according to the target migration strategy of the target sub-service corresponding to the source service container. The service data is then sent to the destination host through a management sub-node, where service recovery is performed. This service data-driven approach, which is based on business awareness and storage, better meets business needs and significantly reduces the amount of data to be migrated during container migration, thereby improving the efficiency of container migration and effectively reducing service downtime and total migration time.

[0037] Figure 1This diagram illustrates a system architecture of a business processing system to which the container migration method provided in this application applies. The business processing system includes a management host 10 and multiple business hosts 20-2n (where n≥2, and business hosts are also called worker nodes). Each business host includes a management sub-node and at least one business container for a sub-service. Each business host can host different business functions. The management host 10 manages the business containers in each business host 20-2n (including container migration). The management sub-nodes in the business hosts can be proxy nodes deployed by the management host 10 in each business host 20-2n, used to manage the migration of business containers in the business hosts. For example, business host 20 includes a management sub-node 201 and business containers 202-203, and business host 21 includes a management sub-node 211 and business containers 212-214.

[0038] When a business host in a business processing system migrates a container to another business host, the business host from which the business data is migrated is called the source host, and the business host into which the business data is migrated is called the destination host. In this embodiment, the migration of business data from container 202 in business host 20 to business host 21 is used as an example for illustration. Figure 2 As shown.

[0039] Specifically, when the service host 20 receives the container migration instruction sent by the management host 10, it sends a migration instruction to the container 202 according to the container identifier of the container 202 to be migrated in the container migration instruction. After receiving the migration instruction, the container 202 reads the target migration policy pre-configured for the service corresponding to the container 202, and uses the target migration policy to determine the service data to be migrated, and saves the service data to the first storage space shared between the management sub-node 201 of the service host 20 and the container 202. When it is determined that the container 202 will store the service data in the first storage space, the management sub-node 201 sends the service data to the service host 21 according to the identifier of the destination host included in the container migration instruction.

[0040] When the management sub-node 21 of the service host 21 receives the container creation instruction sent by the management host 10, it creates a second storage space and a new service container 214. The second storage space is a shared storage space between the new service container 214 and the management sub-node 211 of the destination host. The management sub-node 21 stores the service data in the second storage space. When the new service container 214 determines that the service data is stored in the second storage space, it obtains the target recovery policy pre-configured for the service corresponding to the container 202, and performs service recovery according to the service data in the second storage space and the target recovery policy.

[0041] In the aforementioned business processing system, each business host can be any computing node / electronic device, such as a server or terminal. A server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server. A terminal can be a smartphone, tablet, laptop, desktop computer, intelligent voice interaction device (e.g., smart speaker), wearable electronic device (e.g., smartwatch), in-vehicle terminal, smart home appliance (e.g., smart TV), AR / VR device, etc., but is not limited to these.

[0042] The various service hosts can be connected directly or indirectly through wired or wireless communication methods, such as wired networks or wireless networks. The wired network can include local area networks, metropolitan area networks, and wide area networks, while the wireless network can include Bluetooth, Wi-Fi, and other networks that enable wireless communication.

[0043] The technical solutions of this application and their effects are described below through several embodiments. It should be noted that the following embodiments can be referenced, borrowed from, or combined with each other. Identical terms, similar features, and similar implementation steps in different embodiments will not be repeated.

[0044] This application provides a container migration method applied to a business processing system. The business processing system is a container application management system comprising multiple business hosts. Each business host includes a management sub-node and at least one business container for a sub-service. The management sub-node in each business host manages the migration of the business containers within that business host. This container migration method can be executed by the management sub-node in the source host. The source host is any business host in the business processing system that requires container migration. The hosts in this business processing system can be any electronic device, such as a server or terminal.

[0045] The container migration method provided in the embodiments of this application is described in detail below. See also Figure 3 , Figure 3 This is a flowchart illustrating the container migration method provided in this application embodiment. The method may include the following steps S310-S330, wherein: Step S310: Receive container migration instructions.

[0046] The container migration instruction includes the container identifier of the source service container where the service data to be migrated is located, and the identifier of the destination host. The source service container is the service container in at least one sub-service of the source host that needs to have its service data migrated. The destination host is the service host to which the service data to be migrated is to be migrated. The destination host is one of the multiple service hosts in the service processing system other than the source host. The identifier of the destination host can be the ID, address information, etc. of the destination host, as long as it can uniquely identify the destination host in the service processing system.

[0047] In this embodiment, the business processing system may further include a management host (also called a master node or control plane) for managing the migration of containers in each business host within the business processing system. Optionally, the container migration instruction may be sent by the management host to the management sub-node of the source host when the container migration conditions are met. The conditions for meeting the container migration include any one of the following: Received a migration command from the user terminal / management terminal; or The source host's operating parameters in at least one metric dimension are greater than the corresponding parameter threshold for that metric dimension; or The source business container's operating parameters under at least one metric dimension are greater than the parameter threshold corresponding to that metric dimension.

[0048] The migration command can be sent by the management terminal in response to a user's container migration trigger operation for the source service container. The migration command includes the identifier of the source host, the container identifier of the source service container where the service data to be migrated is located, and the identifier of the destination host to which the service data to be migrated is to be migrated.

[0049] The management host can monitor the operating parameters of each business container or business host in real time across various metrics. When the operating parameter of a business container exceeds the corresponding threshold for at least one metric dimension, the corresponding business host is designated as the source host. A source business container is then identified from the business containers deployed on that source host, and a container migration command is sent to the management sub-node of the source host. For example, if the overall resource utilization of a business host exceeds a preset threshold, it indicates that the number of containers deployed on that business host is excessive. A source business container can be identified from the already deployed business containers on that business host to migrate the business data from that source container to an idle business host.

[0050] When the operating parameters of a service container exceed the corresponding threshold for each of at least one metric dimension, the service container is designated as the source service container, and the service host hosting the service container is designated as the source host. A container migration command is then sent to the management sub-node of the source host. For example, if the CPU utilization of a service container consistently exceeds a preset threshold, it indicates that the service container's CPU resource requirements exceed the current service host's capacity. In this case, a container migration command is sent to the source host of the service container to migrate the service data within the service container to a destination host with sufficient CPU resources.

[0051] Among them, at least one indicator dimension includes, but is not limited to, running status, resource utilization (CPU utilization, memory usage), etc.

[0052] Step S320: Based on the container identifier, send a migration instruction to the source service container so that after receiving the migration instruction, the source service container can obtain the pre-configured target migration policy, determine the service data to be migrated according to the target migration policy, and save the service data to the first storage space.

[0053] Typically, container migration requires migrating all business data. This includes the container's running status, root file system, and management context. The running status includes process state information, memory pages, and kernel context. The root file system stores all files that the container may access, and the management context includes various configuration information for the container.

[0054] In this embodiment, some highly important data can be selected from all the business data of the container for migration. Considering that different business containers carry different business functions and therefore have different processing and focus areas for business data, this embodiment allows configuring a migration strategy for each business container's sub-businesses. The migration strategy for each sub-business specifies the business data to be saved when migrating that sub-business, such as intermediate result data of a business program execution or key files required for business operation. Taking a model training task as an example, the migration strategy for this sub-business of the business container could be to save the model parameters adjusted after the most recent training iteration as the business data to be migrated.

[0055] The target migration strategy is a data migration strategy for the target sub-service corresponding to the source service container, and the first storage space is a shared storage space between the management sub-node of the source host and the source service container.

[0056] Optionally, the target migration strategy can be pre-encapsulated into the checkpoint API. After receiving the migration instruction, the source business container can call the checkpoint API to pause business execution and save the container's business data.

[0057] Step S330: When it is determined that the source service container stores the service data in the first storage space, the service data is sent to the destination host according to the identifier of the destination host, so that the destination host can perform a service recovery operation based on the service data.

[0058] In this embodiment, when the management sub-node in the source host detects whether business data has been stored in the first storage space, it can detect the first storage space at preset time intervals. When a first identifier is detected in the first storage space, it is determined that the source business container has stored the business data in the first storage space. The first identifier is an identifier created and saved in the first storage space after the source business container stores the business data. Optionally, the first identifier can be a checkpoint completion file.

[0059] In this embodiment, the management sub-node of the source host can send service data to the management sub-node of the destination host based on the identifier of the destination host. The management sub-node of the destination host can restore the service in the following ways: Create a second storage space and a new business container, wherein the second storage space is a shared storage space between the new business container and the management sub-node of the destination host; Business data is stored in a second storage space so that a new business container can perform business recovery based on the business data stored in the second storage space.

[0060] In this embodiment, the management sub-node stores business data in a shared storage space. New business containers can read business data from the shared storage space after startup. This method of data transmission through shared storage space is not limited by real-time communication, thus reducing the consumption of communication resources.

[0061] Optionally, the new service container can be created by the management sub-node of the destination host after receiving the container creation instruction sent by the management host. Specifically, the management sub-node of the destination host receives the container creation instruction sent by the management host, determines the container configuration information of the source service container based on the container creation instruction, and creates a new service container based on the container configuration information of the source service container.

[0062] The container creation instruction is sent by the management host after determining that the container migration conditions are met and the destination host is the host to which the business data to be migrated is to be migrated. The container configuration information includes all dependencies of the application running in the source business container, such as the operating system, runtime environment, library files, configuration files, etc. The container migration conditions to be met can be found in the conditions shown in step S310 above, and will not be repeated here.

[0063] Optionally, the container creation instruction includes the container image identifier of the source business container. After receiving the container creation instruction, the management sub-node of the destination host determines whether the local storage contains the container configuration information (also known as container image information) corresponding to the container image identifier based on the container image identifier in the container creation instruction. If it exists, a new business container is created based on the container configuration information; otherwise, an image retrieval request is sent to the image repository (such as Docker Hub), and the container configuration information returned by the image repository based on the container image identifier carried in the image retrieval request is received. A new business container is created based on the obtained container configuration information.

[0064] In this embodiment, the management sub-node of the target host can control the startup of a new service container. After detecting that service data has been stored in the second storage space, the new service container can perform service recovery based on the service data stored in the second storage space. Optionally, the new service container can continuously detect the second storage space at preset time intervals. When a second identifier is detected in the second storage space, it is determined that the management sub-node of the target host has stored the service data in the second storage space. As an optional approach, the second identifier can be a restore completion file.

[0065] Optionally, if the new service container determines that the management sub-node of the target host has stored the service data in the second storage space, it obtains the target recovery policy and restores the service operation status according to the target recovery policy and the service data in the second storage space. The target recovery policy is a recovery policy for the service status of the target sub-service.

[0066] based on Figure 3The container migration method shown describes a process where, during the migration of a source service container from a source host to a destination host, the management sub-node of the source host, upon receiving a container migration instruction, sends a migration instruction to the source service container based on the container identifier contained in the migration instruction. Upon receiving the migration instruction, the source service container determines the service data to be migrated according to a pre-configured target migration strategy and saves the service data to a first storage space. Once the management sub-node of the source host confirms that the service data is stored in the first storage space, it sends the service data to the destination host, enabling the destination host to perform service recovery operations based on the service data. Because the data to be migrated from the source service container is determined by the source service container based on the data migration strategy of the corresponding target sub-service after receiving the migration instruction, this business-aware and stored business data better meets business needs. It also significantly reduces the amount of data to be migrated during container migration, improving the efficiency of container migration and effectively reducing service downtime and total migration time.

[0067] In this embodiment, after the new service container completes the service recovery, it can delete the second identifier from the second storage space. The management sub-node of the destination host can detect the second storage space at preset time intervals. When the management sub-node of the destination host determines that the second identifier in the second storage space has been deleted, it can determine that the service status of the new service container has been restored. At this time, it can send a migration success indication to the management sub-node of the source host. When the management sub-node of the source host receives the migration success indication, it can delete the source service container and other migration-related data (such as the first identifier in the first storage space).

[0068] If the management sub-node of the destination host determines that the second identifier in the second storage space has not been deleted within a preset time period, it indicates that the service recovery has failed. It can then send a migration failure indication to the management sub-node of the source host. Upon receiving the migration failure indication, the management sub-node of the source host can notify the source service container to control the execution of the service recovery.

[0069] In this embodiment, the management sub-node can be functionally divided into a container management component and a container hot migration component. The container management component communicates with the management host, receives instructions from the management host, and reports container running status information to the management host. For example, when the business processing system is a Kubernetes container application management system, this container management component can be a kubelet component. The container hot migration component executes container migration tasks. A hot migration plugin is deployed in the business container to detect hot migration events and collect business data.

[0070] Optionally, the container hot migration component in the management child node includes a hot migration manager, such as... Figure 4As shown, the container hot migration component can work with the hot migration plugin in the business container through the hot migration manager to achieve the migration of business data.

[0071] Figure 5 This is a schematic diagram illustrating the process of implementing container hot migration through the cooperation of the hot migration manager and hot migration plugin provided in this application embodiment. The following details the process of implementing container hot migration through the cooperation of the hot migration manager in the container hot migration component and the hot migration plugin in the business container: A1: The hot migration component in the source host sends migration instructions to the hot migration plugin in the source service container through the hot migration manager; When the hot migration component of the source host receives the container migration instruction, it determines the source service container based on the container identifier included in the container migration instruction, sends a migration instruction to the hot migration plugin in the source service container through the hot migration manager, and starts to check whether the checkpoint completion file has been created in the specified storage location. A2: After receiving the migration instruction, the hot migration plugin in the source business container calls the checkpoint API provided by the business logic in the source business container to pause business execution and save the business state, and determine the business state data it is concerned with (i.e. the business data to be migrated). The checkpoint API contains the target migration policy configured for the target sub-business corresponding to the source business container. The specified storage location is a shared file between the hot migration plugin and the hot migration manager. A3: The hot migration plugin in the source business container saves the determined business status data (i.e., business data) to the specified storage location and creates a checkpoint completion file (i.e., the first identifier) ​​to notify the hot migration manager that the business status data has been saved. The specified storage location can be a designated storage location. A4: When the hot migration manager in the source host detects the checkpoint completion file, it transfers the business status data stored in the specified storage location of the source host to the hot migration manager of the destination host. A5: The hot migration manager in the destination host saves the business status data to the pre-created specified storage location in the destination host, and indicates that the business status data transmission is complete by creating a restore completion file (i.e., the second identifier); When the container management component of the destination host receives a container creation instruction from the management host, it creates a new service container and specifies a storage location, and puts the new service container into a ready-to-start state. This container creation instruction can be sent by the management host after selecting the target host. Upon receiving the service status data, the hot migration manager saves it to the specified storage location.

[0072] A6: The hot migration plugin in the new business container calls the restore API to restore the business; The container management component in the destination host controls the startup of the target container. The hot migration plugin in the destination host detects whether a restore file exists in a specified storage location in the destination host. If a restore file exists, the restore process is executed, and the restore API provided by the business logic is called to restore the business. The restore API contains the target restore strategy configured for the target sub-business. A7: The hot migration plugin in the new business container of the destination host deletes the restore completion file to notify that the restore process is complete and the business container has started successfully; A8: The hot migration manager in the destination host sends the hot migration result to the hot migration manager in the source host; The hot migration manager on the destination host continuously checks whether the restore file exists in the specified storage location. If the restore file is deleted, the service recovery is confirmed, and the hot migration is successful. If the restore file still exists within a preset time, it indicates an error in the restore process, and the hot migration fails. If the hot migration result is successful, the hot migration manager on the source host deletes the source service container and other hot migration-related data. If the hot migration result is unsuccessful, the hot migration manager on the source host sends a service recovery instruction to the hot migration plugin in the source service container to resume service execution.

[0073] This application also provides a container migration method, which can be applied to a business processing system. The business processing system includes multiple business hosts, each business host includes a management sub-node and at least one business container for a sub-business. The method can be executed by the management sub-node of the destination host. The destination host is any one of the multiple business hosts. The hosts in the business processing system can be any electronic device, such as a server or a terminal.

[0074] Figure 6 This is a flowchart illustrating the container migration method provided in this application embodiment. The method may include the following steps S410-S420, wherein: Step S410: Receive service data sent by the management sub-node of the source host, wherein the source host is any service host other than the destination host among multiple service hosts; Step S420: Create a new service container in the destination host so that the new service container can perform service recovery based on the service data.

[0075] The source host is the business host where the source business container to be migrated is located. The business data is obtained by the management sub-node of the source host from the first storage space and sent to the management sub-node of the destination host according to the identifier of the destination host. The first storage space is the shared storage space between the management sub-node of the source host and the source business container.

[0076] The business data in the first storage space is stored in the source business container. Specifically, after receiving the migration instruction, the source business container determines the business data to be migrated according to the pre-configured target migration strategy. The migration instruction is sent to the source business container by the management sub-node of the source host after receiving the container migration instruction. The container migration instruction includes the container identifier of the source business container and the identifier of the destination host. The target migration strategy is the data migration strategy for the target sub-business corresponding to the source business container.

[0077] The process of saving business data and the process of restoring business data involved in the embodiments of this application can be found in steps S310-S330 above, and will not be repeated here.

[0078] based on Figure 6 The container migration method shown involves the source service container on the source host receiving a migration instruction from the management sub-node. Based on a pre-configured target migration strategy, the container determines the service data to be migrated and sends this data to the destination host, enabling the destination host to perform service recovery operations based on the data. Since the service data to be migrated from the source service container is determined based on the data migration strategy of the target sub-service corresponding to the source service container, compared to migrating all data in the source service container, the data migration strategy based on the target sub-service significantly reduces the amount of data to be migrated during container migration, improving the efficiency of container migration and effectively reducing service downtime and total migration time.

[0079] Based on and Figure 3 The container migration method shown follows the same principle. This application embodiment provides a container migration device, which is deployed in the management sub-node of the source host in a business processing system. The business processing system includes multiple business hosts, each including a management sub-node and at least one business container for a sub-service. The source host is any one of the multiple business hosts. Figure 7 As shown, the container migration device 500 may include: an instruction receiving module 510, a migration instruction sending module 520, and a service data sending module 530, wherein: The instruction receiving module 510 is used to receive a container migration instruction, wherein the container migration instruction includes the container identifier of the source service container where the service data to be migrated is located, and the identifier of the destination host. The migration instruction sending module 520 is used to send a migration instruction to the source service container according to the container identifier, so that after receiving the migration instruction, the source service container obtains a pre-configured target migration strategy, determines the service data to be migrated according to the target migration strategy, and saves the service data to a first storage space, wherein the first storage space is a shared storage space between the management sub-node of the source host and the source service container, and the target migration strategy is a data migration strategy for the target sub-service corresponding to the source service container; The service data sending module 530 is used to send the service data to the destination host according to the identifier of the destination host when it is determined that the source service container stores the service data in the first storage space, so that the destination host can perform a service recovery operation based on the service data.

[0080] Optionally, the service recovery operation is performed by the destination host in the following manner: The management sub-node of the destination host creates a second storage space and a new service container, wherein the second storage space is a shared storage space between the new service container and the management sub-node of the destination host; The management sub-node of the destination host stores the business data in the second storage space so that the new business container can perform business recovery based on the business data stored in the second storage space.

[0081] Optionally, the service recovery based on the service data stored in the second storage space is performed by the new service container in the following manner: If it is determined that the management sub-node of the target host stores the service data in the second storage space, a target recovery strategy is obtained, and service recovery is performed according to the target recovery strategy and the service data in the second storage space. The target recovery strategy is a recovery strategy for the service status of the target sub-service.

[0082] Optionally, the step of determining that the management sub-node of the destination host stores the business data in the second storage space is made by the new business container through the following methods: The second storage space is detected, and when the second identifier is detected, it is determined that the management sub-node of the destination host will store the business data in the second storage space. The device further includes a post-processing module, which can be used for: Upon receiving a migration completion indication from the management sub-node in the destination host, the source service container is deleted. The migration completion indication is sent by the management sub-node of the destination host when it determines that the second identifier in the second storage space has been deleted. The second identifier is deleted from the second storage space by the new service container after the service recovery is completed.

[0083] Optionally, the business processing system further includes a management host, and the new business container is created by the management sub-node of the destination host in the following manner: The system receives a container creation instruction sent by the management host; wherein the container creation instruction is sent by the management host when it determines that the container migration conditions are met and the destination host is the host to which the business data to be migrated is to be migrated. Based on the container creation instruction, determine the container configuration information of the source service container; Based on the container configuration information of the source service container, a new service container is created.

[0084] Optionally, the source service container stores the service data in the first storage space in the following manner: The first storage space is detected at preset time intervals; When a first identifier is detected in the first storage space, it is determined that the source service container stores the service data in the first storage space; The first identifier is an identifier created and saved in the first storage space after the source service container stores the service data in the first storage space.

[0085] Optionally, the conditions for satisfying container migration include any one of the following: Received a migration command for the source service container; or The source host's operating parameters under each of at least one metric dimension are greater than the parameter threshold corresponding to that metric dimension; or The source business container has operating parameters in at least one metric dimension that are greater than the parameter threshold corresponding to that metric dimension.

[0086] Based on and Figure 6 The container migration method shown follows the same principle. This application embodiment provides a container migration apparatus, which is deployed in the management sub-node of the destination host in a business processing system. The business processing system includes multiple business hosts, each business host including a management sub-node and at least one business container for a sub-service. The destination host is any one of the multiple business hosts. Figure 8 As shown, the container migration device 600 may include: a service data receiving module 610 and a container creation module 620, wherein: The service data receiving module 610 is used to receive service data sent by the management sub-node of the source host; wherein the source host is any service host among the plurality of service hosts except the destination host; The container creation module 620 is used to create a new service container in the destination host so that the new service container can perform service recovery based on the service data. The service data is obtained by the management sub-node of the source host from the first storage space and sent to the management sub-node of the destination host according to the identifier of the destination host. The first storage space is a shared storage space between the management sub-node of the source host and the source service container. The service data in the first storage space is determined and saved by the source service container according to the pre-configured target migration policy after receiving the migration instruction. The migration instruction is sent by the management sub-node of the source host to the source service container after receiving the container migration instruction. The container migration instruction includes the container identifier of the source service container and the identifier of the destination host. The target migration policy is a data migration policy for the target sub-service corresponding to the source service container.

[0087] based on Figure 7 or Figure 8 The container migration apparatus shown describes a process where, upon receiving a migration instruction from the management sub-node, the source service container in the source host determines the service data to be migrated based on a pre-configured target migration strategy and sends this data to the destination host. This allows the destination host to perform service recovery operations based on the migrated data. Because the service data to be migrated from the source service container is determined based on the data migration strategy of the target sub-service corresponding to the source service container, compared to migrating all data in the source service container, the data migration strategy based on the target sub-service significantly reduces the amount of data that needs to be migrated during container migration, improving the efficiency of container migration and effectively reducing service downtime and total migration time.

[0088] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0089] This application provides an electronic device, including a memory, a processor, and a computer program stored in the memory. When the processor executes the computer program stored in the memory, it can implement the method in any optional embodiment of this application.

[0090] Figure 9 A schematic diagram of the structure of an electronic device to which an embodiment of the present invention applies is shown, such as... Figure 9 As shown, the electronic device can be a server or a user terminal, and it can be used to implement the methods provided in any embodiment of the present invention.

[0091] like Figure 9 As shown, the electronic device 2000 may primarily include at least one processor 2001. Figure 9 The diagram shows components such as a memory 2002, a communication module 2003, and an input / output interface 2004. Optionally, these components can be connected and communicate with each other via a bus 2005. It should be noted that... Figure 9 The structure of the electronic device 2000 shown is merely illustrative and does not constitute a limitation on the electronic devices to which the methods provided in the embodiments of this application are applicable.

[0092] The memory 2002 can be used to store operating systems and applications, etc. The applications can include computer programs that implement the methods shown in the embodiments of the present invention when invoked by the processor 2001, and can also include programs for implementing other functions or services. The memory 2002 can be ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices that can store information and computer programs, or it can be EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disk storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.

[0093] Processor 2001 is connected to memory 2002 via bus 2005, and implements corresponding functions by calling application programs stored in memory 2002. Processor 2001 can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this invention. Processor 2001 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0094] Electronic device 2000 can connect to a network via communication module 2003 (which may include, but is not limited to, components such as a network interface) to communicate with other devices (such as user terminals or servers) through the network and achieve data interaction, such as sending data to or receiving data from other devices. Communication module 2003 may include wired network interfaces and / or wireless network interfaces, meaning the communication module may include at least one of wired or wireless communication modules.

[0095] Electronic device 2000 can connect to required input / output devices, such as keyboards and display devices, via input / output interface 2004. Electronic device 2000 itself may have a display device, and other display devices can also be connected externally via interface 2004. Optionally, storage devices, such as hard drives, can also be connected via interface 2004 to store data from electronic device 2000, retrieve data from storage device, or store data from storage device into memory 2002. It is understood that input / output interface 2004 can be a wired interface or a wireless interface. Depending on the actual application scenario, the device connected to input / output interface 2004 can be a component of electronic device 2000 or an external device connected to electronic device 2000 when needed.

[0096] The bus 2005 used to connect the components may include a pathway for transmitting information between the components. The bus 2005 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Depending on its function, the bus 2005 can be divided into address bus, data bus, control bus, etc.

[0097] Optionally, for the solution provided in the embodiments of the present invention, the memory 2002 can be used to store a computer program that executes the solution of the present invention, and the processor 2001 runs the computer program. When the processor 2001 runs the computer program, it implements the operation of the method or apparatus provided in the embodiments of the present invention.

[0098] Based on the same principle as the method provided in the embodiments of this application, the embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the corresponding content of the aforementioned method embodiments.

[0099] This application also provides a computer program product, which includes a computer program that, when executed by a processor, can implement the corresponding content of the aforementioned method embodiments.

[0100] It should be noted that the terms "first," "second," "third," "fourth," "1," "2," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown in the figures or text.

[0101] It should be understood that although arrows indicate various operation steps in the flowcharts of this application's embodiments, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of this application's embodiments, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all steps in each flowchart, based on the actual implementation scenario, may include multiple sub-steps or multiple stages. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and this application's embodiments do not limit this.

[0102] The above description is only an optional implementation method for some implementation scenarios of this application. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this application without departing from the technical concept of this application also fall within the protection scope of the embodiments of this application.

Claims

1. A container migration method characterized by, The method is applied to a business processing system, which includes multiple business hosts. Each business host includes a management sub-node and a business container for at least one sub-business. The method is executed by the management sub-node in a source host, which is any one of the multiple business hosts. The method includes: Receive a container migration instruction, wherein the container migration instruction includes the container identifier of the source service container where the service data to be migrated is located, and the identifier of the destination host; According to the container identifier, a migration instruction is sent to the source service container, so that after receiving the migration instruction, the source service container obtains a pre-configured target migration policy, determines the service data to be migrated according to the target migration policy, and saves the service data to a first storage space, wherein the first storage space is a shared storage space between the management sub-node of the source host and the source service container, and the target migration policy is a data migration policy for the target sub-service corresponding to the source service container; If it is determined that the source service container stores the service data in the first storage space, the service data is sent to the destination host according to the identifier of the destination host, so that the destination host performs a service recovery operation based on the service data.

2. The method of claim 1, wherein, The service recovery operation is performed by the destination host in the following manner: The management sub-node of the destination host creates a second storage space and a new service container, wherein the second storage space is a shared storage space between the new service container and the management sub-node of the destination host; The management sub-node of the destination host stores the business data in the second storage space so that the new business container can perform business recovery based on the business data stored in the second storage space.

3. The method according to claim 2, characterized in that, The service recovery based on the service data stored in the second storage space is performed by the new service container in the following manner: If it is determined that the management sub-node of the target host stores the service data in the second storage space, a target recovery strategy is obtained, and service recovery is performed according to the target recovery strategy and the service data in the second storage space. The target recovery strategy is a recovery strategy for the service status of the target sub-service.

4. The method according to claim 3, characterized in that, The step of determining that the management sub-node of the destination host will store the business data in the second storage space is determined by the new business container in the following way: The second storage space is detected, and when the second identifier is detected, it is determined that the management sub-node of the destination host will store the business data in the second storage space. The method further includes: Upon receiving a migration completion indication from the management sub-node in the destination host, the source service container is deleted. The migration completion indication is sent by the management sub-node of the destination host when it determines that the second identifier in the second storage space has been deleted. The second identifier is deleted from the second storage space by the new service container after the service recovery is completed.

5. The method according to claim 2, characterized in that, The business processing system also includes a management host, and the new business container is created by the management sub-node of the destination host in the following way: The system receives a container creation instruction sent by the management host; wherein the container creation instruction is sent by the management host when it determines that the container migration conditions are met and the destination host is the host to which the business data to be migrated is to be migrated. Based on the container creation instruction, determine the container configuration information of the source service container; Based on the container configuration information of the source service container, a new service container is created.

6. The method according to claim 1, characterized in that, The source service container stores the service data in the first storage space in the following way: The first storage space is detected at preset time intervals; When a first identifier is detected in the first storage space, it is determined that the source service container stores the service data in the first storage space; The first identifier is an identifier created and saved in the first storage space after the source service container stores the service data in the first storage space.

7. The method according to claim 5, characterized in that, The conditions for meeting container migration include any of the following: Receive migration commands for the source service container; or The source host's operating parameters under each of at least one metric dimension are greater than the parameter threshold corresponding to that metric dimension; or The source business container has operating parameters in at least one metric dimension that are greater than the parameter threshold corresponding to that metric dimension.

8. A container migration method, characterized in that, The method is applied to a business processing system, which includes multiple business hosts. Each business host includes a management sub-node and a business container for at least one sub-business. The method is executed by the management sub-node of the destination host, which is any one of the multiple business hosts. Receive service data sent by the management sub-node of the source host; wherein the source host is any service host other than the destination host among the plurality of service hosts; A new service container is created in the destination host so that the new service container can perform service recovery based on the service data; The service data is obtained by the management sub-node of the source host from the first storage space and sent to the management sub-node of the destination host according to the identifier of the destination host. The first storage space is a shared storage space between the management sub-node of the source host and the source service container. The service data in the first storage space is determined and saved by the source service container according to the pre-configured target migration strategy after receiving the migration instruction. The migration instruction is sent by the management sub-node of the source host to the source service container after receiving the container migration instruction. The container migration instruction includes the container identifier of the source service container and the identifier of the destination host. The target migration strategy is a data migration strategy for the target sub-service corresponding to the source service container.

9. A container migration device, characterized in that, The device is deployed in the management sub-node of the source host in the business processing system. The business processing system includes multiple business hosts, each of which includes a management sub-node and a business container for at least one sub-business. The source host is any one of the multiple business hosts. The device includes: The instruction receiving module is used to receive container migration instructions, wherein the container migration instructions include the container identifier of the source service container to be migrated and the identifier of the destination host to be migrated to. A migration instruction sending module is used to send a migration instruction to the source service container according to the container identifier, so that after receiving the migration instruction, the source service container obtains a pre-configured target migration strategy, determines the service data to be migrated according to the target migration strategy, and saves the service data to a first storage space, wherein the first storage space is a shared storage space between the management sub-node of the source host and the source service container, and the target migration strategy is a data migration strategy for the target sub-service corresponding to the source service container; The service data sending module is used to send the service data to the destination host according to the identifier of the destination host when it is determined that the source service container stores the service data in the first storage space, so that the destination host can perform a service recovery operation based on the service data.

10. A container migration device, characterized in that, The device is deployed in the management sub-node of the destination host in the business processing system. The business processing system includes multiple business hosts, each of which includes a management sub-node and a business container for at least one sub-business. The destination host is any one of the multiple business hosts. A business data receiving module is used to receive business data sent by the management sub-node of the source host; wherein the source host is any business host other than the destination host among the plurality of business hosts; A container creation module is used to create a new service container in the destination host so that the new service container can perform service recovery based on the service data. The service data is obtained by the management sub-node of the source host from the first storage space and sent to the management sub-node of the destination host according to the identifier of the destination host. The first storage space is a shared storage space between the management sub-node of the source host and the source service container. The service data in the first storage space is determined and saved by the source service container according to the pre-configured target migration strategy after receiving the migration instruction. The migration instruction is sent by the management sub-node of the source host to the source service container after receiving the container migration instruction. The container migration instruction includes the container identifier of the source service container and the identifier of the destination host. The target migration strategy is a data migration strategy for the target sub-service corresponding to the source service container.

11. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method of any one of claims 1 to 7 or 8.

12. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1 to 7 or 8.

13. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method of any one of claims 1 to 7 or 8.