Resource operation method, device and equipment

By obtaining resource operation requests, determining the current configuration information and process configuration information of the target resource, and generating flexible resource operation processes, solving the problem of unchanging cluster resource operation logic and improving resource operation flexibility.

CN120448083APending Publication Date: 2025-08-08HANGZHOU ALICLOUD FEITIAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410176618.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-07
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

In the prior art, the cluster resource operation logic remains unchanged, resulting in low flexibility in resource operation.

Method used

By obtaining resource operation requests, determine the current configuration information of the target resource and the process configuration information corresponding to the resource type, generate a flexible resource operation process, and process the target resource according to this process.

Benefits of technology

It improves the flexibility of resource operations, can generate corresponding operation processes for any resource operation request, and improves the flexibility of operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448083A_ABST
    Figure CN120448083A_ABST
Patent Text Reader

Abstract

The invention provides a resource operation method, device and equipment, and the method comprises the steps: obtaining a resource operation request which comprises the resource type of a target resource and the target configuration information of the target resource; according to the resource operation request, determining current configuration information of the target resource and process configuration information corresponding to the resource type; and generating a resource operation flow according to the target configuration information, the current configuration information and the flow configuration information, and processing the target resource according to the resource operation flow. And the flexibility of operating the resources is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud applications, and in particular to a resource operation method, apparatus, and device. Background Art

[0002] A cluster can include multiple resources. Based on actual needs, you can create, scale out, scale down, and take down these resources. For example, a cluster might be a container orchestration engine (Kubernetes).

[0003] In related technologies, clusters can be equipped with an operator controller. Workers can define custom resources (CRs) in the cluster. The operator controller monitors the CRs and, based on the CRs and the defined operational logic, performs operations on cluster resources. However, in this approach, the operational logic remains fixed, resulting in low flexibility in resource operations. Summary of the Invention

[0004] Various aspects of the present application provide a resource operation method, apparatus, and device to improve the flexibility of operating resources.

[0005] In a first aspect, an embodiment of the present application provides a resource operation method, including:

[0006] Obtaining a resource operation request, wherein the resource operation request includes a resource type of a target resource and target configuration information of the target resource;

[0007] Determining, according to the resource operation request, current configuration information of the target resource and process configuration information corresponding to the resource type;

[0008] A resource operation process is generated according to the target configuration information, the current configuration information, and the process configuration information, and the target resource is processed according to the resource operation process.

[0009] In a possible implementation, generating a resource operation process according to the target configuration information, the current configuration information, and the process configuration information includes:

[0010] Determining a target operation type for the target resource according to the target configuration information and the current configuration information;

[0011] The resource operation process is generated according to the target configuration information, the target operation type and the process configuration information.

[0012] In a possible implementation, generating the resource operation process according to the target configuration information, the target operation type, and the process configuration information includes:

[0013] Acquire a process template corresponding to the target operation type from the process configuration information, wherein the process template includes a plurality of preset operation steps and dependency relationships between the plurality of preset operation steps;

[0014] The resource operation process is generated according to the target configuration information and the process template.

[0015] In a possible implementation, generating the resource operation process according to the target configuration information and the process template includes:

[0016] generating an initial resource operation process according to the target configuration information and the process template, wherein the initial resource operation process includes a plurality of initial operation steps and dependency relationships between the plurality of initial operation steps;

[0017] A resource operation process is generated according to the target configuration information and the initial resource operation process.

[0018] In a possible implementation, generating a resource operation process according to the target configuration information and the initial resource operation process includes:

[0019] Determining, according to the target configuration information, a first operation step and a second operation step from the multiple initial operation steps, where the first operation step is an operation step to be expanded, and the second operation step is an operation step other than the first operation step from the multiple initial operation steps;

[0020] Performing an extension process on the first operation step according to the target configuration information to obtain a plurality of extended operation steps corresponding to the first operation step;

[0021] The resource operation process is generated according to the dependency relationship, the multiple extended operation steps, and the second operation step.

[0022] In a possible implementation, generating the resource operation process according to the dependency relationship, the multiple extended operation steps, and the second operation step includes:

[0023] Determining a step sequence between the plurality of extended operation steps and the second operation step according to the dependency relationship;

[0024] The multiple extension steps and the second operation step are combined and processed according to the step sequence to obtain the resource operation process, which includes the multiple extension steps and the second operation step.

[0025] In a possible implementation, determining the target operation type for the target resource according to the target configuration information and the current configuration information includes:

[0026] Determining configuration difference information between the target configuration information and the current configuration information;

[0027] Determining a target difference type corresponding to the configuration difference information;

[0028] Obtain the preset correspondence between difference types and operation types;

[0029] The target operation type is determined according to the target difference type and the preset corresponding relationship.

[0030] In a possible implementation, processing the target resource according to the resource operation process includes:

[0031] Obtaining the execution status of each operation step in the resource operation process, wherein the execution status is either an executed state or an unexecuted state;

[0032] The target resource is processed according to the execution status of each operation step and the step sequence between the operation steps in the resource operation process.

[0033] In a possible implementation, processing the target resource according to the execution status of each operation step and the order of the operation steps in the resource operation process includes:

[0034] According to the step sequence, the first unexecuted operation step in the resource operation process is determined as the target operation step, and the target operation step is executed. When the execution of the target operation step is completed, the state of the target operation step is switched to the executed state, until the operation steps in the resource operation process are completed, and the processing of the target resource is completed.

