A resource metadata construction method, device, control device and storage medium

By automatically processing OpenAPI information and using preset rules to construct and verify resource metadata, the problem of low efficiency and accuracy of manual derivation is solved, and efficient and accurate resource metadata generation and verification are achieved.

CN114925240BActive Publication Date: 2024-09-20ALIBABA (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210302625.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-25
Publication Date
2024-09-20
Estimated Expiration
2042-03-25

AI Technical Summary

Technical Problem

The efficiency and accuracy of manual derivation of resource metadata is low, especially when the outgoing and incoming parameters of OpenAPI have multiple levels of nesting and a large amount of data, which can easily lead to omissions and mismatches, resulting in low efficiency and low accuracy in confirming resource attributes. Low.

Method used

Automatically process OpenAPI information through computing resources, obtain open application program interface information of resources, construct metadata of resources, use preset derivation rules and verification rules to automatically complete the generation and verification of metadata, and provide repair suggestions. Improve accuracy.

Benefits of technology

It greatly improves the efficiency and accuracy of resource metadata generation, avoids errors in manual derivation, generates metadata through automated methods, ensures the correctness of metadata and provides repair suggestions, improving the integrity and reliability of metadata.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114925240B
    Figure CN114925240B
Patent Text Reader

Abstract

The present application provides a resource metadata construction method, device, control device and storage medium, the method comprising: obtaining the resource's open application program interface information in response to the input resource's operation mapping open application program interface list; constructing the resource's metadata based on the resource's open application program interface information. In this way, by deriving the resource's metadata through computing resources, not only can the low accuracy caused by errors in the manual derivation method be avoided, but also the derivation efficiency can be greatly 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 computing technology, and in particular to a resource metadata construction method, apparatus, control device and storage medium. Background Art

[0002] IaC (Infrastructure as Code) has become an efficient solution for the industry to manage infrastructure. In the process of IaC management, it is necessary to define the metadata of resources; in most scenarios, the generator first generates the metadata of the application interface, and then defines the metadata of the resources based on the metadata of the application interface.

[0003] When manually deducing resource metadata from the metadata of the application program interface, the derivation efficiency and accuracy are low due to the multi-level nesting and large amount of data in the output and input parameters of the application program interface. Summary of the invention

[0004] The problem solved by this application is that the efficiency and accuracy of manually derived resource metadata are low.

[0005] To solve the above problems, the first aspect of the present application provides a resource metadata construction method, comprising:

[0006] In response to the input open application program interface list of the operation mapping of the resource, acquiring the open application program interface information of the resource;

[0007] Build resource metadata based on the resource's open application programming interface information.

[0008] A second aspect of the present application provides a resource metadata construction device, which includes:

[0009] A resource input module, which is used to obtain the open application program interface information of the resource in response to the open application program interface list of the operation mapping of the input resource;

[0010] The metadata building module is used to build metadata of resources based on the open application program interface information of the resources.

[0011] A third aspect of the present application provides a control device, comprising: a memory and a processor;

[0012] The memory is used to store programs;

[0013] The processor, coupled to the memory, is configured to execute the program to:

[0014] In response to the input open application program interface list of the operation mapping of the resource, acquiring the open application program interface information of the resource;

[0015] Build resource metadata based on the resource's open application programming interface information.

[0016] A fourth aspect of the present application provides a computer-readable storage medium on which a computer program is stored, and the program is executed by a processor to implement the resource metadata construction method described above.

[0017] In this application, the metadata of the resource is derived by computing the resource, which can not only avoid the low accuracy caused by errors in the manual derivation method, but also greatly improve the derivation efficiency.

[0018] After manual inference, it needs to be manually written in the format of resource metadata. This solution generates it in an automated way, which can effectively improve the correctness of metadata. By running the verification rules, it can not only determine whether the derived metadata is correct, but also give relevant repair suggestions.

[0019] By automating the correlation between the input and output parameters of OpenAPI and the input and output parameters of different operations, the primary key and list inference of attributes can be achieved; by automating the understanding of the historical access records and documents of OpenAPI, the regularization and enumeration value range filling of attributes can be completed efficiently and automatically, thereby improving the efficiency of metadata generation; by running the correctness rules, it is determined whether the generated metadata meets the expectations, and when problems are encountered, effective repair suggestions are given to improve the correctness of the metadata. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 An architectural diagram constructed based on the resource metadata of this application;

[0021] Figure 2 A flowchart of a resource metadata construction method according to an embodiment of the present application;

[0022] Figure 3 is a flowchart of a resource metadata construction method according to another embodiment of the present application;

[0023] Figure 4 is a flowchart of a resource metadata construction method S200 according to an embodiment of the present application;

[0024] Figure 5 is a flowchart of a resource metadata construction method S202 according to an embodiment of the present application;

[0025] Figure 6 A structural block diagram of a resource metadata construction device according to an embodiment of the present application;

[0026] Figure 7 4 is a structural block diagram of a control device according to an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application are described in detail below in conjunction with the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0028] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application should have the common meanings understood by technicians in the field to which this application belongs.

