Container group state changing method and device

By obtaining and executing state changes, the on-off state of the container group is directly controlled, which solves the complex management problems in the existing technology, and realizes efficient applicability and flexible management of the container group in various application scenarios.

CN119697194APending Publication Date: 2025-03-25JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411731600.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The prior art is difficult to directly control and manage the on-off state of container groups, resulting in complex and inflexible management in some application scenarios.

Method used

By obtaining the status change instructions of the target container group, determining the corresponding status change operations based on the instructions and the current state, and performing these operations to change the running state of the container group, thereby realizing the power-on and shutdown function.

Benefits of technology

It provides a way to control the power-off state of the container group, so that the container group has power-off capabilities, and improves the applicability of the container group in various application scenarios and the flexibility of user management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119697194A_ABST
    Figure CN119697194A_ABST
Patent Text Reader

Abstract

The invention discloses a state changing method and device of a container group, a computer readable medium, electronic equipment and a computer program product. According to one specific embodiment, the method comprises the steps that a state change instruction for a target container group is obtained, and the state change instruction comprises a startup instruction and a shutdown instruction; determining a state change operation for the target container group according to the state change instruction and the current state of the target container group; and executing state change operation on the target container group to obtain the target container group with the changed running state. The invention provides a control mode for the on-off state of the container group, so that the container group has the on-off capability, the applicability of the container group in each application scene is improved, and the flexibility of the management process of the container group by a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, specifically to the field of cloud computing and containerization technology, and more particularly to a method, device, computer-readable medium, electronic device, and computer program product for changing the state of a container group. Background Art

[0002] A Pod (container group) is mainly composed of one or more containers that share the same network namespace and storage volume. The start and stop of containers are managed by the Kubernetes (a container orchestration engine) cluster, rather than the user directly turning on and off the pod. When a user creates a Pod, Kubernetes will start the corresponding container based on the Pod's definition (such as image, resource requirements, etc.). When the Pod is no longer needed, the user can trigger the stop of the container and the release of resources by deleting the Pod's definition. Summary of the invention

[0003] Embodiments of the present application provide a method, system, device, computer-readable medium, electronic device, and computer program product for changing the state of a container group.

[0004] In a first aspect, an embodiment of the present application provides a method for changing the state of a container group, comprising: obtaining a state change instruction for a target container group, wherein the state change instruction includes a startup instruction and a shutdown instruction; determining a state change operation for the target container group according to the state change instruction and a current state of the target container group; and performing the state change operation on the target container group to obtain the target container group after the running state is changed.

[0005] In some examples, determining the state change operation for the target container group according to the state change instruction and the current state of the target container group includes: in response to the state change instruction being a power-on instruction for the target container group in a shutdown state or a shutdown state, determining whether the device on which the target container group is deployed includes the running resources occupied by the target container group before shutdown; in response to the determination, determining that the state change operation for the target container group is a power-on operation; and performing the state change operation on the target container group to obtain the target container group after the running state is changed includes: performing the power-on operation on the target container group based on the running resources to obtain the target container group in the original state before shutdown.

[0006] In some examples, performing a startup operation on the target container group to obtain the target container group in an original state before shutdown includes: performing a startup operation on the target container group to determine whether the target container group is successfully started; in response to a startup failure, obtaining the target container group in a startup failure state; and continuously performing the startup operation on the target container group in the startup failure state until the target container group in the original state is obtained.

[0007] In some examples, the method further includes: determining whether reserved resource data corresponding to the target container group is stored in a resource configuration file of the target container group; in response to determining yes, determining the reserved resource represented by the reserved resource data as the running resource.

[0008] In some examples, the determining of the state change operation for the target container group according to the state change instruction and the current state of the target container group further includes: in response to determining that the device where the target container group is deployed does not include the running resources occupied by the target container group before shutdown, determining that the state change operation for the target container group is a prohibition of power-on operation for prohibiting execution of the power-on operation; and performing the state change operation on the target container group to obtain the target container group after the running state is changed includes: performing the prohibition of power-on operation on the target container group to obtain the target container group in a state of insufficient power-on resources.