[0035] In a second aspect, an embodiment of the present application provides a resource operation device, comprising: an acquisition module, a determination module, a generation module, and a processing module, wherein:

[0036] The acquisition module is used to acquire a resource operation request, wherein the resource operation request includes a resource type of a target resource and target configuration information of the target resource;

[0037] The determination module is configured to determine, according to the resource operation request, the current configuration information of the target resource and the process configuration information corresponding to the resource type;

[0038] The generating module is configured to generate a resource operation process according to the target configuration information, the current configuration information, and the process configuration information;

[0039] The processing module is used to process the target resource according to the resource operation process.

[0040] In a possible implementation, the generating module is specifically configured to:

[0041] Determining a target operation type for the target resource according to the target configuration information and the current configuration information;

[0042] The resource operation process is generated according to the target configuration information, the target operation type and the process configuration information.

[0043] In a possible implementation, the generating module is specifically configured to:

[0044] Acquire a process template corresponding to the target operation type from the process configuration information, wherein the process template includes a plurality of preset operation steps and dependency relationships between the plurality of preset operation steps;

[0045] The resource operation process is generated according to the target configuration information and the process template.

[0046] In a possible implementation, the generating module is specifically configured to:

[0047] generating an initial resource operation process according to the target configuration information and the process template, wherein the initial resource operation process includes a plurality of initial operation steps and dependency relationships between the plurality of initial operation steps;

[0048] A resource operation process is generated according to the target configuration information and the initial resource operation process.

[0049] In a possible implementation, the generating module is specifically configured to:

[0050] Determining, according to the target configuration information, a first operation step and a second operation step from the multiple initial operation steps, where the first operation step is an operation step to be expanded, and the second operation step is an operation step other than the first operation step from the multiple initial operation steps;

[0051] Performing an extension process on the first operation step according to the target configuration information to obtain a plurality of extended operation steps corresponding to the first operation step;

[0052] The resource operation process is generated according to the dependency relationship, the multiple extended operation steps, and the second operation step.

[0053] In a possible implementation, the generating module is specifically configured to:

[0054] Determining a step sequence between the plurality of extended operation steps and the second operation step according to the dependency relationship;

[0055] The multiple extension steps and the second operation step are combined and processed according to the step sequence to obtain the resource operation process, which includes the multiple extension steps and the second operation step.

[0056] In a possible implementation, the determining module is specifically configured to:

[0057] Determining configuration difference information between the target configuration information and the current configuration information;

[0058] Determining a target difference type corresponding to the configuration difference information;

[0059] Obtain the preset correspondence between difference types and operation types;

[0060] The target operation type is determined according to the target difference type and the preset corresponding relationship.

[0061] In a possible implementation, the processing module is specifically configured to:

[0062] Obtaining the execution status of each operation step in the resource operation process, wherein the execution status is either an executed state or an unexecuted state;

[0063] The target resource is processed according to the execution status of each operation step and the step sequence between the operation steps in the resource operation process.

[0064] In a possible implementation, the processing module is specifically configured to:

[0065] According to the step sequence, the first unexecuted operation step in the resource operation process is determined as the target operation step, and the target operation step is executed. When the execution of the target operation step is completed, the state of the target operation step is switched to the executed state, until the operation steps in the resource operation process are completed, and the processing of the target resource is completed.

[0066] In a third aspect, an embodiment of the present application provides a server, comprising: a memory and a processor;

[0067] The memory stores computer-executable instructions;

[0068] The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of the first aspects.

[0069] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, which are used to implement the method described in any one of the first aspects when the computer-executable instructions are executed by a processor.

[0070] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements the method shown in any one of the first aspects when executed by a processor.

[0071] The embodiments of the present application provide a resource operation method, apparatus, and device. A server can obtain a resource operation request and, based on the resource operation request, determine the current configuration information of the target resource and the process configuration information corresponding to the resource type. Furthermore, based on the target configuration information, the current configuration information, and the process configuration information, a resource operation process can be generated, and the target resource can be processed according to the resource operation process. Since the server can flexibly generate a resource operation process corresponding to any resource operation request and process the target resource according to the resource operation process, compared to the prior art in which resources are operated according to a fixed operation logic, the flexibility of resource operation is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0073] Figure 1 A schematic diagram of a scenario provided for an exemplary embodiment of the present application;

[0074] Figure 2 A flowchart of a resource operation method provided by an exemplary embodiment of the present application;

[0075] Figure 3 A flowchart of another resource operation method provided by an exemplary embodiment of the present application;

[0076] Figure 4 A schematic diagram of creating a process template provided by an exemplary embodiment of the present application;

[0077] Figure 5 A schematic diagram of an initial resource operation process provided by an exemplary embodiment of the present application;

[0078] Figure 6 A schematic diagram of a resource operation process provided by an exemplary embodiment of the present application;

[0079] Figure 7 An architectural diagram of a Kubernetes operating platform provided for an exemplary embodiment of this application;

[0080] Figure 8 A schematic structural diagram of a resource operation device provided by an exemplary embodiment of the present application;

[0081] Figure 9 A schematic diagram of the structure of a server provided for an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0082] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0083] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0084] Figure 1 This is a schematic diagram of a scenario provided by an exemplary embodiment of this application. Figure 1 , including an operating platform and a cluster. The operating platform may be a Kubernetes operating platform, and the cluster may be a Kubernetes cluster.

[0085] A Kubernetes cluster can include multiple resources. For example, a Kubernetes cluster can include container resources, database resources, disk resources, and so on.

