A computing resource allocation method and related equipment

By obtaining the computing resource requirements of virtual machines and hot-plugging corresponding resources, the problem of computing resource allocation of virtual machines in kubernetes and kata cluster systems is solved, efficient utilization of resources is achieved, and resource waste is avoided.

CN112114936BActive Publication Date: 2024-09-06BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010989061.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-18
Publication Date
2024-09-06
Estimated Expiration
2040-09-18

AI Technical Summary

Technical Problem

In cluster systems based on Kubernetes and Kata, it is difficult for virtual machines to effectively allocate computing resources, resulting in a waste of computing resources.

Method used

By obtaining the configuration file provided by the user, the computing resource requirements of the virtual machine are determined, and computing resources are hot-inserted into the virtual machine based on the requirements to ensure that the virtual machine can meet the computing resource requirements of the containers deployed on it.

Benefits of technology

This effectively avoids the waste of computing resources and ensures that the virtual machine can provide sufficient computing resources for the containers deployed on it without wasting resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112114936B
    Figure CN112114936B
Patent Text Reader

Abstract

The present application discloses a computing resource allocation method and related equipment, the method comprising: starting a virtual machine and obtaining a first configuration file provided by a user; when it is determined that the first configuration file includes a computing resource requirement of the virtual machine, first determining the computing resources to be hot-plugged of the virtual machine according to the computing resource requirement of the virtual machine in the first configuration file, and then hot-plugging the computing resources to be hot-plugged into the virtual machine, so that the hot-plugged virtual machine can have sufficient computing resources to meet the computing resource requirements of the container deployed thereon. In addition, because the computing resource requirements of the virtual machine in the first configuration file are set by the user according to the actual computing resource requirements of the virtual machine, the computing resources to be hot-plugged determined based on the computing resource requirements of the virtual machine can meet the actual computing resource requirements of the virtual machine, so that the hot-plugged virtual machine can provide sufficient computing resources for the container deployed thereon.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a computing resource allocation method and related equipment. Background Art

[0002] In a cluster system based on kubernetes (abbreviated as k8s) and kata, multiple containers are deployed in a virtual machine as a computing node. In addition, after the virtual machine is started, sufficient computing resources (such as CPU and memory) need to be allocated to the virtual machine so that the virtual machine can meet the computing resource requirements of the containers deployed on it.

[0003] However, how to allocate computing resources to virtual machines remains a technical problem that needs to be solved urgently. Summary of the invention

[0004] In order to solve the above technical problems existing in the prior art, the present application provides a computing resource allocation method and related equipment, which can realize computing resource allocation of virtual machines.

[0005] In order to achieve the above purpose, the technical solutions provided by the embodiments of the present application are as follows:

[0006] The present application provides a computing resource allocation method, including:

[0007] Start the virtual machine;

[0008] Obtain a first configuration file provided by a user;

[0009] When it is determined that the first configuration file includes the virtual machine computing resource requirements, determining the computing resources to be hot-plugged of the virtual machine according to the virtual machine computing resource requirements in the first configuration file;

[0010] Hot plugging the computing resource to be hot plugged into the virtual machine.

[0011] Optionally, determining the computing resources to be hot-plugged of the virtual machine according to the computing resource requirements of the virtual machine in the first configuration file includes:

[0012] Parsing the first configuration file to obtain the computing resource requirements of the virtual machine;

[0013] Determine the computing resources to be hot-plugged for the virtual machine according to the computing resource requirements of the virtual machine.

[0014] Optionally, determining the computing resources to be hot-plugged of the virtual machine according to the computing resource requirements of the virtual machine in the first configuration file includes:

[0015] Obtain a second configuration file, where the second configuration file includes basic resource requirements of the virtual machine;

[0016] When it is determined that the basic resource requirement meets the preset condition, determining the computing resources to be hot-plugged of the virtual machine according to the basic resource requirement and the computing resource requirement of the virtual machine in the first configuration file;

[0017] When it is determined that the basic resource requirement does not meet the preset condition, the computing resources to be hot-plugged of the virtual machine are determined according to the computing resource requirements of the virtual machine in the first configuration file.

[0018] Optionally, determining the computing resources to be hot-plugged of the virtual machine according to the basic resource requirements and the computing resource requirements of the virtual machine in the first configuration file includes:

[0019] Allocate resources according to the basic resource requirements and preset standards to obtain resource differences;

[0020] The computing resources to be hot-plugged of the virtual machine are determined according to the resource difference and the computing resource requirements of the virtual machine in the first configuration file.

[0021] Optionally, the method further includes:

[0022] When it is determined that the first configuration file does not include virtual machine computing resource requirements and when it is determined that the first configuration file includes container computing resource requirements, the computing resources to be hot-plugged of the virtual machine are determined according to the container computing resource requirements in the first configuration file.

[0023] Optionally, when N containers are deployed on the virtual machine, and the first configuration file includes container computing resource requirements of a first container to a container computing resource requirements of an Nth container, determining the computing resources to be hot-plugged of the virtual machine according to the container computing resource requirements in the first configuration file includes:

[0024] The computing resources to be hot-plugged of the virtual machine are obtained according to the sum of the container computing resource requirements of the first container to the container computing resource requirements of the Nth container.

[0025] Optionally, when the first configuration file also includes container computing resource requirements, the method further includes:

[0026] The container deployed on the virtual machine is started, and the container control group corresponding to the container is configured according to the computing resource requirements of the container.

[0027] The present application also provides a computing resource allocation device, including:

[0028] A startup unit, used to start the virtual machine;

[0029] A first acquiring unit, configured to acquire a first configuration file provided by a user;

[0030] A first determining unit, configured to determine the computing resources to be hot-plugged of the virtual machine according to the computing resource requirements of the virtual machine in the first configuration file when determining that the first configuration file includes the computing resource requirements of the virtual machine;

[0031] A hot-plug unit is used to hot-plug the computing resource to be hot-plugged into the virtual machine.

[0032] The present application also provides a device, the device comprising a processor and a memory:

[0033] The memory is used to store computer programs;

[0034] The processor is used to execute any implementation of the computing resource allocation method provided in the embodiments of the present application according to the computer program.

