Cloud computing API recommendation method and device, electronic equipment and readable storage medium

By constructing a heterogeneous information network and an attention aggregation mechanism, the problem of capturing dependencies and user preferences in cloud computing API recommendations is solved, enabling personalized recommendations and improving the efficiency and user experience of the cloud computing platform.

CN121814831APending Publication Date: 2026-04-07CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing technologies cannot effectively capture the dependencies between cloud APIs and users' personalized preferences in cloud API recommendations, resulting in limited recommendation accuracy and low user selection efficiency.

Method used

A heterogeneous information network is constructed, and the relationships between nodes are described through meta-paths. A node-level and semantic-level attention aggregation mechanism is adopted. A heterogeneous graph neural network model is used for cloud API recommendation, including neighbor sampling, feature encoding, attention aggregation, and prediction of preference probability.

Benefits of technology

Personalized cloud API recommendations have been implemented, improving the accuracy and relevance of recommendations, reducing the time cost for users to filter data, alleviating the cold start problem, and enhancing the service efficiency and user satisfaction of the cloud computing platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121814831A_ABST
    Figure CN121814831A_ABST
Patent Text Reader

Abstract

The invention provides a cloud computing API (Application Program Interface) recommendation method and device, electronic equipment and a readable storage medium, relates to the technical field of cloud computing, and aims to realize personalized recommendation of a cloud API with a complex strong dependency relationship. The method comprises the steps that historical data called by a cloud API is acquired, a heterogeneous information network is constructed based on the historical data, and the heterogeneous information network comprises a meta path used for describing the relation between nodes; performing neighbor sampling and feature coding on nodes in the heterogeneous information network to obtain attribute features of each node; performing node-level attention aggregation on the attribute features to obtain feature vectors of target nodes on each element path; performing semantic-level attention aggregation on the feature vectors of the target nodes on the multiple meta-paths to obtain a final feature vector; and according to the final feature vector, predicting the preference probability of the user for calling various cloud APIs, and according to the preference probability, generating a cloud API recommendation list.
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 computing, and in particular to a cloud computing API recommendation method and device, an electronic device, and a readable storage medium. BACKGROUND

[0002] Cloud computing services are widely used due to their "on-demand purchase, take and use" characteristics, and a large number of enterprises implement cloud computing of infrastructure and business systems through cloud services. Cloud API (Application Programming Interface, API) is a core resource interface provided by cloud vendors, which supports users to conveniently manage cloud resources through programming and complete the full life cycle operation of resources. However, with the enrichment of cloud services, the number of cloud APIs published by various vendors has increased dramatically. It is extremely difficult for users to select products suitable for their own needs from numerous cloud APIs with different functions, and a large amount of time needs to be invested in browsing and comparing non-key information, resulting in low screening efficiency and high labor costs.

[0003] To improve user experience, the related art usually uses a collaborative filtering recommendation method to make recommendations based on the similarity of users or products, that is, if user A and user B have similar behaviors, the system will recommend the cloud API commonly used by user A to user B; or if a C-type cloud API is similar to a D-type cloud API, users interested in the C-type cloud API will also receive a recommendation of the D-type cloud API.

[0004] However, in actual applications, cloud APIs do not exist in isolation, and they have complex dependency relationships. The invocation of cloud APIs by users forms a certain network structure and works together to achieve a certain service. Moreover, different users have different preferences and focuses in using cloud APIs, and the collaborative filtering recommendation method cannot effectively capture the dependency relationships between cloud APIs and cannot accurately customize recommendations according to the individual behaviors of users, so the recommendation accuracy is limited in actual application scenarios. SUMMARY

[0005] The embodiments of the present application provide a cloud computing API recommendation method, device, electronic device, and readable storage medium, which can realize personalized recommendation of cloud APIs with complex strong dependency relationships.

[0006] In a first aspect, the present application discloses a cloud computing API recommendation method, which comprises: obtaining historical data of cloud API invocation and constructing a heterogeneous information network based on the historical data, wherein the heterogeneous information network comprises a meta-path for describing the relationship between nodes; performing neighbor sampling and feature encoding on the nodes in the heterogeneous information network to obtain attribute features of each node; performing node-level attention aggregation on the attribute features to obtain a feature vector of the target node on each meta-path; performing semantic-level attention aggregation on the feature vectors of the target nodes on multiple meta-paths to obtain a final feature vector; According to the final feature vector, the preference probability of the user for calling various cloud APIs is predicted, and a cloud API recommendation list is generated according to the preference probability.

[0007] Optionally, the heterogeneous information network includes multiple types of nodes and multiple types of edges, and the multiple types of nodes at least include user nodes, cloud API nodes, and label nodes, and the multiple types of edges at least include calling relationship edges between users and cloud APIs, dependency relationship edges between cloud APIs, and belonging relationship edges between cloud APIs and labels.

[0008] Optionally, the attribute features of the nodes in the heterogeneous information network are obtained by neighbor sampling and feature encoding, including: A random walk strategy with restart is adopted to sample based on the heterogeneous information network to obtain a set of heterogeneous neighbor nodes associated with the nodes; The nodes in the set of heterogeneous neighbor nodes are grouped by type to obtain multiple groups of homogeneous nodes; The attribute information of the nodes in each group of homogeneous nodes is encoded to obtain initial attribute features of the nodes; The initial attribute features are deeply aggregated to obtain the attribute features of the nodes.

[0009] Optionally, the attribute information of the nodes includes attribute information in text form; and the initial attribute features of the nodes are obtained by encoding the attribute information of the nodes in each group of homogeneous nodes, including: The attribute information in text form is encoded as a whole paragraph by a Paragraph2Vec model to obtain the initial attribute features of the nodes.

[0010] Optionally, the attribute information in text form is encoded as a paragraph by a Paragraph2Vec model to obtain the initial attribute features of the nodes, including: The paragraph is mapped to a paragraph vector by the Paragraph2Vec model, and the words in the paragraph are mapped to word vectors; The paragraph vector and the word vectors are combined to form a comprehensive feature vector; Based on the comprehensive feature vector, the prediction scores of each word in the vocabulary are calculated, and the prediction scores are converted to the probability of the target word by using an activation function; According to the probability of the target word, an average logarithmic probability of the target word appearing is calculated, and the Paragraph2Vec model is trained by maximizing the average logarithmic probability, so that the final paragraph vector is obtained as an initial attribute feature of the node.

[0011] Optionally, the initial attribute feature is deep aggregated to obtain an attribute feature of the node, including: The initial attribute feature is processed by a bidirectional long short-term memory network to obtain a forward hidden state sequence and a backward hidden state sequence; The forward hidden state sequence and the backward hidden state sequence are combined to obtain the attribute feature of the node, and the attribute feature of the node represents a deep dependency relationship between attributes.