[0086] The server can obtain resource operation requests and generate corresponding resource operation processes in the Kubernetes operation platform based on the resource operation requests, and then process the target resources according to the resource operation processes.

[0087] For example, resource operation request 1 may be a request to expand container 1. After the server obtains resource operation request 1, it generates resource operation process 1 according to the resource operation request, and then can expand container 1 in the Kubernetes cluster according to resource operation process 1.

[0088] In related technologies, clusters can be equipped with an Operator controller. Workers can define custom resources (CRs) in the cluster. The Operator controller monitors the CRs and, based on the CRs and the defined operational logic, performs operations on cluster resources. However, in this approach, the operational logic is fixed, resulting in limited flexibility in resource operations.

[0089] In an embodiment of the present application, a resource operation request may include the resource type of the target resource and the target configuration information of the target resource. Based on the resource operation request, the server can determine the current configuration information of the target resource and the process configuration information corresponding to the resource type, and then generate a resource operation process based on the target configuration information, current configuration information, and process configuration information, and then process the target resource according to the resource operation process. Since the server can flexibly generate a resource operation process corresponding to any resource operation request and process the target resource according to the resource operation process, compared with the prior art of operating resources according to a fixed operation logic, the flexibility of resource operation is improved.

[0090] The technical solutions shown in this application are described in detail below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be repeated in different embodiments.

[0091] Figure 2 This is a flowchart of a resource operation method provided by an exemplary embodiment of this application. Figure 2 , the method may include:

[0092] S201: Obtain a resource operation request.

[0093] The execution subject of the embodiments of the present application may be a server or a resource operation device provided in the server. The resource operation device may be implemented through software or a combination of software and hardware. The resource operation device may be a processor in the server. For ease of understanding, the following description uses the execution subject as an example.

[0094] The resource operation request includes the resource type of the target resource and the target configuration information of the target resource.

[0095] If the cluster is a Kubernetes cluster, the target resource can be any resource in the Kubernetes cluster.

[0096] The target configuration information may include the target configuration of the target resource, and may also include information about other resources that the target resource depends on, as well as resource dependencies between resources. For example, other resources may include network resources, disk resources, database resources, etc.

[0097] For example, if the target resource is container 1, the resource type is container resource, and the target configuration information 1 may include that the target configuration of container 1 is 5 cores and 10G. Other resources that container 1 depends on may include: load balancer 1, and 10G database 1. The resource dependency relationship is: container 1 depends on load balancer 1 and database 1.

[0098] The server may be provided with an operating platform. Optionally, a staff member may define target configuration information for target resources in the operating platform. The target configuration information may be in the form of a configuration file. For example, the operating platform may be a Kubernetes operating platform.

[0099] Since the target configuration information may also include other resources that the target resource depends on, the lifecycle type corresponding to the target configuration information may also be determined based on the resource usage of the other resources. Optionally, the lifecycle type corresponding to the target configuration information may include Rolling, Deleting, Ready, or Not Ready.

[0100] Optionally, the server can obtain a resource operation request in response to a worker's definition operation on a target resource in the Kubernetes operating platform. For example, the server can obtain resource operation request 1, which may include a resource type of container and target configuration information 1 for container 1. Target configuration information 1 may include a target configuration of 5 cores and 10GB of memory for container 1, and other resources that container 1 depends on include load balancer 1 and 10GB of memory for database 1. The resource dependency relationship is: container 1 depends on load balancer 1 and database 1.

[0101] S202: Determine the current configuration information of the target resource and the process configuration information corresponding to the resource type according to the resource operation request.

[0102] Optionally, resource extension files corresponding to various resource types may be preset in the Kubernetes operating platform.

[0103] The resource extension file can include custom resource CR, health check definition, exposed parameter information, and process configuration information.

[0104] Health check definitions can be used to perform health checks on other resources that the target resource depends on to check whether they are functioning properly. For example, a health check definition can include checking whether a service interface is functioning properly or whether a disk is readable and writable.

[0105] The exposed parameter information may include account number, password, etc.

[0106] The process configuration information may include various operation processes such as the creation process, approval process, and cancellation process corresponding to the resource type.

[0107] Since the resource operation request includes the resource type of the target resource and the target configuration information of the target resource, the server can determine the current configuration information of the target resource in the Kubernetes cluster, determine the resource extension file corresponding to the resource type in the Kubernetes operating platform, and then determine the process configuration information corresponding to the resource type in the resource extension file.

[0108] For example, if the resource operation request 1 includes the resource type of container and the target configuration information 1 of container 1, the server can determine the current configuration information 1 of container 1 in the Kubernetes cluster. If container 1 does not exist in the Kubernetes cluster, the current configuration information 1 of container 1 does not exist, that is, the current configuration information 1 is empty; the server can determine the resource extension file corresponding to the container resource in the Kubernetes operating platform, and determine the process configuration information 1 corresponding to the container resource in the resource extension file. The process configuration information 1 may include various operation processes such as creating a container, expanding the capacity of a container, reducing the capacity of a container, approving, and canceling a container.

[0109] S203: Generate a resource operation process according to the target configuration information, the current configuration information, and the process configuration information, and process the target resource according to the resource operation process.

[0110] A resource operation process can include multiple operation steps.

[0111] In an optional embodiment, a resource operation process can be generated based on the target configuration information, current configuration information, and process configuration information in the following manner: based on the target configuration information and the current configuration information, the target operation type for the target resource is determined; based on the target configuration information, the target operation type, and the process configuration information, the resource operation process is generated.

