Virtual machine instance processing method and container instance creation method

By judging the reusability of virtual machine instances, putting them into the resource reuse pool, and reusing virtual machine instances when container instances are created, the problem of slow container instance creation and startup speed is solved, improving speed and reducing Resource consumption.

WO2025031080A1PCT designated stage expired Publication Date: 2025-02-13HANGZHOU ALICLOUD FEITIAN INFORMATION TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/104046
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-08-10
Filing Date
2024-07-05
Publication Date
2025-02-13

AI Technical Summary

Technical Problem

The creation and startup of container instances is slower, especially in container instances with short run times, which affects the user experience.

Method used

By determining whether the target virtual machine instance belongs to a reusable resource, if it belongs, it is placed in the resource reuse pool, and when creating a specific container instance, the virtual machine instance is obtained from the pool, and directly create the container instance on it.

Benefits of technology

It greatly reduces the creation and startup time of container instances, improves speed, and reduces the consumption of processing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024104046_13022025_PF_FP_ABST
    Figure CN2024104046_13022025_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of cloud computing. Provided are a virtual machine instance processing method and a container instance creation method. The virtual machine instance processing method comprises: in response to a deletion request for a target container instance, determining whether a target virtual machine instance configured to support the operation of the target container instance is a reusable resource; and when the target virtual machine instance is a reusable resource, putting the target virtual machine instance in a resource reuse pool, so as to configure to acquire, when a specific container instance is created, the target virtual machine instance from the resource reuse pool, and create the specific container instance on the target virtual machine instance, wherein configuration requirements of the specific container instance regarding a virtual machine instance match a configuration of the target virtual machine instance.
Need to check novelty before this filing date? Find Prior Art

Description

How to handle virtual machine instances and how to create container instances

[0001] Cross-reference

[0002] This disclosure claims priority to the Chinese patent application filed with the China Patent Office on August 10, 2023, application number 202311011389.5, application name “Processing method of virtual machine instance and creation method of container instance”, the entire contents of which are incorporated by reference into this disclosure. Technical Field

[0003] The present disclosure relates to the field of cloud computing technology, and in particular to a method for processing a virtual machine instance and a method for creating a container instance. Background Art

[0004] Container technology has been widely adopted due to its advantages such as lightweight, portability, scalability, and environmental isolation. However, the speed of creating and starting container instances significantly impacts the user experience, especially for short-lived container instances. Therefore, improving the speed of creating and starting container instances has become a pressing technical challenge in the application of container technology.

[0005] Summary of the Invention

[0006] The embodiments of the present disclosure provide a method for processing a virtual machine instance and a method for creating a container instance to solve one or more of the above-mentioned technical problems.

[0007] In a first aspect, an embodiment of the present disclosure provides a method for processing a virtual machine instance, the method comprising:

[0008] In response to a deletion request for a target container instance, determining whether a target virtual machine instance configured to support the operation of the target container instance is a reusable resource;

[0009] When the target virtual machine instance is a reusable resource, the target virtual machine instance is placed in a resource reuse pool, so that it is set to obtain the target virtual machine instance from the resource reuse pool when creating a specific container instance, and a specific container instance is created on the target virtual machine instance; the configuration requirements of the specific container instance for the virtual machine instance match the configuration of the target virtual machine instance.

[0010] In a second aspect, an embodiment of the present disclosure provides a method for creating a container instance, the method comprising:

[0011] When it is determined that a virtual machine instance can be reused when creating a specific container instance, obtaining a target virtual machine instance that matches the specific configuration requirement from at least one virtual machine instance stored in a resource reuse pool; the at least one virtual machine instance is a reusable resource; and the specific configuration requirement is set to identify a configuration requirement of the specific container instance for the virtual machine instance.

[0012] Create a specific container instance on the target VM instance.

[0013] In a third aspect, an embodiment of the present disclosure provides a system for creating a container instance, the system comprising: a resource storage node and a resource reuse node:

[0014] A resource storage node configured to execute a method for processing a virtual machine instance provided by an embodiment of the present disclosure;

[0015] The resource reuse node is configured to execute the container instance creation method provided by the embodiment of the present disclosure.

[0016] In a fourth aspect, an embodiment of the present disclosure provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor implements the method provided in any embodiment of the present disclosure when executing the computer program.

[0017] In a fifth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method provided by any embodiment of the present disclosure is implemented.

[0018] Compared with the prior art, the present disclosure has the following advantages:

[0019] The technical solution disclosed herein, when deleting a target container instance, first determines whether the target virtual machine instance configured to support the target container instance is a reusable resource. If the target virtual machine instance is a reusable resource, the target virtual machine instance is placed in a resource reuse pool. The target virtual machine instance is configured to be retrieved from the resource reuse pool when creating a specific container instance, and the specific container instance is created on the target virtual machine instance. In other words, if the target virtual machine instance is a reusable resource, when deleting the target container instance, the target virtual machine instance is not deleted. Instead, the target virtual machine instance is placed in the resource reuse pool as a reusable resource, and when creating a specific container instance, the target virtual machine instance is directly reused to create the specific container instance on the target virtual machine instance. Directly reusing the target virtual machine instance when creating a specific container instance avoids the need to expend significant time and processing resources to configure a virtual machine instance configured to support the specific container instance when creating and starting the specific container instance. This significantly reduces the time required to create and start a specific container instance, increases the speed of creating and starting a specific container instance, and reduces the processing resources required to create and start a specific container instance.

[0020] The above summary is for illustrative purposes and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments, and features described above, further aspects, embodiments, and features of the present disclosure will be readily apparent by reference to the accompanying drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings depict some embodiments according to the present disclosure and should not be regarded as limiting the scope of the present disclosure.

[0022] FIG1 is a schematic diagram showing an application process of a method for processing a virtual machine instance and a method for creating a container instance provided in an embodiment of the present disclosure;

[0023] FIG2 shows a flowchart of a method for processing a virtual machine instance provided in an embodiment of the present disclosure;

[0024] FIG3 shows a flowchart of a method for creating a container instance provided in an embodiment of the present disclosure;

[0025] FIG4 is a schematic diagram showing a training process of a container instance classification model provided in an embodiment of the present disclosure;

[0026] FIG5 is a schematic diagram showing a training process of a container instance classification model provided in an embodiment of the present disclosure;

[0027] FIG6 shows a schematic diagram of a processing device for a virtual machine instance provided in an embodiment of the present disclosure;

[0028] FIG7 shows a schematic diagram of a device for creating a container instance provided in an embodiment of the present disclosure; and

[0029] FIG8 shows a block diagram of an electronic device for implementing an embodiment of the present disclosure. DETAILED DESCRIPTION

[0030] The following description sets forth many specific details to facilitate a full understanding of the present disclosure. However, the present disclosure can be implemented in many other forms than those described herein, and those skilled in the art can make similar generalizations without violating the scope of the present disclosure. Therefore, the present disclosure is not limited to the specific implementations disclosed below.