[0029] IaC (Infrastructure as Code) has become an efficient solution for managing infrastructure in the industry. During the IaC management process, it is necessary to define resource types, resource attributes, and five levels of operations.

[0030] In most scenarios, the generator will give priority to designing OpenAPI interfaces (open application programming interfaces), which are not completed in full accordance with the above standards, that is, the OpenAPI provided by the service when abstracting resources is not a resource API (application programming interface). These exceptions include:

[0031] It is necessary to query multiple OpenAPIs to complete the exposure of all resource attributes;

[0032] It is necessary to modify all resource modifiable attributes through multiple OpenAPI modifications;

[0033] It is necessary to complete the creation and destruction of resources through asynchronous checking.

[0034] In this case, the following questions arise:

[0035] The input and output parameters of OpenAPI are difficult to map with the attributes of resources, and there are obstacles in confirming resource attributes; the attribute characteristics of resource attributes are difficult to determine and need to be manually judged, which is inefficient; when there are multiple levels of nested API input and output parameters and the data is large, manual processing is prone to omissions and mismatches.

[0036] When manually deriving the definition of resource metadata from OpenAPI, due to the complexity of mapping relationships, excessive numbers, and APIs not being designed as resource-based APIs, correctly and completely defining the resources is inefficient and has low accuracy.

[0037] In response to the above problems, the present application provides a new resource metadata construction solution, which can construct resource metadata through computing resources such as computers, solving the problems of low accuracy and efficiency of manual construction.

[0038] For ease of understanding, the following terms that may be used are explained here:

[0039] Infrastructure as Code (IaC): Sometimes referred to as 'programmable infrastructure', infrastructure configuration is treated exactly like software programming. In practice, this has begun to blur the lines between writing an application and creating the environment in which it runs. An application may contain scripts that create and coordinate its own virtual machines (VMs). This is the foundation of cloud computing and is critical to DevOps.

[0040] Resources: With the development of automated governance on the cloud, it is expected that cloud products can be abstracted into a unified resource model, which is also the basis of infrastructure and code. Users can use open source resource orchestration tools or self-developed resource orchestration tools to define the entire usage scenario in terms of resources.

[0041] Resource metadata: The metadata of a resource includes the resource's primary key, attribute list, and the mapping relationship between attributes and OpenAPI operation parameters. Detailed attribute information includes type, whether required, whether modifiable, description, regular value, enumeration value range, etc., among which type and whether modifiable are required.

[0042] Resource type description: A model used to describe resource attribute definitions, generally a collection of resource attributes.

[0043] API: Application Programming Interface (API for short), in essence, refers to a predefined function that is used for communication between applications.

[0044] OpenAPI: Open Application Programming Interface (OpenAPI for short) encapsulates the application service into an application program interface and opens it to third-party service developers. This behavior is also called OpenAPI. For example, Alibaba Cloud OpenAPI. Alibaba Cloud opens the capabilities of its cloud server ECS, SMS service, private network, open search and other services to the outside world in the form of public APIs and functions.

[0045] API parameter input: In order to successfully call the API and OpenAPI, users must enter the parameters specified by the API.

[0046] API output parameters: After successfully calling the API and OpenAPI, the response data is received.

[0047] The embodiment of the present application provides a resource metadata construction method, which can be executed by a resource metadata construction device, and the resource metadata construction device can be integrated in electronic devices such as pads, computers, servers, computers, server clusters, data centers, etc. Figure 1 Combination Figure 2 As shown, it is a flowchart of a resource metadata construction method according to an embodiment of the present application; wherein the resource metadata construction method includes:

[0048] S100, in response to an input open API list of operation mappings of a resource, acquiring open API information of the resource;

[0049] When the API interface information of the resource is needed, an interactive input method can be provided for the generator to enter the name of the resource and the OpenAPI list of five operation mappings, for example, through a visual interface to display to the generator, and the generator inputs specific content through mouse clicks, keyboard input and other operations. Taking Alibaba Cloud's cloud products as an example, the generator can be a developer of Alibaba Cloud ECS (Elastic Compute Service cloud server); it can also be an interface or command for setting information input, and the owner of the resource's API interface information enters specific content after receiving the command or through the interface. Taking Alibaba Cloud's cloud products as an example, the owner can be a developer or a physical device or virtual device that stores the corresponding content.

[0050] It should be noted here that the API interface and the OpenAPI interface are quite similar. For cloud computing, the former refers to all interfaces related to cloud computing, and the latter refers to some interfaces among all interfaces related to cloud computing that can be open to users. The open application program interface described in this application is the OpenAPI interface.

[0051] Among them, resources are entities that can be audited, such as CDN acceleration domain names, ECS hosts, disks, hard disks, instances, email templates, databases, etc. The name of a resource can be considered as the type of resource.

