Cloud resource configuration method and device, electronic equipment and computer program product

By building a cloud resource blueprint and parsing it into an abstract syntax tree to generate resource configuration files, the complexity of cloud resource configuration under multi-cloud platforms is solved, and efficient and accurate cloud resource configuration is achieved.

CN120353535APending Publication Date: 2025-07-22XFUSION DIGITAL TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510006241.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The existing technology has complex cloud resource allocation process under multi-cloud platforms. Heterogeneity leads to the complexity of writing configuration files and the increase in learning costs, making it difficult to achieve efficient and accurate resource allocation.

Method used

By building a cloud resource blueprint, a blueprint description file is generated, parsed into an abstract syntax tree, and resource configuration files are generated based on mapping relationships, supporting automated configuration of cloud resources.

Benefits of technology

It reduces the complexity of cloud resource configuration, improves configuration flexibility and convenience, reduces human errors, ensures the accuracy and consistency of configuration information, and is suitable for complex cloud resource configuration scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353535A_ABST
    Figure CN120353535A_ABST
Patent Text Reader

Abstract

The invention provides a cloud resource configuration method and device, electronic equipment and a computer program product. Relates to the technical field of cloud management. In view of the problem of complexity of the current cloud resource configuration process, the cloud resource configuration method provided by the invention comprises the following steps: acquiring a blueprint description file generated based on a cloud resource blueprint; the blueprint description file comprises cloud resource description information of to-be-configured cloud resources; analyzing the blueprint description file, and generating an abstract syntax tree for representing cloud resource description information; the abstract syntax tree records cloud resource description information through node information; generating a resource configuration file according to the node information of the abstract syntax tree and the mapping relation between the node information and the resource configuration information; based on the resource configuration file, executing a configuration operation on the to-be-configured cloud resource; according to the embodiment of the invention, the complexity of cloud resource configuration can be reduced, and the flexibility and convenience of cloud resource configuration are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of cloud management, and particularly to a cloud resource configuration method, apparatus, electronic device, and computer program product. Background Art

[0002] Terraform is an Infrastructure as Code tool used to manage the automated deployment and orchestration of cloud infrastructure, enabling the configuration of cloud infrastructure resources (also known as cloud resources).

[0003] However, as the services supported by cloud platforms become increasingly complex, the process of configuring cloud resources has also become more complex; and there are differences between different cloud service providers, resulting in heterogeneity between different cloud platforms; when configuring cloud resources for multiple cloud platforms, different syntaxes and semantics need to be used in the terraform configuration file to define cloud resources, increasing the complexity of writing the configuration file and the complexity of the cloud resource configuration process. Summary of the Invention

[0004] According to various embodiments of the present application, a cloud resource configuration method, apparatus, electronic device, and computer program product are provided; the complexity of cloud resource configuration can be reduced, and the flexibility and convenience of cloud resource configuration can be improved.

[0005] In a first aspect, the present application provides a cloud resource configuration method, the method comprising:

[0006] Obtain a blueprint description file generated based on a cloud resource blueprint; the blueprint description file includes cloud resource description information of cloud resources to be configured; parse the blueprint description file to generate an abstract syntax tree for representing the cloud resource description information; the abstract syntax tree records the cloud resource description information through node information; generate a resource configuration file according to the node information of the abstract syntax tree and the mapping relationship between the node information and the resource configuration information; based on the resource configuration file, perform a configuration operation on the cloud resources to be configured.

[0007] In the above manner, the blueprint description file is parsed into an abstract syntax tree, the node information of the abstract syntax tree is format-converted to obtain a resource configuration file. Based on the structured abstract syntax tree, it supports efficient and accurate conversion of complex configuration logic, improves the efficiency and accuracy of cloud resource configuration, and can be flexibly applied to complex cloud resource configuration scenarios; and generates a blueprint description file based on the cloud resource blueprint, improving the convenience of cloud resource configuration. The cloud resource blueprint provides a unified standard description method for cloud resources, and the generated blueprint description file can describe the cloud resources of different cloud service providers through the unified standard. For complex business scenarios of cloud resources and multi-cloud configuration scenarios of cloud resources with different architectures, it can reduce the difficulty of configuration writing; it has strong usability and practicality.

[0008] In a possible implementation manner of the first aspect, parsing the blueprint description file to generate an abstract syntax tree for representing cloud resource description information includes:

[0009] Identifying the cloud resource description information in the blueprint description file, where the cloud resource description information includes component information, attribute information, and dependency relationships of the cloud resources to be configured; generating an abstract syntax tree based on the component information, attribute information, and dependency relationships of the cloud resources to be configured.

[0010] Through the above method, the detailed information of cloud resources (including components, attributes, and dependency relationships) can be automatically extracted from the blueprint description file, and a structured abstract syntax tree can be constructed based on this information, thereby simplifying the process of cloud resource configuration and management, and improving the configuration efficiency and accuracy.

[0011] In a possible implementation manner of the first aspect, identifying the cloud resource description information in the blueprint description file includes:

[0012] By traversing and analyzing the character sequence and syntax structure of the blueprint description file, the cloud resource description information in the blueprint description file is identified.

[0013] Through the above method, based on the analysis of the character sequence and syntax structure of the blueprint description file, the cloud resource description information can be accurately extracted and parsed, providing an accurate data basis for subsequent configuration, deployment, or management.

[0014] In a possible implementation manner of the first aspect, generating a resource configuration file according to the node information of the abstract syntax tree and the mapping relationship between the node information and the resource configuration information includes:

[0015] Based on the mapping relationship, determining the resource configuration information corresponding to the node information of the abstract syntax tree; generating a resource configuration file based on the resource configuration information.

[0016] In the above manner, based on the abstract syntax tree and the preset mapping relationship, the required resource configuration information can be automatically extracted from the node information of the abstract syntax tree, and a resource configuration file that meets the requirements can be quickly generated; this reduces the difficulty of writing the resource configuration file, improves the automation degree of the configuration process, and also helps to reduce human errors and ensure the accuracy and consistency of the resource configuration information.