[0009] In some examples, the determining of the state change operation for the target container group according to the state change instruction and the current state of the target container group includes: in response to the state change instruction being a shutdown instruction for the target container group in a powered-on state or a powered-on state, determining that the state change operation for the target container group is a shutdown operation, the shutdown operation including: stopping containers and sandboxes in the target container group; reserving a network address corresponding to the target container group; and releasing running resources occupied by the target container group; and performing the state change operation on the target container group to obtain the target container group after the running state is changed includes: performing a shutdown operation on the target container group to obtain the target container group in a shutdown state.

[0010] In some examples, the method further includes: determining an actual state and an expected state of the target container group after the state change operation is performed; and in response to the actual state being different from the expected state, tuning the target container group according to the expected state.

[0011] In a second aspect, an embodiment of the present application provides a state change device for a container group, including: an instruction acquisition unit, configured to acquire a state change instruction for a target container group, wherein the state change instruction includes a power-on instruction and a power-off instruction; an operation determination unit, configured to determine a state change operation for the target container group according to the state change instruction and a current state of the target container group; and a state change unit, configured to perform the state change operation on the target container group to obtain the target container group after the running state is changed.

[0012] In some examples, the operation determination unit is further configured to: in response to the state change instruction being a power-on instruction for the target container group in a shutdown state or a shutdown state, determine whether the device where the target container group is deployed includes the running resources occupied by the target container group before shutdown; in response to the determination including, determine that the state change operation for the target container group is a power-on operation; and the state change unit is further configured to: based on the running resources, perform the power-on operation on the target container group to obtain the target container group in the original state before shutdown.

[0013] In some examples, the state changing unit is further configured to: perform a startup operation on the target container group to determine whether the target container group is successfully started; in response to a startup failure, obtain a target container group in a startup failure state; and continue to perform a startup operation on the target container group in the startup failure state until a target container group in an original state is obtained.

[0014] In some examples, the apparatus further includes: a resource determination unit configured to: determine whether reserved resource data corresponding to the target container group is stored in a resource configuration file of the target container group; in response to determining yes, determine the reserved resource represented by the reserved resource data as the running resource.

[0015] In some examples, the operation determination unit is further configured to: in response to determining that the device on which the target container group is deployed does not include the running resources occupied by the target container group before shutdown, determine that the state change operation for the target container group is a prohibition of power-on operation for prohibiting execution of the power-on operation; and the state change unit is further configured to: perform the prohibition of power-on operation on the target container group to obtain the target container group in a power-on resource insufficient state.

[0016] In some examples, the operation determination unit is further configured to: in response to the state change instruction being a shutdown instruction for a target container group in a powered-on state or a powered-on state, determine that the state change operation for the target container group is a shutdown operation, where the shutdown operation includes: stopping containers and sandboxes in the target container group; reserving a network address corresponding to the target container group; and releasing running resources occupied by the target container group; and the state change unit is further configured to: perform a shutdown operation on the target container group to obtain a target container group in a powered-on state.

[0017] In some examples, the apparatus further includes: a tuning unit configured to: determine an actual state and an expected state of the target container group after the state change operation is performed; and in response to the actual state being different from the expected state, tune the target container group according to the expected state.

[0018] In a third aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner of the first aspect is implemented.

[0019] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation manner of the first aspect.

[0020] In a fifth aspect, an embodiment of the present application provides a computer program product, including: a computer program, which implements the method described in any implementation manner of the first aspect when executed by a processor.

[0021] The state change method and device of a container group provided in an embodiment of the present application obtain a state change instruction for a target container group, wherein the state change instruction includes a power-on instruction and a power-off instruction; determine a state change operation for the target container group according to the state change instruction and the current state of the target container group; perform the state change operation on the target container group to obtain the target container group after the running state is changed, thereby providing a control method for the power on / off state of the container group, so that the container group has the power on / off capability, which helps to improve the applicability of the container group in various application scenarios and the flexibility of the user in the management process of the container group. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0023] Figure 1 is an exemplary system architecture diagram in which an embodiment of the present application may be applied;

[0024] Figure 2 is a flowchart of an embodiment of a method for changing the state of a container group according to the present application;

[0025] Figure 3 is a schematic diagram of changes of the container group in different states according to this embodiment;

[0026] Figure 4 is a schematic diagram of an application scenario of the method for changing the state of a container group according to this embodiment;