[0031] To facilitate understanding of the technical solutions of the embodiments of the present disclosure, the following describes the related technologies of the embodiments of the present disclosure. The following related technologies are optional solutions that can be combined with the technical solutions of the embodiments of the present disclosure in any way, and all of them fall within the scope of protection of the embodiments of the present disclosure.

[0032] The embodiments of the present disclosure involve a processing scheme for virtual machine instances and a creation scheme for container instances. Among them, the processing scheme for virtual machine instances will first respond to a deletion request for a target container instance, determine whether the target virtual machine instance set to support the operation of the target container instance is a reusable resource, and then, if the target virtual machine instance is a reusable resource, put the target virtual machine instance into a resource reuse pool, so as to set it to obtain the target virtual machine instance from the resource reuse pool when creating a specific container instance, and create a specific container instance on the target virtual machine instance; the configuration requirements of the specific container instance for the virtual machine instance match the configuration of the target virtual machine instance.

[0033] A virtual machine (VM) instance is a virtual machine created and running in a virtualized environment. When creating a VM instance, you often need to first specify its configuration. For example, the VM instance configuration includes the corresponding computing resources and the container image stored in the VM instance. Computing resources include processor resources, memory resources, storage resources, and network resources. In other words, the VM instance corresponds to a specified configuration.

[0034] It should be noted that when creating and running a container instance on a virtual machine instance, the virtual machine instance must first read the container image configured to support the creation and startup of the container instance from the storage device configured to store the container image, and will configure the virtual machine instance based on the read container image. As can be seen, the virtual machine instance running a container instance often stores a container image. Among them, the container image (Container Image) includes the application code, runtime environment, system tools and dependent libraries and other required components, as well as the configuration and parameters required to start and run the application.

[0035] In the embodiments of the present disclosure, the container instance created on the virtual machine instance is generally a Pod (container group) level container instance, for example, ECI (Elastic Container Instance), or it can be a Container (container) level container instance.

[0036] The criterion for determining whether a target virtual machine instance is a reusable resource can be whether the runtime corresponding to the target container instance is less than a configured runtime threshold. Specifically, if the runtime corresponding to the target container instance is less than the configured runtime threshold, the target virtual machine instance can be determined as a reusable resource. However, if the runtime corresponding to the target container instance is not less than the configured runtime threshold, the target virtual machine instance is determined as a non-reusable resource. In other words, if the runtime corresponding to the target container instance is relatively short, the target virtual machine instance can be considered a reusable resource. Container instances with relatively short runtimes often have higher requirements for container instance creation and startup speed. Therefore, if the criterion for determining whether a target virtual machine instance is a reusable resource is set as "whether the runtime corresponding to the target container instance is less than the configured runtime threshold," there is a high probability that the target container instance can be directly reused when it is created again, thereby significantly improving the creation and startup speed of the target virtual machine instance.

[0037] For container instances with shorter runtimes, although there are often higher requirements for the creation and startup speed of container instances, if the container instance with shorter runtime (target container instance) is not created again after being created once, or the frequency of being created again is very low, in this case, if the target virtual machine instance is placed in the resource reuse pool as a reusable resource, the probability of the target virtual machine instance being reused is often very small, which will cause a waste of storage resources and processing resources. Therefore, in order to avoid the waste of storage resources and processing resources, the standard for determining whether the target virtual machine instance is a reusable resource can be further configured as: whether the runtime corresponding to the target container instance is lower than the runtime threshold of the corresponding configuration, and whether the creation frequency corresponding to the target container instance reaches the creation frequency threshold of the corresponding configuration. That is to say, the standard for determining whether the target virtual machine instance is a reusable resource, in addition to including whether the runtime corresponding to the target container instance is lower than the runtime threshold of the corresponding configuration, can also include whether the creation frequency corresponding to the target container instance reaches the creation frequency threshold of the corresponding configuration.

[0038] The criteria for determining whether a target virtual machine instance is a reusable resource are whether the target container instance's corresponding runtime is less than the corresponding configured runtime threshold, and whether the target container instance's corresponding creation frequency reaches the corresponding configured creation frequency threshold. If the target container instance's corresponding runtime is determined to be no less than the corresponding configured runtime threshold, the target virtual machine instance is directly determined not to be a reusable resource. However, if the target container instance's corresponding runtime is determined to be less than the corresponding configured runtime threshold, further determination of whether the target virtual machine instance is a reusable resource is required based on whether the target container instance's corresponding creation frequency reaches the corresponding configured creation frequency threshold. Specifically, if the target container instance's corresponding runtime is less than the corresponding configured runtime threshold, and if the target container instance's corresponding creation frequency reaches the corresponding configured creation frequency threshold, the target virtual machine instance is determined to be a reusable resource; otherwise, the target virtual machine instance is determined to be a non-reusable resource. In other words, the target virtual machine instance is considered a reusable resource only when the target container instance's corresponding runtime is short and its corresponding creation frequency is high.

[0039] It should be noted that, when configuring whether the running time is lower than the running time threshold as the standard for determining whether the target virtual machine instance is a reusable resource, other determination conditions can also be configured as the standard for determining whether the target virtual machine instance is a reusable resource, for example, whether the creation frequency corresponding to the above-mentioned target container instance reaches the corresponding configured creation frequency threshold. However, in addition to processing other determination conditions, including whether the creation frequency corresponding to the target container instance reaches the corresponding configured creation frequency threshold, it can also be the container instance type corresponding to the target container instance. In this case, the standard for determining whether the target virtual machine instance is a reusable resource is whether the running time corresponding to the target container instance is lower than the corresponding configured running time threshold, and whether the container instance type corresponding to the target container instance is the specified container instance type.

[0040] When determining whether a target virtual machine instance is a reusable resource, the criteria for determining whether the target container instance's runtime is less than the configured runtime threshold and whether the container instance type corresponding to the target container instance is a specified container instance type is used. If the runtime corresponding to the target container instance is determined to be no less than the configured runtime threshold, the target virtual machine instance is directly determined to be a non-reusable resource. However, if the runtime corresponding to the target container instance is determined to be less than the configured runtime threshold, further determination of whether the target virtual machine instance is a reusable resource is required based on whether the container instance type corresponding to the target container instance is a specified container instance type. Specifically, if the runtime corresponding to the target container instance is less than the configured runtime threshold, and if the container instance type corresponding to the target container instance is a specified container instance type, the target virtual machine instance is determined to be a reusable resource; otherwise, the target virtual machine instance is determined to be a non-reusable resource. In other words, the target virtual machine instance is considered a reusable resource only when the runtime corresponding to the target container instance is shorter and is of a specified container instance type.

[0041] In addition, other determination conditions can also be personalized according to needs. In the embodiments of the present disclosure, the types of other determination conditions are not specifically limited. If the target virtual machine instance is a reusable resource, when placing the target virtual machine instance into the resource reuse pool, the target container instance on the target virtual machine instance must be deleted first, and then the target virtual machine instance is added to the resource reuse pool. In other words, the reused resource pool stores the target virtual machine instance, but does not include the target container instance. In addition, since the target container instance has been deleted, the container image is still stored on the target virtual machine instance. In the embodiments of the present disclosure, the container image stored in the target virtual machine instance is also used as the configuration of the target virtual machine instance.