[0052] Each resource has multiple operations. Each operation allows multiple different OpenAPIs to be configured. These operations include:

[0053] Create: Complete the OpenAPI collection of resource creation;

[0054] Delete: Complete the OpenAPI collection of resource deletion;

[0055] Modify: Complete the OpenAPI collection of resource attribute modification;

[0056] Query: query the OpenAPI collection of all resource attributes by resource primary key;

[0057] List: Query the OpenAPI collection of all resource lists and all attributes under the account.

[0058] For a resource, the operations it includes are one, two, or more of the above five operations.

[0059] For example, one resource might contain only query and list operations, while another resource might contain create, delete, and query operations.

[0060] Among them, an OpenAPI interface may not only belong to one set of operations, but also have the functions of two or more operations; for example, an OpenAPI may belong to both the query operation and the list operation set, because it actually performs query operations and list operations. In general, an OpenAPI may belong to both the query operation and the list operation set; but if an OpenAPI belongs to the modification operation, it is generally impossible for it to also belong to the query operation.

[0061] Among them, each operation of a resource is mapped to a set belonging to the operation, and there are multiple OpenAPIs in the set; among them, each operation set can be in the form of an OpenAPI list, and the OpenAPI list contains an OpenAPI name or an OpenAPI identifier. The specific content of the OpenAPI can be obtained from the storage space through the OpenAPI name or the OpenAPI identifier.

[0062] In one embodiment, according to the input OpenAPI list, the output parameter information, input parameter information and document information of each OpenAPI interface are extracted. The document information includes the description of all OpenAPI input and output parameters, which may include the enumeration value range description and regular expression of the field.

[0063] The OpenAPI metadata includes a description of the input and output parameter lists, including whether the parameters are required, the parameter type, the parameter serialization method (such as JSON), etc.

[0064] S200, constructing metadata of resources based on the open application program interface information of the resources.

[0065] Figure 1 The architecture diagram constructed for resource metadata; the resource's open application program interface information is Figure 1 The figure shows the API documentation and metadata in the figure. The specific process of deriving / constructing resource metadata from API documentation and metadata is given in the figure.

[0066] In the OpenAPI list of resource operation mapping, each OpenAPI interface has its output parameter information, input parameter information and document information. Based on this information, the metadata of the resource can be derived and constructed through preset derivation rules.

[0067] The preset derivation rules are pre-stored in a storage space or a derivation method, and the metadata of the resource can be deduced by reading and loading or directly executing the derivation method.

[0068] In this way, by deducing the metadata of resources through computing resources, not only can the low accuracy caused by errors in manual deduction be avoided, but also the deduction efficiency can be greatly improved.

[0069] It should be noted that in this application, the metadata of a resource is derived through the metadata of the OpenAPI of the resource. Therefore, the derivation of the metadata of each resource should be independent of each other; the input of the open application programming interface list of the resource operation mapping should also be performed on an individual resource basis.

[0070] After manual inference, it needs to be manually written in the format of resource metadata. This solution generates it in an automated way, which can effectively improve the correctness of metadata.

[0071] In one embodiment, if Figure 3 As shown, the method further includes:

[0072] S300, verifying the constructed metadata of the resource;

[0073] In one implementation, the metadata of the resource is verified using a preset verification rule.

[0074] There may be multiple preset verification rules, which may be obtained based on actual conditions or summaries of historical data. Taking Alibaba Cloud's resource verification rules as an example, there are currently more than 80 verification rules.

[0075] In one embodiment, the verification rule may include whether the mapping of necessary resource operations is complete, ordinary resources must include creation, deletion, and query operations, and read-only resources must include query operations; wherein ordinary resources and read-only resources are two categories of resources, if the resource is a common category resource, then the resource must include creation operations, deletion operations, and query operations, if not met, then the verification rule fails the verification; if the resource is a read-only category resource, then the resource must and only include query operations and list operations, if not met, then the verification rule fails the verification.

[0076] In one embodiment, the verification rule may include whether the primary key of the resource is defined, wherein the primary key is one or more fields in a table, and its value is used to uniquely identify a record in the table. The primary key is a unique keyword, part of the table definition. The primary key of a table can be composed of multiple keywords, and the column of the primary key cannot contain null values. In other words, each resource needs to have a globally (under an account) unique primary key at runtime to uniquely locate a resource; when a combination of multiple attributes is required to uniquely locate a resource, the attributes can be set as a primary key, a secondary primary key, etc. Under this verification rule, ordinary resources and read-only resources must have a primary key (the primary key cannot be empty, and must have ≥1 attribute as the primary key). If this is not met, the verification of this verification rule fails.

[0077] In one embodiment, the verification rules may include whether the primary key appears in the output parameters of the creation operation, whether it is a required input parameter for deletion, modification, and query, and whether the output parameter of the list operation is an array and the structure contains all the primary key information; if not met, the verification rule fails.