[0027] Figure 5 is a flowchart of another embodiment of a method for changing the state of a container group according to the present application;

[0028] Figure 6 is a structural diagram of an embodiment of a device for changing the state of a container group according to the present application;

[0029] Figure 7 It is a structural diagram of a computer system suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION

[0030] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0031] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0032] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.

[0033] Figure 1 An exemplary architecture 100 is shown to which the method and apparatus for changing the state of a container group of the present application can be applied.

[0034] like Figure 1As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The communication connection between the terminal devices 101, 102, 103 constitutes a topological network, and the network 104 is used to provide a medium for the communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0035] The terminal devices 101, 102, 103 can interact with the server 105 through the network 104 to receive or send data, etc. The terminal devices 101, 102, 103 can be hardware devices or software that support network connection for data interaction and data processing. When the terminal devices 101, 102, 103 are hardware, they can be various electronic devices that support network connection, information acquisition, interaction, display, processing and other functions, including but not limited to smart phones, car computers, tablet computers, e-book readers, laptop portable computers and desktop computers, etc. When the terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules for providing distributed services, for example, or it can be implemented as a single software or software module. No specific limitation is made here.

[0036] The server 105 may be a server that provides various services, for example, a background processing server that receives a state change instruction for a target container group issued by a user through the terminal devices 101, 102, 103, determines a state change operation for the target container group according to the state change instruction and the current state of the target container group, and performs a state change operation on the target container group to change the running state of the target container group. As an example, the server 105 may be a cloud server.

[0037] It should be noted that the server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, software or software modules used to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.

[0038] It should also be noted that the state change method of the container group provided in the embodiment of the present application is generally executed by the server, but the possibility of being executed by the terminal device, or being executed by the server and the terminal device in cooperation with each other is not excluded. Accordingly, the various parts (such as various units) included in the state change device of the container group can be all set in the server, or all set in the terminal device, or can be set in the server and the terminal device respectively.

[0039] It should be understood that Figure 1 The number of terminal devices, networks, and servers in the system is only illustrative. Any number of terminal devices, networks, and servers may be provided as required. When the electronic device on which the state change method of the container group is running does not need to perform data transmission with other electronic devices, the system architecture may only include the electronic device (e.g., server or terminal device) on which the state change method of the container group is running.

[0040] Continue to refer Figure 2 , shows a process 200 of an embodiment of a method for changing the state of a container group, comprising the following steps:

[0041] Step 201: Obtain a state change instruction for a target container group.