[0042] In the embodiments of the present disclosure, the configuration requirements of a specific container instance for a virtual machine instance are referred to as specific configuration requirements. Corresponding to the configuration of the virtual machine instance, the specific configuration requirements include the container image requirements of the specific container instance for the container image stored in the virtual machine instance, and the computing resource requirements of the specific container instance for the computing resources corresponding to the virtual machine instance. The matching of the configuration requirements of the specific container instance for the virtual machine instance with the configuration of the target virtual machine instance generally means that the container image stored in the target virtual machine instance must match the container image requirements, and the computing resources corresponding to the target virtual machine instance must meet the computing resource requirements.

[0043] The container image stored in the target virtual machine instance must match the container image requirement, meaning that the container image corresponding to the container image requirement is the same as the container image stored in the target virtual machine instance. For example, if the container image requirement is container image A, then the container image stored in the target virtual machine instance must also be container image A. The computing resources corresponding to the target virtual machine instance must meet the computing resource requirement, meaning that the computing resources corresponding to the target virtual machine instance must be greater than or equal to the computing resources corresponding to the computing resource requirement. For example, if the computing resources corresponding to the computing resource requirement are: a dual-core processor and 4GB (Giga Byte) of running memory, then the computing resources corresponding to the target virtual machine instance can be a dual-core processor and 4GB of running memory, a dual-core processor and 8GB of running memory, or even a quad-core processor and 8GB of running memory.

[0044] The container instance creation scheme involved in the embodiments of the present disclosure, when determining that a virtual machine instance can be reused when creating a specific container instance, first obtains a target virtual machine instance that matches specific configuration requirements from at least one virtual machine instance stored in a resource reuse pool, and then creates the specific container instance on the target virtual machine instance. The at least one virtual machine instance is a reusable resource, and the specific configuration requirements are set to identify the configuration requirements of the specific container instance for the virtual machine instance.

[0045] The basis for determining whether a virtual machine instance can be reused when creating a specific container instance is whether the predicted runtime for the specific container instance is lower than the configured runtime threshold. Specifically, if the predicted runtime for the specific container instance is lower than the configured runtime threshold, the virtual machine instance can be reused when creating the specific container instance. If the predicted runtime for the specific container instance is not lower than the configured runtime threshold, the virtual machine instance cannot be reused when creating the specific container instance. In other words, if the predicted runtime for the specific container instance is short, it can be determined that resources can be reused to create the specific container instance. Container instances with shorter runtimes often have higher requirements for container instance creation and startup speed. Therefore, if the basis for determining whether a virtual machine instance can be reused when creating a specific container instance is "whether the predicted runtime for the specific container instance is lower than the configured runtime threshold," there is a high probability that virtual machine instances stored in the resource reuse pool can be reused when creating container instances with shorter runtimes, thereby significantly improving the creation and startup speed of container instances with shorter runtimes.

[0046] To more clearly illustrate the virtual machine instance processing method and container instance creation method provided in the embodiments of the present disclosure, we first introduce an application example of the virtual machine instance processing method and container instance creation method provided in the embodiments of the present disclosure. The virtual machine instance processing method and container instance creation method provided in the embodiments of the present disclosure can be set as part of the ECI creation process. As shown in Figure 1, a schematic diagram of the application process of the virtual machine instance processing method and container instance creation method provided in the embodiments of the present disclosure is shown. The specific implementation process of this example includes the virtual machine instance processing stage and the container instance creation stage.

[0047] The virtual machine instance processing phases are as follows: After receiving a deletion request from a client for a target ECI, the server first responds to the deletion request and determines whether the target virtual machine instance configured to support the target ECI is a reusable resource. If so, the server places the target virtual machine instance into the resource reuse pool.

[0048] The ECI creation phase is as follows: After a user sends a request to the server to create a specific ECI, the server first responds to the request and determines whether a reusable VM instance is available for creating the ECI. If so, the server retrieves a target VM instance matching the specified configuration requirements from at least one VM instance in the resource reuse pool and creates the ECI on the target VM instance.

[0049] It should be noted that the above-mentioned application examples of the method for processing virtual machine instances and the method for creating container instances provided in the embodiments of the present disclosure are for ease of understanding and are not intended to limit the method for processing virtual machine instances and the method for creating container instances provided in the embodiments of the present disclosure. Specifically, the application scenarios of the method for processing virtual machine instances and the method for creating container instances provided in the embodiments of the present disclosure are not specifically limited. For example, in addition to being applicable to the creation process of ECI, the method for processing virtual machine instances and the method for creating container instances provided in the embodiments of the present disclosure can also be applied to the creation process of other types of container instances.

[0050] In addition, the user end in the embodiments of the present disclosure is a device terminal that needs to use a container instance to complete a specific task, and the server end is generally a cloud server. In other words, the execution entity of the virtual machine instance processing method and container instance creation method provided in the embodiments of the present disclosure is generally a cloud server.

[0051] In addition, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose or edit authorization or rejection.

[0052] The following specific embodiments describe in detail the technical solutions of the present disclosure and how the technical solutions of the present disclosure solve the above-mentioned technical problems. The following related technologies are optional solutions that can be combined with the technical solutions of the embodiments of the present disclosure in any way, and all of them fall within the scope of protection of the embodiments of the present disclosure. For the same or similar concepts or processes, they may not be repeated in some embodiments.

[0053] FIG2 shows a flowchart of a method 200 for processing a virtual machine instance provided in an embodiment of the present disclosure. The method may include steps S201 - S202 .

[0054] In step S201 , in response to a deletion request for a target container instance, it is determined whether a target virtual machine instance configured to support the operation of the target container instance is a reusable resource.

[0055] The target container instance generally refers to a container instance that has completed running. The type of the target container instance is generally ECI, but it can also be other types of container instances.

[0056] Container instances with shorter runtimes often have higher requirements for container instance creation and startup speeds. Therefore, if the standard for determining whether a target virtual machine instance is a reusable resource is determined as "whether the runtime corresponding to the target container instance is lower than the corresponding configured runtime threshold," there is a high probability that when the target container instance is created again, it can be directly reused with the target virtual machine instance, thereby increasing the creation and startup speed of the target virtual machine instance. If the standard for determining whether a target virtual machine instance is a reusable resource is "whether the runtime corresponding to the target container instance is lower than the corresponding configured runtime threshold," when determining whether a target virtual machine instance configured to support the operation of the target container instance is a reusable resource, the runtime corresponding to the target container instance can be first obtained. Then, if the runtime is lower than the corresponding configured runtime threshold, a determination is made as to whether the target virtual machine instance is a reusable resource.