[0112] For example, if target configuration information 1 includes a target configuration of 5 cores and 10G for container 1, and current configuration information 1 for container 1 is empty, then it can be determined that the target operation type for container 1 is a create operation type. The server can then generate resource operation process 1 for performing the create operation on container 1 based on target configuration information 1, the create operation type, and process configuration information 1. Assuming that resource operation process 1 can include four operation steps, the server can create container 1 according to the four operation steps in resource operation process 1.

[0113] In an embodiment of the present application, the server can obtain a resource operation request and, based on the resource operation request, determine the current configuration information of the target resource and the process configuration information corresponding to the resource type. Furthermore, based on the target configuration information, the current configuration information, and the process configuration information, the server can generate a resource operation process and process the target resource in accordance with the resource operation process. Because the server can flexibly generate a resource operation process corresponding to any resource operation request and process the target resource in accordance with the resource operation process, this improves the flexibility of resource operations compared to the prior art, which operates resources according to a fixed operation logic.

[0114] Below, in Figure 2 Based on the embodiment shown, combined Figure 3 , which explains how to operate the above resources.

[0115] Figure 3 This is a flowchart of another resource operation method provided by an exemplary embodiment of this application. Figure 3 , the method may include:

[0116] S301: Obtain a resource operation request.

[0117] S302: Determine the current configuration information of the target resource and the process configuration information corresponding to the resource type according to the resource operation request.

[0118] It should be noted that the execution process of steps S301 to S302 can refer to steps S201 to S202 and will not be repeated here.

[0119] S303: Determine a target operation type for the target resource according to the target configuration information and the current configuration information.

[0120] In an optional embodiment, the target operation type for the target resource can be determined based on the target configuration information and the current configuration information in the following manner: determining the configuration difference information between the target configuration information and the current configuration information; determining the target difference type corresponding to the configuration difference information; obtaining a preset correspondence between the difference type and the operation type; and determining the target operation type based on the target difference type and the preset correspondence.

[0121] Optionally, there is a preset correspondence between the difference type and the operation type, as shown in Table 1:

[0122] Table 1

[0123] Difference Type Operation Type Create Type Creating an Operation Type Expansion Type Expansion operation type Shrink type Shrink operation type …… ……

[0124] For example, if target configuration information 1 includes a target configuration of 5 cores and 10G for container 1, and current configuration information 1 for container 1 is empty, then configuration difference information 1 between target configuration information 1 and current configuration information 1 can be determined to be a newly added 5-core, 10G container 1. Based on configuration difference information 1, the corresponding target difference type 1 can be determined to be a create type. If the preset correspondence between difference types and operation types is shown in Table 1, then based on target difference type 1 being the create type, the target operation type can be determined to be a create operation type in the preset correspondence.

[0125] S304: Obtain a process template corresponding to the target operation type from the process configuration information.

[0126] Optionally, for any resource type, the process configuration information includes process templates corresponding to multiple operation types for operating the resource. Optionally, the process configuration information may also include a lifecycle type corresponding to each process template.

[0127] For example, if the resource type is a container, the process configuration information may include process templates corresponding to multiple operation types for operating the container resource, and the lifecycle type corresponding to each process template, as shown in Table 2:

[0128] Table 2

[0129] Operation Type Process templates Lifecycle Type Creating an Operation Type Creating a process template Ready Expansion operation type Expansion process template Upgraded Shrink operation type Scaling process template Ready …… …… ……

[0130] Optionally, the server can use the kernel execution engine in the Kubernetes operating platform to determine whether a process template corresponding to the target operation type exists in the process configuration information. If so, and if the lifecycle type corresponding to the process template matches the lifecycle type corresponding to the target configuration information, the server can retrieve the process template corresponding to the target operation type from the process configuration information. A process template can include multiple preset operation steps and dependencies between the multiple preset operation steps.

[0131] For example, if the target operation type is a create operation type, the server can use the core execution engine to determine whether a create process template corresponding to the create operation type exists in the process configuration information. If so, and if the lifecycle type corresponding to the create process template is Ready, and the lifecycle type corresponding to the target configuration information is Ready, it can be determined that the lifecycle type corresponding to the create process template is consistent with the lifecycle type corresponding to the target configuration information. The create process template corresponding to the create operation type can then be obtained from the process configuration information.

[0132] Next, combine Figure 4 , which explains how to create a process template.

[0133] Figure 4 This is a schematic diagram of a process template creation process provided by an exemplary embodiment of this application. Figure 4 For example, a creation process template might include five steps. Step 1 determines whether the database that the container depends on exists; Step 2 begins the database creation approval process; Step 3 creates the database; Step 4 begins the container creation approval process; and Step 5 creates the container. The dependencies between these five pre-set steps might be: Step 2 depends on Step 1, Step 3 depends on Step 2, and Step 4 depends on either Step 3 or Step 1.

[0134] S305: Generate a resource operation process based on the target configuration information and the process template.

[0135] In an optional embodiment, the resource operation process may be generated according to the target configuration information and the process template in the following manner: generating an initial resource operation process according to the target configuration information and the process template; generating a resource operation process according to the target configuration information and the initial resource operation process.

[0136] Optionally, the server may instantiate the process template according to the target configuration information to generate an initial resource operation process. The initial resource operation process may include multiple initial operation steps and dependencies between the multiple initial operation steps.