[0078] In one implementation, the verification rule may include whether the query operation covers all resource attributes; if not, the verification of this verification rule fails.

[0079] When all the preset verification rules are verified and passed, the verification of the metadata of the resource is passed; if at least one of the preset verification rules fails, the verification of the metadata of the resource fails.

[0080] S400: When the verification fails, the metadata information that fails in the metadata of the resource is displayed.

[0081] If the verification fails, it means that the derived resource metadata has problems with definition completeness and accuracy. The failed metadata information is presented to the definer or generator for correction, thereby improving the accuracy of the metadata of the final resource.

[0082] If the verification passes, the metadata of the finalized resource can be obtained.

[0083] In one implementation, a corresponding repair suggestion is set for a preset verification rule. If the verification rule fails, the corresponding repair suggestion is displayed synchronously when the metadata information that fails is displayed.

[0084] In this way, by running the verification rules, we can not only determine whether the derived metadata is correct, but also give relevant repair suggestions.

[0085] In one embodiment, if Figure 3 As shown, the method further includes:

[0086] S500: In response to the input metadata information, update the metadata of the resource.

[0087] After receiving the modification information (input metadata information) of the metadata that failed to be passed from the generator or the R&D personnel, the metadata of the resource is updated according to the modification information.

[0088] By updating, the unverified part of the resource metadata can be replaced, thereby improving the accuracy of the metadata of the resource that is finally determined.

[0089] The input metadata information may be input in an interactive input manner.

[0090] In one implementation, the metadata of the resource is updated, and the updated metadata of the resource is re-verified. If it fails, the steps of displaying and updating the metadata information that failed are continued until the verification passes.

[0091] In one implementation, the generator or developer is provided with the permission to skip the verification rules, so that the verification rules that cannot be passed at present are ignored, thereby avoiding the problem of too many verification times due to problems with the verification rules.

[0092] In one implementation, after the metadata of the resource is updated, the updated metadata is used as the finalized metadata of the resource.

[0093] In one embodiment, the open application program interface information includes the output parameters, input parameters and document information of the open application program interface; S200, based on the open application program interface information of the resource, constructs the metadata of the resource, and based on the correlation between the output parameters and input parameters of different open application program interfaces of the resource and the document information, derives and constructs the metadata of the resource.

[0094] In one embodiment, the correlation between the output parameters and input parameters of different open application interfaces may specifically include: the correlation between the output parameters of different open application interfaces, the correlation between the input parameters of different open application interfaces, the correlation between the input parameters of one part of open application interfaces and the output parameters of another part of open application interfaces in different open application interfaces, and the correlation between the output parameters and input parameters of the open application interfaces of the same operation, and the correlation between the output parameters and input parameters of open application interfaces of different operations.

[0095] Among them, in the above implementation, the association can be between one open application program interface and another open application program interface, or between multiple open application program interfaces and multiple other open application program interfaces; the number of open application program interfaces on both sides with the association is not limited here.

[0096] Based on the above correlation, the correlation can be converted into corresponding preset criteria, so as to automatically complete the inference of the metadata of the resource through the preset criteria. In one embodiment, the metadata of the resource includes resource category, resource attribute and the mapping relationship between the output parameter and input parameter of the open application program interface and the resource attribute.

[0097] like Figure 4 As shown, the metadata of the resource is derived and constructed based on the association between the output parameters and input parameters of different open application program interfaces of the resource and the document information, including:

[0098] S201, deriving the resource category according to the category of the operation of the resource;

[0099] The resource operations are classified into five categories: creation, deletion, modification, query, and list. Due to characteristics, each resource includes at least one of the above-mentioned operations.

[0100] The resource categories of the resource include common and read-only. Common category: resources including complete operations (create, delete, query); read-only category: resources including only query and list operations.

[0101] In one implementation, the resource category of the resource further includes other resource categories based on the general category and the read-only category. In this implementation, no limitation is imposed on the other further resource categories.

[0102] In one implementation, the resource category is derived as follows:

[0103] If the resource contains OpenAPI interfaces for create, delete, and query operations, the resource category is inferred to be normal; if the resource includes OpenAPI interfaces for modify and / or list operations in addition to the OpenAPI interfaces for create, delete, and query operations, the resource category is still inferred to be normal. If the resource only contains OpenAPI interfaces for query and list operations, the resource type is inferred to be read-only. If the resource is other than the above, the resource category is defaulted to normal and marked as incomplete resource metadata, which requires further manual improvement.

[0104] In another embodiment, the resource category is derived as follows:

[0105] If the resource only contains the OpenAPI interfaces for query and list operations, the resource type is inferred to be read-only. If the resource includes at least one OpenAPI interface for modify, create, and delete operations in addition to the OpenAPI interfaces for query and list operations, the resource category is inferred to be common. If the resource does not contain the OpenAPI interfaces for query and list operations at the same time, the input is inferred to be wrong and the derivation stops.