[0035] The embodiment of the present application also provides a computer-readable storage medium, which is used to store a computer program, and the computer program is used to execute any implementation of the computing resource allocation method provided in the embodiment of the present application.

[0036] Compared with the prior art, the embodiments of the present application have at least the following advantages:

[0037] In the computing resource allocation method provided in the embodiment of the present application, a virtual machine is started and a first configuration file provided by a user is obtained; when it is determined that the first configuration file includes the computing resource requirements of the virtual machine, the computing resources to be hot-plugged of the virtual machine are first determined according to the computing resource requirements of the virtual machine in the first configuration file, and then the computing resources to be hot-plugged are hot-plugged into the virtual machine, so that the hot-plugged virtual machine can have sufficient computing resources to meet the computing resource requirements of the container deployed on it. In addition, because the computing resource requirements of the virtual machine in the first configuration file are set by the user according to the actual computing resource requirements of the virtual machine, the computing resources to be hot-plugged determined based on the computing resource requirements of the virtual machine can meet the actual computing resource requirements of the virtual machine, so that the hot-plugged virtual machine can provide sufficient computing resources for the container deployed on it. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0039] Figure 1 A flowchart of a computing resource allocation method provided in an embodiment of the present application;

[0040] Figure 2 A schematic diagram of an application scenario of the computing resource allocation method provided in an embodiment of the present application;

[0041] Figure 3 A schematic diagram of the structure of a computing resource allocation device provided in an embodiment of the present application;

[0042] Figure 4 A schematic diagram of the device structure provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] In order to facilitate understanding of the technical solution of the present application, some technical terms involved in the present application are explained below.

[0044] Kubernetes (abbreviated as k8s) is a container-based cluster management platform, and the Kubernetes cluster can include a master node (Master Node) and multiple computing nodes (WorkNode) that are respectively connected to the master node. The master node can be used to manage and control multiple computing nodes. A computing node is a workload node, and at least one container group (Pod) can be deployed in each computing node, and each container group can be encapsulated with one or more containers (Container) for carrying software programs.

[0045] Pod is the basic operating unit of Kubernetes and the smallest deployment unit that can be created, debugged, and managed. In addition, multiple containers in the same Pod can share network resources (such as IP addresses). For example, when the first Pod includes 3 containers and the first Pod has a first IP address, the 3 containers on the first Pod share the first IP address.

[0046] Kata is an open source container project that aims to unify the security advantages of virtual machines with the speed and manageability of containers. In addition, Kata was created by merging two existing open source projects, Intel Clear Containers and Hyper runV, so that Kata solves the security and isolation issues of traditional container shared kernels.

[0047] kata-runtime is a component in kata, and kata-runtime is used in an OCI (Oracle Call Interface) compatible container runtime to process all commands specified by the OCI runtime specification and start kata-shim instances. Among them, kata-shim is also a component in kata, and kata-shim is used to monitor container processes.

[0048] YAML (Yet another markup language) is a language used to write configuration files. In addition, YAML is particularly suitable for expressing or editing data structures, various configuration files, dumping debugging content, file outlines, etc. In addition, YAML is more suitable for expressing hierarchical data structures and also for expressing related data. It should be noted that configuration files written in YAML are all files with the suffix .yml.

[0049] The inventor discovered in the study of virtual machine computing resources corresponding to Pod that: the user can pre-specify the container computing resource requirements (that is, the container computing resource peak) of each container in the virtual machine, so that the sum of the container computing resource requirements of all containers deployed on the virtual machine can be determined as the virtual machine computing resource requirements of the virtual machine. However, because the actual amount of computing resources consumed by each container at different operating times is different, it is almost impossible for all containers in the virtual machine to consume the actual amount of computing resources at the same time to reach the computing resource peak, so that the virtual machine computing resource requirements determined based on the sum of the container computing resource requirements of all containers deployed on the virtual machine are much higher than the actual value of the virtual machine computing resources of the virtual machine, which easily leads to a waste of computing resources.

[0050] For example, when container 1 and container 2 are deployed on a virtual machine, and the container computing resource requirement of container 1 is 2C4G, and the container computing resource requirement of container 2 is 2C4G, the sum of the container computing resource requirement of container 1 2C4G and the container computing resource requirement of container 2 2C4G, 4C8G, can be determined as the virtual machine computing resource requirement of the virtual machine. In addition, if the actual computing resources consumed by container 1 and container 2 during operation cannot reach the maximum computing resources at the same time, and the actual computing resource peak value of the virtual machine is 3C6G, then the actual computing resource peak value of the virtual machine 3C6G is lower than the virtual machine computing resource requirement 4C8G obtained by the above calculation, so that at least 1C2G of computing resources in the virtual machine are always idle, resulting in a waste of computing resources.

[0051] In order to solve the above technical problems, an embodiment of the present application provides a computing resource allocation method, which includes: after starting the virtual machine, obtaining a first configuration file provided by a user; when it is determined that the first configuration file includes the computing resource requirements of the virtual machine, first determining the computing resources to be hot-plugged of the virtual machine according to the computing resource requirements of the virtual machine in the first configuration file, and then hot-plugging the computing resources to be hot-plugged into the virtual machine, so that the virtual machine after hot-plugging can have sufficient computing resources to meet the computing resource requirements of the container deployed thereon.

[0052] It can be seen that because the virtual machine computing resource demand in the first configuration file is set by the user according to the actual computing resource demand of the virtual machine, the computing resources to be hot-plugged determined based on the computing resource demand of the virtual machine can meet the actual computing resource demand of the virtual machine without wasting computer resources, so that the hot-plugged virtual machine can provide sufficient computing resources for the containers deployed on it without wasting computer resources, thus avoiding the waste of computing resources.

[0053] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0054] Method Embodiment

[0055] See also Figure 1 , which is a flowchart of a computing resource allocation method provided in an embodiment of the present application.

[0056] The computing resource allocation method provided in the embodiment of the present application includes S101-S106:

[0057] S101: Start the virtual machine.