[0012] Optionally, the attribute feature is aggregated by attention at a node level to obtain a feature vector of a target node on each meta-path, including: For each meta-path, the attribute features of nodes of the same type on the meta-path are mapped to the same feature space by a transformation matrix to obtain mapped node features, and the mapped node features include a target node feature and a neighbor node feature; According to the target node feature and the neighbor node feature, an attention weight of a neighbor node on the target node on the meta-path is calculated; According to the attention weight, the neighbor node features are weighted and summed, and are processed by an activation function to obtain a feature vector of the target node on the meta-path.

[0013] Optionally, according to the target node feature and the neighbor node feature, an attention weight of a neighbor node on the target node on the meta-path is calculated, including: The target node feature and the neighbor node feature are spliced to form a combined feature vector; The combined feature vector is multiplied by an attention vector of the meta-path to obtain an initial attention score, and the initial attention score is processed by a nonlinear activation to obtain an importance score of the neighbor node on the target node; The importance score is normalized to obtain the attention weight.

[0014] Optionally, the feature vectors of the target node on a plurality of meta-paths are aggregated by attention at a semantic level to obtain a final feature vector, including: According to the feature vector of the target node on the meta-path, a semantic importance weight of an edge is calculated; The semantic importance weight is normalized to obtain a semantic level weight coefficient of the edge; According to the semantic level weight coefficient of the edge, the feature vectors of the target nodes on each meta-path are weighted and summed to obtain the final feature vector.

[0015] Optionally, according to the feature vectors of the target nodes on the meta-path, the semantic importance weight of the edge is calculated, including: The feature vectors of the target nodes on the meta-path are linearly transformed and nonlinearly activated to obtain processed features. The processed features are dot multiplied with the semantic level attention vectors to obtain importance scores of the target nodes. The importance scores of all target nodes are averaged to obtain the semantic importance weight of the edge.

[0016] Optionally, according to the final feature vector, the preference probability of the user for calling each type of cloud API is predicted, including: The final feature vector is mapped to an output dimension corresponding to the number of cloud API categories through nonlinear transformation of a multilayer perceptron classifier. The result of the output dimension is converted into the preference probability of the user for calling each type of cloud API.

[0017] Optionally, the cloud computing API recommendation method is implemented based on a heterogeneous graph neural network model, and the heterogeneous graph neural network model includes a sampling encoding network, a bidirectional long short-term memory network, a first graph attention network, a second graph attention network, and a multilayer perceptron classifier. The nodes in the heterogeneous information network are neighbor sampled and feature encoded through the sampling encoding network and the bidirectional long short-term memory network to obtain attribute features of each node. The attribute features are node-level attention aggregated through the first graph attention network to obtain feature vectors of target nodes on each meta-path. The feature vectors of the target nodes on multiple meta-paths are semantically aggregated through the second graph attention network to obtain a final feature vector. The preference probability of the user for calling each type of cloud API is predicted according to the final feature vector through the multilayer perceptron, and a cloud API recommendation list is generated according to the preference probability.

[0018] In a second aspect, a cloud computing API recommendation device is disclosed, and the device includes: A network construction module is configured to obtain historical data of cloud API calling and construct a heterogeneous information network based on the historical data, wherein the heterogeneous information network includes meta-paths for describing relationships between nodes. The feature encoding module is used to perform neighbor sampling and feature encoding on the nodes in the heterogeneous information network to obtain the attribute features of each node; The node aggregation module is used to perform node-level attention aggregation on the attribute features to obtain the feature vector of the target node on each meta-path. The semantic aggregation module is used to perform semantic-level attention aggregation on the feature vectors of target nodes on multiple meta-paths to obtain the final feature vector. The recommendation prediction module is used to predict the probability of a user's preference for calling various cloud APIs based on the final feature vector, and generate a cloud API recommendation list based on the preference probability.

[0019] A third aspect of this application discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the cloud computing API recommendation method described in the first aspect of this application.

[0020] A fourth aspect of this application discloses a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the cloud computing API recommendation method described in the first aspect of this application. The embodiments of this application have the following advantages: In this embodiment of the application, by constructing a heterogeneous information network and using meta-paths to describe the complex relationships between nodes, it is possible to deeply explore the inherent strong dependencies between cloud APIs, thereby more accurately recommending API combinations that are closely related in function to users, significantly improving the relevance and usability of the recommendations.

[0021] By introducing a dual attention aggregation mechanism at both the node and semantic levels, the system can automatically learn and distinguish the differences in importance of different cloud APIs to a specific user. This allows the recommendation results to adaptively reflect the user's personal preferences and historical calling habits, prioritizing cloud APIs with higher importance and achieving truly customized recommendations, thus improving the accuracy of the recommendations.

[0022] For new users or newly launched cloud APIs, the lack of historical interaction data makes it difficult to provide effective recommendations. The method in this application leverages the structural characteristics of heterogeneous information networks, enabling the propagation and diffusion of limited information from new nodes (such as attributes and initial associations) throughout the network. This allows for effective inference of potential preferences, providing meaningful initial recommendations for new users or new cloud APIs and effectively alleviating the cold start problem.

[0023] In this way, by implementing automated and intelligent cloud API recommendations, the time cost and cognitive load for users to select and find suitable cloud APIs are significantly reduced, the application development and deployment process is accelerated, and the overall service efficiency and user satisfaction of the cloud computing platform are improved, thereby enhancing the platform's competitiveness. Attached Figure Description

[0024] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is a flowchart illustrating the steps of a cloud computing API recommendation method provided in an embodiment of this application. Figure 2 This is a schematic diagram of a heterogeneous information network provided in an embodiment of this application; Figure 3 This is a schematic diagram of a sampling and encoding heterogeneous information network provided in an embodiment of this application; Figure 4 This is a schematic diagram of an initial attribute feature aggregation provided in an embodiment of this application; Figure 5 This is a schematic diagram of a node-level aggregation of neighbor nodes provided in an embodiment of this application; Figure 6 This is a schematic diagram of a heterogeneous graph neural network model provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a cloud computing API recommendation device provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0026] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0027] To better understand the technical solution of this application, the technical concepts involved in this application will be briefly explained first.

[0028] HetGNN (Heterogeneous Graph Neural Network) is a type of heterogeneous graph neural network. The nodes in this network structure store rich information, aggregate the attribute features of neighboring nodes, and finally obtain the information to be predicted.

[0029] GAT (Graph Attention Networks) is a graph structure model that introduces an attention mechanism. In this model, the features of a node are only related to its neighboring nodes. By aggregating the features of neighboring nodes with different levels of attention, the features of the target node are output, thus enabling personalized recommendations.