[0106] S202, deriving the resource attribute and the configuration of the resource attribute according to the output parameter, input parameter and document information of the open application program interface;

[0107] S203: Determine a mapping relationship between output parameters and input parameters of the open application program interface and the resource attributes according to the derivation process of the resource attributes.

[0108] In the process of deriving the resource attributes according to the output parameters, input parameters and document information of the open application interface, the resource attributes are derived from the output parameters and input parameters. The output parameters, input parameters and the derived attributes will have a mapping relationship at the same time. By recording the mapping relationship in the derivation process, the mapping relationship between the output parameters, input parameters and the resource attributes of the open application interface can be determined.

[0109] In one embodiment, after recording the mapping relationship between the output parameters, input parameters and the resource attributes of the open application interface during the derivation process, the mapping relationship is extended to the mapping of the output parameters, input parameters and the resource attributes of other open application interfaces of the resource, thereby determining the mapping relationship between the output parameters, input parameters and the resource attributes of the open application interface.

[0110] In one embodiment, the types of operations include create, delete, modify, query and list.

[0111] like Figure 5 As shown, the S202, deriving the resource attribute and the configuration of the resource attribute according to the output parameter, input parameter and document information of the open application program interface, includes:

[0112] S210, deriving a resource attribute list of the resource according to the output parameters and input parameters of the open application program interface mapped to the query operation, the create operation, and the delete operation;

[0113] In one implementation, after excluding the system parameters in the output parameters and input parameters of the open application program interface, the resource attribute list is derived based on the output parameters and input parameters of the open application program interface after excluding the system parameters.

[0114] Among them, system parameters are parameters generated by the intermediate gateway or manufacturer itself when the user calls OpenAPI / API, not input by the user. The system parameters include fields such as RequestId, error code, and error information.

[0115] In one implementation, the union of the output parameters of the open application program interface of the query operation mapping and the required input parameters of the open application program interface of the create operation mapping is used as the resource attribute list of the resource.

[0116] It should be noted that, in the above implementation, the derived resource attribute list is a resource attribute list of a minimum set of the resource.

[0117] Among them, since the resource attribute list is determined by the union of the output parameters of the open application interface mapped by the query operation and the required input parameters of the open application interface mapped by the create operation, if the output parameters of the open application interface mapped by the query operation are not fully filled in, or the required input parameters of the open application interface mapped by the create operation are not fully filled in, it will cause the determined resource attribute list to lack certain resource attributes compared with the actual resource attribute list of the resource; therefore, the derivation method derives the resource attribute list of the minimum set of the resource.

[0118] In one implementation, the user or generator may add other resource attributes based on the derived resource attribute list and process the mapping relationship.

[0119] In one implementation, the intersection of the output parameters of the open application program interface for creating operation mapping and the required input parameters of the open application program interface for deleting operation mapping is used as the primary key in the resource attribute.

[0120] In another implementation, if the category of the resource is a read-only category, the primary key name in the attribute of the resource defaults to the resource type name+Id.

[0121] For example, if the resource type name of a resource is Instance, the default derived primary key is InstanceId.

[0122] In one implementation, there may be multiple primary keys (primary key list) for a resource.

[0123] For example, if the resource type Instance is uniquely determined by the primary key UserId and the primary key InstanceId, the primary key list is [UserId, InstanceId]. If [UserId, InstanceId] is the primary key list, then the required input parameters of the open application program interface mapped to the query operation, delete operation, and modify operation must have these two, and they are required input parameters.

[0124] The purpose of the primary key is to uniquely locate resources. The definition of the primary key supports the existence of multiple primary keys, but in most cases there is only one primary key.

[0125] For example, user A has a resource named name, and user B also has a resource named name. If only name (as the primary key) is passed, the service layer cannot determine which resource it points to; if A+name or B+name is passed, the service layer can clearly determine the resource it points to.

[0126] The input parameters of the open application program interface include multiple parameters. If one or some of the parameters are required, then this or these parameters are the required input parameters of the open application program interface.

[0127] The open application program interface information (API metadata) records mandatory restrictions, for example, by adding "required=true" after a specific parameter to define the parameter as mandatory.

[0128] S211, deriving the configuration of the resource attribute according to the output parameters and input parameters of the open application program interface mapped by the create operation and the modify operation and the document information of the open application program interface of the resource.

[0129] In one implementation, the configuration of the resource attribute of the mandatory input parameter mapping of the open application program interface for creating the operation mapping is derived as mandatory, and the configuration of other resource attributes of the resource is derived as optional.

[0130] In one embodiment, the configuration of the resource attribute that is not a primary key of the resource in the input parameter of the open application program interface of the modification operation mapping is deduced as modifiable, and the configuration of other resource attributes of the resource is deduced as unmodifiable. Among them, the configuration of the primary key of the resource is unmodifiable.

[0131] In one implementation, the parameter type of the resource attribute of the resource is derived according to the parameter type in the document information of the open application program interface of the resource.