[0057] In one example, if the runtime corresponding to the target container instance is lower than the runtime threshold of the corresponding configuration, the target virtual machine instance can be determined as a reusable resource, and if the runtime corresponding to the target container instance is not lower than the runtime threshold of the corresponding configuration, the target virtual machine instance will be determined as a non-reusable resource.

[0058] The runtime threshold can be determined based on a priori values ​​or a preconfigured probability of reusable resources. For example, the runtime threshold can be 30 minutes. The reusable resource probability refers to the probability of using a virtual machine instance as a reusable resource. Generally, the greater the runtime threshold, the greater the probability of using a virtual machine instance as a reusable resource. In other words, in the embodiments of the present disclosure, the probability of using a virtual machine instance as a reusable resource can be adjusted by preconfiguring the reusable resource probability.

[0059] For container instances with shorter runtimes, although there are often higher requirements for the creation and startup speed of container instances, if the container instance with shorter runtime (target container instance) is not created again after being created once, or the frequency of being created again is very low, in this case, if the target virtual machine instance is placed in the resource reuse pool as a reusable resource, the probability of the target virtual machine instance being reused is often very small, which will cause a waste of storage resources and processing resources. Therefore, in order to avoid the waste of storage resources and processing resources, the standard configuration for determining whether the target virtual machine instance is a reusable resource can be further configured as whether the runtime corresponding to the target container instance is lower than the runtime threshold of the corresponding configuration, and whether the creation frequency corresponding to the target container instance reaches the creation frequency threshold of the corresponding configuration. In this case, when the runtime is lower than the runtime threshold of the corresponding configuration, when determining whether the target virtual machine instance is a reusable resource, the creation frequency corresponding to the target container instance can be obtained when the runtime is lower than the runtime threshold, and then, when the creation frequency reaches the creation frequency threshold of the corresponding configuration, it is determined that the target virtual machine instance is a reusable resource.

[0060] In one example, if the running time corresponding to the target container instance is lower than the running time threshold of the corresponding configuration, and at the same time, the creation frequency corresponding to the target container instance reaches the creation frequency threshold of the corresponding configuration, the target virtual machine instance is determined to be a reusable resource; otherwise, the target virtual machine instance is determined to be a non-reusable resource.

[0061] In one possible implementation, when whether the running time is lower than the running time threshold is configured as the standard for determining whether the target virtual machine instance is a reusable resource, other determination conditions can also be configured as the standard for determining whether the target virtual machine instance is a reusable resource, for example, whether the creation frequency corresponding to the above-mentioned target container instance reaches the creation frequency threshold of the corresponding configuration. However, in addition to processing other determination conditions including whether the creation frequency corresponding to the target container instance reaches the creation frequency threshold of the corresponding configuration, it can also be the container instance type corresponding to the target container instance. In this case, the standard for determining whether the target virtual machine instance is a reusable resource is whether the running time corresponding to the target container instance is lower than the running time threshold of the corresponding configuration, and whether the container instance type corresponding to the target container instance is the specified container instance type.

[0062] In addition, other determination conditions can also be customized according to needs. In the embodiments of this disclosure, the types of other determination conditions are not specifically limited. In one possible implementation, obtaining the creation frequency corresponding to the target container instance means first obtaining the operation behavior log for the target container instance, then parsing the operation behavior log to obtain historical creation behavior data for the target container instance, and then determining the creation frequency based on the historical creation behavior data.

[0063] The operation log records historical deletion and creation data for container instances. The historical deletion data describes at least each deletion operation on the container instance and the time each deletion operation occurred. The historical creation data describes at least each creation operation on the container instance and the time each creation operation occurred. The creation frequency can be determined based on the number of target container creations within a specified time period. In one example, the creation frequency can be calculated based on the number of target container creations within an hour.

[0064] The method for processing virtual machine instances provided in the embodiments of the present disclosure, after responding to a deletion request for a target container instance and determining whether the target virtual machine instance configured to support the operation of the target container instance is a reusable resource, further executes step S202. In step S202, if the target virtual machine instance is a reusable resource, the target virtual machine instance is placed into a resource reuse pool, configured to obtain the target virtual machine instance from the resource reuse pool when creating a specific container instance, and a specific container instance is created on the target virtual machine instance; the configuration requirements of the specific container instance for the virtual machine instance match the configuration of the target virtual machine instance.

[0065] The configuration of a virtual machine instance includes the computing resources corresponding to the virtual machine instance and the container image stored in the virtual machine instance. Computing resources include processor resources, memory resources, storage resources, and network resources. Corresponding to the configuration of the virtual machine instance, specific configuration requirements include the container image requirements of a specific container instance for the container image stored in the virtual machine instance, and the computing resource requirements of the computing resources corresponding to the virtual machine instance. Matching the configuration requirements of a specific container instance for the virtual machine instance with the configuration of the target virtual machine instance generally means that the container image stored in the target virtual machine instance must match the container image requirements, and the computing resources corresponding to the target virtual machine instance must meet the computing resource requirements.

[0066] The container image stored in the target VM instance must match the container image requirement, meaning that the container image corresponding to the container image requirement must be the same as the container image stored in the target VM instance. For example, if the container image requirement is container image A, the container image stored in the target VM instance must also be container image A. The computing resources corresponding to the target VM instance must meet the computing resource requirement, meaning that the computing resources corresponding to the target VM instance must be greater than or equal to the computing resources corresponding to the computing resource requirement.

[0067] In one possible implementation, in order to ensure that the target virtual machine instance is stored in the reuse resource pool but not the target container instance, when placing the target virtual machine instance into the resource reuse pool, the target container instance must first be deleted on the target virtual machine instance, and then the target virtual machine instance is added to the resource reuse pool.

[0068] In addition, if the target virtual machine instance is continuously stored in the resource reuse pool for too long, then it indicates that the target virtual machine instance has not been reused. If the target virtual machine instance is still stored in the resource reuse pool when it has not been reused for a long time, it will cause a waste of storage resources. In order to avoid this situation, after the target virtual machine instance is placed in the resource reuse pool, the continuous storage time of the target virtual machine instance in the resource reuse pool can be further monitored, and when the continuous storage time reaches the corresponding configured storage time threshold, the target virtual machine instance is deleted from the resource reuse pool. The storage time threshold can be configured according to a priori value. In one example, the storage time threshold is 30 minutes. That is, if the target virtual machine instance is continuously stored in the resource reuse pool for 30 minutes, the target virtual machine instance can be deleted from the resource reuse pool.