[0137] Next, combine Figure 5 , explaining the initial resource operation process.

[0138] Figure 5 This is a schematic diagram of an initial resource operation process provided by an exemplary embodiment of this application. Figure 5 For example, if the target configuration information includes the target configuration of the container as 5 cores and 10G, and other resources that container 1 depends on include database 1, if you create a process template such as Figure 4 As shown, the creation process template can be instantiated according to the target configuration information to obtain the initial resource operation process, such as Figure 5 As shown in . The initial resource operation process includes five initial operation steps. Step 51 determines whether Database 1, which Container 1 depends on, exists; Step 52 is the creation and approval process for Database 1; Step 53 is the creation of Database 1; Step 54 is the creation and approval process for Container 1; and Step 55 is the creation of Container 1 with 5 cores and 10G. The dependencies between these five initial operation steps are: Step 52 depends on Step 51, Step 53 depends on Step 52, and Step 54 depends on Step 53 or Step 51. This initial resource operation process is the initial creation process for Container 1.

[0139] Optionally, after the initial resource operation process is generated, the initial resource operation process can be submitted to the Kubernetes cluster.

[0140] In an optional embodiment, a resource operation process can be generated based on the target configuration information and the initial resource operation process in the following manner: according to the target configuration information, a first operation step and a second operation step are determined in multiple initial operation steps; the first operation step is extended according to the target configuration information to obtain multiple extended operation steps corresponding to the first operation step; and a resource operation process is generated based on the dependency relationship, the multiple extended operation steps, and the second operation step.

[0141] The first operation step is an operation step to be expanded, and the second operation step is an operation step other than the first operation step in the multiple initial operation steps.

[0142] Optionally, the server may determine whether to perform extended processing on the first operation step based on the target configuration information. If so, the first operation step may be extended based on the target configuration information to obtain multiple extended operation steps corresponding to the first operation step; if not, the first operation step does not need to be extended.

[0143] Optionally, a resource operation process may be generated based on the dependency relationship, the plurality of extended operation steps, and the second operation step in the following manner: determining a step sequence between the plurality of extended operation steps and the second operation step based on the dependency relationship; and combining the plurality of extended steps and the second operation step according to the step sequence to obtain the resource operation process. The resource operation process includes the plurality of extended steps and the second operation step.

[0144] It should be noted that if the resource operation process for operating the target resource involves operations on other types of resources that the target resource depends on, the resource extension files corresponding to the other resource types can be obtained in the Kubernetes operation platform, and the operation process for the other resources can be obtained in the corresponding resource extension files, and then the operation process for the other resources can be incorporated into the resource operation process for operating the target resource.

[0145] Next, combine Figure 6 , explaining the resource operation process.

[0146] Figure 6 This is a schematic diagram of a resource operation process provided by an exemplary embodiment of this application. Figure 6 For example, if the initial resource operation process is Figure 5 As shown, in the five initial operation steps, step 52, step 53 and step 54 can be determined as the first operation step, and step 51 and step 55 can be determined as the second operation step.

[0147] If step 52 is the creation approval process of database 1, then for step 52, if the size of database 1 included in the target configuration information 1 is 10G, and if the corresponding preset threshold is 5G, then since the required size of database 1 is larger than the corresponding preset threshold, approval is required, then step 52 can be expanded to obtain two extended operation steps corresponding to step 52, namely step 521 and step 522.

[0148] If step 53 involves creating a database, the server can obtain the resource extension file corresponding to the database in the Kubernetes operating platform. Furthermore, from the resource extension file, the server can obtain operation flow 2 for creating the database. Assuming that operation flow 2 includes three steps for creating a database, these three steps are the extended operation steps corresponding to step 53, which can be steps 531, 532, and 533. Step 531 can generate the name of database 1, step 532 can generate the file for database 1, and step 533 can create database 1.

[0149] If step 54 is the creation approval process of container 1, then for step 54, if the target configuration information 1 includes the target configuration of container 1 as 5 cores 10G, and if the corresponding preset threshold is 1 core 2G, then since the required configuration of container 1 is greater than the corresponding preset configuration threshold, approval is required, then step 54 can be expanded to obtain two extended operation steps corresponding to step 54, namely step 541 and step 542.

[0150] The server can determine the sequence of steps between the multiple extended operation steps and the second operation step according to the dependency relationship in the initial operation process as follows: step 51, step 521, step 522, step 523, step 531, step 532, step 533, step 541, step 542, and step 55, and then combine the multiple extended steps and the second operation step according to the sequence of steps to obtain a resource operation process, such as Figure 6 This resource operation process is the operation process for creating container 1.

[0151] A resource operation process records the entire process from submitting the target resource configuration information to completing the operation on the target resource. After generating the resource operation process, you can submit it to the Kubernetes cluster.

[0152] S306: Obtain the execution status of each operation step in the resource operation process.

[0153] The execution status is either executed or not executed.

[0154] Optionally, an Operator controller can be provided in the Kubernetes operating platform. The Operator controller can monitor the initial resource operation process submitted by the kernel execution engine, identify the process execution engine corresponding to the first operation step in the initial resource operation process, and then generate a sub-process executable by the process execution engine based on the process execution engine and multiple extended operation steps in the resource operation process. The sub-process includes multiple extended operation steps corresponding to the first operation step. The sub-process can be executed by the corresponding execution engine.

[0155] Optionally, the Kubernetes operating platform can support multiple open source process execution engines.