[0132] In one implementation, the configuration of the resource attribute includes an enumeration value range and a regular expression, and the S202, deriving the resource attribute and the configuration of the resource attribute according to the output parameter, input parameter and document information of the open application program interface, further includes:

[0133] S212, obtaining historical access information of the open application program interface;

[0134] S213: derive the enumeration value range and the regular expression of the resource attribute according to the document information and historical access information of the open application program interface.

[0135] By using historical access information as a comparison and completing the derivation of the enumeration value range and the regular expression through analysis of historical access behavior and semantic analysis of the document, the quality of resource metadata can be effectively improved.

[0136] By automating the understanding of OpenAPI's historical access records and documents, the regularization and enumeration value range filling of attributes can be completed efficiently and automatically, improving the efficiency of metadata generation;

[0137] In one embodiment, S213 derives the enumeration value range and the regular expression of the resource attribute based on the document information and historical access information of the open application interface, compares the enumeration value range extracted by clustering analysis of the document information, the regular expression, and the comparison data extracted by clustering analysis of the historical access information, and derives the enumeration value range and the regular expression of the resource attribute.

[0138] Among them, the specific process of deriving the enumeration value range and the regular expression of the resource attribute is: performing cluster analysis on the document information of the open application program interface to extract the enumeration value range and the regular expression of the resource attribute; performing cluster analysis on the historical access information to extract the comparison data of the enumeration value range and the regular expression therein; if the comparison data of the enumeration value range of a certain resource attribute all fall within the enumeration value range of the resource attribute, then it is confirmed that the enumeration value range of the resource attribute is correct; if at least one of the comparison data of the enumeration value range of the resource attribute does not fall within the enumeration value range of the resource attribute, then the enumeration value range of the resource attribute is incorrect; if the comparison data of the regular expression of a certain resource attribute all conform to the regular expression of the resource attribute, then it is confirmed that the regular expression of the resource attribute is correct; if at least one of the comparison data of the regular expression of a certain resource attribute does not conform to the regular expression of the resource attribute, then it is confirmed that the regular expression of the resource attribute is incorrect.

[0139] For example, the enumeration value range / enumeration value list of a resource attribute is [red, yellow, blue], and its comparison data (only one of the same comparison data can be retained) is (red, yellow, blue), then the enumeration value range of the resource attribute is correct; if its comparison data is (red, yellow, black), then the enumeration value range of the resource attribute is incorrect.

[0140] For example, the regular expression ^[\u4E00-\u9FA5A-Za-z0-9]+$ indicates that the combination of Chinese, English, and numbers 0-9 is supported; the regular expression of a resource attribute is the above formula, and ac appears in the actual historical access log (comparison data), which does not conform to this regular expression (the formula does not contain -), indicating that the regular expression of the resource attribute is inferred incorrectly.

[0141] In one implementation, the comparison data may be field values ​​in a historical log.

[0142] There are multiple attributes of the resource, but not all attributes have enumeration value ranges and regular expressions; some attributes of the resource have enumeration value ranges, and some attributes have regular expressions (such as passwords).

[0143] The cluster analysis process is to train based on all OpenAPI document information + artificial sample sets, and then deduce any OpenAPI document information through the training results to obtain the derived results.

[0144] The enumeration value range of resource attributes and the cluster analysis process of the regular expression are independent of each other, and the cluster analysis process of performing cluster analysis on historical access information and extracting the enumeration value range and the cluster analysis process of the comparison data of the regular expression is also independent of each other.

[0145] Resource attributes are the most important components of metadata. Manual inference is inefficient and prone to errors. This solution automatically extracts them from the mapped OpenAPI through resource primary key rules and attribute rules, greatly improving efficiency and accuracy.

[0146] The regularity and enumeration value range of attribute values ​​are very important for the orchestration tool, and it is difficult to complete them quickly through manual inference. This solution can effectively improve the quality of resource metadata by analyzing historical access behavior and semantic analysis of documents.

[0147] The embodiment of the present application provides a resource metadata construction device, which is used to execute the resource metadata construction method described in the above content of the present application. The resource metadata construction device is described in detail below.

[0148] like Figure 6 As shown, the resource metadata construction device includes:

[0149] A resource input module 101, which is used to obtain the open application program interface information of the resource in response to the input open application program interface list of the operation mapping of the resource;

[0150] The metadata construction module 102 is used to construct metadata of resources based on the open application program interface information of the resources.

[0151] In one embodiment, the device further comprises:

[0152] A metadata verification module 103, which is used to verify the constructed metadata of the resource;

[0153] The information display module 104 is used to display the metadata information of the resource that failed the verification when the verification fails.

[0154] In one embodiment, the device further comprises:

[0155] The metadata updating module 105 is used to update the metadata of the resource in response to the input metadata information.

[0156] In one implementation, the open application program interface information includes output parameters, input parameters and document information of the open application program interface;