[0042] In this embodiment, the execution subject of the container group state change method (for example Figure 1 The terminal device or server in the target container group can obtain the state change instruction for the target container group remotely or locally through a wired network connection or a wireless network connection. The state change instruction includes a power-on instruction and a power-off instruction.

[0043] Pod is a core concept in Kubernetes, which represents the smallest deployable computing unit that can be created and managed in a Kubernetes cluster. Pod encapsulates one or more containers (usually Docker containers) that share storage, network, and a common environment to run them. Containers in a Pod can work closely together because they share resources and are usually deployed together to achieve common goals.

[0044] Pods are designed to support multiple containers working together to complete a single task. For example, a Pod for a web application may contain a web server container and a database container. These containers can communicate with each other through a shared network within the Pod and can access shared storage volumes.

[0045] The main features of Pods include:

[0046] Shared resources: Containers in a Pod share the same network namespace, storage volumes, and a set of process spaces. This means they can communicate with each other through localhost and can access the same file system locations.

[0047] Lifecycle: Pods are treated as an indivisible unit that are created together, run together, and usually terminated together. When a container in a Pod stops running, the entire Pod usually stops and needs to be recreated.

[0048] Automatic recovery: Kubernetes controllers (such as Deployment, ReplicaSet, etc.) can automatically manage the life cycle of Pod. If the Pod stops running for some reason (such as node failure), the controller will automatically try to recreate it.

[0049] Persistent Storage: Pods can use persistent storage volumes to store data that survives deletion of the Pod. This allows the Pod to maintain data consistency when it is restarted or rescheduled.

[0050] Isolation: Although containers in a Pod can share resources, the Pods themselves are isolated from each other in the Kubernetes cluster. This means that containers in one Pod will not affect containers in another Pod.

[0051] In Kubernetes, Pods are usually created by defining manifest files in YAML (YAML Ain't a Markup Language, a human-readable data serialization standard) or JSON (JavaScript Object Notation) format. These files describe the configuration of the Pod, including the containers it contains, the resources used, network policies, storage configuration, etc. Through the kubectl command-line tool or other Kubernetes API clients, users can submit these Pod manifests to the Kubernetes cluster for deployment and management.

[0052] The startup instruction is intended to start the container group, that is, the process from the shutdown state where the container group is not running to the process where the container group starts to perform its main functions. The shutdown instruction is intended to stop the container group, that is, the process where the container group terminates its executed functions and releases the occupied system resources.

[0053] In some practical application scenarios, the container group needs to have the ability to turn on and off. For example, in application scenarios that emphasize security and reliability, in order to prevent the container group from being accidentally deleted, it is necessary to put the container group into an intermediate state of stopping service before deleting the container group. After confirming that the container group is normal, delete the container group. In this case, the shutdown state can be used as an intermediate state. For another example, in the scenario of renting computing resources such as GPUs (Graphics Processing Units), the resources are expensive and the configuration is complex. Users expect to pay on demand, but do not want to frequently destroy, rebuild, and repeat complex configuration operations on the container group. In this case, if the container group has the ability to turn on and off, frequent destruction, reconstruction, and repeated complex configuration operations on the container group can be avoided.

[0054] Step 202: Determine a state change operation for the target container group according to the state change instruction and the current state of the target container group.

[0055] In this embodiment, the execution subject may determine the state changing operation for the target container group according to the state changing instruction and the current state of the target container group.

[0056] As an example, the execution subject or the electronic device connected to the execution subject in communication is provided with a correspondence table representing the correspondence between various state change instructions, various current states, and state change operations. The execution subject first determines the current state of the target container group, and determines the operation corresponding to the state change instruction and the current state of the target container group in the correspondence table as the state change operation for the target container group.

[0057] As another example, the execution subject may determine whether the expected state corresponding to the state change instruction is consistent with the current state of the target container group; in response to inconsistency, determine the change target of the current data resources and computing resources of the target container group when the current state is changed to the expected state; and determine the state change operation to bring the data resources and computing resources to the change target.

[0058] Continue to refer Figure 3 , which shows a schematic diagram of changes in the container group in different states. The operating states of the container group include: startup state, startup state, insufficient startup resources state, shutdown state, shutdown state, and startup failure state.

[0059] Step 203: Perform a state change operation on the target container group to obtain the target container group after the running state is changed.

[0060] In this embodiment, the execution subject may perform a state change operation on the target container group to obtain the target container group after the running state is changed.

[0061] As an example, when there is no time sequence relationship between the operations in the state change operation, the execution subject may execute the operations in the state change operation in series or in parallel to obtain the target container group after the running state is changed.

[0062] As another example, when various operations in the state change operation have a time sequence relationship, the execution subject may execute various operations in the state change operation according to the time sequence relationship to obtain the target container group after the running state is changed.

[0063] Continue to see Figure 4 , Figure 4 FIG. 4 is a schematic diagram 400 of an application scenario of the method for changing the state of a container group according to this embodiment. Figure 4In the application scenario, user 401 rents GPU resources provided by a resource service provider, which delivers them in the form of a container group. During the rental process, user 401 will not use the target container group it rents for a period of time. Therefore, a state change instruction (shutdown instruction) for the target container group is sent to server 403 providing container group services through terminal device 402. Server 403 first obtains the state change instruction for the target container group; then, based on the state change instruction and the current state of the target container group, determines the state change operation for the target container group; finally, performs the state change operation on the target container group to obtain the target container group in the shutdown state after the running state is changed.

[0064] The method provided by the above embodiment of the present application obtains a state change instruction for a target container group, wherein the state change instruction includes a power-on instruction and a power-off instruction; determines a state change operation for the target container group according to the state change instruction and the current state of the target container group; and performs the state change operation on the target container group to obtain the target container group after the running state is changed, thereby providing a control method for the power on / off state of the container group, so that the container group has the power on / off capability, which helps to improve the applicability of the container group in various application scenarios and the flexibility of the user in the management process of the container group.

[0065] In some implementations of this embodiment, the execution subject may perform step 202 in the following manner:

[0066] In the first step, in response to the state change instruction being a startup instruction for a target container group in a shutdown state or a shutdown-in-progress state, determining whether a device in which the target container group is deployed includes operating resources occupied by the target container group before shutdown.

[0067] When the current state of the target container group is the shutdown state or the shutdown state, the user can issue a startup instruction for the target container group. In response to determining that the state change instruction is a startup instruction, the execution subject can determine the operating resources occupied by the target container group before shutdown, and determine whether the device where the target container group is deployed includes the above operating resources that are idle (not occupied by other container groups).

[0068] For each container group, before shutting down the container group, the execution entity may determine and store the operating resources occupied by the container group.

[0069] The second step, in response to the determination, includes determining that the state change operation for the target container group is a startup operation.

[0070] In this implementation, in response to determining that the device where the target container group is deployed includes the operating resources occupied by the target container group before shutdown, the state change operation for the target container group is determined to be a startup operation. The startup operation, for example, occupies the operating resources occupied by the target container group before shutdown, and implements its main functions before shutdown based on the operating resources.

[0071] In this implementation, the execution subject may perform step 203 in the following manner: based on the running resources, a startup operation is performed on the target container group to obtain the target container group in the original state before shutdown.

[0072] Based on operating resources such as data resources and computing resources, a startup operation is performed on the target container group, and functions corresponding to the container group are run to obtain the target container group in an original state before startup.

[0073] In this implementation, the startup operation is performed on the target container group only when the device on which the target container group is deployed includes the operating resources occupied by the target container group before shutdown, thereby improving the feasibility and success rate of the startup operation.

[0074] In some implementations of this embodiment, the execution subject may perform the startup operation for the target container group in the following manner:

[0075] First, a startup operation is performed on the target container group to determine whether the target container group is successfully started; then, in response to a startup failure, a target container group in a startup failure state is obtained; finally, the startup operation is continuously performed on the target container group in the startup failure state until the target container group in the original state is obtained.

[0076] After executing the startup operation on the target container group, the execution subject further detects whether the target container group is consistent with the expected state corresponding to the startup operation (the original state before shutdown); in response to inconsistency, it is determined that the startup of the target container group fails. At this time, the current state of the target container group is set to the startup failure state, such as the startUpFailed state. For the target container group in the startup failure state, the execution subject performs the startup operation on the target container group again.

[0077] The execution subject may iteratively execute the operations above until a target container group in an original state is obtained.

[0078] In this implementation, when the device where the target container group is deployed includes the running resources occupied by the target container group before shutdown, the target container group can theoretically be successfully started. At this time, the startup operation can be repeatedly performed on the target container group, thereby improving the startup success rate of the target container group.

[0079] In some implementations of this embodiment, the execution subject may perform the following operations: first, determine whether the resource configuration file of the target container group stores reserved resource data corresponding to the target container group; then, in response to determining yes, determine the reserved resource represented by the reserved resource data as the running resource.

[0080] Resource configuration file, that is, Pod definition file, such as a YAML file.

[0081] In this implementation, the operating resources occupied by the target container in the boot state can be stored in the resource configuration file as reserved resource data, so that when a boot command is received, the operating state of the target container group is changed to the original state before shutdown based on the reserved resource data, thereby improving the convenience and practicality of the boot operation.

[0082] In some optional implementations of this embodiment, the execution subject may also perform step 202 in the following manner: in response to determining that the device on which the target container group is deployed does not include the running resources occupied by the target container group before shutdown, determining that the state change operation for the target container group is a prohibition of power-on operation for prohibiting execution of a power-on operation.

[0083] As an example, prohibiting the power-on operation is, for example, ignoring the power-on operation so as not to execute the power-on operation; blocking the execution process of the power-on operation so as to maintain the current shutdown state of the target container group.

[0084] In this implementation, the execution subject may perform step 203 in the following manner: performing a startup prohibition operation on the target container group to obtain a target container group in a startup resource insufficient state. The resource insufficient state is, for example, the insufficientResources state.

[0085] When it is determined that the target container group is in a state of insufficient startup resources, a response prompt message can be sent to the rental user and the service provider corresponding to the target container group, so that the rental user can determine the current state of the target container group and the service provider can handle the problem of insufficient startup resources in a timely manner.

[0086] In this implementation, when the startup resources are insufficient, the startup prohibition operation is performed on the target container group to obtain the target container group in a state of insufficient startup resources, thereby further improving the accuracy of the current state of the target container group.

[0087] In some optional implementations of this embodiment, the execution subject may perform step 202 in the following manner: in response to the state change instruction being a shutdown instruction for the target container group in the startup state or the startup state, determining that the state change operation for the target container group is a shutdown operation.

[0088] In this implementation, for a target container group that is in the startup state or in the startup state, the user can issue a shutdown command to it. The shutdown operation includes:

[0089] 1. Stop the containers and sandboxes in the target container group. In containerization technology, Sandbox provides a restricted operating environment for containers to prevent applications in the container from causing damage to the host or other containers. How Sandbox works The working principle of Sandbox is mainly achieved through redirection technology. When a program runs in Sandbox, the files it generates and modifies will be directed to the folder of Sandbox itself, not the actual system folder. In this way, even if the program contains malicious behavior, it will only affect the environment in Sandbox, and will not cause harm to the entire system.

[0090] 2. Reserve the network address corresponding to the target container group. The network address is, for example, an IP (Internet Protocol) address.

[0091] 3. Release the operating resources occupied by the target container group.

[0092] In this implementation, the execution subject may perform step 203 in the following manner: performing a shutdown operation on the target container group to obtain a target container group in a shutdown state.

[0093] When the shutdown operation is executed, the target container group changes from the original startup state or startup state to the shutdown state.

[0094] In this implementation, a specific implementation method for the shutdown capability of a container group is provided, which helps to improve the applicability of the container group in various application scenarios and the flexibility of the user's management process of the container group.

[0095] In some optional implementations of this embodiment, the above execution subject may also perform the following operations:

[0096] First, determine the actual state and expected state of the target container group after the state change operation is performed.

[0097] As an example, after executing the state change operation on the target container group, the execution subject may determine the current actual state of the target container group and the expected state that the state change operation hopes to achieve in real time or periodically.

[0098] Then, in response to the actual state being different from the desired state, the target container group is tuned according to the desired state.

[0099] For the actual state and the expected state of the determined target container group after the state change operation is executed, the execution subject may determine whether the two are consistent; in response to the actual state being different from the expected state, the target container group is tuned according to the expected state. For example, the execution subject may determine a tuning operation from the actual state to the expected state, and perform the tuning operation on the target container group. It should be noted that the tuning operation in this implementation can be combined with the above embodiments, for example, the expected state is the power-on state and the power-off state in the above embodiments.

[0100] In this implementation, based on the tuning operation on the target container group, the target container group is always in the desired state that the state change operation hopes to achieve, thereby ensuring the effectiveness of the state change operation.

[0101] Continue to refer Figure 5 , shows a schematic process 500 of another embodiment of a method for changing the state of a container group according to the present application, comprising the following steps:

[0102] Step 501: Obtain a state change instruction for a target container group.

[0103] The state change instruction includes a power-on instruction and a power-off instruction.

[0104] Step 502: In response to the state change instruction being a startup instruction for a target container group in a shutdown state or a shutdown-in-progress state, determine whether a device in which the target container group is deployed includes operating resources occupied by the target container group before shutdown.

[0105] Step 503 , in response to the determination, includes determining that the state change operation for the target container group is a startup operation.

[0106] Step 504: Based on the running resources, a startup operation is performed on the target container group to determine whether the target container is successfully started.

[0107] Step 505: In response to the startup failure, a target container group in a startup failure state is obtained.

[0108] Step 506: Continue to perform the startup operation on the target container group in the startup failure state until the target container group in the original state is obtained.

[0109] Step 507: In response to determining that the device in which the target container group is deployed does not include the operating resources occupied by the target container group before shutdown, determine that the state change operation for the target container group is a prohibition of power-on operation for prohibiting execution of a power-on operation.

[0110] Step 508: Perform a startup prohibition operation on the target container group to obtain a target container group in a startup resource insufficient state.

[0111] Step 509 : In response to the state change instruction being a shutdown instruction for the target container group in the startup state or the startup state, determining that the state change operation for the target container group is a shutdown operation.

[0112] The shutdown operation includes: stopping the containers and sandboxes in the target container group; reserving the network address corresponding to the target container group; and releasing the operating resources occupied by the target container group.

[0113] Step 510: Perform a shutdown operation on the target container group to obtain a target container group in a shutdown state.

[0114] It can be seen from this embodiment that Figure 2 Compared with the corresponding embodiment, the process 500 of the method for changing the state of the container group in this embodiment specifically illustrates the implementation method of the startup capability and shutdown capability of the target container group, further improving the applicability of the container group in various application scenarios and the flexibility of the user's management process of the container group.

[0115] Continue to refer Figure 6 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a device for changing the state of a container group. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0116] like Figure 6 As shown, the state change device 600 of a container group includes: an instruction acquisition unit 601, configured to acquire a state change instruction for a target container group, wherein the state change instruction includes a power-on instruction and a power-off instruction; an operation determination unit 602, configured to determine a state change operation for the target container group according to the state change instruction and the current state of the target container group; and a state change unit 603, configured to perform the state change operation on the target container group to obtain the target container group after the running state is changed.

[0117] In some implementations of this embodiment, the operation determining unit 602 is further configured to: in response to the state change instruction being a power-on instruction for the target container group in the shutdown state or the shutdown state, determine whether the device where the target container group is deployed includes the running resources occupied by the target container group before shutdown; in response to the determination including, determine that the state change operation for the target container group is a power-on operation; and the state changing unit 603 is further configured to: based on the running resources, perform the power-on operation on the target container group to obtain the target container group in the original state before shutdown.

[0118] In some implementations of this embodiment, the state changing unit 603 is further configured to: perform a startup operation on the target container group to determine whether the target container group is successfully started; in response to a startup failure, obtain a target container group in a startup failure state; and continue to perform a startup operation on the target container group in the startup failure state until a target container group in an original state is obtained.

[0119] In some implementations of this embodiment, the apparatus further includes: a resource determination unit (not shown in the figure), configured to: determine whether reserved resource data corresponding to the target container group is stored in a resource configuration file of the target container group; in response to determining yes, determine the reserved resource represented by the reserved resource data as the running resource.

[0120] In some implementations of this embodiment, the operation determining unit 602 is further configured to: in response to determining that the device on which the target container group is deployed does not include the running resources occupied by the target container group before shutdown, determine that the state changing operation for the target container group is a prohibiting power-on operation for prohibiting execution of the power-on operation; and the state changing unit 603 is further configured to: perform the prohibiting power-on operation on the target container group to obtain the target container group in a power-on resource insufficient state.

[0121] In some implementations of this embodiment, the operation determining unit 602 is further configured to: in response to the state change instruction being a shutdown instruction for a target container group in a startup state or a startup state, determine that the state change operation for the target container group is a shutdown operation, where the shutdown operation includes: stopping containers and sandboxes in the target container group; reserving a network address corresponding to the target container group; and releasing running resources occupied by the target container group; and the state changing unit 603 is further configured to: perform a shutdown operation on the target container group to obtain a target container group in a shutdown state.

[0122] In some implementations of this embodiment, the above-mentioned device further includes: a tuning unit (not shown in the figure), configured to: determine the actual state and the expected state of the target container group after the state change operation is performed; in response to the actual state being different from the expected state, tune the target container group according to the expected state.

[0123] In this embodiment, the instruction acquisition unit in the state change device of the container group acquires the state change instruction for the target container group, wherein the state change instruction includes a power-on instruction and a power-off instruction; the operation determination unit determines the state change operation for the target container group according to the state change instruction and the current state of the target container group; the state change unit performs the state change operation on the target container group to obtain the target container group after the running state is changed, thereby providing a control method for the power on / off state of the container group, so that the container group has the power on / off capability, which helps to improve the applicability of the container group in various application scenarios and the flexibility of the user's management process of the container group.

[0124] Reference below Figure 7 , which shows a device suitable for implementing the embodiments of the present application (eg Figure 1 Schematic diagram of the structure of a computer system 700 of devices 101, 102, 103, 105) shown. Figure 7 The device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0125] like Figure 7 As shown, the computer system 700 includes a processor (e.g., CPU, central processing unit) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The processor 701, ROM 702, and RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0126] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.