[0017] In a possible implementation manner of the first aspect, the node information of the abstract syntax tree includes node type information, metadata information, and attribute information; the resource configuration information includes tool configuration, provider configuration, resource configuration, data configuration, and output configuration; based on the mapping relationship, determining the resource configuration information corresponding to the node information of the abstract syntax tree includes:

[0018] Determining the tool configuration according to the first field of the node type information; determining the provider configuration according to the metadata information; determining the resource configuration according to the third field of the node type; determining the data configuration according to the identifier and name in the attribute information; determining the output configuration according to the dependency relationship and operation information in the attribute information.

[0019] In the above manner, based on the preset mapping relationship, the node information of the abstract syntax tree can be quickly converted into the corresponding resource configuration information, improving the format conversion efficiency; the mapping relationship provides a clear correspondence between the node information and the resource configuration information to ensure the accuracy of the resource configuration information; the mapping relationship can be flexibly defined, so as to support the configuration requirements of a variety of different application scenarios; based on the preset mapping relationship, it can be ensured that the generated resource configuration information conforms to the standards and specifications of the configuration tool, promoting the standardization of the configuration information.

[0020] In a possible implementation manner of the first aspect, before obtaining the blueprint description file generated based on the cloud resource blueprint, the method includes:

[0021] Constructing a cloud resource blueprint based on the visual resource canvas; the cloud resource blueprint includes component information, attribute information, and dependency relationships of the cloud resources to be configured.

[0022] In the above manner, constructing a cloud resource blueprint based on the visual resource canvas can make the process of generating the blueprint description file more intuitive and understandable; by constructing the cloud resource blueprint, an efficient configuration method is realized, the time for resource deployment is shortened, and the overall work efficiency and resource configuration efficiency are improved; the cloud resource blueprint provides a clear view of the cloud resources, which can optimize resource utilization and operation and maintenance management; based on the visual resource canvas, the components, attributes, and dependency relationships of the cloud resources can be adjusted to adapt to the changing business needs, thus supporting flexible cloud resource adjustment and expansion.

[0023] In a possible implementation of the first aspect, the resource configuration file includes the attribute information and dependency relationships of the cloud resources to be configured; based on the resource configuration file, performing a configuration operation on the cloud resources to be configured includes:

[0024] Creating a configuration execution plan based on the attribute information and dependency relationships in the resource configuration file; performing a configuration operation on the cloud resources to be configured according to the configuration execution plan.

[0025] By the above method, creating and executing a configuration execution plan based on the attribute information and dependency relationships in the resource configuration file can significantly improve the automation, accuracy, efficiency, consistency, transparency, and flexibility of resource configuration.

[0026] In a second aspect, the present application provides a cloud resource configuration device, including:

[0027] A file acquisition unit, configured to acquire a blueprint description file generated based on a cloud resource blueprint; the blueprint description file includes cloud resource description information of the cloud resources to be configured, and the cloud resource description information conforms to the cloud deployment specification;

[0028] A file parsing unit, configured to parse the blueprint description file to generate an abstract syntax tree for representing the cloud resource description information; the abstract syntax tree records the cloud resource description information through node information;

[0029] A syntax conversion unit, configured to generate a resource configuration file according to the node information of the abstract syntax tree; the resource configuration file includes the attribute information and dependency relationships of the cloud resources to be configured;

[0030] A resource configuration unit, configured to perform a configuration operation on the cloud resources to be configured based on the resource configuration file.

[0031] In a third aspect, the present application provides an electronic device, including a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the method described in any item of the first aspect is implemented.

[0032] In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method described in any item of the first aspect is implemented.

[0033] In a fifth aspect, the present application provides a computer program product, when the computer program product runs on a device, the device is caused to execute the method described in any item of the first aspect above.

[0034] It can be understood that the beneficial effects of the above second aspect to the fifth aspect can refer to the relevant descriptions in the first aspect above, and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0036] Figure 1 It is a schematic diagram of the overall architecture of the cloud resource configuration application scenario provided by the embodiment of the present application;

[0037] Figure 2 It is a schematic diagram of the interface for visually configuring the cloud resource blueprint provided by the embodiment of the present application;

[0038] Figure 3 It is a schematic diagram of the implementation process of the cloud resource configuration method provided by the embodiment of the present application;

[0039] Figure 4 It is a schematic diagram of the overall architecture of the cloud resource configuration method provided by the embodiment of the present application;

[0040] Figure 5 It is a schematic diagram of the architecture of the abstract syntax tree provided by the embodiment of the present application;

[0041] Figure 6 It is a schematic diagram of the overall process of the cloud resource configuration method provided by the embodiment of the present application;

[0042] Figure 7 It is a schematic diagram of the structure of the device provided by the embodiment of the present application;

[0043] Figure 8 It is a schematic diagram of the structure of the electronic device provided by the embodiment of the present application. Detailed Embodiments

[0044] The following will describe in detail the embodiments of the technical solutions of the present application with reference to the drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present application, so they are only examples and cannot be used to limit the protection scope of the present application.