[0058] A virtual machine refers to a computing node in k8s, and at least one container group Pod can be deployed on the virtual machine. Among them, a Pod can encapsulate at least one container. It can be seen that multiple containers can be deployed on a virtual machine. For example, N containers can be deployed on a virtual machine, and N is a positive integer.

[0059] In addition, since the computing resources required for the virtual machine to start are relatively small, in order to ensure that the virtual machine can start normally, the preset standard allocation resources can be allocated to the virtual machine in advance, so that the virtual machine can complete the startup using the preset standard allocation resources. Among them, the preset standard allocation resources refer to the minimum computer resources required during the operation of the virtual machine. In addition, the preset standard allocation resources can be set in advance.

[0060] S102: Obtain a first configuration file provided by a user.

[0061] The first configuration file records the computing resource requirements specified by the user for the virtual machine (such as virtual machine computing resource requirements and container computing resource requirements, etc.). For example, the first configuration file can be a yaml configuration file entered by the user in k8s.

[0062] The first configuration file may include virtual machine computing resource requirements and / or container computing resource requirements. The virtual machine computing resource requirements refer to the peak computing resource requirements of the virtual machine during the operation of the virtual machine. The container computing resource requirements refer to the peak computing resource requirements of the container during the operation of the container.

[0063] It should be noted that, in most cases, the first configuration file will usually definitely include container computing resource requirements, so the embodiments of the present application will be introduced by taking the first configuration file including virtual machine computing resource requirements and container computing resource requirements, or the first configuration file including container computing resource requirements as an example.

[0064] It should also be noted that the embodiments of the present application do not limit computing resources. For example, computing resources may include memory and a central processing unit (CPU).

[0065] Based on the above content, it can be known that in the embodiment of the present application, when the user wants to directly specify the computing resource peak value of the virtual machine corresponding to the Pod, the user can write the computing resource peak value of the virtual machine as the computing resource demand of the virtual machine into the first configuration file, so that the computing resource peak value of the virtual machine can be known based on the computing resource demand of the virtual machine in the first configuration file. Similarly, when the user wants to directly specify the computing resource peak value of each container deployed in the virtual machine, the user can write the computing resource peak value of each container as the container computing resource demand of the container into the first configuration file, so that the computing resource peak value of each container deployed in the virtual machine can be known based on the container computing resource demand in the first configuration file.

[0066] It should be noted that the embodiment of the present application does not limit the execution order of S101 and S102, and S101 and S102 can be executed in sequence (such as Figure 1As shown), S102 and S101 may be executed sequentially, or S101 and S102 may be executed simultaneously.

[0067] S103: Determine whether the first configuration file includes the virtual machine computing resource requirements; if so, execute S104; if not, execute S105.

[0068] In an embodiment of the present application, after obtaining the first configuration file, it can be determined whether the first configuration file includes the virtual machine computing resource requirements; if it is included, it can be determined that the user directly specifies the computing resource peak of the virtual machine corresponding to the Pod, so the computing resources that should be allocated to the virtual machine can be determined directly based on the virtual machine computing resource requirements existing in the first configuration file; if it is not included, it can be determined that the user only specifies the computing resource peak of each container deployed in the virtual machine, so in order to ensure that the computer resources allocated to the virtual machine can meet the computing resource overhead of all containers deployed thereon, the sum of the container computing resources of all containers deployed thereon can be determined as the virtual machine computing resource requirement of the virtual machine.

[0069] In addition, the embodiment of the present application also provides an implementation of S103, which is specifically: first parse the first configuration file to obtain a parsing result; then determine whether the virtual machine computing resource requirements of the virtual machine exist in the parsing result. If so, it is determined that the first configuration file includes the virtual machine computing resource requirements; if not, it is determined that the first configuration file does not include the virtual machine computing resource requirements. Among them, the parsing result refers to the result obtained by parsing the parameters of the first configuration file, and the parsing result may include virtual machine computing resource requirements and / or container computing resource requirements. It should be noted that the embodiment of the present application does not limit the parsing process of the first configuration file. For example, the first configuration file can be parsed by k8s.

[0070] S104: Determine the computing resources to be hot-plugged of the virtual machine according to the computing resource requirements of the virtual machine in the first configuration file.

[0071] The computing resources to be hot-plugged refer to computing resources that need to be hot-plugged into the virtual machine after the virtual machine is started, so that the hot-plugged virtual machine can meet the computing resource overhead during the startup and runtime of all containers deployed on it.

[0072] The embodiment of the present application also provides an implementation of S104, which specifically comprises: parsing the first configuration file to obtain the computing resource requirements of the virtual machine; and determining the computing resources to be hot-plugged of the virtual machine according to the computing resource requirements of the virtual machine.

[0073] Based on this, it can be seen that in an embodiment of the present application, after obtaining the first configuration file, the virtual machine computing resource requirements can be first parsed from the first configuration file, and then the virtual machine computing resource requirements obtained by parsing can be used to determine the computing resources to be hot-plugged of the virtual machine.

[0074] In addition, the embodiment of the present application does not limit the implementation process of determining the computing resources to be hot-plugged based on the computing resource requirements of the virtual machine, which is specifically: directly determining the computing resource requirements of the virtual machine as the computing resources to be hot-plugged of the virtual machine.

[0075] In some cases, in addition to the user specifying the virtual machine computing resource overhead of the virtual machine, the operation and maintenance personnel (that is, the technicians who maintain the operation process of the virtual machine) will also specify the virtual machine basic computing resource overhead of the virtual machine. Therefore, in order to simultaneously meet the computing resource requirements of the user and the operation and maintenance personnel for the virtual machine, the computing resource overhead specified by the two can be referred to at the same time to determine the computing resources to be hot-plugged of the virtual machine. Based on this, the embodiment of the present application also provides an implementation of S104, which specifically includes S1041-S1044:

[0076] S1041: Obtain a second configuration file.

[0077] The second configuration file refers to a parameter configuration file provided by the operation and maintenance personnel for maintaining the operation process of the virtual machine, and the second configuration file may include the basic resource requirements of the virtual machine. The basic resource requirements of the virtual machine refer to the computing resource overhead required for maintaining the operation process of the virtual machine.

[0078] S1042: Determine whether the basic resource requirements of the virtual machine meet the preset conditions; if so, execute S1043; if not, execute S1044.