[0069] The method for processing virtual machine instances provided in the embodiments of the present disclosure, when deleting the target container instance, will first determine whether the target virtual machine instance that is set to support the operation of the target container instance is a reusable resource, and when the target virtual machine instance is a reusable resource, the target virtual machine instance will be placed in the resource reuse pool, so as to be set to obtain the target virtual machine instance from the resource reuse pool when creating a specific container instance, and create a specific container instance on the target virtual machine instance. In other words, if the target virtual machine instance is a reusable resource, then when deleting the target container instance, the target virtual machine instance is not deleted, but the target virtual machine instance is placed in the resource reuse pool as a reusable resource, and the target virtual machine instance is directly reused when creating a specific container instance, so as to create a specific container instance on the target virtual machine instance. Directly reusing the target virtual machine instance when creating a specific container instance can avoid consuming a lot of time and processing resources to configure the virtual machine instance that is set to support the operation of the specific container instance when creating and starting the specific container instance. In this way, the time required to create and start a specific container instance can be greatly reduced, the creation and startup speed of a specific container instance can be increased, and at the same time, the processing resources required to create and start a specific container instance can be reduced.

[0070] Corresponding to the application example of the method provided in the embodiment of the present disclosure and the processing method of the virtual machine instance provided in the embodiment of the present disclosure, the embodiment of the present disclosure also provides a method for creating a container instance. As shown in Figure 3, it is a flowchart of a method 300 for creating a container instance provided in the embodiment of the present disclosure. The method may include steps S301-S302.

[0071] In step S301, when it is determined that a virtual machine instance can be reused when creating a specific container instance, a target virtual machine instance that matches the specific configuration requirement is obtained from at least one virtual machine instance stored in a resource reuse pool; at least one virtual machine instance belongs to a reusable resource; and the specific configuration requirement is set to identify the configuration requirement of the specific container instance for the virtual machine instance.

[0072] Container instances with shorter runtimes often have higher requirements for container instance creation and startup speed. Therefore, if the basis for determining whether a virtual machine instance can be reused when creating a specific container instance is determined to be "whether the predicted runtime corresponding to the specific container instance is lower than the corresponding configured runtime threshold," there is a high probability that virtual machine instances stored in the resource reuse pool can be reused when creating a container instance with shorter runtimes, thereby significantly improving the creation and startup speed of container instances with shorter runtimes. If the basis for determining whether a virtual machine instance can be reused when creating a specific container instance is "whether the predicted runtime corresponding to the specific container instance is lower than the corresponding configured runtime threshold," when determining whether a virtual machine instance can be reused when creating a specific container instance, the system can first predict whether the runtime of the specific container instance is lower than the corresponding configured runtime threshold based on the specific configuration requirements. Then, if the runtime is lower than the corresponding configured runtime threshold, the system can determine that the virtual machine instance can be reused when creating the specific container instance. If the runtime is not lower than the corresponding configured runtime threshold, the system can determine that the virtual machine instance cannot be reused when creating the specific container instance.

[0073] In one example, if the predicted runtime corresponding to a specific container instance is lower than a corresponding configured runtime threshold, it can be determined that the virtual machine instance can be reused when creating the specific container instance. If the predicted runtime corresponding to the specific container instance is not lower than the corresponding configured runtime threshold, it can be determined that the virtual machine instance cannot be reused when creating the specific container instance.

[0074] The runtime of a container instance is strongly correlated with some of the configurations in the container instance's creation configuration. Therefore, when determining whether a virtual machine instance can be reused when creating a specific container instance, the runtime of the specific container instance can be predicted to be lower than the runtime threshold of the corresponding configuration based on the creation configuration requirements corresponding to the specific container instance. The creation configuration requirements are set to identify the requirements of the specific container instance for the creation configuration, and the creation configuration requirements include specific configuration requirements. Specifically, in addition to the configuration requirements of the specific container instance for the virtual machine instance (i.e., specific configuration requirements), the creation configuration requirements also include the requirements of the specific container instance for the container instance restart policy (Restart_Policy), the requirements of the specific container instance for the manager (Managed_By), the requirements of the specific container instance for the container image pull policy (Ownerrefferrence), and the requirements of the specific container instance for the clone set (Cloneset). Correspondingly, the creation configuration required for a specific container instance includes, in addition to the virtual machine instance configuration required for the specific container instance, the container instance restart policy required for the specific container instance, the manager required for the specific container instance, the container image pull policy required for the specific container instance, and the clone set required for the specific container instance.

[0075] In one possible implementation, to quickly and accurately predict whether the runtime is below a runtime threshold, based on the creation configuration requirements corresponding to a specific container instance, when predicting whether the runtime of a specific container instance is below the runtime threshold for the corresponding configuration, the creation configuration requirements can be first parsed to obtain the creation configuration required for the specific container instance. A feature vector corresponding to the creation configuration required for the specific container instance can then be obtained. The feature vector is then input into a trained container instance classification model to obtain a container instance classification result output by the container instance classification model. The container instance classification result is configured to indicate whether the runtime is below the runtime threshold.

[0076] The training process of the container instance classification model can be shown in FIG4 , which shows a schematic diagram of the training process of a container instance classification model. The training process of the container instance classification model is as follows:

[0077] First, for multiple container instance samples in a container instance sample set, the creation configuration of each container instance sample is obtained. Second, the creation configuration of each container instance sample is discretized. During the discretization process, the creation configuration of each container instance sample can be binned, and then the binned creation configuration can be binarized to obtain discrete features corresponding to the creation configuration of each container instance sample. The discrete features corresponding to the creation configuration of each container instance sample are used as feature vectors corresponding to the creation configuration of each container instance sample. Third, a container instance classification result labeled for each container instance sample is obtained. Finally, a container instance classification model to be trained is trained using the feature vectors corresponding to the creation configuration of each container instance sample and the container instance classification result labeled for each container instance sample to obtain a trained container instance classification model. The binning process and the binarization process can be implemented based on a pre-configured binning process model configured for binning and a pre-configured binarization process model configured for binarization, respectively.

[0078] Binning the creation configurations of each container instance sample refers to binning the creation configurations of each container instance sample according to positive and negative samples, with the creation configurations of each container instance sample belonging to positive samples being classified into one category and the creation configurations of each container instance sample belonging to negative samples being classified into another category. Positive and negative samples are classified based on whether the runtime of the container instance sample is below the runtime threshold of the corresponding configuration. That is, positive samples include container instance samples whose runtime is below the runtime threshold, and negative samples include container instance samples whose runtime is not below the runtime threshold.

[0079] In addition, during the training process of the container instance classification model, a correspondence analysis strategy can be used to determine the creation configurations that are highly correlated with the runtime. This configuration can be used to improve the accuracy of the container instance classification results when predicting whether the runtime is lower than the runtime threshold.

[0080] In the embodiment of the present disclosure, for some container instances, their corresponding running time is either lower than the running time threshold or not lower than the running time threshold. In this case, the container instance can be regarded as data noise and needs to be excluded when constructing the container instance sample set.

[0081] In one example, since the naive Bayes model has advantages such as robustness, timeliness, and short prediction time, the container instance classification model can be a model built based on the naive Bayes model and configured to classify container instances.

[0082] It should be noted that the container instance classification result output by the container instance classification model can be whether the runtime is lower than the runtime threshold. The container instance classification result can also be whether a specific container is a reusable virtual machine instance. Specifically, if the runtime is lower than the runtime threshold, the container instance classification result is a reusable virtual machine instance for the specific container. If the runtime is not lower than the runtime threshold, the container instance classification result is a non-reusable virtual machine instance for the specific container. The form of the container instance classification result can also be configured according to individual needs. In the embodiments of the present disclosure, the form of the container instance classification result is not specifically limited.