[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above drawings are intended to cover non-exclusive inclusion.

[0046] In the description of the embodiments of the present application, technical terms such as "first" and "second" are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity, specific order or primary-secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "a plurality" is more than two, unless otherwise specifically defined.

[0047] Reference to "embodiments" in this text means that the specific features, structures, or characteristics described in connection with the embodiments may be included in at least one embodiment of the present application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein may be combined with other embodiments.

[0048] In the description of the embodiments of the present application, the term "and / or" is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this text generally represents an "or" relationship between the associated objects before and after.

[0049] Currently, cloud service providers support using Terraform to achieve automated management of cloud-based infrastructure resources (hereinafter referred to as cloud resources), such as actions like creating, updating, viewing, and deleting virtual machines, network resources, container resources, storage resources, etc., and can also manage physical machines, such as installing software and deploying applications. In the process of automating the management of cloud-based infrastructure resources based on Terraform, users need to manually write a Terraform configuration file that defines the resources according to the business orchestration requirements, and then use this Terraform configuration file based on the Terraform tool to complete the configuration of the cloud resources.

[0050] Due to the complexity of the services supported by the cloud platform and the deployment scenarios of hybrid multi-cloud, the traditional method of manually configuring cloud resources becomes time-consuming and complex in the foregoing application scenarios, especially for the operation and maintenance work in a multi-cloud environment, bringing a great deal of labor costs. For example, the heterogeneity between multi-cloud platforms requires handling different syntax and semantics in the Terraform configuration file, increasing the complexity and learning cost of writing the Terraform configuration file; and for another example, there may be complex dependency relationships between cloud resources, and different cloud services and business application scenarios require different configuration parameters; all of which increase the complexity of writing the Terraform configuration file and further increase the difficulty of configuring cloud resources.

[0051] To solve the above technical problems, the embodiments of the present application provide a cloud resource configuration method. By visually designing the cloud resource topology structure, a cloud resource blueprint is constructed, and a blueprint description file is obtained based on the cloud resource blueprint; the blueprint description file is identified and converted to obtain a resource configuration file that can be used by a cloud resource configuration tool, so as to configure cloud resources (including hybrid multi-cloud resources) based on the resource configuration file; the problems of complex cloud resource configuration processes and difficult dependency relationship management in complex business scenarios are solved, and the convenience, flexibility, and accuracy of cloud resource configuration are improved.

[0052] Before introducing the implementation process of the cloud resource configuration method provided by the embodiments of the present application, the professional terms involved in the embodiments of the present application are introduced.

[0053] 1. Cloud Management Platform (CMP) is a cloud service management tool that provides comprehensive multi-cloud management and control services and can manage cloud resources of multiple cloud service providers.

[0054] 2. Terraform is an infrastructure as code tool used for the automated deployment and orchestration of cloud infrastructure to achieve the configuration of cloud resources. The Terraform tool uses declarative configuration to describe all cloud resources to be deployed and their dependencies. The Terraform tool allows users to define and manage cloud infrastructure in a repeatable and maintainable manner, ensuring resource consistency and scalability.

[0055] 3. Topology and Orchestration Specification for Cloud Applications (TOSCA) is a cloud application topology orchestration specification formulated by the Organization for the Advancement of Structured Information Standards (OASIS). It defines information such as the topology structure, component relationships, attributes, and operations of cloud resource orchestration to facilitate the description of the topology structure and behavior of cloud resources.

[0056] 4. The visual blueprint design tool refers to a graphical tool that supports the function of visual blueprint UI design, and provides an interface for visualizing the topology structure of cloud resources. The visual blueprint design tool provided in the embodiments of this application can integrate the TOSCA specification, and provide cloud resource components, component relationship setting methods, attribute setting methods, topology structure setting methods, etc. that conform to the TOSCA specification, for designing cloud resource blueprints that conform to the TOSCA specification, and then obtaining blueprint description files that conform to the TOSCA specification.

[0057] The implementation process of the cloud resource configuration method provided in the embodiments of this application is introduced below.

[0058] Please refer to Figure 1 , the overall architecture schematic diagram of the cloud resource configuration application scenario provided in the embodiments of this application. As Figure 1 shown, through the above visual blueprint design tool, a visual blueprint is constructed to design a cloud resource blueprint of the cloud resource topology structure, and a blueprint description file is obtained; through the recognition and extraction of the blueprint description file, data in the form of an abstract syntax tree structure is obtained; through the format conversion of the data in the abstract syntax tree structure, a resource configuration file is obtained; through the resource configuration tool, the resource configuration file is executed to complete the configuration operation of the cloud resources.

[0059] Among them, the configuration of cloud resources can include configuration operations for hybrid multi-cloud scenarios, such as for cloud resource 1, cloud resource 2 to cloud resource n (n is an integer greater than 2); cloud resource 1 to cloud resource n can respectively correspond to different types of resources, such as public cloud, private cloud, and hybrid cloud, etc.

[0060] It can be understood that the execution subject of the embodiments of this application can be an electronic device, or the above multi-cloud management platform, or a device integrated on the multi-cloud management platform. Taking the execution subject as an electronic device as an example, the electronic device can integrate a visual blueprint design tool and a resource configuration tool. Among them, the visual blueprint design tool can also be independently deployed on any terminal.

[0061] Based on the above overall architecture, the implementation process of constructing a cloud resource blueprint based on the visual blueprint design tool is introduced first.

[0062] Please refer to Figure 2, a schematic diagram of the interface for visually configuring a cloud resource blueprint provided by an embodiment of the present application; the visual blueprint design tool can represent each component of the cloud resource through nodes and represent the dependency relationships between components through arrows or connection lines; for example, the arrow points to the dependent component. The display interface may include a task bar 21, a toolbar 22, a cloud resource addition control 23, a component menu 24, a confirmation control 25, and a canvas 26; the component menu may include cloud infrastructure resources represented by different icons, such as virtual machines, container resources, network resources, storage resources, and applications, etc.

[0063] In some embodiments, a cloud resource blueprint is constructed based on the visual resource canvas; the cloud resource blueprint may include component information, attribute information, and dependency relationships of the cloud resources to be configured.

[0064] Among them, the component information is the infrastructure for cloud resource configuration, such as virtual machines, network resources, container resources, storage resources, and application software, etc. The attribute information includes the attribute information of the cloud resources, such as the provider of the cloud resources, the cloud resource type (such as private cloud, public cloud, etc.), etc., and also includes the attribute information of each component; the dependency relationships include the dependency relationships between cloud resources and the dependency relationships between each component.

[0065] As Figure 2 shown, a cloud resource configuration project can be created through the task bar 21; an object to be configured, such as a cloud resource to be configured, is selected based on the toolbar 22; in response to the user triggering the cloud resource addition control 23 (such as clicking on the cloud resource addition control 23), a cloud provider and the cloud resources to be used are selected, such as cloud resource 1; when selecting a cloud provider and the cloud resources to be used, one or more cloud resources of the same cloud provider can be selected, and cloud resources of multiple different cloud providers can also be selected. Here, the number of cloud resources to be configured selected is not specifically limited.

[0066] Exemplarily, in response to the user's drag - and - drop operation of each component from the component menu 24 to the canvas 26, corresponding components can be created on the canvas 26; for example, component A1 and component A2 of cloud resource 1, and component B1 and component B2 of cloud resource 2. In response to the user clicking on a component on the canvas 26, a control for configuring the component attribute information is displayed, which is used to configure the attribute information of the component; for example, configuring information such as component name, specification, address, and port.

[0067] Among them, based on business requirements, when creating component dependencies, dependencies between cloud resources can be directly established; for example, cloud resource 2 depends on cloud resource 1. Or, in response to a user's connection operation on two components of the same cloud resource, dependencies between the two components are established; for example, component A2 depends on component A1, and component B1 depends on component B2. Or, dependencies between components of different cloud resources can also be created; for example, by connecting component A2 and component B1, the dependency between component B1 and component A2 is created.

[0068] Correspondingly, when creating each component of a cloud resource, application components of the cloud resource can also be selected; for example, application a1, application a2, application a3, and application a4 of cloud resource 1. When selecting cloud resource application components, in response to a user clicking on an application component on the canvas 26, controls for setting application attribute information can be displayed for configuring the attribute information of the application component. When creating dependencies, it also includes creating dependencies between application components; for example, application a1 depends on application a2, application a4 depends on application a3, application b2 depends on application b1, and application b3 depends on application b4.

[0069] Exemplarily, for different business scenarios, through this visual blueprint design tool, the electronic device receives a user's creation instruction and can flexibly construct a cloud resource blueprint, reducing the difficulty of configuring cloud resources in complex application scenarios.

[0070] By constructing the cloud resource topology structure, a cloud resource blueprint is obtained; in response to a user's click operation on the confirmation control 25, the electronic device generates a blueprint description file based on this cloud resource blueprint; for example, the electronic device can extract all component information, attribute information, and dependency relationship data from the cloud resource blueprint. The electronic device can convert the extracted data into the format required by the blueprint description file, encoding the component information, attribute information, and dependency relationships into a data structure or syntax that can be understood and processed by a computer, to obtain a blueprint description file for the cloud resource to be configured.

[0071] It should be noted that the above interface schematic diagram is only exemplary, and the content displayed on the interface and each control do not limit the visual blueprint design tool. Different display interfaces and the ways of representing nodes and dependencies on the display interface can be set based on the actual application scenario; for example, different types of nodes or dependencies can also be distinguished by different colors, shapes, or sizes; for another example, the dependency relationship between components can be represented by a tree structure diagram, with each component as a node of the tree, and the components it depends on can be used as its child nodes; for another example, the dependency relationship between components can also be represented by a star structure.

[0072] Based on the blueprint description file of the cloud resources to be configured generated by the above visualization blueprint design tool, the following describes the specific implementation process of the cloud resource configuration method through embodiments.

[0073] Please refer to Figure 3 , the schematic flowchart of the implementation process of the resource configuration method provided by the embodiment of the present application. Taking the execution subject of this method as an electronic device as an example, this method may include the following steps:

[0074] S301, obtain a blueprint description file generated based on the cloud resource blueprint; the blueprint description file includes cloud resource description information of the cloud resources to be configured.

[0075] In the embodiment of the present application, as Figure 4 shown, the electronic device generates a blueprint description file based on the component information, attribute information, and dependency relationship of the cloud resource blueprint. The cloud resource description information in the blueprint description file is used to represent the attribute information and dependency relationship of the cloud resources.

[0076] Exemplarily, the blueprint description file is a description file that conforms to the TOSCA specification and is used to describe the topological structure of cloud resource components on the cloud platform. The cloud resources are described by nodes, and the dependency relationship is described by relationships. For example, the first node represents a virtual machine, and the second node represents an application. The application (the second node) is deployed (relationship) on the virtual machine named host (the first node). The blueprint description file can be a file in XML or YAML format.

[0077] Exemplarily, the blueprint description file may include a node template and a relationship module. Among them, the node template defines each node (such as each component) in the cloud resource blueprint, including the type, attributes, etc. of the node. The TOSCA specification also provides internal functions, such as input and output functions. When generating the blueprint description file, the input function and the output function are respectively used to define elements such as the input and output of the cloud resources to be configured. Among them, the blueprint description file also supports extending the components and dependency relationships of the cloud resources through programs, so as to be applicable to complex cloud resource deployment and orchestration requirements.

[0078] S302, parse the blueprint description file to generate an abstract syntax tree for representing cloud resource description information; the abstract syntax tree records cloud resource description information through node information.

[0079] In the embodiment of the present application, the electronic device converts the cloud resource description information into structured data through the parsing of the blueprint description file, and represents the cloud resource description information through the node information of the abstract syntax tree, realizing the structured representation of the cloud resource description information. The abstract syntax tree is used to represent the syntax structure and semantic relationship in the blueprint description file.

[0080] Exemplarily, the abstract syntax tree is an abstract representation of the source code syntax structure of the blueprint description file, presenting the syntax structure of the programming language in a tree-like form. The node information of each node in the tree structure is used to represent an element in the blueprint description file. For example, elements such as components, attributes, dependencies, inputs, and outputs of cloud resources are described through node information.

[0081] In some embodiments, parsing the blueprint description file to generate an abstract syntax tree for representing cloud resource description information includes:

[0082] S3021, identifying the cloud resource description information in the blueprint description file, where the cloud resource description information includes component information, attribute information, and dependency relationships of the cloud resources to be configured.

[0083] S3022, generating an abstract syntax tree based on the component information, attribute information, and dependency relationships of the cloud resources to be configured.

[0084] Exemplarily, the electronic device identifies the cloud resource description information by parsing the source code in the blueprint description file. In the abstract syntax tree, each node can represent an element in the blueprint description file, such as cloud resources, attributes, dependencies, inputs, and outputs. The type of the node in the abstract syntax tree depends on the element in the blueprint description file.

[0085] Among them, the abstract syntax tree organizes the nodes into a tree structure, and each node has corresponding child nodes, which can represent other elements related to this node. In the abstract syntax tree, attributes can also be added to the node to represent detailed information in the blueprint description file, such as attributes of the name, type, status, etc. of the element represented by this node.

[0086] Such as Figure 5 shown, the abstract syntax tree includes a root node and non-root nodes (such as child nodes and leaf nodes). The root node is used to represent the project for configuring cloud resources, that is, recording this project through the root node information, such as the project name, etc.; the child nodes of the root node representing this project contain the description information of all cloud resources within this project. Three child nodes are used to represent three resource types, corresponding to the elements in the blueprint configuration file respectively, and this element can be a component of cloud resources; for example, cloud resources such as network resources, virtual switches, virtual machines, and storage volumes, and nodes of resource types such as cloud applications can also be included.

[0087] Correspondingly, as Figure 5As shown, attribute nodes can also be added to the nodes representing resource types, and the attribute information of each type of cloud resource can be represented by leaf nodes. For example, the attribute information corresponding to network resources includes network address, name, and dependency relationship; the attribute information of virtual switches includes network address and name; the attribute information of virtual machine instances includes image identifier, instance type, and instance name.

[0088] Among them, the dependency relationship between different cloud resources can be represented by the arrow pointing between nodes. For example, the dependency relationship between a virtual machine and a storage volume can be represented by the node representing the virtual machine pointing to the node representing the storage volume, indicating that the virtual machine depends on the storage volume; or, the dependency relationship can be represented by the node representing the attribute. For example, the attribute node corresponding to network resources includes a leaf node for representing the dependency relationship, and the leaf node representing the dependency relationship can contain the identifier of the object on which the network resources depend; or, the dependency relationship of cloud resources can be directly represented by a dependency relationship node. For example, the leaf node of a virtual switch represents its related dependency relationship. Thus, the cloud resource description information represented by code in the blueprint description file is converted into a tree-like data structure.

[0089] It should be noted that Figure 5 the structure of the abstract syntax tree, the node types, and the content represented by each node information shown are only for illustrative purposes. It can also be in the form of other tree structures, and the content of cloud resource description information can be represented by node information. For example, the abstract syntax tree can also include data type nodes for representing the data types used in the cloud resource blueprint description file (such as integers, strings, boolean values, etc.).

[0090] In some embodiments, identifying the cloud resource description information in the blueprint description file includes:

[0091] By traversing and analyzing the character sequence and syntax structure of the blueprint description file, the cloud resource description information in the blueprint description file is identified.

[0092] Exemplarily, during the process of parsing the blueprint description file by an electronic device, keywords, identifiers, operators, and syntax units such as numbers, spaces, and comments in the blueprint description file can be identified, so as to analyze and mark the blueprint description file to generate an abstract syntax tree. When generating the blueprint description file, the reading process of the blueprint description file is triggered.

[0093] As Figure 4 shown, the electronic device reads the blueprint description file based on the reading program, and generates an abstract syntax tree by identifying each syntax unit of the blueprint description file. Among them, through lexical analysis, each vocabulary in the blueprint description file is analyzed; through syntactic analysis, the vocabularies obtained by lexical analysis are combined three-dimensionally to determine the relationship between words.

[0094] Exemplarily, the electronic device can implement reading and parsing of the blueprint description file through the Go language, identify cloud resources, attribute information of cloud resources, and dependency relationships of cloud resources in the blueprint description file, generate an abstract syntax tree; and record the attribute information and dependency relationships of cloud resources within the node information of the abstract syntax tree. Among them, the cloud resources further include cloud applications, and the dependency relationships of cloud resources further include the dependency relationships of cloud applications.

[0095] S303, generate a resource configuration file according to the node information of the abstract syntax tree and the mapping relationship between the node information and the resource configuration information.

[0096] In the embodiment of the present application, the electronic device traverses the abstract syntax tree, reads the node information of each hierarchical node, converts the format of the cloud resource description information recorded based on the node information, converts the cloud resource description information based on the TOSCA specification into resource configuration information in the terraform format, and generates a resource configuration file.

[0097] Exemplarily, by traversing the abstract syntax tree, extract the node information; convert the node type in the node information into the corresponding cloud resource type, and convert the cloud resource description information recorded in the node information into the attribute information of the cloud resource and the dependency relationship of the cloud resource.

[0098] Among them, the mapping relationship between the node information and the resource configuration information is stored in the electronic device, and this mapping relationship is used to indicate the corresponding relationship between the cloud resource description information represented based on the TOSCA specification in the node information and the resource configuration information in the terraform format.

[0099] Exemplarily, this resource configuration file can be a configuration file recognizable and executable by a resource configuration tool; for example, this resource configuration file can be a Terraform configuration file executable by the Terraform resource configuration tool.

[0100] In some embodiments, generating a resource configuration file according to the node information of the abstract syntax tree and the mapping relationship between the node information and the resource configuration information includes:

[0101] Based on the mapping relationship, query the resource configuration information corresponding to the node information of the abstract syntax tree; based on the resource configuration information, generate a resource configuration file.

[0102] In an embodiment of the present application, a mapping relationship between resource description information represented based on the TOSCA specification and resource configuration information in Terraform format can be set in the node information. The electronic device reads the node information of each node by traversing the abstract syntax tree; based on this mapping relationship, obtains the resource configuration information corresponding to the node information of each node; and generates a resource configuration file based on this resource configuration information. Figure 4 As shown in Figure 4 , the electronic device traverses the abstract syntax tree, performs mapping conversion on the node information, and generates a resource configuration file.

[0103] In some embodiments, the node information of the abstract syntax tree includes node type information, metadata information, and attribute information; the resource configuration information includes tool configuration, provider configuration, resource configuration, data configuration, and output configuration; based on the mapping relationship, determining the resource configuration information corresponding to the node information includes:

[0104] Determine the tool configuration according to the first field of the node type information; determine the provider configuration according to the metadata information; determine the resource configuration according to the third field of the node type; determine the data configuration according to the identifier and name in the attribute information; determine the output configuration according to the dependency relationship and operation information in the attribute information.

[0105] Exemplarily, the mapping relationship includes: the correspondence between the first field of the node type information and the tool configuration, the correspondence between the third field of the node type information and the resource configuration, the correspondence between the metadata information and the provider configuration, the correspondence between the identifier and name in the attribute information and the data configuration, and the correspondence between the dependency relationship and operation information in the attribute information and the output configuration.

[0106] Thus, based on the above mapping relationship and the node information of each node of the abstract syntax tree, determine the specific content of each configuration in the corresponding resource configuration information.

[0107] Such as Figure 5For each node information of the abstract syntax tree shown, the electronic device can identify each field in the node information and determine the corresponding resource configuration information based on the mapping relationship. For example, the node type (node_type) corresponds to each node type information it contains (tecentcloud.nodes.VPC, tecentcloud.nodes.vSwitch, tecentcloud.nodes.ECSInstance). By identifying the first field (tecentcloud) in this node type information, the tool configuration (terraform configuration) is determined; the node information also includes metadata information (metadata). By identifying the access key (ak:access_key) and secret key (sk:secreat_key) corresponding to this metadata information, the provider configuration (provider configuration) is determined; by identifying the third field (VPC, vSwitch, and ECSInstance) in the node type information, the resource configuration (resource configuration) is determined; by identifying the identifiers (such as IP address (ip:192.168.0.0 / 12), type (Instance_type), and image_id:XXX), names (such as name:testVPC, name:testvSwitch, and Instance_name:test_ecs) in the attribute information (properties), the data configuration (data configuration) is determined; by identifying the dependency relationship (such as dependsOn:testvSwitch) and operation information (such as action:create) in the attribute information (properties), the output configuration (output configuration) is determined.

[0108] Among them, the tool configuration (terraform configuration) is used to indicate which provider's cloud resources to use; the metadata information is the metadata of the cloud resource provider or manufacturer; the dependency relationship is used to determine the execution order of cloud resources. For example, Figure 5 as shown, the virtual machine (VPC) depends on the switch, so during the configuration process, the operation on the switch is executed first, and then the operation on the virtual machine (VPC) is executed. The operation information is used to indicate the operation on the source resource, including the operations set by the user, such as the create operation (create).

[0109] Exemplarily, the tool configuration refers to the top-level structure of the entire Terraform configuration file, which defines the entry point of the Terraform project, sets the version requirements of the resource configuration tool, clarifies the organization and architecture of the entire configuration file, and ensures the logic and readability of the configuration file; this node also contains references to other nodes (such as provider configuration, resource configuration).

[0110] The provider configuration is used to specify the cloud service provider or infrastructure provider used by the resource configuration tool to create and manage cloud resources; in the resource configuration file, the provider node defines the connection information with the cloud provider, including necessary authentication credentials and interface endpoints, etc.; thus, the resource configuration tool can interact with the interface of the cloud service provider to automatically create, modify, or delete cloud resources; for example, when generating the provider configuration, the electronic device can specify authentication information such as the access key of the cloud service provider.

[0111] The resource configuration defines the cloud resources to be configured and their attributes; through the resource configuration, the type of cloud resources (such as virtual machines, network resources, etc.), name, configuration parameters, and dependencies, etc. can be specified, enabling the resource configuration tool to automatically create, modify, or delete cloud resources based on the content of the resource configuration.

[0112] The data configuration is used to define external data sources, allowing the resource configuration tool to obtain data from external data sources (such as the interfaces of cloud providers, local files, etc.) and use this data in the configuration file, enabling the resource configuration tool to configure cloud resources according to the external data sources, improving the flexibility and reusability of the configuration. For example, the resource configuration tool obtains data such as the image identifier provided by the cloud provider through the data configuration and references this data when creating cloud resources.

[0113] The output configuration is used to define the information output after the resource configuration tool executes the configuration operation, which can be the attributes or status of the cloud resources configured by the resource configuration tool, etc. Through the definition of the output configuration, the output information can be presented to users in an easy-to-read and understand manner or integrated into other tools. For example, by defining the output configuration, information such as the public network address or domain name system name of the output virtual machine instance is obtained.

[0114] It should be noted that the above mapping relationship and each information content are only for exemplary illustration; based on the requirements of the actual business application scenario, other information content and mapping relationships of other information content may also be included, and this mapping relationship can be flexibly set, adjusted, or extended according to the actual application scenario to ensure the accuracy of format conversion.

[0115] S304, based on the resource configuration file, perform configuration operations on the cloud resources to be configured.

[0116] In an embodiment of the present application, the electronic device automatically submits the generated resource configuration file to the resource configuration tool, and the resource configuration tool reads the attribute information and dependency relationships of the resources to be configured in the resource configuration file, and completes the configuration of the cloud resources to be configured based on the attribute information and dependency relationships.

[0117] In some embodiments, the resource configuration file includes the attribute information and dependency relationships of the cloud resources to be configured; based on the resource configuration file, performing a configuration operation on the cloud resources to be configured includes:

[0118] S3041, creating a configuration execution plan based on the attribute information and dependency relationships in the resource configuration file.

[0119] S3042, performing a configuration operation on the cloud resources to be configured according to the configuration execution plan.

[0120] Exemplarily, after obtaining the resource configuration file, the resource configuration tool integrated in the electronic device creates a configuration execution plan, that is, creates a specific, ordered, and executable configuration operation plan according to the attribute information and dependency relationships in the resource configuration file, which is used to describe how to gradually perform the configuration operation according to the resources and dependency relationships in the resource configuration file to achieve the configuration goal.

[0121] Exemplarily, the configuration operations performed may include creating cloud resources, setting attributes, establishing dependency relationships, etc. Configuring cloud resources based on Terraform can simplify and automate the management process of cloud resources, making the deployment and configuration of cloud resources more efficient and reliable; it can also be applied to the operation and maintenance of hyper-converged infrastructure resources.

[0122] Figure 6 The overall process schematic diagram of the cloud resource configuration method provided by the embodiment of the present application is shown. Based on the same implementation principle as the above embodiment, it will not be elaborated here. The overall process of the cloud resource configuration method may include the following steps:

[0123] 1. Select a cloud provider. The cloud provider is used to provide cloud resources.

[0124] 2. Select cloud resources.

[0125] 3. Configure cloud resource attributes.

[0126] 4. Configure cloud resource dependency relationships.

[0127] 5. Select a cloud application.

[0128] 6. Configure cloud application attributes.

[0129] 7. Configure cloud application dependency relationships.

[0130] 8. Generate a blueprint description file.

[0131] 9. Read the blueprint description file.

[0132] 10. Parse the blueprint description file.

[0133] 11. Identify cloud resource dependencies.

[0134] 12. Identify cloud application dependencies.

[0135] 13. Generate an abstract syntax tree.

[0136] 14. Traverse the abstract syntax tree.

[0137] 15. Read the abstract syntax tree node information.

[0138] 16. Based on the mapping relationship, map the resource configuration information of the cloud resources.

[0139] 17. Generate resource configuration files from resource configuration information.

[0140] 18. Submit the resource configuration file.

[0141] 19. Create an execution plan.

[0142] 20. Configure cloud resources.

[0143] Through the embodiments of the present application, the blueprint description file is parsed into an abstract syntax tree, and the node information of the abstract syntax tree is formatted to obtain a resource configuration file. Based on the structured abstract syntax tree, it supports efficient and accurate conversion of complex configuration logic, improves the efficiency and accuracy of cloud resource configuration, and can be flexibly applied to complex cloud resource configuration scenarios; and generates a blueprint description file based on the cloud resource blueprint, improves the convenience of cloud resource configuration, and reduces the difficulty of configuration writing for complex business scenarios of cloud resources and multi-cloud configuration scenarios of cloud resources with different architectures; opens up the entire process of resource orchestration design and orchestration execution, greatly improving the ease of use of cloud resource orchestration in complex scenarios.

[0144] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0145] Corresponding to the cloud resource configuration method provided in the above embodiment, Figure 7 A schematic diagram of the structure of a cloud resource configuration device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0146] Reference Figure 7 , the device comprises:

[0147] A file acquisition unit 71 for acquiring a blueprint description file generated based on a cloud resource blueprint; the blueprint description file includes cloud resource description information of cloud resources to be configured, and the cloud resource description information conforms to cloud deployment specifications;

[0148] A file parsing unit 72 for parsing the blueprint description file to generate an abstract syntax tree corresponding to the cloud resource description information; the node information of the abstract syntax tree is used to indicate the cloud resource description information;

[0149] A format conversion unit 73 for performing format conversion on the node information of the abstract syntax tree to generate a resource configuration file; the resource configuration file includes attribute information and dependency relationships of cloud resources to be configured;

[0150] A resource configuration unit 74 for performing a configuration operation on the cloud resources to be configured based on the attribute information and dependency relationships in the resource configuration file.

[0151] In a possible implementation manner, the file parsing unit 72 is further configured to identify the cloud resource description information in the blueprint description file, where the cloud resource description information includes component information, attribute information, and dependency relationships of the cloud resources to be configured; and generate an abstract syntax tree based on the component information, attribute information, and dependency relationships of the cloud resources to be configured.

[0152] In a possible implementation manner, the file parsing unit 72 is further configured to identify the cloud resource description information in the blueprint description file by traversing and analyzing the character sequence and syntax structure of the blueprint description file.