[0030] In related technologies, the complex dependencies between cloud APIs and the different user preferences and focuses on cloud APIs are ignored, making it difficult to achieve accurate customized recommendations and limiting the accuracy of recommendations in practical application scenarios. To overcome the limitations of related technologies, embodiments of this application provide a cloud computing API recommendation method. This method not only makes recommendations based on common interface function descriptions, user preferences, and call frequency, but also takes into account the complex dependencies and attention mechanisms between cloud APIs, providing users with customized recommendation services, improving the accuracy and relevance of recommendations, ensuring user experience, and improving product service quality.

[0031] Reference Figure 1 As shown, Figure 1 This is a flowchart illustrating the steps of a cloud computing API recommendation method provided in an embodiment of this application. Figure 1 As shown, a cloud computing API recommendation method provided in this application embodiment may include steps S110 to S150: Step S110: Obtain historical data of cloud API calls and construct a heterogeneous information network based on the historical data, wherein the heterogeneous information network includes meta-paths for describing the relationships between nodes.

[0032] Specifically, historical data on cloud API calls over a specific period can be obtained from the cloud computing platform. This historical data reflects the usage of cloud APIs during that period. The historical data may include information such as user ID, cloud API ID, call time, and call frequency.

[0033] By preprocessing historical data of API calls (such as handling duplicate values, missing values, outliers, etc.), a heterogeneous information network with defined meta-paths is constructed.

[0034] like Figure 2As shown, the heterogeneous information network includes multiple types of nodes and multiple types of edges. The multiple types of nodes include at least user nodes, cloud API nodes, and tag nodes. The multiple types of edges include at least the call relationship edge between users and cloud APIs, the dependency relationship edge between cloud APIs, and the ownership relationship edge between cloud APIs and tags.

[0035] Furthermore, the relationships between nodes in this heterogeneous information network are described through meta-paths. For example, when a user calls a cloud API, the dependencies between cloud APIs and the cloud APIs are tagged with a specific label.

[0036] In this embodiment, considering that the current cloud API call situation not only depends on the API's own functional description and usage frequency, but also has a great deal to do with user preferences and the dependencies between cloud APIs, a heterogeneous information network is constructed by modeling a sufficient number of cloud API call situations (i.e., historical data of cloud API calls). This network includes multiple types of entities and relationships such as cloud APIs, users, dependencies, and API tags. Subsequently, cloud API recommendations are made based on this heterogeneous information network, which can deeply explore the inherent strong dependencies between cloud APIs and provide personalized recommendations for users.

[0037] Step S120: Perform neighbor sampling and feature encoding on the nodes in the heterogeneous information network to obtain the attribute features of each node.

[0038] Specifically, neighboring nodes are sampled on a heterogeneous information network at a target distance to obtain a set of heterogeneous neighboring nodes associated with the node. The attribute information of each node in the set of heterogeneous neighboring nodes is then feature-encoded to obtain the attribute features of each node. These attribute features can be static features, such as features related to the function description, parameter specifications, and user history of the cloud API; or dynamic features, such as features related to real-time user feedback (return value description) and the frequency of cloud API calls.

[0039] Step S130: Perform node-level attention aggregation on the attribute features to obtain the feature vector of the target node on each meta-path.

[0040] The node-level attention aggregation of the attribute features can be achieved through a graph attention network. For each meta-path in the heterogeneous information network, feature learning is performed in the graph neural network. For the current target node (such as a specific user or a cloud API to be recommended), the feature vector of the target node on the meta-path is obtained by fixing the node type on the meta-path and aggregating the attribute features of its neighboring nodes of the same type based on attention.

[0041] By performing node-level attention aggregation on attribute features, the attribute features of neighboring nodes with high importance will have a greater impact on the results. Therefore, it is possible to learn the diverse feature representations of the target node in different semantic contexts along different meta-paths. In other words, it automatically learns the importance of different cloud APIs to ensure that personalized recommendations can be made for users, which are more in line with users' calling habits and improve the accuracy of recommendations.

[0042] Step S140: Perform semantic-level attention aggregation on the feature vectors of target nodes on multiple meta-paths to obtain the final feature vector.

[0043] After step S130, each target node obtains the attribute features of multiple neighboring nodes of the same type. In step S140, the feature vectors of the target nodes on multiple meta-paths are further fused. Similar to node-level aggregation, this step also adopts an attention mechanism. By evaluating the importance of different meta-paths (edges) themselves, the feature vectors of the target nodes on multiple meta-paths are aggregated according to their importance to obtain the final feature vector.

[0044] For example, if a user's historical behavior indicates that the meta-path of "behavior of similar users" is more important than "cloud API dependency", then the former will be assigned a higher weight. All target nodes on the meta-path will be merged according to their respective importance weights to obtain a comprehensive and integrated final feature vector. This vector deeply integrates the multi-dimensional and multi-semantic information of the target nodes in the network.

[0045] Step S150: Based on the final feature vector, predict the user's preference probability for calling various cloud APIs, and generate a cloud API recommendation list based on the preference probability.

[0046] Specifically, the final feature vector can be input into a prediction model (e.g., a multilayer perceptron classifier). This model maps the high-dimensional feature vector to all candidate cloud APIs, outputting a preference probability value for each API. This value represents the predicted likelihood that the target user will call that cloud API. Finally, by sorting the preference probabilities of various cloud APIs, the top K cloud APIs with the highest probabilities are selected to form the final personalized recommendation list, which is then presented to the user.

[0047] The technical solution adopted in this application constructs a heterogeneous information network and utilizes meta-paths to describe the complex relationships between nodes. This allows for in-depth mining of the inherent strong dependencies between cloud APIs, thereby more accurately recommending functionally related API combinations to users, significantly improving the relevance and usability of the recommendations. By introducing a dual attention aggregation mechanism at the node and semantic levels, it can automatically learn and distinguish the differences in importance of different cloud APIs to specific users. This enables the recommendation results to adaptively reflect users' personal preferences and historical calling habits, prioritizing cloud APIs with higher importance to users, achieving truly customized recommendations and improving the accuracy of the recommendations.

[0048] For new users or newly launched cloud APIs, effective recommendations are difficult to make due to a lack of historical interaction data. The method in this application leverages the structural characteristics of heterogeneous information networks, enabling the propagation and diffusion of limited information from new nodes (such as attributes and initial associations) throughout the network. This allows for effective inference of potential preferences, providing meaningful initial recommendations for new users or new cloud APIs and effectively alleviating the cold start problem. Thus, by achieving automated and intelligent cloud API recommendations, this method significantly reduces the time cost and cognitive load for users to filter and find suitable cloud APIs, accelerates application development and deployment processes, and ultimately improves the overall service efficiency and user satisfaction of the cloud computing platform, enhancing its competitiveness.