[0083] In an embodiment of the present disclosure, at least one virtual machine instance stores a corresponding container image. Specific configuration requirements include the container image requirements of the specific container instance for the container image stored in the virtual machine instance, as well as the computing resource requirements of the computing resources corresponding to the virtual machine instance. Matching the configuration of the virtual machine instance with the specific configuration requirements means that the container image stored in the virtual machine instance must match the container image requirements, and the computing resources corresponding to the virtual machine instance must meet the computing resource requirements. Specifically, matching the container image stored in the virtual machine instance with the container image requirements means that the container image corresponding to the container image requirement is the same as the container image stored in the virtual machine instance. For example, if the container image requirement is container image 1, the container image stored in the virtual machine instance must also be container image 1. Meeting the computing resource requirements for the virtual machine instance means that the computing resources corresponding to the virtual machine instance must be greater than or equal to the computing resources corresponding to the computing resource requirements. For example, if the computing resource requirements correspond to a dual-core processor and 4GB of RAM, then the computing resources corresponding to the virtual machine instance can be a dual-core processor and 4GB of RAM, a dual-core processor and 8GB of RAM, or even a quad-core processor and 8GB of RAM.

[0084] To ensure that the container image stored in the target virtual machine instance is identical to the container image corresponding to the container image requirement, when obtaining a target virtual machine instance that matches a specific configuration requirement from at least one virtual machine instance stored in the resource reuse pool, candidate virtual machine instances storing container images that match the container image requirement can be first screened from the at least one virtual machine instance. The target virtual machine instance can then be obtained from the candidate virtual machine instances. That is, the target virtual machine instance can be first screened from the at least one virtual machine instance to select virtual machine instances storing the same container image as the container image corresponding to the container image requirement. The target virtual machine instance can then be further screened from the virtual machine instances storing the same container image as the container image corresponding to the container image requirement. This ensures that the container image stored in the target virtual machine instance is identical to the container image corresponding to the container image requirement.

[0085] To ensure that the computing resources corresponding to the target VM instance are equal to or greater than the computing resources corresponding to the computing resource requirements, when obtaining a target VM instance from candidate VM instances, the specific configuration requirements can be read to obtain the computing resource requirements of the specific container instance for the VM instance. Then, from the candidate VM instances, a VM instance that meets the computing resource requirements is selected as the target VM instance.

[0086] The container instance creation method provided in the embodiment of the present disclosure further executes step S302 after obtaining a target virtual machine instance that matches a specific configuration requirement. In step S302, a specific container instance is created on the target virtual machine instance.

[0087] The type of a specific container instance is generally ECI, but it can also be other types of container instances.

[0088] It should be noted that in the embodiments of the present disclosure, before determining whether a specific container instance is a reusable virtual machine instance when it is created, it can be determined whether the user end that initiates the container instance creation request frequently creates container instances. Only when the user end frequently creates container instances will it be further determined whether a reusable virtual machine instance is created when the specific container instance is created. Otherwise, the traditional path is taken to create the specific container instance, that is, first configure the virtual machine instance, and then create the specific container instance on the virtual machine instance. Among them, whether the user end frequently creates container instances can be determined based on the user end's operation behavior log for the container instance.

[0089] In addition, when it is determined that a specific container instance is to be created as a reusable virtual machine instance, it is generally necessary to take the traditional path to create the specific container instance.

[0090] The method for creating a container instance provided in the embodiment of the present disclosure, when it is determined that a virtual machine instance can be reused when creating a specific container instance, will obtain a target virtual machine instance that matches the specific configuration requirements from at least one virtual machine instance stored in the resource reuse pool, and will create a specific container instance on the target virtual machine instance. That is to say, when it is determined that a virtual machine instance can be reused when creating a specific container instance, the target virtual machine instance will be directly reused when creating the specific container instance to create the specific container instance on the target virtual machine instance. Directly reusing the target virtual machine instance when creating a specific container instance can avoid consuming a lot of time and processing resources to configure the virtual machine instance set to support the operation of the specific container instance when creating and starting the specific container instance. In this way, the time required to create and start a specific container instance can be greatly reduced, the creation and startup speed of the specific container instance can be improved, and at the same time, the processing resources required to create and start the specific container instance can be reduced.

[0091] Corresponding to the application examples of the methods provided in the embodiments of the present disclosure and the processing methods of virtual machine instances and the creation methods of container instances provided in the embodiments of the present disclosure, the embodiments of the present disclosure also provide a container instance creation system. As shown in Figure 5, it is a structural block diagram of a container instance creation system 500 according to an embodiment of the present disclosure. The system 500 may include: a resource storage node 501 and a resource reuse node 502. Among them, the resource storage node 501 is configured to execute the processing method of the virtual machine instance provided in the embodiments of the present disclosure. The resource reuse node 502 is configured to execute the container instance creation method provided in the embodiments of the present disclosure. The resource storage node 501 and the resource reuse node 502 are generally functional modules, devices, etc. configured on the server.

[0092] The functions of each node in each device of the embodiment of the present disclosure can be referred to the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.

[0093] Corresponding to the application examples of the methods provided in the embodiments of the present disclosure and the methods for processing virtual machine instances provided in the embodiments of the present disclosure, the embodiments of the present disclosure also provide a device for processing virtual machine instances. As shown in FIG6 , it is a structural block diagram of a device 600 for processing virtual machine instances according to an embodiment of the present disclosure. The device 600 may include:

[0094] A reusable resource determination module 601 is configured to determine, in response to a deletion request for a target container instance, whether a target virtual machine instance configured to support the operation of the target container instance is a reusable resource;

[0095] The reusable resource storage module 602 is configured to place the target virtual machine instance into the resource reuse pool when the target virtual machine instance belongs to a reusable resource, and to obtain the target virtual machine instance from the resource reuse pool when creating a specific container instance, and to create a specific container instance on the target virtual machine instance; the configuration requirements of the specific container instance for the virtual machine instance match the configuration of the target virtual machine instance.

[0096] In a possible implementation, the reusable resource determination module 601 includes:

[0097] The runtime acquisition submodule is set to obtain the runtime corresponding to the target container instance;

[0098] The first reusable resource determination submodule is configured to determine whether the target virtual machine instance is a reusable resource when the running time is lower than a corresponding configured running time threshold.

[0099] In a possible implementation, the first reusable resource determination submodule includes:

[0100] A first creation frequency acquisition submodule is configured to acquire the creation frequency corresponding to the target container instance when the running time is lower than the running time threshold;

[0101] The second reusable resource determination submodule is configured to determine that the target virtual machine instance is a reusable resource when the creation frequency reaches a corresponding configured creation frequency threshold.

[0102] In a possible implementation, the first creation frequency acquisition submodule includes:

[0103] An operation behavior log acquisition submodule is configured to acquire operation behavior logs for a target container instance;

[0104] A historical creation behavior data acquisition submodule is configured to parse the operation behavior log to obtain historical creation behavior data for the target container instance;

[0105] The second creation frequency acquisition submodule determines the creation frequency based on historical creation behavior data.

[0106] In one possible implementation, the reusable resource storage module 602 includes:

[0107] The reusable resource storage submodule is configured to delete the target container instance on the target virtual machine instance and add the target virtual machine instance to the resource reuse pool.

[0108] In a possible implementation, the apparatus 600 further includes:

[0109] a continuous storage duration acquisition module configured to monitor the continuous storage duration of the target virtual machine instance in the resource reuse pool after the target virtual machine instance is placed in the resource reuse pool;

[0110] The virtual machine instance deletion module is configured to delete the target virtual machine instance from the resource reuse pool when the continuous storage time reaches the corresponding configured storage time threshold.

[0111] The functions of each module in each device of the embodiment of the present disclosure can be referred to the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.

[0112] Corresponding to the application examples of the methods and the container instance creation method provided in the embodiments of the present disclosure, the embodiments of the present disclosure also provide a container instance creation device. As shown in Figure 7, it is a structural block diagram of a container instance creation device 700 according to an embodiment of the present disclosure. The device 700 may include:

[0113] The target virtual machine instance acquisition module 701 is configured to, when determining that a virtual machine instance is reusable when creating a specific container instance, acquire a target virtual machine instance that matches a specific configuration requirement from at least one virtual machine instance stored in a resource reuse pool; the at least one virtual machine instance is a reusable resource; and the specific configuration requirement is configured to identify a configuration requirement of the specific container instance for the virtual machine instance.

[0114] The specific container instance creation module 702 is configured to create a specific container instance on the target virtual machine instance.

[0115] In a possible implementation, the target virtual machine instance acquisition module 701 includes:

[0116] A first runtime prediction submodule is configured to predict whether the runtime of the specific container instance is lower than a runtime threshold of the corresponding configuration based on a creation configuration requirement corresponding to the specific container instance; the creation configuration requirement is configured to identify a requirement of the specific container instance for a creation configuration, the creation configuration requirement including a specific configuration requirement;

[0117] The reusable virtual machine instance determination submodule is configured to determine a reusable virtual machine instance when creating a specific container instance when the running time is lower than the corresponding configured running time threshold.

[0118] In one possible implementation, the first runtime prediction submodule includes:

[0119] Create configuration acquisition submodule, which is set to parse the creation configuration requirements and obtain the creation configuration required for a specific container instance;

[0120] A feature vector acquisition submodule is configured to obtain a feature vector corresponding to a creation configuration required for a specific container instance;

[0121] The second runtime prediction submodule is configured to input the feature vector into a trained container instance classification model to obtain a container instance classification result output by the container instance classification model; the container instance classification result is configured to indicate whether the runtime is lower than a runtime threshold.

[0122] In one possible implementation, at least one virtual machine instance stores a corresponding container image, and the specific configuration requirement includes a container image requirement of the specific container instance for the container image stored in the virtual machine instance. The target virtual machine instance acquisition module 701 includes:

[0123] A candidate virtual machine instance acquisition submodule is configured to screen out a candidate virtual machine instance storing a container image that matches the container image requirement from at least one virtual machine instance;

[0124] The first target virtual machine instance acquisition submodule is configured to acquire a target virtual machine instance from the candidate virtual machine instances.

[0125] In a possible implementation, the first target virtual machine instance acquisition submodule includes:

[0126] A computing resource requirement acquisition submodule is configured to read specific configuration requirements and obtain the computing resource requirements of a specific container instance for a virtual machine instance;

[0127] The second target virtual machine instance acquisition submodule is configured to acquire a virtual machine instance that meets the computing resource requirements from the candidate virtual machine instances as the target virtual machine instance.

[0128] The functions of each module in each device of the embodiment of the present disclosure can be referred to the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.

[0129] The functions of each module in each device of the embodiment of the present disclosure can be referred to the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.

[0130] Figure 8 is a block diagram of an electronic device used to implement embodiments of the present disclosure. As shown in Figure 8 , the electronic device includes a memory 801 and a processor 802. Memory 801 stores a computer program executable by processor 802. Processor 802 executes the computer program to implement the methods described in the above embodiments. There can be one or more memory 801 and processor 802.

[0131] The electronic device also includes:

[0132] The communication interface 803 is configured to communicate with external devices and perform data exchange transmission.

[0133] If the memory 801, processor 802, and communication interface 803 are implemented independently, the memory 801, processor 802, and communication interface 803 can be interconnected via a bus and communicate with each other. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. This bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, FIG8 shows a single thick line, but this does not indicate a single bus or a single type of bus.

[0134] Optionally, in a specific implementation, if the memory 801, the processor 802 and the communication interface 803 are integrated on a chip, the memory 801, the processor 802 and the communication interface 803 can communicate with each other through an internal interface.

[0135] An embodiment of the present disclosure provides a computer-readable storage medium storing a computer program, which implements the method provided in the embodiment of the present disclosure when the program is executed by a processor.

[0136] An embodiment of the present disclosure further provides a chip, which includes a processor configured to call and execute instructions stored in a memory, so that a communication device equipped with the chip executes the method provided by the embodiment of the present disclosure.

[0137] An embodiment of the present disclosure also provides a chip, including: an input interface, an output interface, a processor and a memory. The input interface, the output interface, the processor and the memory are connected through an internal connection path. The processor is configured to execute the code in the memory. When the code is executed, the processor is configured to execute the method provided by the disclosed embodiment.

[0138] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor that supports the Advanced RISC Machines (ARM) architecture.

[0139] Furthermore, optionally, the above-mentioned memory may include a read-only memory and a random access memory, and may also include a non-volatile random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct RAM bus random access memory (DR RAM).

[0140] In the above embodiments, all or part of the embodiments may be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented in the form of a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the present disclosure are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.

[0141] In the description of this specification, reference to the terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. In addition, those skilled in the art may combine and integrate different embodiments or examples described in this specification, as well as features of different embodiments or examples, unless they are mutually inconsistent.

[0142] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. Throughout the present disclosure, "plurality" means two or more, unless otherwise specifically defined.

[0143] Any process or method description described in a flowchart or otherwise herein can be understood to represent a module, segment, or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process. The scope of the preferred embodiments of the present disclosure includes additional implementations in which functions may be performed in a different order than shown or discussed, including in a substantially simultaneous manner or in a reverse order depending on the functions involved.

[0144] The logic and / or steps represented in the flowchart or otherwise described herein may be considered, for example, as an ordered list of executable instructions configured to implement the logical functions, and may be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device).

[0145] It should be understood that various parts of the present disclosure may be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods may be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above-described method embodiments may be performed by a program instructing the relevant hardware. The program may be stored in a computer-readable storage medium. When executed, the program includes one or a combination of the steps of the method embodiments.