[0153] In a possible implementation manner, the format conversion unit 73 is further configured to determine resource configuration information corresponding to the node information of the abstract syntax tree based on a mapping relationship; and generate a resource configuration file based on the resource configuration information.

[0154] In a possible implementation manner, the node information of the abstract syntax tree includes node type information, metadata information, and attribute information; the resource configuration information includes tool configuration, provider configuration, resource configuration, data configuration, and output configuration; the format conversion unit 73 is further configured to determine the tool configuration according to the first field of the node type information; determine the provider configuration according to the metadata information; determine the resource configuration according to the third field of the node type; determine the data configuration according to the identifier and / or name of the attribute information; and determine the output configuration according to the dependency relationship and operation information in the attribute information.

[0155] In a possible implementation manner, the apparatus further includes a blueprint construction unit for constructing a cloud resource blueprint based on a visual resource canvas; the cloud resource blueprint includes component information, attribute information, and dependency relationships of cloud resources to be configured.

[0156] In a possible implementation, the resource configuration unit 74 is further configured to create a configuration execution plan based on the attribute information and dependency relationships in the resource configuration file; and to perform configuration operations on the cloud resources to be configured according to the configuration execution plan.

[0157] Through the embodiments of the present application, the blueprint description file is parsed into an abstract syntax tree, and the node information of the abstract syntax tree is formatted to obtain a resource configuration file. Based on the structured abstract syntax tree, it supports efficient and accurate conversion of complex configuration logic, improves the efficiency and accuracy of cloud resource configuration, and can be flexibly applied to complex cloud resource configuration scenarios; and generates a blueprint description file based on the cloud resource blueprint, improves the convenience of cloud resource configuration, and reduces the difficulty of configuration writing for complex business scenarios of cloud resources and multi-cloud configuration scenarios of cloud resources with different architectures; opens up the entire process of resource orchestration design and orchestration execution, greatly improving the ease of use of cloud resource orchestration in complex scenarios.