[0049] The following sections provide a detailed explanation of the cloud computing API recommendation method implemented in this application, specifically Section 1.1 Neighbor Sampling and Feature Encoding, Section 1.2 Aggregating Neighbor Nodes at the Node Level, Section 1.3 Aggregating Neighbor Nodes at the Semantic Level, and Section 1.4 Generating Recommendation Results.

[0050] 1.1 Neighbor sampling and feature encoding: In an optional embodiment, step S120 above, "performing neighbor sampling and feature encoding on nodes in the heterogeneous information network to obtain the attribute features of each node," specifically includes sub-steps S120-1 to S120-4: Step S120-1: Using a random walk strategy with restart, sampling is performed based on the heterogeneous information network to obtain a set of heterogeneous neighbor nodes associated with the node.

[0051] Based on the heterogeneous information network, a random walk with restart strategy is used for neighbor sampling. Specifically, for each node, after executing the random walk with restart strategy, all nodes appearing in the walk path are collected to form an initial neighbor pool. Duplicate nodes in the initial neighbor pool are removed, and unique neighbor node identifiers are retained. Then, based on the shortest path distance between the neighbor node and the node, neighbors within the target distance (e.g., 3 hops) are selected, and finally, a set of heterogeneous neighbor nodes associated with the node is obtained.

[0052] Step S120-2: Group the nodes in the heterogeneous neighbor node set according to type to obtain multiple groups of nodes of the same type.

[0053] Specifically, nodes of the same type are grouped together. For example, a user type node group contains all neighboring nodes of the user type; a cloud API type node group contains all neighboring nodes of the cloud API type; and a tag type node group contains all neighboring nodes of the tag type.

[0054] Step S120-3: Encode the attribute information of nodes in each group of nodes of the same type to obtain the initial attribute features of the nodes.

[0055] The node's attribute information includes textual attributes (such as cloud API descriptions and user profiles) and non-textual attributes (such as numeric types and tag categories). Different encoding methods are used for different types of attribute information; for example, cloud API descriptions can be encoded using a paragraph encoding model, and numeric types can be encoded using a normalized method.

[0056] like Figure 3 As shown, Figure 3 This is a schematic diagram of a sampling and encoding heterogeneous information network provided in an embodiment of this application. The nodes in the sampled heterogeneous neighbor node set are grouped by type to obtain multiple groups of nodes of the same type. The attribute information of the nodes in each group of nodes of the same type is encoded to obtain the initial attribute features of the nodes. The attribute features of the nodes can be static features, such as features related to the function description, parameter description, and user history behavior of cloud APIs. The attribute features of the nodes can also be dynamic features, such as features related to real-time user feedback (return value description) and the call frequency of cloud APIs.

[0057] In some embodiments, the attribute information of the node includes attribute information in text form; encoding the attribute information of nodes in each group of similar nodes to obtain the initial attribute features of the node includes: using the Paragraph2Vec model to encode the attribute information in text form as a whole paragraph to obtain the initial attribute features of the node.

[0058] The text-based attribute information can include: cloud API function description documents, which detail the API's functions, parameters, return values, etc.; cloud API version update notes, which describe the function changes and optimizations in each version; user feedback, i.e., user evaluations and suggestions on the use of the cloud API; and API technical documentation, which includes usage examples, best practices, and other technical content.

[0059] The Paragraph2Vec model is a paragraph encoding model used to generate vector representations of sentences, paragraphs, or documents, capturing the semantic information of the text. It encodes attribute information in text form to obtain initial attribute features for nodes, which represent the semantics of the attribute information in the text.

[0060] Specifically, using the Paragraph2Vec model, the attribute information in text form is encoded as a paragraph to obtain the initial attribute features of the node, including: Step A1: Map the paragraph to a paragraph vector using the Paragraph2Vec model, and map the words in the paragraph to word vectors.

[0061] In this system, a paragraph is composed of words, and the entire paragraph is mapped to a unique paragraph vector, denoted as D. Each word in the paragraph is mapped to its corresponding word vector; that is, the word vector corresponding to a word can be obtained by looking up the word vector table. .

[0062] Step A2: Combine the paragraph vector and the word vector to form a comprehensive feature vector.

[0063] Specifically, a comprehensive feature vector can be obtained by averaging the paragraph vector and word vector. The comprehensive feature vector is a vector that integrates global information of the paragraph and local information of the context.

[0064] Step A3: Based on the comprehensive feature vector, calculate the prediction score of each word in the vocabulary, and use an activation function to convert the prediction score into the probability of the target word; For example, the prediction score of a word It can be represented as:

[0065] in, This represents the composite feature vector, where b and U are softmax parameters, b represents the bias term, and U represents the weight matrix.

[0066] The probability of a target word can be expressed as:

[0067] in, Indicates in a given paragraph and context words Below, the target words are The probability of; Indicate target words The predicted score, This represents the sum of the prediction scores for all words.

[0068] Step A4: Calculate the average log probability of the target word based on its probability, and train the Paragraph2Vec model by maximizing the average log probability. Use the resulting paragraph vector as the initial attribute feature of the node.

[0069] For example, the average log probability of the occurrence of a target word can be expressed as:

[0070] Where N represents the number of words.

[0071] The training objective of the Paragraph2Vec model is to maximize the probability of the target word. This is achieved by using the average log probability of the target word as the objective function. The Paragraph2Vec model is trained by maximizing this average log probability, specifically by adjusting the paragraph vector D, all word vectors, and parameters U and b. After training, the resulting paragraph vectors are used as the initial attribute features of the nodes.

[0072] Thus, encoding attribute information in text form using the Paragraph2Vec model effectively preserves the complete semantics of the attribute information and the meaning of words in specific technical contexts. This provides powerful text semantic understanding capabilities for cloud API recommendations and is a key technological support for achieving accurate personalized recommendations.

[0073] Step S120-4: Perform deep aggregation on the initial attribute features to obtain the attribute features of the nodes.

[0074] In this embodiment, a node may have multiple types of attribute information. For example, the attribute information of a cloud API node may include text descriptions (e.g., functional documentation), numerical information (e.g., call frequency, cost, version number, etc.), and category tags (e.g., the service category it belongs to). By deeply aggregating the initial attribute features corresponding to the node, unified, fixed-dimensional attribute features are obtained.

[0075] In some embodiments, the initial attribute features are subjected to deep aggregation to obtain the attribute features of the nodes, including: Step S120-4-1: Process the initial attribute features through a bidirectional long short-term memory network to obtain the forward hidden state sequence and the backward hidden state sequence; Step S120-4-2: Combine the forward hidden state sequence and the backward hidden state sequence to obtain the attribute features of the node, wherein the attribute features of the node represent the deep dependency relationship between attributes.