[0146] In addition, the functional units in the various embodiments of the present disclosure may be integrated into a single processing module, or each unit may exist physically separately, or two or more units may be integrated into a single module. The aforementioned integrated modules may be implemented in the form of hardware or in the form of software functional modules. If the aforementioned integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may also be stored in a computer-readable storage medium. The storage medium may be a read-only memory, a magnetic disk, or an optical disk, etc.

[0147] The above are specific embodiments of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any person skilled in the art can easily conceive of various modifications or substitutions within the technical scope disclosed in this disclosure, and such modifications or substitutions should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims. Industrial Applicability

[0148] The disclosed embodiment proposes a method for processing a virtual machine instance and a method for creating a container instance. When deleting a target container instance, it will first determine whether the target virtual machine instance that is set to support the operation of the target container instance is a reusable resource. If the target virtual machine instance is a reusable resource, the target virtual machine instance will be placed in a resource reuse pool, so that when creating a specific container instance, the target virtual machine instance is obtained from the resource reuse pool and a specific container instance is created on the target virtual machine instance. In other words, if the target virtual machine instance is a reusable resource, when deleting the target container instance, the target virtual machine instance is not deleted, but the target virtual machine instance is placed in the resource reuse pool as a reusable resource, and when creating a specific container instance, the target virtual machine instance is directly reused to create a specific container instance on the target virtual machine instance. Directly reusing the target virtual machine instance when creating a specific container instance can avoid consuming a lot of time and processing resources to configure the virtual machine instance that is set to support the operation of the specific container instance when creating and starting the specific container instance. In this way, the time required to create and start a specific container instance can be greatly reduced, the creation and startup speed of a specific container instance can be increased, and at the same time, the processing resources required to create and start a specific container instance can be reduced.

Claims

1. A method for processing a virtual machine instance, comprising: In response to a deletion request for a target container instance, determining whether a target virtual machine instance configured to support the operation of the target container instance belongs to a reusable resource; When the target virtual machine instance belongs to a reusable resource, the target virtual machine instance is placed in a resource reuse pool, so that when a specific container instance is created, the target virtual machine instance is obtained from the resource reuse pool, and the specific container instance is created on the target virtual machine instance; the configuration requirements of the specific container instance for the virtual machine instance match the configuration of the target virtual machine instance.

2. The method according to claim 1, wherein: In response to the deletion request for the target container instance, determining whether the target virtual machine instance configured to support the operation of the target container instance belongs to a reusable resource includes: Obtain the running time corresponding to the target container instance; When the running time is lower than a corresponding configured running time threshold, it is determined whether the target virtual machine instance belongs to a reusable resource.

3. The method according to claim 2, wherein: When the running time is lower than the running time threshold of the corresponding configuration, determining whether the target virtual machine instance belongs to a reusable resource includes: When the running time is lower than the running time threshold, obtaining a creation frequency corresponding to the target container instance; When the creation frequency reaches a corresponding configured creation frequency threshold, it is determined that the target virtual machine instance belongs to a reusable resource.

4. The method according to claim 3, wherein: The obtaining the creation frequency corresponding to the target container instance includes: Obtaining an operation behavior log for the target container instance; Parsing the operation behavior log to obtain historical creation behavior data for the target container instance; The creation frequency is determined according to the historical creation behavior data.

5. The method according to claim 1, wherein: When the target virtual machine instance belongs to a reusable resource, placing the target virtual machine instance into a resource reuse pool includes: The target container instance is deleted on the target virtual machine instance, and the target virtual machine instance is added to the resource reuse pool.

6. The method according to claim 1, wherein: After placing the target virtual machine instance into a resource reuse pool, the method further includes: Monitoring the continuous storage time of the target virtual machine instance in the resource reuse pool; When the continuous storage time reaches a corresponding configured storage time threshold, the target virtual machine instance is deleted from the resource reuse pool.

7. A method for creating a container instance, comprising: When it is determined that a virtual machine instance can be reused when creating a specific container instance, a target virtual machine instance matching the specific configuration requirement is obtained from at least one virtual machine instance stored in a resource reuse pool; the at least one virtual machine instance It is a reusable resource; the specific configuration requirement is set to identify the configuration requirement of the specific container instance for the virtual machine instance; The specific container instance is created on the target virtual machine instance.

8. The method according to claim 7, wherein: The reusable VM instance when creating a specific container instance is determined by the following steps: Based on the creation configuration requirement corresponding to the specific container instance, predict whether the running time of the specific container instance is lower than the running time threshold of the corresponding configuration; the creation configuration requirement is set to identify the requirement of the specific container instance for the creation configuration, and the creation configuration requirement includes the specific configuration requirement; When the running time is lower than a corresponding configured running time threshold, it is determined that the virtual machine instance can be reused when creating the specific container instance.

9. The method according to claim 8, wherein: The predicting, based on the creation configuration requirement corresponding to the specific container instance, whether the running time of the specific container instance is lower than the running time threshold of the corresponding configuration includes: Parsing the creation configuration requirement to obtain the creation configuration required for the specific container instance; Obtain a feature vector corresponding to a creation configuration required for the specific container instance; The feature vector is input into a trained container instance classification model to obtain a container instance classification result output by the container instance classification model; the container instance classification result is set to identify whether the running time is lower than the running time threshold.

10. The method according to claim 7, wherein: A corresponding container image is respectively stored in the at least one virtual machine instance, and the specific configuration requirement includes a container image requirement of the specific container instance for the container image stored in the virtual machine instance; The step of obtaining a target virtual machine instance matching a specific configuration requirement from at least one virtual machine instance stored in the resource reuse pool includes: From the at least one virtual machine instance, select a candidate virtual machine instance storing a container image matching the container image requirement; The target virtual machine instance is obtained from the candidate virtual machine instances.

11. The method according to claim 10, wherein: The acquiring the target virtual machine instance from the candidate virtual machine instances comprises: Read the specific configuration requirement to obtain the computing resource requirement of the specific container instance for the virtual machine instance; Among the candidate virtual machine instances, a virtual machine instance that meets the computing resource requirement is obtained as the target virtual machine instance.

12. A system for creating a container instance, comprising: Resource storage nodes and resource reuse nodes; The resource storage node is configured to execute the method according to any one of claims 1 to 6; The resource reuse node is configured to execute the method described in any one of claims 7-11.

13. An electronic device comprising a memory, a processor and a computer program stored in the memory, wherein the processor implements the method according to any one of claims 1 to 11 when executing the computer program.

14. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Lightweight mobile edge computing node and construction method

    CN112130960A

  • Transaction processing method and device based on blockchain virtual machine multiplexing

    CN112529711A

  • Application instance construction method, device and equipment

    CN114675940A

  • Method for providing a trial environment to enable user to try out application in cloud environment and server using the same

    US20180034688A1

  • Task processing method, device, storage medium, and program product

    WO2023082389A1