[0158] Figure 8 A schematic diagram of the hardware structure of the electronic device 8 is shown.

[0159] like Figure 8 As shown, the electronic device 8 of this embodiment includes: at least one processor 80 ( Figure 8 Only one is shown), a memory 81, wherein the memory 81 stores a computer program 82 that can be run on the processor 80. When the processor 80 executes the computer program 82, the steps in the above method embodiment are implemented, such as Figure 3 Alternatively, when the processor 80 executes the computer program 82, the functions of the modules / units in the above-mentioned device embodiments are realized.

[0160] It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 8. In other embodiments of the present application, the electronic device 8 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0161] The electronic device 8 may include, but is not limited to, a processor 80 and a memory 81. Those skilled in the art will appreciate that Figure 8 It is only an example of the electronic device 8 and does not constitute a limitation of the electronic device 8. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the server may also include an input sending device, a network access device, a bus, etc.

[0162] The processor 80 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0163] The processor 80 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 80 is a cache memory. The memory may store instructions or data that the processor 80 has just used or cyclically used. If the processor 80 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 80, and thus improves the efficiency of the system.

[0164] In some embodiments, the memory 81 may be an internal storage unit of the electronic device 8, such as a hard disk or memory of the electronic device 8. The memory 81 may also be an external storage device of the electronic device 8, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 8. Further, the memory 81 may also include both an internal storage unit of the electronic device 8 and an external storage device. The memory 81 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of computer programs, etc. The memory 81 may also be used to temporarily store data that has been sent or is to be sent.