[0127] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 709, and / or installed from a removable medium 711. When the computer program is executed by the processor 701, the above-mentioned functions defined in the method of the present application are executed.

[0128] It should be noted that the computer-readable medium of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0129] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the client computer, partially on the client computer, as a separate software package, partially on the client computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the client computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0130] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the device, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0131] The units involved in the embodiments described in the present application may be implemented by software or by hardware. The described units may also be set in a processor, for example, may be described as: a processor comprising a data determination unit, a list update unit, and a display unit. Among them, the names of these units do not constitute a limitation on the unit itself under certain circumstances. For example, the data determination unit may also be described as "a unit for determining event data of node events in the medical treatment process of a target user based on multiple business subsystems in a smart hospital system."

[0132] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the device, the computer device: determines the event data of the node events in the treatment process of the target user based on multiple business subsystems in the smart hospital system; updates the to-do event list corresponding to the target user according to the event data; and displays the to-do event list through the target terminal.

[0133] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.

Claims

1. A method for changing the state of a container group, comprising: Acquire a state change instruction for the target container group, wherein the state change instruction includes a power-on instruction and a power-off instruction; Determine a state change operation for the target container group according to the state change instruction and the current state of the target container group; The state changing operation is performed on the target container group to obtain the target container group after the running state is changed.