[0156] The Operator controller can submit sub-processes to the Kubernetes cluster. The process execution engine can execute the sub-processes.

[0157] The Operator controller can monitor the execution status of sub-processes and aggregate the execution status into the initial resource operation process.

[0158] Optionally, the server can monitor the execution status of each initial operation step in the initial resource operation process through the kernel execution engine (kone) in the Kubernetes operating platform, and synchronize the execution status to the resource operation process.

[0159] For example, if the resource operation process is Figure 6 As shown, the execution status of step 51, step 52, and step 53 may be an executed state, and the execution status of step 54 and step 55 may be an unexecuted state.

[0160] S307: Process the target resource according to the execution status of each operation step and the step sequence between each operation step in the resource operation process.

[0161] In an optional embodiment, the target resource can be processed according to the execution status of each operation step and the step sequence between the operation steps in the resource operation process in the following manner: according to the step sequence, the first operation step in the resource operation process that is not executed is determined as the target operation step, the target operation step is executed, and when the execution of the target operation step is completed, the status of the target operation step is switched to the executed status, until the operation steps in the resource operation process are completed, and the processing of the target resource is completed.

[0162] For example, if the resource operation process is Figure 6 As shown, if the execution status of steps 51, 52, and 53 can be in the executed state, and the execution status of steps 54 and 55 can be in the unexecuted state, then the first unexecuted operation step in the resource operation process, namely operation step 54, can be determined as the target operation step. Since operation step 54 has corresponding extension steps 541 and 542, the process execution engine corresponding to step 54 can execute steps 541 and 542 until extension step 542 is executed, switching the status of step 54 to the executed state. After the operation steps in the resource operation process are executed, the creation of container 1 is completed.

[0163] In an embodiment of the present application, the server can obtain a resource operation request and, based on the resource operation request, determine the current configuration information of the target resource and the process configuration information corresponding to the resource type. The server can determine the target operation type for the target resource based on the target configuration information and the current configuration information, and obtain the process template corresponding to the target operation type in the process configuration information. The server can generate a resource operation process based on the target configuration information and the process template. The server can obtain the execution status of each operation step in the resource operation process and process the target resource based on the execution status of each operation step and the step sequence between each operation step in the resource operation process. Since the server can flexibly generate a resource operation process corresponding to the resource operation request for any resource operation request and process the target resource according to the resource operation process, the flexibility of operating resources is improved compared to the prior art in which resources are operated according to a fixed operation logic.

[0164] Since the technical solution of this application is based on the operating platform, Figure 7 , taking the Kubernetes operating platform as an example, the operating platform is explained.

[0165] Figure 7 This is an architectural diagram of a Kubernetes operating platform provided by an exemplary embodiment of this application. Figure 7, the Kubernetes operating platform can include the interface layer, the kernel engine layer and the final execution layer.

[0166] Alternatively, staff can define target resource configuration information in the Kubernetes operating platform through the interface layer. The target configuration information may include the target configuration of the target resource, other resources that the target resource depends on, and resource dependencies between resources.

[0167] Staff can also define resource extension files corresponding to various resource types in the Kubernetes operating platform through the interface layer. Resource extension files can include custom resources, health check definitions, exposed parameter information, and process configuration information.

[0168] The final execution layer can include multiple process execution engines and plug-ins. The plug-ins can include multiple directed acyclic graph (DAG) services and multiple operator controllers.

[0169] In step 1, the server can respond to the staff's definition of the target resource in the Kubernetes operating platform and obtain a resource operation request for the target resource through the kernel execution engine. The resource operation request may include the resource type of the target resource and the target configuration information of the target resource.

[0170] In step 2, the server can use the kernel execution engine to obtain the resource extension file corresponding to the resource type in the resource operation request, and determine the process configuration information corresponding to the resource type in the resource extension file. For example, if the resource type is a container, the server can determine the resource extension file 1 corresponding to the container resource and determine the process configuration information in the resource extension file 1. The process configuration information can include process templates corresponding to various operation types.

[0171] In step 3, the server can obtain the current configuration information of the target resource through the kernel execution engine and determine the target operation type for the target resource based on the target configuration information and the current configuration information. Assume that the target resource is container 1 and the target operation type for the target resource is a create operation type.

[0172] In step ④, the server can obtain the process template corresponding to the target operation type in the process configuration information through the kernel execution engine, and generate the initial resource operation process. For example, if the target operation type is a create operation type, the server can determine the creation process template corresponding to the create operation type in the process configuration information through the kernel execution engine. The server can instantiate the creation process template according to the target configuration information and generate the initial resource operation process 1. The initial resource operation process 1 is an operation process for creating container 1. The initial resource operation process 1 can include multiple initial operation steps and the dependency relationship between the multiple initial operation steps.

[0173] After the initial resource operation process is generated, it can be submitted to the Kubernetes cluster through the kernel execution engine.

[0174] In step 5, the server can generate a resource operation process based on the target configuration information and the initial resource operation process through the kernel execution engine. The resource operation process can include multiple extended operation steps corresponding to the first operation step, as well as a second operation step. The kernel execution engine can submit the resource operation process to the Kubernetes cluster.

[0175] In step 6, the server can monitor the initial resource operation process generated by the core execution engine through the Operator controller. The Operator controller provides the core execution engine with a unified, standard external abstract interface. For example, it can perform functions such as approval, risk control, pause, terminate, and resume.