[0165] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0166] It should be noted that the structure of the above-mentioned electronic device is only illustrative, and based on different application scenarios, it may also include other physical structures, and the physical structure of the electronic device is not limited here.

[0167] In the above embodiments, the descriptions of the various embodiments each have their own emphasis. For parts not detailed or recorded in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0168] An embodiment of the present application also provides a computer-readable storage medium storing a computer program, which when executed by a processor can implement the steps in the above method embodiments.

[0169] An embodiment of the present application provides a computer program product, which when running on a server enables the server to implement the steps in the above method embodiments.

[0170] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above method embodiments of the present application, it can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps in the above method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.

[0171] The electronic device, computer storage medium, and computer program product provided in the above embodiments of the present application are all used to execute the method provided above. Therefore, the beneficial effects they can achieve can refer to the beneficial effects corresponding to the method provided above, and will not be elaborated here.

[0172] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.

[0173] It should be understood that the above is only to help those skilled in the art better understand the embodiments of the present application, rather than to limit the scope of the embodiments of the present application. Those skilled in the art can obviously make various equivalent modifications or changes according to the above examples. For example, in the various embodiments of the above detection method, some steps may not be necessary, or some steps may be newly added, etc. Or any combination of any two or any more of the above embodiments. The solutions after such modifications, changes or combinations also fall within the scope of the embodiments of the present application.