[0076] like Figure 4 As shown, after encoding the node's attribute information using an encoding model (such as the Paragraph2Vec model), a Bidirectional Long Short-Term Memory (Bi-LSTM) network is used to deeply aggregate the initial attribute features to obtain the node's attribute features. The Bi-LSTM network has a powerful ability to capture complex dependencies in the input data and can learn the intrinsic relationships between different attributes. For example, it might learn that "when the 'computing' category label and a description containing the keyword 'GPU' appear simultaneously, the features of this cloud API should be more strongly emphasized towards high-performance computing." Furthermore, Bi-LSTM can scan the data simultaneously from front to back and from back to front, thus capturing the contextual relationships between all attribute information more comprehensively.

[0077] Specifically, first, each initial attribute feature can be preprocessed and dimension aligned by a fully connected neural network; then, the processed initial attribute features are input into a bidirectional long short-term memory network for processing to obtain a forward hidden state sequence and a backward hidden state sequence; next, the forward hidden state sequence and the backward hidden state sequence are concatenated; and all concatenation results are summed or averaged to obtain the attribute features of the node.

[0078] For example, the attribute characteristics of node v It can be represented as:

[0079] in, Represents a set of nodes. This represents a fully connected neural network. This indicates a combination operation (concatenation operation). Represents the Long Short-Term Memory network. This represents the i-th initial attribute feature.

[0080] The technical solution adopted in this application maintains semantic relevance to the target node while ensuring sampling diversity through a random walk strategy with restart; and it effectively captures complex relationships between nodes through a deep aggregation mechanism. Thus, this solution has good adaptability to different types of nodes and relationships, and therefore can achieve personalized recommendations for cloud APIs with complex and strongly dependent relationships.

[0081] 1.2 Aggregate neighbor nodes at the node level: In an optional embodiment, step S130 above, "performing node-level attention aggregation on the attribute features to obtain the feature vector of the target node on each meta-path," may specifically include steps S130-1 to S130-3: Step S130-1: For each meta-path, the attribute features of nodes of the same type on the meta-path are mapped to the same feature space through a transformation matrix to obtain the mapped node features. The mapped node features include: target node features and neighbor node features.

[0082] In heterogeneous information networks, the attribute features of different nodes are usually of different dimensions, making direct attention computation impossible. By introducing type-specific transformation matrices, a unified feature representation space is established for nodes of the same type on each meta-path, providing a reliable input foundation for subsequent attention computation. Specifically, for each meta-path, the target node and its neighboring nodes are identified, and an independent trainable transformation matrix is ​​assigned to each node. The attribute features of the nodes are then projected onto the same dimensional space through matrix multiplication. This operation ensures that the attribute features of nodes from different sources and with different semantics can be compared and calculated on the same scale, laying the foundation for the accurate calculation of attention weights.

[0083] For example, for node i, the mapped node features It can be represented as:

[0084] in, Represents the transformation matrix. This represents the feature vector of node i.

[0085] Step S130-2: Calculate the attention weights of the neighboring nodes on the metapath to the target node based on the target node features and the neighboring node features.

[0086] An attention mechanism is used to dynamically evaluate the importance of different neighbor nodes to the target node, so as to obtain the attention weights of neighbor nodes to the target node on the metapath.

[0087] Optionally, based on the target node features and the neighbor node features, the attention weights of the neighbor nodes on the meta-path to the target node are calculated, including: Step S130-2-1: Concatenate the target node features with the neighbor node features to form a combined feature vector; Step S130-2-2: Multiply the combined feature vector with the attention vector of the meta-path to obtain the initial attention score, and perform nonlinear activation processing on the initial attention score to obtain the importance score of the neighboring nodes to the target node. Step S130-2-3: Normalize the importance score to obtain the attention weight.

[0088] In this context, the weights of two nodes i and j (i being the target node and j being a neighbor node) on a metapath Φ are shared, and the importance score of neighbor node j to target node i is... The expression is:

[0089] in, This represents node attention. This represents the initial attention score; `||` is the sigmoid activation function (used for non-linear activation of the initial attention score), and `||` is the concatenation operation. The attention vector representing the meta-path. Representing the characteristics of neighboring nodes, This represents the characteristics of the target node.

[0090] Attention weights of neighboring nodes to the target node on the metapath It can be expressed as:

[0091] in, The function is used to normalize the importance score.

[0092] Understandably, based on the attention weights of neighboring nodes to the target node on the metapath, it is possible to automatically identify which neighboring nodes are more important for the representation learning of the target node under a specific semantic relationship (metapath), so as to ensure that personalized recommendations can be made for users.

[0093] Step S130-3: Based on the attention weights, the features of the neighboring nodes are weighted and summed, and then processed by an activation function to obtain the feature vector of the target node on the metapath.

[0094] Specifically, the features of the target node are weighted according to the attention weight of each neighbor node to the target node, and the features of important neighbors will receive greater weight. Then, the features of all weighted neighbors are summed and a nonlinear transformation is introduced through an activation function (such as the sigmoid activation function) to finally generate the feature vector of the target node on the metapath.

[0095] For example, the feature vector of the target node on the metapath. It can be represented as:

[0096] The attention-weighted aggregation method ensures that the feature vectors of target nodes on the metapath retain information about important neighbors while reducing interference from unimportant neighbors, thus obtaining more discriminative node representations.

[0097] like Figure 5 As shown, when aggregating neighbor nodes at the node level, we can use a graph attention network (GAT) to calculate the attention weights of neighbor nodes on each metapath to the target node. Then, based on the attention weights, we can perform a weighted summation of the features of the neighbor nodes and process them through an activation function to obtain the feature vector of the target node on the metapath.

[0098] The technical solution adopted in this application dynamically evaluates the importance of neighboring nodes under different semantic relationships through an attention mechanism, achieving accurate relationship perception. Weighted aggregation using attention weights enhances the discriminative power of the generated node features. Furthermore, the attention weights provide interpretable evidence for the recommendation results, clearly demonstrating which neighboring nodes have a key impact on the final recommendation, thus improving the transparency and credibility of the recommendation system. In this way, the method provides strong technical support for accurate recommendations using cloud computing APIs through deep learning and intelligent aggregation of node features.

[0099] 1.3 Aggregating neighbor nodes at the semantic level: In an optional embodiment, step S140 above, "performing semantic-level attention aggregation on the feature vectors of target nodes on multiple meta-paths to obtain the final feature vector," may specifically include steps S140-1 to S140-3: Step S140-1: Calculate the semantic importance weight of the edges based on the feature vectors of the target nodes on the metapath.