[0157] The metadata building module 102 is also used for:

[0158] Based on the association between output parameters and input parameters of different open application program interfaces of the resource and the document information, the metadata of the resource is derived and constructed.

[0159] In one embodiment, the metadata of the resource includes resource category, resource attribute and mapping relationship between output parameter, input parameter of open application program interface and the resource attribute;

[0160] The metadata building module 102 is also used for:

[0161] Deducing the resource category according to the category of the operation of the resource;

[0162] Derived the resource attribute and the configuration of the resource attribute according to the output parameter, input parameter and document information of the open application program interface;

[0163] According to the derivation process of the resource attributes, a mapping relationship between the output parameters and input parameters of the open application program interface and the resource attributes is determined.

[0164] In one embodiment, the types of operations include create, delete, modify, query and list.

[0165] The metadata building module 102 is also used for:

[0166] Derived a resource attribute list of the resource according to the output parameters and input parameters of the open application program interface mapped to the query operation, the create operation and the delete operation;

[0167] The configuration of the resource attribute is derived according to the output parameters and input parameters of the open application program interface mapped by the creation operation and the modification operation and the document information of the open application program interface of the resource.

[0168] In one embodiment, the configuration of the resource attribute includes an enumeration value range and a regular expression.

[0169] The metadata building module 102 is also used for:

[0170] Obtaining historical access information of the open application program interface;

[0171] The enumeration value range and the regular expression of the resource attribute are derived according to the document information and the historical access information of the open application program interface.

[0172] In one implementation, the metadata construction module 102 is further configured to:

[0173] The enumeration value range and the regular expression extracted by clustering analysis on the document information are compared with the comparison data extracted by clustering analysis on the historical access information to derive the enumeration value range and the regular expression of the resource attribute.

[0174] The resource metadata construction device provided in the above-mentioned embodiment of the present application and the resource metadata construction method provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.

[0175] The above describes the internal functions and structure of the resource metadata construction device. Figure 7 As shown, in practice, the resource metadata construction device can be implemented as a control device, including: a memory 301 and a processor 303.

[0176] The memory 301 may be configured to store programs.

[0177] In addition, the memory 301 may also be configured to store various other data to support operations on the control device. Examples of such data include instructions for any application or method operating on the control device, contact data, phone book data, messages, pictures, videos, etc.

[0178] The memory 301 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0179] The processor 303 is coupled to the memory 301 and is configured to execute a program in the memory 301 to:

[0180] In response to the input open application program interface list of the operation mapping of the resource, acquiring the open application program interface information of the resource;

[0181] Build resource metadata based on the resource's open application programming interface information.

[0182] In one implementation, the processor 303 is specifically configured to:

[0183] The constructed metadata of the resource is verified; when the verification fails, the metadata information that fails in the metadata of the resource is displayed.

[0184] In one implementation, the processor 303 is specifically configured to:

[0185] In response to the input metadata information, the metadata of the resource is updated.

[0186] In one implementation, the open application program interface information includes output parameters, input parameters, and document information of the open application program interface, and the processor 303 is specifically configured to:

[0187] Based on the association between output parameters and input parameters of different open application program interfaces of the resource and the document information, the metadata of the resource is derived and constructed.

[0188] In one implementation, the metadata of the resource includes resource categories, resource attributes, and a mapping relationship between output parameters and input parameters of an open application program interface and the resource attributes; the processor 303 is specifically configured to:

[0189] According to the category of the operation of the resource, the resource category is derived; according to the output parameters, input parameters and document information of the open application interface, the resource attributes and the configuration of the resource attributes are derived; according to the derivation process of the resource attributes, the mapping relationship between the output parameters, input parameters and the resource attributes of the open application interface is determined.

[0190] In one implementation, the types of operations include creation, deletion, modification, query and list, and the processor 303 is specifically configured to:

[0191] Based on the output parameters and input parameters of the open application interface mapped by the query operation, the create operation and the delete operation, the resource attribute list of the resource is derived; based on the output parameters and input parameters of the open application interface mapped by the create operation and the modify operation and the document information of the open application interface of the resource, the configuration of the resource attribute is derived.

[0192] In one implementation, the configuration of the resource attribute includes an enumeration value range and a regular expression, and the processor 303 is specifically configured to:

[0193] Acquire historical access information of the open application program interface; and derive the enumeration value range and the regular expression of the resource attribute according to the document information and historical access information of the open application program interface.

[0194] In one implementation, the processor 303 is specifically configured to:

[0195] The enumeration value range and the regular expression extracted by clustering analysis on the document information are compared with the comparison data extracted by clustering analysis on the historical access information to derive the enumeration value range and the regular expression of the resource attribute.

[0196] In this application, Figure 7 Only some components are shown schematically, which does not mean that the control device only includes Figure 7 Components shown.