[0174] It should also be understood that the classification of the methods, situations, categories and embodiments in the embodiments of the present application is only for convenience of description and should not constitute a special limitation. The features in various methods, categories, situations and embodiments can be combined without conflict.

[0175] It should also be understood that in the various embodiments of the present application, if there is no special description and logical conflict, the terms and / or descriptions between different embodiments are consistent and can be cited from each other. The technical features in different embodiments can be combined to form new embodiments according to their internal logical relationships.

[0176] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0177] In the embodiments provided by the present application, it should be understood that the disclosed device / network device and method can be implemented in other ways. For example, the device / network device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical or other form.

[0178] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0179] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

[0180] Finally, it should be noted that: the above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or replacements within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claimed rights.

Claims

1. A cloud resource configuration method, characterized in that, The method includes: Obtaining a blueprint description file generated based on a cloud resource blueprint; the blueprint description file includes cloud resource description information of cloud resources to be configured; Parsing the blueprint description file to generate an abstract syntax tree for representing the cloud resource description information; the abstract syntax tree records the cloud resource description information through node information; Generating a resource configuration file according to the node information of the abstract syntax tree and the mapping relationship between the node information and the resource configuration information; Performing a configuration operation on the cloud resources to be configured based on the resource configuration file.

2. The method according to claim 1, wherein The parsing the blueprint description file to generate an abstract syntax tree for representing the cloud resource description information includes: Identifying the cloud resource description information in the blueprint description file, where the cloud resource description information includes component information, attribute information, and dependency relationships of the cloud resources to be configured; Generating the abstract syntax tree based on the component information, the attribute information, and the dependency relationships of the cloud resources to be configured.

3. The method according to claim 2, wherein The identifying the cloud resource description information in the blueprint description file includes: Identifying the cloud resource description information in the blueprint description file by traversing and analyzing the character sequence and syntax structure of the blueprint description file.

4. The method according to claim 1, wherein The generating a resource configuration file according to the node information of the abstract syntax tree and the mapping relationship between the node information and the resource configuration information includes: Determining the resource configuration information corresponding to the node information based on the mapping relationship; Generating the resource configuration file based on the resource configuration information.

5. The method according to claim 4, wherein The node information of the abstract syntax tree includes node type information, metadata information, and attribute information; the resource configuration information includes tool configuration, provider configuration, resource configuration, data configuration, and output configuration; The determining the resource configuration information corresponding to the node information based on the mapping relationship includes: Determining the tool configuration according to the first field of the node type information; Determining the provider configuration according to the metadata information; Determining the resource configuration according to the third field of the node type; Determining the data configuration according to the identifier and name in the attribute information; Determining the output configuration according to the dependency relationship and operation information in the attribute information.

6. The method according to any one of claims 1 to 5, characterized in that, Before the obtaining a blueprint description file generated based on a cloud resource blueprint, the method includes: Constructing the cloud resource blueprint based on a visual resource canvas; the cloud resource blueprint includes component information, attribute information, and dependency relationships of the cloud resources to be configured.

7. The method according to any one of claims 1 to 5, characterized in that The resource configuration file includes the attribute information and dependency relationships of the cloud resources to be configured; The performing a configuration operation on the cloud resources to be configured based on the resource configuration file includes: Creating a configuration execution plan based on the attribute information and dependency relationships in the resource configuration file; Performing a configuration operation on the cloud resources to be configured according to the configuration execution plan.

8. A cloud resource configuration device, characterized in that, The apparatus includes: A file acquisition unit for acquiring a blueprint description file generated based on a cloud resource blueprint; the blueprint description file includes cloud resource description information of cloud resources to be configured, and the cloud resource description information conforms to cloud deployment specifications; A file parsing unit for parsing the blueprint description file to generate an abstract syntax tree corresponding to the cloud resource description information; the node information of the abstract syntax tree is used to indicate the cloud resource description information; A syntax conversion unit for performing format conversion on the node information of the abstract syntax tree to generate a resource configuration file; the resource configuration file includes attribute information and dependency relationships of the cloud resources to be configured; A resource configuration unit for performing a configuration operation on the cloud resources to be configured based on the attribute information and the dependency relationships in the resource configuration file.

9. An electronic device, characterized in that, It includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the method described in any one of claims 1 to 7 is implemented.

10. A computer program product, characterized in that, When a computer program product runs on a device, the device is caused to execute the method described in any one of claims 1 to 7.

Citation Information

Cited By

  • Cloud resource configuration method, apparatus and device, and computer readable storage medium

    CN120848951A

  • Cloud resource configuration method, device, equipment and computer readable storage medium

    CN120848951B