[0100] The semantic importance weights of edges quantify the contribution of different meta-paths to the representation of the target node. In heterogeneous information networks, each meta-path represents a specific semantic relationship (such as a dependency-based path, a functional similarity-based path, etc.), but different semantic relationships have different importance to the final recommendation task. Semantic-level attention operations are used on the feature vectors of target nodes along multiple meta-paths to calculate the semantic importance weights of edges. Optionally, the semantic importance weight of the edge is calculated based on the feature vector of the target node on the metapath, including: performing linear transformation and nonlinear activation processing on the feature vector of the target node on the metapath to obtain processed features; performing a dot product operation on the processed features and the semantic level attention vector to obtain the importance score of the target node; and averaging the importance scores of all target nodes to obtain the semantic importance weight of the edge.

[0101] The linear transformation and nonlinear activation processing of the feature vectors of the target nodes on the meta-path can be achieved by: inputting the feature vectors of the target nodes on each meta-path into a shared fully connected layer for feature transformation, mapping the features to a unified semantic space; and introducing nonlinear transformation through the hyperbolic tangent activation function (tanh) to enhance the expressive power of the model and obtain the processed features.

[0102] For example, the edge semantic importance weight It can be represented as:

[0103] Where q represents the semantic-level attention vector. b and b represent the weight matrix and bias term of the linear transformation, respectively.

[0104] Step S140-2: Normalize the semantic importance weights to obtain the semantic level weight coefficients of the edges.

[0105] Specifically, the semantic importance weights are normalized using the softmax function to obtain the semantic level weight coefficients of the edges. ,Right now:

[0106] By normalizing the semantic importance weights, they are transformed into a standardized probability distribution. Since the semantic importance weights of different edges fall within different numerical ranges, directly using them could lead to some edges excessively dominating the aggregation process. The softmax function is used to normalize the semantic importance weights. This function amplifies the differences in semantic importance weights through exponential transformation while ensuring that the sum of the semantic level weight coefficients of all edges is 1, forming a reasonable probability distribution. This process not only guarantees the comparability of the semantic importance weights of each edge but also more clearly focuses on important semantic relationships, effectively suppressing interference from noisy paths.

[0107] Step S140-3: Based on the semantic level weight coefficient of the edge, the feature vectors of the target nodes on each meta-path are weighted and summed to obtain the final feature vector.

[0108] Specifically, the feature vector of the target node on each meta-path is multiplied by its corresponding semantic weight coefficient, and then all weighted feature vectors are summed. This weighted summation operation is essentially an attention-guided feature selection mechanism, giving greater weight to the feature vectors of important semantic paths, making them dominant in the final feature vector; while the feature vectors of less important semantic paths contribute less. The final generated feature vector integrates complementary information from multiple semantic perspectives, providing a comprehensive and accurate node representation for downstream recommendation tasks.

[0109] For example, the final feature vector can be represented as:

[0110] Where P represents the number of edges. This represents the semantic level weight coefficient of the i-th edge.

[0111] The technical solution of this application adopts an attention mechanism to automatically adjust the importance of different edges, increase the weight of edges with high contribution rates, and reduce the weight of meaningless edges, so as to ensure that the final features can fully reflect the characteristics of nodes under different semantic relationships, thereby obtaining customized recommendation information based on the final feature vector.

[0112] 1.4 Generate recommendation results: In an optional embodiment, step S150 above, "predicting the user's preference probability for calling various cloud APIs based on the final feature vector," specifically includes: mapping the final feature vector to an output dimension corresponding to the number of cloud API categories through a nonlinear transformation of a multilayer perceptron classifier; and converting the result of the output dimension into the user's preference probability for calling various cloud APIs.

[0113] The final feature vector contains key information and contextual relationships from the cloud API documentation. It is used as input to a multilayer perceptron (MLP) classifier. Through the nonlinear transformation of the MLP, the final feature vector is mapped to the predicted probability of the category label to obtain the predicted value, which is the probability of the user's preference for calling various cloud APIs.

[0114] Finally, by ranking the preference probabilities of various cloud APIs, the top K cloud APIs with the highest probabilities are selected to form the final personalized recommendation list, which is then presented to the user. This achieves personalized recommendations for cloud APIs with complex and strong dependencies.

[0115] In one optional embodiment, the cloud computing API recommendation method is implemented based on a heterogeneous graph neural network model, such as... Figure 6 As shown, the heterogeneous graph neural network model includes: a sampling encoding network, a bidirectional long short-term memory network, a first graph attention network, a second graph attention network, and a multilayer perceptron classifier.

[0116] Specifically, the sampling coding network and the bidirectional long short-term memory network are used to perform neighbor sampling and feature encoding on nodes in the heterogeneous information network to obtain the attribute features of each node; the first graph attention network is used to perform node-level attention aggregation on the attribute features to obtain the feature vector of the target node on each meta-path; the second graph attention network is used to perform semantic-level attention aggregation on the feature vectors of the target nodes on multiple meta-paths to obtain the final feature vector; the multilayer perceptron classifier predicts the user's preference probability for calling various cloud APIs based on the final feature vector, and generates a cloud API recommendation list based on the preference probability.

[0117] Specifically, both the first and second graph attention networks are GAT networks. Neighbor sampling and feature encoding are performed on nodes in the heterogeneous information network using the sampling encoding network and the bidirectional long short-term memory network. The specific process is as follows: the sampling encoding network samples the heterogeneous information network to obtain a set of heterogeneous neighbor nodes associated with each node; the nodes in the heterogeneous neighbor node set are grouped by type to obtain multiple groups of similar nodes; the attribute information of the nodes in each group of similar nodes is encoded to obtain the initial attribute features of the nodes. The bidirectional long short-term memory network performs deep aggregation on the initial attribute features to obtain the attribute features of the nodes.

[0118] In practical implementation, historical data on cloud API calls from multiple different users can be obtained from open datasets (i.e., historical cloud API call data). The cloud APIs must be of different types and labels. A heterogeneous information network dataset is then constructed based on this historical cloud API call data to train a heterogeneous graph neural network model (HetGNN-GAT). Specifically, the input from the heterogeneous information network dataset is imported into the heterogeneous graph neural network model, hyperparameters are configured, and forward propagation is performed. Finally, a loss function is defined, backpropagation is performed, hyperparameters are updated, and the heterogeneous graph neural network model is optimized. Finally, based on the trained heterogeneous graph neural network model, user demand for cloud APIs is predicted, enabling accurate cloud API recommendations. Highly relevant cloud APIs are also recommended to users, reducing labor costs and thus improving the service quality and user satisfaction of the cloud vendor's platform.