[0197] The control device provided in this embodiment is based on the same inventive concept as the resource metadata construction method provided in the embodiment of the present application, and has the same beneficial effects as the method adopted, run or implemented by the application program stored therein.

[0198] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0199] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, 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 generate 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 flowchart and / or block diagram. 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.

[0200] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate 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 A function specified in one or more boxes.

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

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

[0203] The 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. The memory is an example of a computer-readable medium.

[0204] The present application also provides a computer-readable storage medium corresponding to the resource metadata construction method provided in the aforementioned implementation manner, on which a computer program (i.e., a program product) is stored. When the computer program is executed by a processor, it will execute the resource metadata construction method provided in any of the aforementioned implementation manners.

[0205] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. 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 disk read-only memory (CD-ROM), digital versatile disk (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 temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0206] The computer-readable storage medium provided in the above-mentioned embodiments of the present application and the resource metadata construction method provided in the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.

[0207] It should be noted that in the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known structures and technologies are not shown in detail so as not to obscure the understanding of this description.

[0208] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0209] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0210] The above is only 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 modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A resource metadata construction method, It is characterized in that include: In response to the input open application program interface list of the operation mapping of the resource, acquiring the open application program interface information of the resource; The open application program interface information includes the output parameters, input parameters and document information of the open application program interface; Based on the open application program interface information of the resource, the metadata of the resource is constructed; including: based on the correlation between the output parameters and input parameters of different open application program interfaces of the resource and the document information, the metadata of the resource is derived and constructed.

2. The method according to claim 1, It is characterized in that Also includes: Verifying the metadata of the constructed resource; When the verification fails, the metadata information that fails in the metadata of the resource is displayed.

3. The method according to claim 2, It is characterized in that Also includes: In response to the input metadata information, the metadata of the resource is updated.

4. The method according to claim 1, It is characterized in that The metadata of the resource includes resource category, resource attributes, and the mapping relationship between the output parameters and input parameters of the open application program interface and the resource attributes; the metadata of the resource is derived and constructed based on the correlation between the output parameters and input parameters of different open application program interfaces of the resource and the document information, including: Deducing the resource category according to the category of the operation of the resource; Derived the resource attribute and the configuration of the resource attribute according to the output parameter, input parameter and document information of the open application program interface; According to the derivation process of the resource attributes, a mapping relationship between the output parameters and input parameters of the open application program interface and the resource attributes is determined.

5. The method according to claim 4, It is characterized in that The categories of the operations include creation, deletion, modification, query and list, and the derivation of the resource attributes and the configuration of the resource attributes according to the output parameters, input parameters and document information of the open application program interface includes: Derived a resource attribute list of the resource according to the output parameters and input parameters of the open application program interface mapped to the query operation, the create operation and the delete operation; The configuration of the resource attribute is derived according to the output parameters and input parameters of the open application program interface mapped by the creation operation and the modification operation and the document information of the open application program interface of the resource.

6. The method according to claim 5, It is characterized in that The configuration of the resource attribute includes an enumeration value range and a regular expression, and the derivation of the resource attribute and the configuration of the resource attribute according to the output parameter, input parameter and document information of the open application program interface also includes: Obtaining historical access information of the open application program interface; The enumeration value range and the regular expression of the resource attribute are derived according to the document information and the historical access information of the open application program interface.

7. The method according to claim 6, It is characterized in that In the process of deducing the enumeration value range and the regular expression of the resource attribute based on the document information and the historical access information of the open application program interface, the enumeration value range extracted by clustering analysis of the document information, the regular expression and the comparison data extracted by clustering analysis of the historical access information are compared to derive the enumeration value range and the regular expression of the resource attribute.

8. A resource metadata construction device, It is characterized in that include: A resource input module, which is used to obtain the open application program interface information of the resource in response to the open application program interface list of the operation mapping of the input resource; The open application program interface information includes the output parameters, input parameters and document information of the open application program interface; A metadata construction module is used to construct metadata of resources based on the open application program interface information of the resources; including: based on the correlation between the output parameters and input parameters of different open application program interfaces of the resources and the document information, deriving and constructing the metadata of the resources.

9. The device according to claim 8, It is characterized in that Also includes: A metadata verification module, which is used to verify the metadata of the constructed resource; The information display module is used to display the metadata information of the resource that failed the verification when the verification fails.

10. A control device, It is characterized in that include: Memory and processor; The memory is used to store programs; The processor, coupled to the memory, is configured to execute the program to: In response to the input open application program interface list of the operation mapping of the resource, the open application program interface information of the resource is acquired; the open application program interface information includes the output parameter, input parameter and document information of the open application program interface; Based on the open application program interface information of the resource, the metadata of the resource is constructed; including: based on the correlation between the output parameters and input parameters of different open application program interfaces of the resource and the document information, the metadata of the resource is derived and constructed.

11. A computer-readable storage medium having a computer program stored thereon, It is characterized in that The program is executed by a processor to implement the method according to any one of claims 1 to 8.