2. The method according to claim 1, wherein: The determining, according to the state change instruction and the current state of the target container group, a state change operation for the target container group includes: In response to the state change instruction being a startup instruction for a target container group that is in a shutdown state or a shutdown-in-progress state, determining whether a device on which the target container group is deployed includes operating resources occupied by the target container group before shutdown; In response to the determining, the step includes determining that the state change operation for the target container group is a power-on operation; and The performing the state change operation on the target container group to obtain the target container group after the running state is changed includes: Based on the running resources, the startup operation is performed on the target container group to obtain the target container group in an original state before shutdown.

3. The method according to claim 2, wherein: The step of performing the startup operation on the target container group to obtain the target container group in an original state before shutdown includes: Performing the startup operation on the target container group to determine whether the target container is successfully started; In response to the startup failure, obtaining a target container group in a startup failure state; The startup operation is continuously performed on the target container group in the startup failure state until the target container group in the original state is obtained.

4. The method according to claim 2, wherein: Also includes: Determine whether reserved resource data corresponding to the target container group is stored in the resource configuration file of the target container group; In response to the determination being yes, the reserved resources represented by the reserved resource data are determined as the operating resources.

5. The method according to claim 2, wherein: The determining, according to the state change instruction and the current state of the target container group, a state change operation for the target container group further includes: In response to determining that the device in which the target container group is deployed does not include the running resources occupied by the target container group before shutdown, determining that the state change operation for the target container group is a power-on prohibition operation for prohibiting execution of the power-on operation; and The performing the state change operation on the target container group to obtain the target container group after the running state is changed includes: The startup prohibition operation is performed on the target container group to obtain a target container group in a startup resource insufficient state.

6. The method according to claim 1, wherein: The determining, according to the state change instruction and the current state of the target container group, a state change operation for the target container group includes: In response to the state change instruction being a shutdown instruction for a target container group in a startup state or a startup state, determining that the state change operation for the target container group is a shutdown operation, the shutdown operation includes: Stop the containers and sandboxes in the target container group; Reserving the network address corresponding to the target container group; and releasing the operating resources occupied by the target container group; and The performing the state change operation on the target container group to obtain the target container group after the running state is changed includes: The shutdown operation is performed on the target container group to obtain a target container group in a shutdown state.

7. The method according to any one of claims 1 to 6, wherein: Also includes: Determine an actual state and an expected state of the target container group after the state change operation is performed; In response to the actual state being different from the desired state, the target container set is tuned according to the desired state.

8. A device for changing the state of a container group, comprising: An instruction acquisition unit is configured to acquire a state change instruction for a target container group, wherein the state change instruction includes a startup instruction and a shutdown instruction; an operation determining unit, configured to determine a state changing operation for the target container group according to the state changing instruction and the current state of the target container group; The state changing unit is configured to perform the state changing operation on the target container group to obtain the target container group after the running state is changed.

9. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. An electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

11. A computer program product comprising: A computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.