[0119] The heterogeneous graph neural network model provided in this application can solve the problem of complex dependencies between cloud APIs. Based on specific types of edges between cloud API nodes constructed in a heterogeneous information network, and applying an attention mechanism, it automatically learns and adjusts the contribution level of each node, increasing the weight of edges with high contribution rates and reducing the weight of meaningless edges, thereby obtaining customized recommendation information. Simultaneously, the heterogeneous graph neural network model also solves the cold start problem caused by the lack of historical interaction information. It utilizes the entity relationship network to diffuse limited information throughout the network, enabling a certain degree of recommendation even when data is insufficient.

[0120] This application also provides a cloud computing API recommendation device, referring to... Figure 7 As shown, Figure 7 This is a schematic diagram of a cloud computing API recommendation device provided in an embodiment of this application. The device includes: The network construction module 710 is used to obtain historical data of cloud API calls and construct a heterogeneous information network based on the historical data, wherein the heterogeneous information network includes meta-paths for describing the relationships between nodes; The feature encoding module 720 is used to perform neighbor sampling and feature encoding on the nodes in the heterogeneous information network to obtain the attribute features of each node; The node aggregation module 730 is used to perform node-level attention aggregation on the attribute features to obtain the feature vector of the node target on each meta-path. The semantic aggregation module 740 is used to perform semantic-level attention aggregation on the feature vectors of target nodes on multiple meta-paths to obtain the final feature vector. The recommendation prediction module 750 is used to predict the probability of a user's preference for calling various cloud APIs based on the final feature vector, and generate a cloud API recommendation list based on the preference probability.

[0121] In some optional embodiments, the heterogeneous information network includes multiple types of nodes and multiple types of edges. The multiple types of nodes include at least user nodes, cloud API nodes, and tag nodes. The multiple types of edges include at least call relationship edges between users and cloud APIs, dependency relationship edges between cloud APIs, and ownership relationship edges between cloud APIs and tags.

[0122] In some optional embodiments, the feature encoding module includes: The sampling module is used to perform sampling based on the heterogeneous information network using a random walk strategy with restart, to obtain a set of heterogeneous neighbor nodes associated with the node; The grouping module is used to group the nodes in the heterogeneous neighbor node set according to their type, resulting in multiple groups of nodes of the same type; The encoding module is used to encode the attribute information of nodes in each group of similar nodes to obtain the initial attribute features of the nodes. The aggregation module is used to perform deep aggregation on the initial attribute features to obtain the attribute features of the nodes.

[0123] In some optional embodiments, the attribute information of the node includes attribute information in text form; the encoding module is further configured to: use the Paragraph2Vec model to encode the attribute information in text form as a whole paragraph to obtain the initial attribute features of the node.

[0124] In some optional embodiments, the encoding module is further configured to: The Paragraph2Vec model maps the paragraphs to paragraph vectors and the words in the paragraphs to word vectors. The paragraph vector and the word vector are combined to form a comprehensive feature vector; Based on the comprehensive feature vector, the predicted score of each word in the vocabulary is calculated, and the prediction score is converted into the probability of the target word using an activation function; Based on the probability of the target word, the average log probability of the target word is calculated, and the Paragraph2Vec model is trained by maximizing the average log probability. The resulting paragraph vector is then used as the initial attribute feature of the node.

[0125] In some optional embodiments, the aggregation module is further configured to: The initial attribute features are processed by a bidirectional long short-term memory network to obtain the forward hidden state sequence and the backward hidden state sequence; The forward hidden state sequence and the backward hidden state sequence are combined to obtain the attribute features of the node, and the attribute features of the node represent the deep dependencies between attributes.

[0126] In some optional embodiments, the node aggregation module is further configured to: For each meta-path, the attribute features of nodes of the same type on the meta-path are mapped to the same feature space through a transformation matrix to obtain the mapped node features. The mapped node features include: target node features and neighbor node features. Based on the target node features and the neighbor node features, calculate the attention weights of the neighbor nodes on the metapath to the target node; Based on the attention weights, the features of the neighboring nodes are weighted and summed, and then processed by an activation function to obtain the feature vector of the target node on the metapath.

[0127] In some optional embodiments, the node aggregation module is further configured to: The target node features are concatenated with the neighbor node features to form a combined feature vector; The combined feature vector is multiplied by the attention vector of the meta-path to obtain an initial attention score, and the initial attention score is subjected to nonlinear activation processing to obtain the importance score of the neighboring nodes to the target node. The importance score is normalized to obtain the attention weight.

[0128] In some optional embodiments, the semantic aggregation module is further configured to: Calculate the semantic importance weight of the edges based on the feature vectors of the target nodes on the metapath; The semantic importance weights are normalized to obtain the semantic level weight coefficients of the edges; Based on the semantic level weight coefficients of the edges, the feature vectors of the target nodes on each metapath are weighted and summed to obtain the final feature vector.

[0129] In some optional embodiments, the semantic aggregation module is further configured to: The feature vectors of the target nodes on the metapath are subjected to linear transformation and nonlinear activation processing to obtain the processed features; The processed features are multiplied by the semantic-level attention vector to obtain the importance score of the target node. The semantic importance weight of an edge is obtained by averaging the importance scores of all target nodes.

[0130] In some optional embodiments, the recommendation prediction module is further configured to: The final feature vector is mapped to the output dimension corresponding to the number of cloud API categories through the nonlinear transformation of the multilayer perceptron classifier. The results of the output dimensions are converted into probabilities of user preferences for calling various cloud APIs.

[0131] It is understood that the cloud computing API recommendation device in this application embodiment can implement the cloud computing API recommendation method in the above embodiment. The cloud computing API recommendation device and the cloud computing API recommendation method have the same advantages over the prior art, and will not be repeated here.

[0132] This application also provides an electronic device, see embodiments thereof. Figure 8 , Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. For example... Figure 8 As shown, the electronic device 800 includes a memory 810 and a processor 820. The memory 810 and the processor 820 are connected via a bus for communication. The memory 810 stores a computer program that can run on the processor 820 to implement the steps of the cloud computing API recommendation method described in the embodiments of this application.

[0133] This application also provides a readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the cloud computing API recommendation method described in this application.

[0134] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the cloud computing API recommendation method described in this application.

[0135] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0136] This application describes embodiments of methods and apparatus according to flowchart illustrations and / or block diagrams. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0137] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing terminal equipment to cause a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0138] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0139] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0140] The foregoing has provided a detailed description of a cloud computing API recommendation method, apparatus, electronic device, and readable storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A cloud computing API recommendation method, characterized in that, The method includes: Obtain historical data of cloud API calls and construct a heterogeneous information network based on the historical data, wherein the heterogeneous information network includes meta-paths for describing the relationships between nodes; Neighbor sampling and feature encoding are performed on the nodes in the heterogeneous information network to obtain the attribute features of each node; Node-level attention aggregation is performed on the attribute features to obtain the feature vector of the target node on each meta-path; Semantic-level attention aggregation is performed on the feature vectors of target nodes on multiple meta-paths to obtain the final feature vector; Based on the final feature vector, predict the probability of user preference for calling various cloud APIs, and generate a cloud API recommendation list based on the preference probability.