[0079] The preset condition is used to represent the condition that needs to be satisfied by the basic resource demand of the virtual machine when determining the computing resource to be hot-plugged, and the preset condition is preset.

[0080] In actual applications, the basic resource demand specified by the operation and maintenance personnel for the virtual machine should not exceed the preset standard allocated resources (that is, the computing resources actually required when the virtual machine is started), so that after the virtual machine is started, the virtual machine can continue to use the released preset standard allocated resources to offset the basic resource demand of the virtual machine. Therefore, in this case, there is no need to consider the impact of the basic resource demand of the virtual machine on the hot-plug computing resources; however, in some special cases, the basic resource demand specified by the operation and maintenance personnel for the virtual machine will exceed the preset standard allocated resources, so that after the virtual machine is started, the virtual machine cannot use the released preset standard allocated resources to completely offset the basic resource demand of the virtual machine. Therefore, in this case, the impact of the basic resource demand of the virtual machine on the hot-plug computing resources should be considered.

[0081] In order to meet the computing resource requirements of the virtual machine in the above two situations, a preset condition can be set in advance that the basic resource requirement of the virtual machine is higher than the preset standard allocation resource, so that the above two situations can be judged based on the preset condition.

[0082] Based on the relevant content of S1042 above, it can be known that after obtaining the basic resource requirements of the virtual machine, it can be determined whether the basic resource requirements of the virtual machine meet the requirements of higher than the preset standard allocation resources; if higher, it can be determined that the preset standard allocation resources released after the virtual machine is started cannot meet the basic resource requirements of the virtual machine. Therefore, in order to simultaneously meet the basic resource requirements specified by the operation and maintenance personnel and the virtual machine computing resource requirements specified by the user, the basic resource requirements of the virtual machine and the virtual machine computing resource requirements can be comprehensively considered to jointly determine the virtual machine's hot-plug computing resources; if not higher, it can be determined that the preset standard allocation resources released after the virtual machine is started can meet the basic resource requirements of the virtual machine. Therefore, in order to save computing resources, only the user-specified virtual machine computing resource requirements can be considered to determine the virtual machine's hot-plug computing resources.

[0083] S1043: Determine the computing resources to be hot-plugged of the virtual machine according to the basic resource requirements and the computing resource requirements of the virtual machine in the first configuration file.

[0084] In an embodiment of the present application, after determining that the basic resource demand specified by the operation and maintenance personnel is higher than the preset standard allocated resources, it can be determined that the existing preset standard allocated resources in the virtual machine can only offset part of the basic resource demand. Therefore, in order to save computing resources, the computing resources to be hot-plugged of the virtual machine can be determined based on the unoffset portion of the basic resource demand and the user-specified virtual machine computing resource demand.

[0085] Based on this, an embodiment of the present application provides an implementation of S1043, which is specifically: allocating resources according to basic resource requirements and preset standards to obtain resource differences; determining the computing resources to be hot-plugged of the virtual machine according to the resource differences and the virtual machine computing resource requirements in the first configuration file.

[0086] The resource difference is used to represent the unoffset portion of the basic resource requirements specified by the operation and maintenance personnel.

[0087] Based on the relevant content of S1043 above, it can be known that after determining that the basic resource demand specified by the operation and maintenance personnel is higher than the preset standard allocated resources, the basic resource demand and the preset standard allocated resources can be subtracted to obtain the resource difference; then the resource difference and the virtual machine computing resource demand specified by the user are summed to determine the computing resources to be hot-plugged for the virtual machine, so that the sum of the computing resources to be hot-plugged and the preset standard allocated resources can jointly meet the basic resource demand specified by the operation and maintenance personnel and the virtual machine computing resource demand specified by the user, so that the virtual machine after the hot plug is completed can simultaneously meet the computing resource requirements of the operation and maintenance personnel and the user for the virtual machine.

[0088] S1044: Determine the computing resources to be hot-plugged of the virtual machine according to the computing resource requirements of the virtual machine in the first configuration file.

[0089] Based on the relevant contents of S1041 to S1044 above, it can be known that after obtaining the virtual machine computing resource requirements specified by the user, it is first determined whether the basic resource requirements specified by the operation and maintenance personnel are higher than the preset standard allocated resources released after the virtual machine is started. If higher, the computing resources to be hot-plugged of the virtual machine can be determined based on the calculation of the virtual machine computing resource requirements specified by the user, the basic resource requirements specified by the operation and maintenance personnel, and the preset standard allocated resources, so that the sum of the computing resources to be hot-plugged and the preset standard allocated resources can be no less than the sum of the virtual machine computing resource requirements specified by the user and the basic resource requirements specified by the operation and maintenance personnel, so that the virtual machine after the hot plug is completed can simultaneously meet the computing resource requirements of the operation and maintenance personnel and the user for the virtual machine; if not higher, the computing resources to be hot-plugged of the virtual machine can be directly determined based on the virtual machine computing resource requirements specified by the user, so that the sum of the computing resources to be hot-plugged and the preset standard allocated resources can be no less than the sum of the virtual machine computing resource requirements specified by the user and the basic resource requirements specified by the operation and maintenance personnel, so that the virtual machine after the hot plug is completed can simultaneously meet the computing resource requirements of the operation and maintenance personnel and the user for the virtual machine.

[0090] Based on the relevant content of S104 above, it can be known that after determining that the virtual machine computing resource demand of the virtual machine exists in the first configuration file, the virtual machine computing resource demand of the virtual machine can be directly determined as the hot-plug computing resource of the virtual machine, which is specifically: when the virtual machine computing resource demand includes memory demand and CPU demand, the memory demand of the virtual machine can be directly determined as the memory to be hot-plugged of the virtual machine, and the CPU demand of the virtual machine can be directly determined as the CPU to be hot-plugged of the virtual machine. Among them, because the virtual machine computing resource demand of the virtual machine is directly specified by the user according to the actual computing resource demand of the virtual machine, the computing resource to be hot-plugged determined based on the computing resource demand of the virtual machine can meet the actual computing resource demand of the virtual machine without wasting computer resources, so that the hot-plugged virtual machine can provide sufficient computing resources for the container deployed on it without wasting computer resources, thereby avoiding the waste of computing resources.