[0176] In step ⑦, the server can identify the process execution engine in the initial resource operation process through the Operator controller, and generate multiple sub-processes based on the process execution engine and resource operation process. For example, if the resource operation process is Figure 6 As shown, sub-process 1 may include two extended steps 521 and 522 corresponding to step 52; sub-process 2 may include three extended steps 531, 532, and 533 corresponding to step 53; and sub-process 3 may include two extended steps 541 and 542 corresponding to step 54.

[0177] In step ⑧, the server may execute the corresponding sub-process through the process execution engine.

[0178] In step ⑨, the server can monitor the execution status of the sub-process through the Operator controller and aggregate the execution status to the initial resource operation process.

[0179] In step ⑩, the server may monitor the execution status of the initial resource operation process through the kernel execution engine and synchronize the execution status to the resource operation process.

[0180] In step In the process, the server can obtain the execution status of each operation step in the resource operation process through the kernel execution engine, and process the target resource according to the execution status of each operation step and the step sequence between the operation steps in the resource operation process.

[0181] When all steps in the resource operation process are completed, the operation on the target resource is completed. During this process, the user can adjust the target resource by modifying the target configuration information or by modifying the initial resource operation process on the control interface to adjust the target resource.

[0182] It should be noted that the Kubernetes operating platform in this application has good end-state driving capabilities, architectural stability, and scalability, and also has process control capabilities such as approval, suspension, and termination.

[0183] The technical solution of the present application is a resource operation method that is oriented towards the final state and has an interventionable operation process. Through the technical solution of the present application, the flexibility of operating the target resources can be improved.

[0184] This application is based on the declarative description language of CUE, and provides differentiated application delivery scenario control capability definitions for final content. It also has excellent scalability and can meet the needs of different scales and complexities. By connecting to different process execution engines through abstract interfaces, it achieves flexibility and openness in process intervention, making the Kubernetes operating platform highly open and scalable, and can be seamlessly integrated with different process engines.

[0185] In an embodiment of the present application, the server can obtain a resource operation request and, based on the resource operation request, determine the current configuration information of the target resource and the process configuration information corresponding to the resource type. The server can determine the target operation type for the target resource based on the target configuration information and the current configuration information, and obtain the process template corresponding to the target operation type in the process configuration information. The server can generate a resource operation process based on the target configuration information and the process template. The server can obtain the execution status of each operation step in the resource operation process and process the target resource based on the execution status of each operation step and the step sequence between each operation step in the resource operation process. Since the server can flexibly generate a resource operation process corresponding to the resource operation request for any resource operation request and process the target resource according to the resource operation process, the flexibility of operating resources is improved compared to the prior art in which resources are operated according to a fixed operation logic.

[0186] Figure 8This is a schematic diagram of the structure of a resource operation device provided by an exemplary embodiment of the present application. Figure 8 The resource operation device 10 may include: an acquisition module 11, a determination module 12, a generation module 13 and a processing module 14, wherein:

[0187] The acquisition module 11 is used to acquire a resource operation request, wherein the resource operation request includes a resource type of a target resource and target configuration information of the target resource;

[0188] The determination module 12 is configured to determine the current configuration information of the target resource and the process configuration information corresponding to the resource type according to the resource operation request;

[0189] The generating module 13 is used to generate a resource operation process according to the target configuration information, the current configuration information, and the process configuration information;

[0190] The processing module 14 is configured to process the target resource according to the resource operation process.

[0191] The resource operation device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principles and beneficial effects are similar and will not be repeated here.

[0192] In a possible implementation, the generating module 13 is specifically configured to:

[0193] Determining a target operation type for the target resource according to the target configuration information and the current configuration information;

[0194] The resource operation process is generated according to the target configuration information, the target operation type and the process configuration information.

[0195] In a possible implementation, the generating module 13 is specifically configured to:

[0196] Acquire a process template corresponding to the target operation type from the process configuration information, wherein the process template includes a plurality of preset operation steps and dependency relationships between the plurality of preset operation steps;

[0197] The resource operation process is generated according to the target configuration information and the process template.

[0198] In a possible implementation, the generating module 13 is specifically configured to:

[0199] generating an initial resource operation process according to the target configuration information and the process template, wherein the initial resource operation process includes a plurality of initial operation steps and dependency relationships between the plurality of initial operation steps;

[0200] A resource operation process is generated according to the target configuration information and the initial resource operation process.

[0201] In a possible implementation, the generating module 13 is specifically configured to:

[0202] Determining, according to the target configuration information, a first operation step and a second operation step from the multiple initial operation steps, where the first operation step is an operation step to be expanded, and the second operation step is an operation step other than the first operation step from the multiple initial operation steps;

[0203] Performing an extension process on the first operation step according to the target configuration information to obtain a plurality of extended operation steps corresponding to the first operation step;

[0204] The resource operation process is generated according to the dependency relationship, the multiple extended operation steps, and the second operation step.

[0205] In a possible implementation, the generating module 13 is specifically configured to:

[0206] Determining a step sequence between the plurality of extended operation steps and the second operation step according to the dependency relationship;

[0207] The multiple extension steps and the second operation step are combined and processed according to the step sequence to obtain the resource operation process, which includes the multiple extension steps and the second operation step.

[0208] In a possible implementation, the determining module 12 is specifically configured to:

[0209] Determining configuration difference information between the target configuration information and the current configuration information;

[0210] Determining a target difference type corresponding to the configuration difference information;

[0211] Obtain the preset correspondence between difference types and operation types;

[0212] The target operation type is determined according to the target difference type and the preset corresponding relationship.