2. The method according to claim 1, characterized in that, The heterogeneous information network includes multiple types of nodes and multiple types of edges. The multiple types of nodes include at least user nodes, cloud API nodes, and tag nodes. The multiple types of edges include at least the call relationship edge between users and cloud APIs, the dependency relationship edge between cloud APIs, and the ownership relationship edge between cloud APIs and tags.

3. The method according to claim 1, characterized in that, Neighbor sampling and feature encoding are performed on the nodes in the heterogeneous information network to obtain the attribute features of each node, including: A random walk strategy with restart is adopted, and sampling is performed based on the heterogeneous information network to obtain a set of heterogeneous neighbor nodes associated with the node; The nodes in the heterogeneous neighbor node set are grouped by type to obtain multiple groups of nodes of the same type; Encode the attribute information of nodes in each group of similar nodes to obtain the initial attribute features of the nodes; The initial attribute features are then deeply aggregated to obtain the attribute features of the nodes.

4. The method according to claim 3, characterized in that, The node's attribute information includes text-based attribute information; the attribute information of nodes in each group of similar nodes is encoded to obtain the node's initial attribute features, including: The Paragraph2Vec model is used to encode the attribute information in text form as a whole paragraph to obtain the initial attribute features of the node.

5. The method according to claim 4, characterized in that, Using the Paragraph2Vec model, the attribute information in text form is encoded as a paragraph to obtain the initial attribute features of the nodes, including: The Paragraph2Vec model maps the paragraphs to paragraph vectors and the words in the paragraphs to word vectors. The paragraph vector and the word vector are combined to form a comprehensive feature vector; Based on the comprehensive feature vector, the predicted score of each word in the vocabulary is calculated, and the prediction score is converted into the probability of the target word using an activation function; Based on the probability of the target word, the average log probability of the target word is calculated, and the Paragraph2Vec model is trained by maximizing the average log probability. The resulting paragraph vector is then used as the initial attribute feature of the node.

6. The method according to claim 3, characterized in that, The initial attribute features are deeply aggregated to obtain the attribute features of the nodes, including: The initial attribute features are processed by a bidirectional long short-term memory network to obtain the forward hidden state sequence and the backward hidden state sequence; The forward hidden state sequence and the backward hidden state sequence are combined to obtain the attribute features of the node, and the attribute features of the node represent the deep dependencies between attributes.

7. The method according to claim 1, characterized in that, Node-level attention aggregation is performed on the attribute features to obtain the feature vector of the target node on each meta-path, including: For each meta-path, the attribute features of nodes of the same type on the meta-path are mapped to the same feature space through a transformation matrix to obtain the mapped node features. The mapped node features include: target node features and neighbor node features. Based on the target node features and the neighbor node features, calculate the attention weights of the neighbor nodes on the metapath to the target node; Based on the attention weights, the features of the neighboring nodes are weighted and summed, and then processed by an activation function to obtain the feature vector of the target node on the metapath.

8. The method according to claim 7, characterized in that, Based on the target node features and the neighbor node features, calculate the attention weights of the neighbor nodes on the metapath to the target node, including: The target node features are concatenated with the neighbor node features to form a combined feature vector; The combined feature vector is multiplied by the attention vector of the meta-path to obtain an initial attention score, and the initial attention score is subjected to nonlinear activation processing to obtain the importance score of the neighboring nodes to the target node. The importance score is normalized to obtain the attention weight.

9. The method according to claim 1, characterized in that, Semantic-level attention aggregation is performed on the feature vectors of target nodes on multiple meta-paths to obtain the final feature vector, including: Calculate the semantic importance weight of the edges based on the feature vectors of the target nodes on the metapath; The semantic importance weights are normalized to obtain the semantic level weight coefficients of the edges; Based on the semantic level weight coefficients of the edges, the feature vectors of the target nodes on each metapath are weighted and summed to obtain the final feature vector.

10. The method according to claim 9, characterized in that, Based on the feature vectors of the target nodes on the metapath, the semantic importance weights of the edges are calculated, including: The feature vectors of the target nodes on the metapath are subjected to linear transformation and nonlinear activation processing to obtain the processed features; The processed features are multiplied by the semantic-level attention vector to obtain the importance score of the target node. The semantic importance weight of an edge is obtained by averaging the importance scores of all target nodes.

11. The method according to claim 1, characterized in that, Based on the final feature vector, predict the probability of user preference for calling various cloud APIs, including: The final feature vector is mapped to the output dimension corresponding to the number of cloud API categories through the nonlinear transformation of the multilayer perceptron classifier. The results of the output dimensions are converted into probabilities of user preferences for calling various cloud APIs.

12. The method according to claim 1, characterized in that, The cloud computing API recommendation method is implemented based on a heterogeneous graph neural network model, which includes: a sampling encoding network, a bidirectional long short-term memory network, a first graph attention network, a second graph attention network, and a multilayer perceptron classifier. In this process, the sampling coding network and the bidirectional long short-term memory network are used to perform neighbor sampling and feature encoding on the nodes in the heterogeneous information network to obtain the attribute features of each node. The attribute features are aggregated at the node level by the first graph attention network to obtain the feature vector of the target node on each meta-path. The second graph attention network performs semantic-level attention aggregation on the feature vectors of target nodes on multiple meta-paths to obtain the final feature vector. The multilayer perceptron classifier predicts the probability of a user's preference for calling various cloud APIs based on the final feature vector, and generates a cloud API recommendation list based on the preference probability.

13. A cloud computing API recommendation device, characterized in that, The device includes: A network construction module is used to acquire historical data of cloud API calls and construct a heterogeneous information network based on the historical data, wherein the heterogeneous information network includes meta-paths for describing the relationships between nodes; The feature encoding module is used to perform neighbor sampling and feature encoding on the nodes in the heterogeneous information network to obtain the attribute features of each node; The node aggregation module is used to perform node-level attention aggregation on the attribute features to obtain the feature vector of the node target on each meta-path. The semantic aggregation module is used to perform semantic-level attention aggregation on the feature vectors of target nodes on multiple meta-paths to obtain the final feature vector. The recommendation prediction module is used to predict the probability of a user's preference for calling various cloud APIs based on the final feature vector, and generate a cloud API recommendation list based on the preference probability.

14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the cloud computing API recommendation method according to any one of claims 1-12.

15. A readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the cloud computing API recommendation method according to any one of claims 1-12.