[0091] S105: Determine the computing resources to be hot-plugged of the virtual machine according to the container computing resource requirements in the first configuration file.

[0092] The embodiment of the present application also provides an implementation of S105, which specifically comprises: parsing the first configuration file to obtain container computing resource requirements; and determining the computing resources to be hot-plugged of the virtual machine according to the container computing resource requirements.

[0093] Based on this, it can be seen that in an embodiment of the present application, after obtaining the first configuration file, the container computing resource requirements of each container deployed on the virtual machine can be parsed from the first configuration file, and then the container computing resource requirements of each container deployed on the virtual machine can be used to determine the computing resources to be hot-plugged of the virtual machine.

[0094] In addition, the embodiment of the present application does not limit the implementation process of determining the computing resources to be hot-plugged based on the container computing resource requirements, which is specifically: when N containers are deployed on the virtual machine, and the first configuration file includes the container computing resource requirements of the first container to the container computing resource requirements of the Nth container, the computing resources to be hot-plugged of the virtual machine are obtained based on the sum of the container computing resource requirements of the first container to the container computing resource requirements of the Nth container.

[0095] Based on this, it can be known that after determining the container computing resource requirements of the N containers deployed on the virtual machine in the first configuration file, the computing resources to be hot-plugged of the virtual machine can be obtained based on the sum of the container computing resource requirements of the first container to the container computing resource requirements of the Nth container. Specifically, the sum of the container computing resource requirements of the first container to the container computing resource requirements of the Nth container is determined as the computing resources to be hot-plugged of the virtual machine.

[0096] In addition, based on the relevant content of “basic resource requirements specified by operation and maintenance personnel” in S104, the embodiment of the present application also provides a possible implementation of S105, which specifically includes S1051-S1054:

[0097] S1051: Obtain a second configuration file.

[0098] S1052: Determine whether the basic resource requirements of the virtual machine meet the preset conditions; if so, execute S1053; if not, execute S1054.

[0099] S1053: Determine the computing resources to be hot-plugged of the virtual machine according to the basic resource requirements and the container computing resource requirements in the first configuration file.

[0100] S1054: Determine the computing resources to be hot-plugged of the virtual machine according to the container computing resource requirements in the first configuration file.

[0101] It should be noted that the relevant contents of S1051 to S1054 are similar to the relevant contents of S1041 to S1044 in the above text. It is only necessary to replace the "virtual machine computing resource requirements" in S1041 to S1044 in the above text with "container computing resource requirements".

[0102] Based on the relevant contents of S1051 to S1054 above, it can be known that after obtaining the container computing resource demand specified by the user, it is first determined whether the basic resource demand specified by the operation and maintenance personnel is higher than the preset standard allocated resources released after the virtual machine is started. If it is higher, the computing resources to be hot-plugged of the virtual machine can be determined based on the calculation of the container computing resource demand specified by the user, the basic resource demand specified by the operation and maintenance personnel, and the preset standard allocated resources, so that the sum of the computing resources to be hot-plugged and the preset standard allocated resources can be no less than the sum of the container computing resource demand specified by the user and the basic resource demand specified by the operation and maintenance personnel, so that the virtual machine after the hot plug is completed can simultaneously meet the computing resource requirements of the operation and maintenance personnel and the user for the virtual machine; if it is not higher, the computing resources to be hot-plugged of the virtual machine can be directly determined based on the container computing resource demand specified by the user, so that the sum of the computing resources to be hot-plugged and the preset standard allocated resources can be no less than the sum of the container computing resource demand specified by the user and the basic resource demand specified by the operation and maintenance personnel, so that the virtual machine after the hot plug is completed can simultaneously meet the computing resource requirements of the operation and maintenance personnel and the user for the virtual machine.

[0103] Based on the relevant content of S105 above, it can be known that after determining that the first configuration file does not include the virtual machine computing resource requirements of the virtual machine, but includes the container computing resource requirements of all containers deployed on the virtual machine, the sum of the container computing resource requirements of all containers deployed on the virtual machine can be directly used to determine the computing resources to be hot-plugged of the virtual machine, so that the determined computing resources to be hot-plugged can meet the maximum computing resource overhead of all containers on the virtual machine.

[0104] S106: Hot-plug the computing resources to be hot-plugged of the virtual machine into the virtual machine.

[0105] In an embodiment of the present application, after the computing resources to be hot-plugged of the virtual machine are obtained, these acquired computing resources to be hot-plugged can be directly hot-plugged into the virtual machine so that the virtual machine can meet the computing resource overhead of all containers deployed thereon during operation.

[0106] In some cases, after the computing resource to be hot-plugged is hot-plugged into the virtual machine, the container on the virtual machine can be started and the container control group (cgroups) of the container can be configured. Based on this, the embodiment of the present application also provides a possible implementation of the computing resource allocation method. In this implementation, the computer resource allocation method includes S107 in addition to all or part of the steps in S101-S106:

[0107] S107: Start the container deployed on the virtual machine, and configure the container control group corresponding to the container according to the container computing resource requirements. The container control group is used to limit the allocation of container computing resources for all containers deployed on the virtual machine.

[0108] Based on the relevant content of S107 above, it can be known that in an embodiment of the present application, after completing the allocation of computing resources to the virtual machine (that is, hot-plugging the computing resources to be hot-plugged to the virtual machine), each container deployed on the virtual machine can be started, and the container control groups corresponding to these containers can be configured with parameters according to the container computing resource requirements of each container, so that the configured container control group can allocate computing resource restrictions to each container deployed on the virtual machine.

[0109] Based on the relevant contents of the above-mentioned computing resource allocation method, it can be known that after starting the virtual machine, the first configuration file provided by the user is obtained; when it is determined that the first configuration file includes the computing resource requirements of the virtual machine, the computing resources to be hot-plugged of the virtual machine are first determined according to the computing resource requirements of the virtual machine in the first configuration file, and then the computing resources to be hot-plugged are hot-plugged to the virtual machine, so that the virtual machine after hot-plugging can have sufficient computing resources to meet the computing resource requirements of the container deployed on it. In addition, because the computing resource requirements of the virtual machine in the first configuration file are set by the user according to the actual computing resource requirements of the virtual machine, the computing resources to be hot-plugged determined based on the computing resource requirements of the virtual machine can meet the actual computing resource requirements of the virtual machine without wasting computer resources, so that the virtual machine after hot-plugging can provide sufficient computing resources for the containers deployed on it without wasting computer resources, thereby avoiding the waste of computing resources.