[0213] In a possible implementation, the processing module 14 is specifically configured to:

[0214] Obtaining the execution status of each operation step in the resource operation process, wherein the execution status is either an executed state or an unexecuted state;

[0215] The target resource is processed according to the execution status of each operation step and the step sequence between the operation steps in the resource operation process.

[0216] In a possible implementation, the processing module 14 is specifically configured to:

[0217] According to the step sequence, the first unexecuted operation step in the resource operation process is determined as the target operation step, and the target operation step is executed. When the execution of the target operation step is completed, the state of the target operation step is switched to the executed state, until the operation steps in the resource operation process are completed, and the processing of the target resource is completed.

[0218] The resource operation device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principles and beneficial effects are similar and will not be repeated here.

[0219] The exemplary embodiment of the present application provides a structural diagram of a server, see Figure 9 The server 20 may include a processor 21 and a memory 22. Exemplarily, the processor 21 and the memory 22 are interconnected via a bus 23.

[0220] The memory 22 stores computer-executable instructions;

[0221] The processor 21 executes the computer-executable instructions stored in the memory 22 , so that the processor 21 performs the method shown in the above method embodiment.

[0222] Accordingly, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method described in the above method embodiment.

[0223] Accordingly, an embodiment of the present application may also provide a computer program product, including a computer program, which, when executed by a processor, may implement the method shown in the above method embodiment.

[0224] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0225] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0226] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0227] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.

[0228] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0229] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0230] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0231] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0232] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.

Claims

1. A resource operation method, characterized in that: include: Obtaining a resource operation request, wherein the resource operation request includes a resource type of a target resource and target configuration information of the target resource; Determining, according to the resource operation request, current configuration information of the target resource and process configuration information corresponding to the resource type; A resource operation process is generated according to the target configuration information, the current configuration information, and the process configuration information, and the target resource is processed according to the resource operation process.

2. The method according to claim 1, characterized in that Generating a resource operation process according to the target configuration information, the current configuration information, and the process configuration information, including: Determining a target operation type for the target resource according to the target configuration information and the current configuration information; The resource operation process is generated according to the target configuration information, the target operation type and the process configuration information.

3. The method according to claim 2, characterized in that Generating the resource operation process according to the target configuration information, the target operation type, and the process configuration information includes: Acquire a process template corresponding to the target operation type from the process configuration information, wherein the process template includes a plurality of preset operation steps and dependency relationships between the plurality of preset operation steps; The resource operation process is generated according to the target configuration information and the process template.

4. The method according to claim 3, characterized in that Generating the resource operation process according to the target configuration information and the process template includes: generating an initial resource operation process according to the target configuration information and the process template, wherein the initial resource operation process includes a plurality of initial operation steps and dependency relationships between the plurality of initial operation steps; A resource operation process is generated according to the target configuration information and the initial resource operation process.

5. The method according to claim 4, characterized in that Generating a resource operation process according to the target configuration information and the initial resource operation process includes: Determining, according to the target configuration information, a first operation step and a second operation step from the multiple initial operation steps, where the first operation step is an operation step to be expanded, and the second operation step is an operation step other than the first operation step from the multiple initial operation steps; Performing an extension process on the first operation step according to the target configuration information to obtain a plurality of extended operation steps corresponding to the first operation step; The resource operation process is generated according to the dependency relationship, the multiple extended operation steps, and the second operation step.

6. The method according to claim 5, characterized in that Generating the resource operation process according to the dependency relationship, the multiple extended operation steps, and the second operation step includes: Determining a step sequence between the plurality of extended operation steps and the second operation step according to the dependency relationship; The multiple extension steps and the second operation step are combined and processed according to the step sequence to obtain the resource operation process, which includes the multiple extension steps and the second operation step.

7. The method according to any one of claims 2 to 6, characterized in that: Determining a target operation type for the target resource according to the target configuration information and the current configuration information includes: Determining configuration difference information between the target configuration information and the current configuration information; Determining a target difference type corresponding to the configuration difference information; Obtain the preset correspondence between difference types and operation types; The target operation type is determined according to the target difference type and the preset corresponding relationship.

8. The method according to any one of claims 1 to 7, characterized in that Processing the target resource according to the resource operation process includes: Obtaining the execution status of each operation step in the resource operation process, wherein the execution status is either an executed state or an unexecuted state; The target resource is processed according to the execution status of each operation step and the step sequence between the operation steps in the resource operation process.

9. The method according to claim 8, characterized in that Processing the target resource according to the execution status of each operation step and the order of the operation steps in the resource operation process includes: According to the step sequence, the first unexecuted operation step in the resource operation process is determined as the target operation step, and the target operation step is executed. When the execution of the target operation step is completed, the state of the target operation step is switched to the executed state, until the operation steps in the resource operation process are completed, and the processing of the target resource is completed.

10. A resource operation device, characterized in that: include: Acquisition module, determination module, generation module and processing module, wherein, The acquisition module is used to acquire a resource operation request, wherein the resource operation request includes a resource type of a target resource and target configuration information of the target resource; The determination module is configured to determine, according to the resource operation request, the current configuration information of the target resource and the process configuration information corresponding to the resource type; The generating module is configured to generate a resource operation process according to the target configuration information, the current configuration information, and the process configuration information; The processing module is used to process the target resource according to the resource operation process.

11. A server, characterized in that: include: at least one processor; as well as a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the server to execute the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, the method according to any one of claims 1 to 9 is implemented.

13. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.