[0110] In order to facilitate the understanding of the technical solution provided by the implementation of this application, a specific description is given below in conjunction with a scenario embodiment.

[0111] Scenario Example

[0112] See also Figure 2 , which is a schematic diagram of an application scenario of the computing resource allocation method provided in an embodiment of the present application.

[0113] The application provided in the embodiments of the present application is Figure 2 The computing resource allocation method in the application scenario shown includes the following steps:

[0114] Step 1: k8s parses the first configuration file provided by the user to obtain the specified computing resource requirements.

[0115] K8s is used to manage and control the cluster.

[0116] The first configuration file may be a yaml configuration file. In addition, the yaml configuration file may include a memory configuration item and a CPU configuration item. The memory configuration item is used to pass the user-specified virtual machine memory limit information to Kata; the CPU configuration item is used to pass the user-specified virtual machine CPU limit information to Kata.

[0117] The specified computing resource requirement is used to represent the computer resource limit specified by the user, and the specified computing resource requirement may include a virtual machine computing resource requirement and / or a container computing resource requirement.

[0118] Step 2: After kata-runtime obtains the specified computing resource requirements, it is determined whether the specified computing resource requirements include the virtual machine computing resource requirements of the virtual machine; if so, step 3 is executed; if not, step 4 is executed. Among them, kata-runtime is used to manage and control the virtual machine.

[0119] Step 3: Allocate resources according to the virtual machine computing resource requirements, basic resource requirements, and preset standards of the virtual machine, and determine the computing resources to be hot-plugged of the virtual machine.

[0120] Step 4: Hot-plug the computing resources to be hot-plugged into the virtual machine.

[0121] Step 5: Start the container deployed on the virtual machine and configure the container control group corresponding to the container according to the container computing resource requirements.

[0122] It should be noted that for the relevant contents of the above steps 1 to 5, please refer to the relevant contents in the above method embodiment.

[0123] Based on the relevant contents of steps 1 to 5 above, it can be known that the user can specify the virtual machine computing resource requirements and the container computing resource requirements in the first configuration file in advance, so that the computing resources (CPU and / or memory) that need to be hot-plugged into the virtual machine can be determined based on the virtual machine computing resource requirements, and the container control group can be configured based on the container computing resource requirements of each container deployed on the virtual machine, so that the container control group can control and restrict all containers deployed on the virtual machine.

[0124] Based on the computing resource allocation method provided by the above method embodiment, the embodiment of the present application also provides a computing resource allocation device, which is explained and illustrated below in conjunction with the accompanying drawings.

[0125] Device Embodiment

[0126] For technical details of the computing resource allocation device provided in the device embodiment, please refer to the above method embodiment.

[0127] See also Figure 3 , which is a structural diagram of a computing resource allocation device provided in an embodiment of the present application.

[0128] The computing resource allocation device 300 provided in the embodiment of the present application includes:

[0129] A startup unit 301, used to start a virtual machine;

[0130] A first obtaining unit 302 is used to obtain a first configuration file provided by a user;

[0131] A first determining unit 303 is used to determine the computing resources to be hot-plugged of the virtual machine according to the computing resource requirements of the virtual machine in the first configuration file when it is determined that the first configuration file includes the computing resource requirements of the virtual machine;

[0132] The hot plug unit 304 is used to hot plug the computing resource to be hot plugged into the virtual machine.

[0133] In a possible implementation, the first determination unit 303 is specifically configured to: parse the first configuration file to obtain the virtual machine computing resource requirements; and determine the computing resources to be hot-plugged of the virtual machine according to the virtual machine computing resource requirements.

[0134] In a possible implementation manner, the first determining unit 303 includes:

[0135] A first acquisition subunit is used to acquire a second configuration file, where the second configuration file includes basic resource requirements of the virtual machine;

[0136] A first determining subunit is used to determine the computing resources to be hot-plugged of the virtual machine according to the basic resource requirements and the computing resource requirements of the virtual machine in the first configuration file when it is determined that the basic resource requirements meet the preset conditions;

[0137] The second determining subunit is used to determine the computing resources to be hot-plugged of the virtual machine according to the computing resource requirements of the virtual machine in the first configuration file when it is determined that the basic resource requirements do not meet the preset conditions.

[0138] In a possible implementation, the first determination subunit is specifically used to: allocate resources according to the basic resource requirements and preset standards to obtain a resource difference; and determine the computing resources to be hot-plugged of the virtual machine according to the resource difference and the virtual machine computing resource requirements in the first configuration file.

[0139] In a possible implementation manner, the computing resource allocation device 300 further includes:

[0140] The second determination unit is used to determine the computing resources to be hot-plugged of the virtual machine according to the container computing resource requirements in the first configuration file when it is determined that the first configuration file does not include the virtual machine computing resource requirements and when it is determined that the first configuration file includes the container computing resource requirements.

[0141] In a possible implementation, the second determination unit is specifically configured to: when N containers are deployed on the virtual machine and the first configuration file includes container computing resource requirements from the first container to the Nth container, obtain the computing resources to be hot-plugged of the virtual machine based on the sum of the container computing resource requirements from the first container to the Nth container.

[0142] In a possible implementation manner, when the first configuration file further includes container computing resource requirements, the computing resource allocation device 300 further includes:

[0143] A configuration unit is used to start the container deployed on the virtual machine and configure the container control group corresponding to the container according to the computing resource requirements of the container.

[0144] Based on the relevant contents of the computing resource allocation device 300, it can be known that in the computing resource allocation device 300, the virtual machine is started and the first configuration file provided by the user is obtained; when it is determined that the first configuration file includes the computing resource requirements of the virtual machine, the computing resources to be hot-plugged of the virtual machine are first determined according to the computing resource requirements of the virtual machine in the first configuration file, and then the computing resources to be hot-plugged are hot-plugged to the virtual machine, so that the virtual machine after hot-plugging can have sufficient computing resources to meet the computing resource requirements of the container deployed on it. In addition, because the computing resource requirements of the virtual machine in the first configuration file are set by the user according to the actual computing resource requirements of the virtual machine, the computing resources to be hot-plugged determined based on the computing resource requirements of the virtual machine can meet the actual computing resource requirements of the virtual machine, so that the virtual machine after hot-plugging can provide sufficient computing resources for the container deployed on it.

[0145] Based on the computing resource allocation method provided by the above method embodiment, the embodiment of the present application also provides a device, which is explained and illustrated below in conjunction with the accompanying drawings.

[0146] Device Embodiment

[0147] For technical details of the device provided in the device embodiment, please refer to the above method embodiment.

[0148] See also Figure 4 , which is a schematic diagram of the device structure provided in an embodiment of the present application.

[0149] The device 400 provided in the embodiment of the present application includes: a processor 401 and a memory 402;

[0150] The memory 402 is used to store computer programs;

[0151] The processor 401 is used to execute any implementation of the computing resource allocation method provided by the above method embodiment according to the computer program. That is, the processor 401 is used to execute the following steps:

[0152] Start the virtual machine;

[0153] Obtain a first configuration file provided by a user;

[0154] When it is determined that the first configuration file includes the virtual machine computing resource requirements, determining the computing resources to be hot-plugged of the virtual machine according to the virtual machine computing resource requirements in the first configuration file;

[0155] Hot plugging the computing resource to be hot plugged into the virtual machine.

[0156] Optionally, determining the computing resources to be hot-plugged of the virtual machine according to the computing resource requirements of the virtual machine in the first configuration file includes:

[0157] Parsing the first configuration file to obtain the computing resource requirements of the virtual machine;

[0158] Determine the computing resources to be hot-plugged for the virtual machine according to the computing resource requirements of the virtual machine.

[0159] Optionally, determining the computing resources to be hot-plugged of the virtual machine according to the computing resource requirements of the virtual machine in the first configuration file includes:

[0160] Obtain a second configuration file, where the second configuration file includes basic resource requirements of the virtual machine;

[0161] When it is determined that the basic resource requirement meets the preset condition, determining the computing resources to be hot-plugged of the virtual machine according to the basic resource requirement and the computing resource requirement of the virtual machine in the first configuration file;

[0162] When it is determined that the basic resource requirement does not meet the preset condition, the computing resources to be hot-plugged of the virtual machine are determined according to the computing resource requirements of the virtual machine in the first configuration file.

[0163] Optionally, determining the computing resources to be hot-plugged of the virtual machine according to the basic resource requirements and the computing resource requirements of the virtual machine in the first configuration file includes:

[0164] Allocate resources according to the basic resource requirements and preset standards to obtain resource differences;

[0165] The computing resources to be hot-plugged of the virtual machine are determined according to the resource difference and the computing resource requirements of the virtual machine in the first configuration file.

[0166] Optionally, the method further includes:

[0167] When it is determined that the first configuration file does not include virtual machine computing resource requirements and when it is determined that the first configuration file includes container computing resource requirements, the computing resources to be hot-plugged of the virtual machine are determined according to the container computing resource requirements in the first configuration file.

[0168] Optionally, when N containers are deployed on the virtual machine, and the first configuration file includes container computing resource requirements of a first container to a container computing resource requirements of an Nth container, determining the computing resources to be hot-plugged of the virtual machine according to the container computing resource requirements in the first configuration file includes:

[0169] The computing resources to be hot-plugged of the virtual machine are obtained according to the sum of the container computing resource requirements of the first container to the container computing resource requirements of the Nth container.

[0170] Optionally, when the first configuration file also includes container computing resource requirements, the method further includes:

[0171] The container deployed on the virtual machine is started, and the container control group corresponding to the container is configured according to the computing resource requirements of the container.

[0172] The above is the relevant content of the device 400 provided in the embodiment of the present application.

[0173] Based on the computing resource allocation method provided by the above method embodiment, the embodiment of the present application also provides a computer-readable storage medium.

[0174] Medium Embodiment

[0175] For technical details of the computer-readable storage medium provided by the medium embodiment, please refer to the method embodiment.

[0176] The embodiment of the present application provides a computer-readable storage medium, which is used to store a computer program, and the computer program is used to execute any implementation of the computing resource allocation method provided in the above method embodiment. That is, the computer program is used to execute the following steps:

[0177] Start the virtual machine;

[0178] Obtain a first configuration file provided by a user;

[0179] When it is determined that the first configuration file includes the virtual machine computing resource requirements, determining the computing resources to be hot-plugged of the virtual machine according to the virtual machine computing resource requirements in the first configuration file;

[0180] Hot plugging the computing resource to be hot plugged into the virtual machine.

[0181] Optionally, determining the computing resources to be hot-plugged of the virtual machine according to the computing resource requirements of the virtual machine in the first configuration file includes:

[0182] Parsing the first configuration file to obtain the computing resource requirements of the virtual machine;

[0183] Determine the computing resources to be hot-plugged for the virtual machine according to the computing resource requirements of the virtual machine.

[0184] Optionally, determining the computing resources to be hot-plugged of the virtual machine according to the computing resource requirements of the virtual machine in the first configuration file includes:

[0185] Obtain a second configuration file, where the second configuration file includes basic resource requirements of the virtual machine;

[0186] When it is determined that the basic resource requirement meets the preset condition, determining the computing resources to be hot-plugged of the virtual machine according to the basic resource requirement and the computing resource requirement of the virtual machine in the first configuration file;

[0187] When it is determined that the basic resource requirement does not meet the preset condition, the computing resources to be hot-plugged of the virtual machine are determined according to the computing resource requirements of the virtual machine in the first configuration file.

[0188] Optionally, determining the computing resources to be hot-plugged of the virtual machine according to the basic resource requirements and the computing resource requirements of the virtual machine in the first configuration file includes:

[0189] Allocate resources according to the basic resource requirements and preset standards to obtain resource differences;

[0190] The computing resources to be hot-plugged of the virtual machine are determined according to the resource difference and the computing resource requirements of the virtual machine in the first configuration file.

[0191] Optionally, the method further includes:

[0192] When it is determined that the first configuration file does not include virtual machine computing resource requirements and when it is determined that the first configuration file includes container computing resource requirements, the computing resources to be hot-plugged of the virtual machine are determined according to the container computing resource requirements in the first configuration file.

[0193] Optionally, when N containers are deployed on the virtual machine, and the first configuration file includes container computing resource requirements of a first container to a container computing resource requirements of an Nth container, determining the computing resources to be hot-plugged of the virtual machine according to the container computing resource requirements in the first configuration file includes:

[0194] The computing resources to be hot-plugged of the virtual machine are obtained according to the sum of the container computing resource requirements of the first container to the container computing resource requirements of the Nth container.

[0195] Optionally, when the first configuration file also includes container computing resource requirements, the method further includes:

[0196] The container deployed on the virtual machine is started, and the container control group corresponding to the container is configured according to the computing resource requirements of the container.

[0197] The above is the relevant content of the computer-readable storage medium provided in the embodiments of the present application.

[0198] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0199] The above is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as above in the preferred embodiment, it is not used to limit the present invention. Any technician familiar with the art can make many possible changes and modifications to the technical solution of the present invention by using the methods and technical contents disclosed above without departing from the scope of the technical solution of the present invention, or modify it into an equivalent embodiment of equivalent changes. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of protection of the technical solution of the present invention.

Claims

1. A computing resource allocation method, characterized in that: include: Start the virtual machine; Obtain a first configuration file provided by a user; When it is determined that the first configuration file includes a virtual machine computing resource requirement, determining the computing resource to be hot-plugged of the virtual machine according to the virtual machine computing resource requirement in the first configuration file; Hot plugging the computing resource to be hot plugged into the virtual machine; The step of determining the computing resources to be hot-plugged of the virtual machine according to the computing resource requirements of the virtual machine in the first configuration file includes: Obtaining a second configuration file, where the second configuration file includes a basic resource requirement of the virtual machine, where the basic resource requirement refers to a computing resource overhead required for maintaining the operation of the virtual machine; When it is determined that the basic resource demand meets the preset condition, the computing resources to be hot-plugged of the virtual machine are determined according to the basic resource demand and the computing resource demand of the virtual machine in the first configuration file, the preset condition is used to indicate that the condition satisfied by the basic resource demand of the virtual machine needs to be referred to when determining the computing resources to be hot-plugged, the preset condition is determined according to the preset standard allocation resources, and the preset standard allocation resources are the computing resources actually required when the virtual machine is started; When it is determined that the basic resource requirement does not meet the preset condition, the computing resources to be hot-plugged of the virtual machine are determined according to the computing resource requirements of the virtual machine in the first configuration file.

2. The method according to claim 1, characterized in that The step of determining the computing resources to be hot-plugged of the virtual machine according to the computing resource requirements of the virtual machine in the first configuration file includes: Parsing the first configuration file to obtain the computing resource requirements of the virtual machine; Determine the computing resources to be hot-plugged for the virtual machine according to the computing resource requirements of the virtual machine.

3. The method according to claim 1, characterized in that: The step of determining the computing resources to be hot-plugged of the virtual machine according to the basic resource requirements and the computing resource requirements of the virtual machine in the first configuration file includes: Allocate resources according to the basic resource requirements and preset standards to obtain resource differences; The computing resources to be hot-plugged of the virtual machine are determined according to the resource difference and the computing resource requirements of the virtual machine in the first configuration file.

4. The method according to claim 1, characterized in that: The method further comprises: When it is determined that the first configuration file does not include virtual machine computing resource requirements and when it is determined that the first configuration file includes container computing resource requirements, the computing resources to be hot-plugged of the virtual machine are determined according to the container computing resource requirements in the first configuration file.

5. The method according to claim 4, characterized in that When N containers are deployed on the virtual machine, and the first configuration file includes container computing resource requirements of the first container to the container computing resource requirements of the Nth container, and N is a positive integer, determining the computing resources to be hot-plugged of the virtual machine according to the container computing resource requirements in the first configuration file includes: The computing resources to be hot-plugged of the virtual machine are obtained according to the sum of the container computing resource requirements of the first container to the container computing resource requirements of the Nth container.

6. The method according to claim 1, characterized in that When the first configuration file further includes container computing resource requirements, the method further includes: The container deployed on the virtual machine is started, and the container control group corresponding to the container is configured according to the computing resource requirements of the container.

7. A computing resource allocation device, characterized in that: include: A startup unit, used to start the virtual machine; A first acquiring unit, configured to acquire a first configuration file provided by a user; A first determining unit, configured to determine the computing resources to be hot-plugged of the virtual machine according to the computing resource requirements of the virtual machine in the first configuration file when determining that the first configuration file includes the computing resource requirements of the virtual machine; A hot-plug unit, used for hot-plugging the computing resource to be hot-plugged into the virtual machine; The first determining unit is specifically configured to: Obtaining a second configuration file, where the second configuration file includes a basic resource requirement of the virtual machine, where the basic resource requirement refers to a computing resource overhead required for maintaining the operation of the virtual machine; When it is determined that the basic resource demand meets the preset condition, the computing resources to be hot-plugged of the virtual machine are determined according to the basic resource demand and the computing resource demand of the virtual machine in the first configuration file, the preset condition is used to indicate that the condition satisfied by the basic resource demand of the virtual machine needs to be referred to when determining the computing resources to be hot-plugged, the preset condition is determined according to the preset standard allocation resources, and the preset standard allocation resources are the computing resources actually required when the virtual machine is started; When it is determined that the basic resource requirement does not meet the preset condition, the computing resources to be hot-plugged of the virtual machine are determined according to the computing resource requirements of the virtual machine in the first configuration file.

8. A device, characterized in that The device comprises a processor and a memory: The memory is used to store computer programs; The processor is configured to execute the method according to any one of claims 1 to 6 according to the computer program.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 6.