High-order connectivity guided diffusion co-calibration cloud api recommendation method, device and medium
Patent Information
- Application Number
- CN202611065678.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-17
- Publication Date
- 2026-10-13
AI Technical Summary
1、抑制了辅助内容信息中的任务无关噪声:将内容表示校准建模为扩散潜在空间中的去噪过程,并利用历史调用关系所反映的协同信号引导反向去噪,使校准内容表示更符合实际调用偏好。
Smart Images

Figure CN122903692A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent software development technology, and in particular to a method, apparatus and medium for recommending cloud APIs based on high-order connectivity-guided diffusion-coordinated calibration. Background Technology
[0002] With the continued development of cloud computing and service-oriented software development paradigms, cloud APIs have become a crucial infrastructure for modern application development. Enterprises and organizations encapsulate data, algorithms, and business capabilities into remotely accessible cloud APIs and provide developers with standardized calling interfaces through open platforms. Developers can call and combine multiple cloud APIs as needed to build applications with customized functionality.
[0003] As the cloud API ecosystem expands, platforms like ProgrammableWeb, ShowAPI, and RapidAPI aggregate a large number of reusable cloud APIs. When faced with a multitude of candidate cloud APIs with similar functionalities, developers need to repeatedly search, compare, and filter, leading to cloud API overload and significantly increasing application development costs. To alleviate this problem, cloud API recommendation technology is used to filter out cloud APIs with a higher probability of being called from the candidate cloud API set based on application needs.
[0004] Among existing cloud API recommendation methods, collaborative filtering is widely used due to its efficiency and versatility. Early methods typically used matrix factorization to map applications and cloud APIs into a shared latent space to predict application preferences for cloud API calls. With the development of graph neural network technology, graph-based collaborative filtering models such as NGCF and LightGCN capture collaborative signals in higher-order connectivity by performing multi-hop neighborhood aggregation on the application-cloud API interaction graph. Other methods introduce hypergraph structures to characterize higher-order collaborative relationships between multiple nodes. Collaborative filtering methods are heavily reliant on historical interaction data. When the observed interactions between applications and cloud APIs are sparse, the model struggles to learn high-quality node representations. In the cloud API ecosystem, most applications only call a small number of cloud APIs, making sparse interactions a common phenomenon. Under sparse interaction conditions, relying solely on the interaction graph for representation learning can easily lead to insufficient representation of the target application's preferences, thus reducing the accuracy of the recommendation results.
[0005] To mitigate the lack of supervision caused by sparse interactions, existing methods typically introduce auxiliary content information associated with applications and cloud APIs, such as text descriptions, tags, service provider information, category information, and related metadata. One type of method constructs additional relationship structures based on attributes to supplement interaction signals, while another type transfers collaborative knowledge to content representations by aligning content representations with collaborative representations. However, auxiliary content information is not always relevant to the recommendation task. Some cloud APIs lack service provider or category attributes, excessive tags introduce redundant content, and text descriptions written by different developers or service providers vary in writing style and granularity, and may also contain promotional content unrelated to core functionality. If the original auxiliary content is directly input into the recommendation model, the model may treat task-irrelevant semantics as valid semantics, weakening its ability to capture true call preferences.
[0006] Therefore, how to supplement interaction signals with auxiliary content information related to the recommendation task and suppress task-irrelevant noise in the auxiliary content information when interaction data is sparse, so as to improve the accuracy and robustness of cloud API recommendations, has become an urgent problem to be solved in this field. Summary of the Invention
[0007] This application provides a method, apparatus, and medium for high-order connectivity-guided diffusion-cooperative calibration of cloud API recommendations. By utilizing first-order and high-order connectivity in the application-cloud API interaction graph as structured cooperative conditions, it guides the auxiliary content representation to perform reverse denoising calibration in the diffusion potential space, thereby suppressing task-irrelevant noise in the auxiliary content information and improving the accuracy and robustness of cloud API recommendations under interaction sparsity conditions.
[0008] In a first aspect, this application provides a high-order connectivity-guided diffusion-coordinated calibration cloud API recommendation method, the method comprising: Obtain historical call relationship data between the application and the cloud API, as well as auxiliary content information of the application and the cloud API, and construct an application-cloud API interaction graph based on the historical call relationship data; The application-cloud API interaction graph and the auxiliary content information are respectively feature-encoded to obtain the collaborative representation and content representation of the application and cloud API, respectively. Extract the first-order and higher-order connectivity of application nodes and cloud API nodes from the application-cloud API interaction graph to generate connectivity representations corresponding to different hop counts; The content representation and the connectivity representation are mapped to a shared diffusion potential space. Forward noise processing is performed on the potential content representation corresponding to the content representation. In the reverse denoising process, the connectivity representation is used as a structured cooperative condition. The association between the structured cooperative condition and the noisy content representation is determined by cross attention. The noisy content representation is iteratively denoised according to the association to obtain the calibrated content representation of the application and cloud API. The collaborative representation and the calibration content representation are compared and learned to constrain the consistency between the collaborative representation and the calibration content representation; Based on the collaborative representation, the fusion amount of the calibration content representation is controlled by a gating mechanism to obtain the final representation of the application and cloud API; A predicted score is calculated based on the final representation of the target application and the final representation of the candidate cloud APIs, and the recommended cloud API for the target application is determined based on the predicted score.
[0009] In one possible design, an application-cloud API interaction graph is constructed based on the historical call relationship data, including: Let the application set be The cloud API collection is The observation interaction set is ,in For application sets, For cloud API collection, It is a Cartesian product. For the number of applications, This refers to the number of cloud APIs. , and They are the 1st, 2nd and 3rd respectively. One application, , and They are the 1st, 2nd and 3rd respectively. A cloud API, Indicates application I have called the cloud API. ; Get each application Auxiliary content information and each cloud API Auxiliary content information The auxiliary content information includes text descriptions, tags, service provider information, and related metadata; According to the observation interaction set Application Building - Cloud API Two-Part Interaction Diagram ,in For a set of nodes, Let be the set of edges. , .
[0010] In one possible design, feature encoding is performed on the application-cloud API interaction graph and the auxiliary content information respectively to obtain the collaborative representation and content representation of the application and cloud API, including: Retrieve the initial ID embedding matrix of the application and cloud API from the embedding lookup table: in, For the initial ID embedding matrix of the application and cloud API, and The first application and the second application, respectively. Initial ID embedding for each application, and The first cloud API and the second Embed the initial ID of each cloud API; The initial ID embedding matrix is input into a two-branch feature encoder containing an interaction branch and a content branch. The interaction branch uses a LightGCN encoder. Layer propagation is as follows: in, and Representing applications respectively HeYun API The set of first-order neighbors, and Representing applications respectively In the Layer and first Layer embedding representation, and They represent cloud APIs respectively. In the Layer and first Layer embedding representation; After completion After layer propagation, the representations of each layer are aggregated to obtain the application. Collaborative representation and cloud API Collaborative representation : in, l For the propagation layer index of the LightGCN encoder, This represents the propagation layer number of the LightGCN encoder; The auxiliary content information is preprocessed to obtain the initial content feature vector: in, For application The initial content feature vector, This is a preprocessing function for content information on the application side. For application Supplementary content information, For cloud API The initial content feature vector, This is a preprocessing function for content information on the cloud API side. For cloud API Supplementary content information; The content branch uses a two-layer feedforward neural network as a content encoder, and the application is obtained through the content encoder. Content representation HeYun API Content representation : in, , , , , , , , For learnable parameters, For the real number field, d For embedded dimensions, o m This serves as the initial content feature dimension for the application. o a For the initial content feature dimensions of the cloud API, This represents a non-linear activation function.
[0011] In one possible design, the first-order and higher-order connectivity of application nodes and cloud API nodes are extracted from the application-cloud API interaction graph to generate connectivity representations corresponding to different hop counts, including: Determine the application First-order reachable neighbor set : in, For application Any cloud API in the set of first-order reachable neighbors; for Recursively determine the target node Jump reachable neighbor set, and in determining When a neighbor is reachable by hop, the target node itself is excluded. Jumpable Neighbor Set for: in, To differentiate from the target application Other applications, For from application collection Exclude target application The resulting application set For application The Jump-reachable neighbor set; make Indicates application and Jump to Neighbor The length between is The number of walks is determined using a counting-aware multi-hot encoding function. Generate application of Jump connectivity representation : in, u For application of Jump to reach your neighbor. For application and Jump to Neighbor The length between is The number of walks, H The maximum number of hops to consider for connectivity extraction; Generate cloud APIs in the same way of Jump connectivity representation .
[0012] In one possible design, the ways to obtain the calibration content representation of the application and the cloud API include: Application Content representation HeYun API Content representation Mapped to respectively Dimensional potential content representation: in, , Represents a learnable projection function; , , and These are learnable parameters; For application Potential content representation, For cloud API Potential content representation; Map the connectivity representations of different hop counts to respectively: 3D structured collaborative conditions: in, , Indicates the first Jump connectivity represents the corresponding learnable projection function; and These are the learnable parameters corresponding to the application side. and These are the learnable parameters corresponding to the cloud API side; Indicates application The Skip structured collaborative conditions. Indicates cloud API The Skip structured collaborative conditions; by As an application The initial potential content is represented at the diffusion time. Inject Gaussian noise according to the following formula: in, , , For diffusion time Noise scheduling parameters, For diffusion time The noise content is represented as follows: For application The initial potential content representation at diffusion time 0, Gaussian noise sampled from a standard Gaussian distribution, It has a mean of 0 and a covariance matrix that is the identity matrix. The standard Gaussian distribution; Application The Skip to structured collaborative conditions and diffusion time Noise content representation Expanded to matrix: in, For application The The matrix obtained after the jump structured cooperative condition expansion. For application At the diffusion moment The noise content is represented by the expanded matrix. For the first The learnable extension vector corresponding to the jump structured collaborative condition. The noise content is represented by the corresponding learnable expansion vector. T It is the transpose operator; With the first The skip structured collaborative condition is used as the query, and the noise content is used as the key and value to determine them respectively: ; ; in, For the first Skip the query matrix corresponding to the structured collaborative conditions. For diffusion time The noise content represents the corresponding key matrix. For diffusion time The noise content is represented by the corresponding value matrix. These are the learnable projection matrices corresponding to the query matrix, key matrix, and value matrix, respectively. The first is obtained according to the following formula. Skip-structured collaborative conditional guided cross-attention representation: in, For the first Skip-structured collaborative conditional guided cross-attention representation. For normalized exponential functions, It is the transpose operator; For applications , No. The prediction result of the content representation in the reverse denoising process is as follows: in, Indicates the first The fusion weights corresponding to the order of collaboration conditions. Represents a nonlinear transformation function. Indicates application In the The content representation obtained by prediction during the reverse denoising process; After the reverse denoising process is completed, the application The final calibration result is denoted as ; Calculate cloud APIs in the same way The calibration content indicates .
[0013] In one possible design, comparative learning is performed on the cooperative representation and the calibration content representation to constrain the consistency between the cooperative representation and the calibration content representation, including: The collaborative representation and calibration content representation of the same node are used as positive sample pairs, and the representations of other nodes are used as negative samples to calculate the contrast loss on the application side. : in, It's a temperature parameter. This indicates the calculation of cosine similarity, and the contrast loss on the cloud API side is calculated in the same way. The overall comparative loss was obtained. .
[0014] In one possible design, based on the collaborative representation, the fusion amount of the calibration content representation is controlled through a gating mechanism to obtain the final representation of the application and cloud API, including: Utilizing gated residual connection fusion applications The collaborative representation and calibration content representation are obtained. The final expression : in, This represents a vector concatenation operation. This represents element-wise multiplication. and For learnable parameters, This is a gate vector used to control the injection intensity of the calibration content representation; The cloud API was calculated in the same way. The final expression .
[0015] In one possible design, a prediction score is calculated based on the final representation of the target application and the final representation of the candidate cloud APIs, and the cloud API recommendation result corresponding to the target application is determined based on the prediction score, including: Calculate the target application according to the following formula. The final representation of the candidate cloud API The inner product between the final representations yields the predicted score. : in, For application The final expression, Candidate cloud APIs The final representation; Using a target content representation prediction method, the diffusion loss is calculated separately for the application side and the cloud API side: in, For application-side diffusion loss, Indicates about the application diffusion time and Gaussian noise Expectations For cloud API side diffusion loss, Indicates information about cloud APIs diffusion time and Gaussian noise Expectations For application The initial potential content representation, For application In the The content representation obtained by prediction during the reverse denoising process. For cloud API The initial potential content representation, For cloud API In the The content representation obtained by prediction during the reverse denoising process. For diffusion loss; By employing Bayesian personalized ranking loss, the combination of applications with observed call relationships and cloud APIs achieves a higher prediction score than the combination without observed relationships. in, To train the set of triples, For the set of unobserved call relationships, For the observed call relationships, The regularization coefficient is . These are the learnable parameters for the recommendation model.
[0016] Combined with comparative loss The overall training objective of building the recommendation model is: in, These are the weighting coefficients for diffusion loss. Weighting coefficients for comparison losses; Minimize the overall training objective through backpropagation. Update the learnable parameters in the recommendation model; The candidate cloud APIs are sorted in descending order according to the predicted scores, and the top-k cloud APIs are selected as the recommended results.
[0017] Secondly, this application provides a high-order connectivity-guided diffusion-coordinated calibration cloud API recommendation device, the device comprising: The data acquisition module is configured to acquire historical call relationship data between the application and the cloud API, as well as auxiliary content information of the application and the cloud API, and construct an application-cloud API interaction graph based on the historical call relationship data. The dual-branch feature encoding module is configured to encode the features of the application-cloud API interaction graph and the auxiliary content information respectively, so as to obtain the collaborative representation and content representation of the application and the cloud API respectively. The higher-order connectivity extraction module is configured to extract the first-order and higher-order connectivity of application nodes and cloud API nodes from the application-cloud API interaction graph, and generate connectivity representations corresponding to different hop counts. The diffusion calibration module is configured to map the content representation and the connectivity representation to a shared diffusion latent space, perform forward noise addition on the latent content representation corresponding to the content representation, and in the reverse denoising process, use the connectivity representation as a structured cooperative condition, determine the association between the structured cooperative condition and the noisy content representation through cross attention, and iteratively denoise the noisy content representation according to the association to obtain the calibration content representation of the application and cloud API. The contrastive learning module is configured to perform contrastive learning on the collaborative representation and the calibration content representation to constrain the consistency between the collaborative representation and the calibration content representation; The gated fusion module is configured to use the collaborative representation as the base representation and control the fusion amount of the calibration content representation through a gating mechanism to obtain the final representation of the application and cloud API; The recommendation prediction module is configured to calculate a prediction score based on the final representation of the target application and the final representation of the candidate cloud APIs, and determine the cloud API recommendation result corresponding to the target application based on the prediction score.
[0018] Thirdly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the high-order connectivity-guided diffusion collaborative calibration cloud API recommendation method as described in the first aspect and various possible designs of the first aspect.
[0019] The high-order connectivity-guided diffusion-coordinated calibration cloud API recommended method, apparatus, and medium provided in this application have at least the following beneficial effects: 1. Suppresses task-irrelevant noise in auxiliary content information: The content representation calibration is modeled as a denoising process in the diffusion potential space, and the cooperative signal reflected by the historical call relationship is used to guide the reverse denoising, so that the calibrated content representation is more in line with the actual call preferences.
[0020] 2. Explicit utilization of multi-order collaborative structures is realized: first-order and higher-order connectivity are extracted separately, connectivity representations are generated based on reachable neighbors with different hop counts and walk counts, and cross-attention is used as a structured collaborative condition to introduce into the reverse denoising process, providing hierarchical collaborative guidance for content representation calibration.
[0021] 3. Enhanced consistency and discriminativeness of node representations: Through contrastive learning, the collaborative representation and calibration content representation of the same node are used as positive sample pairs, and the representations of other nodes are used as negative samples, thereby enhancing the consistency between collaborative representation and calibration content representation and improving the discriminativeness between different node representations.
[0022] 4. Improved recommendation accuracy and robustness: Using collaborative representation as the basic representation, the injection strength of the calibration content representation is adaptively controlled through an asymmetric gating mechanism. This reduces the interference of noisy content while preserving historical call preferences, resulting in more accurate and stable cloud API recommendations. Attached Figure Description
[0023] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0024] Figure 1 A flowchart illustrating a high-order connectivity-guided diffusion-coordinated calibration cloud API recommendation method provided in this application embodiment; Figure 2 A schematic diagram of the overall structure of a high-order connectivity-guided diffusion-coordinated calibration cloud API recommendation method provided in this application embodiment; Figure 3 A schematic diagram of the extraction and connectivity encoding process of first-order and higher-order reachable neighbors provided in the embodiments of this application; wherein, (a) is the application-cloud API interaction diagram; (b) is the first-order reachable neighbor of application m1; (c) is the second-order reachable neighbor of application m1; and (d) is the third-order reachable neighbor of application m1. Figure 4 This is a structural diagram of a high-order connectivity-guided diffusion collaborative calibration cloud API recommendation device provided in an embodiment of this application.
[0025] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this application to those skilled in the art through reference to specific embodiments. Detailed Implementation
[0026] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0027] The collection, storage, use, processing, transmission, provision, and disclosure of relevant data and information in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0028] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.
[0029] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0030] This application provides a method for recommending cloud APIs based on high-order connectivity-guided diffusion-based collaborative calibration, such as... Figure 1 and Figure 2 As shown, the recommended method for the high-order connectivity-guided diffusion-coordinated calibration cloud API includes the following steps S10-S70.
[0031] S10: Obtain historical call relationship data between the application and the cloud API, as well as auxiliary content information of the application and the cloud API, and construct the application-cloud API interaction graph based on the historical call relationship data.
[0032] In some embodiments, step S10 specifically includes the following steps S101-S103.
[0033] S101: Obtain the applications, cloud APIs, and their historical call relationships within the target cloud API ecosystem.
[0034] Let the application set be The cloud API collection is The observation interaction set is ,in For application sets, For cloud API collection, It is a Cartesian product. For the number of applications, This refers to the number of cloud APIs. , and They are the 1st, 2nd and 3rd respectively. One application, , and They are the 1st, 2nd and 3rd respectively. A cloud API, Indicates application I have called the cloud API. ; Each record in the observed interaction set corresponds to a single cloud API call that has already occurred, representing the application's actual call preferences for the cloud API. Application-cloud API combinations that do not appear in the observed interaction set are considered unobserved call relationships.
[0035] S102: Obtain auxiliary content information from the application and cloud API.
[0036] Get each application Auxiliary content information and each cloud API Auxiliary content information The auxiliary content information includes text descriptions, tags, service provider information, and related metadata; The auxiliary content information can include structured discrete attributes and unstructured text information. Structured discrete attributes include categories, tags, and service providers; unstructured text information includes application requirement descriptions and cloud API function descriptions. The auxiliary content information is used to semantically characterize the application's functional requirements and the cloud API's service capabilities.
[0037] S103: Construct a two-part interaction diagram of the application-cloud API based on the observation interaction set.
[0038] According to the observation interaction set Application Building - Cloud API Two-Part Interaction Diagram ,in For a set of nodes, Let be the set of edges. , ; In the application-cloud API interaction graph, application nodes and cloud API nodes are connected via historical call edges. This interaction graph is used both to learn collaborative representations and to subsequently extract connectivity at different hop counts.
[0039] S20: Perform feature encoding on the application-cloud API interaction graph and auxiliary content information respectively to obtain the collaborative representation and content representation of the application and cloud API.
[0040] In some embodiments, step S20 employs a dual-branch feature encoder that includes an interaction branch and a content branch to learn the collaborative representation and content representation of the application and the cloud API, respectively, specifically including the following steps S201 and S202.
[0041] S201: Learn the collaborative representation of the application and the cloud API using interactive branches.
[0042] First, obtain the initial ID embedding matrix of the application and cloud API from the embedding lookup table: in, For the initial ID embedding matrix of the application and cloud API, and The first application and the second application, respectively. Initial ID embedding for each application, and The first cloud API and the second The initial ID embedding of a cloud API is used to uniquely identify the corresponding application node or cloud API node and serves as the initial node representation for neighborhood propagation in the interaction branch.
[0043] This embodiment uses LightGCN as the collaborative filtering encoder for the interaction branch. For the first... Layered propagation: application nodes aggregate information from the cloud API nodes they directly connect to, and cloud API nodes aggregate information from the application nodes they directly connect to. in, , This represents the propagation layer number of the LightGCN encoder. and Representing applications respectively In the Layer and first Layer embedding representation, and They represent cloud APIs respectively. In the Layer and first The layer's embedding representation; the first-order neighbor sets on the application side and the cloud API side represent the set of cloud APIs directly connected to the target application and the set of applications directly connected to the target cloud API, respectively. The neighborhood normalization coefficient is used to reduce the impact of different node degrees on the aggregation result.
[0044] Finish After layer propagation, the initial representation and the representations of each propagation layer are aggregated to obtain a collaborative representation of the application and the cloud API: Collaboration means learning from historical call relationships, which can reflect the application's actual cloud API call preferences and the potential collaborative relationships between cloud APIs.
[0045] S202: Utilize content branches to learn the content representation of applications and cloud APIs.
[0046] The auxiliary content information is preprocessed. Single-valued category features are encoded using one-hot encoding, multi-labeled category features are encoded using multi-hot encoding, and unstructured text information is extracted using a pre-trained Sentence-BERT model to extract semantic vectors. The initial content feature vector is obtained based on the preprocessing function. in, For application The initial content feature vector, This is a preprocessing function for content information on the application side. For application Supplementary content information, For cloud API The initial content feature vector, This is a preprocessing function for content information on the cloud API side. For cloud API Supplementary content information; Different types of auxiliary content are preprocessed and converted into a unified vector form. The application-side preprocessing function and the cloud API-side preprocessing function can be set separately according to the attribute type and original dimension on both sides.
[0047] The content branch uses a two-layer feedforward neural network as a content encoder to obtain the content representation of the application and the content representation of the cloud API. in, , , , , , , , For learnable parameters, For the real number field, d For embedded dimensions, o m This serves as the initial content feature dimension for the application. o a σ represents the initial content feature dimension of the cloud API, and σ denotes a non-linear activation function. The content representation is used to preserve semantic information in application requirements and cloud API service capabilities, but the uncalibrated content representation may contain noise irrelevant to the recommendation task.
[0048] S30: Extract the first-order and higher-order connectivity of application nodes and cloud API nodes from the application-cloud API interaction graph, and generate connectivity representations corresponding to different hop counts.
[0049] In some embodiments, step S30 explicitly extracts first-order and higher-order connectivity from the application-cloud API interaction graph and generates connectivity representations based on reachable neighbors with different hop counts and walk counts, specifically including the following steps S301-S303.
[0050] S301: Determine the set of first-order reachable neighbors of the target node.
[0051] Determine the application First-order reachable neighbor set: in, For application Any cloud API in the set of first-order reachable neighbors.
[0052] An application's first-order reachable neighbors are the cloud APIs that the application directly calls, and the cloud API's first-order reachable neighbors are the applications that directly call that cloud API. First-order reachable neighbors directly reflect the observed calling preferences.
[0053] S302: Recursively determine the set of higher-order reachable neighbors of the target node.
[0054] for Recursively determine the target node Jump reachable neighbor set, and in determining Exclude the target node itself when jumping to reachable neighbors: in, To differentiate from the target application Other applications, For from application collection Exclude target application The resulting application set For application The Jump to reachable neighbor set.
[0055] like Figure 3 As shown, for application nodes, even-hop reachable neighbors are other application nodes connected via hops of the corresponding length, while odd-hop reachable neighbors are cloud API nodes connected via hops of the corresponding length; the reachable neighbor types for cloud API nodes are the opposite. Two-hop neighbors can reflect applications with similar call records, and three-hop neighbors can reflect potentially related cloud APIs called by these similar applications.
[0056] S303: Generate a connectivity representation based on reachable neighbors with different hop counts and walk counts.
[0057] make Indicates application and Jump to Neighbor The length between is The number of walks is determined using a counting-aware multi-hot encoding function. Generate application of Jump connectivity representation: in, u For application of Jump to reach your neighbor. For application and Jump to Neighbor The length between is The number of walks, H The maximum number of hops to consider for connectivity extraction; In the same way, cloud API of Jump connectivity is represented as: in, For cloud API of Jump to reachable neighbor set, For cloud API and Jump to Neighbor The length between is The number of walks, H The maximum number of hops considered for connectivity extraction.
[0058] The counting-aware multi-hot encoding function writes the number of hops between the target node and each reachable neighbor into the corresponding neighbor positions, sets the other positions to zero, and then normalizes it using the total number of hops. The connectivity representations of different hop numbers retain the structural semantics of the corresponding order, avoiding excessive mixing of cooperative signals of different orders in the unified propagation representation.
[0059] S40: Map the content representation and connectivity representation to a shared diffusion latent space, perform forward denoising and reverse denoising guided by structured cooperative conditions, and obtain a calibrated content representation.
[0060] In some embodiments, step S40 maps the content representation and connectivity representation to a shared diffusion potential space, performs forward denoising on the potential content representation corresponding to the content representation, and in the reverse denoising process, uses the connectivity representation as a structured collaboration condition, determines the association between the structured collaboration condition and the noisy content representation through cross attention, and iteratively denoises the noisy content representation according to the association to obtain the calibrated content representation of the application and cloud API, specifically including the following steps S401-S403.
[0061] S401: Map content representations and connectivity representations with different hop counts to a shared diffusion potential space.
[0062] Application Content representation HeYun API Content representation Mapped to respectively Dimensional potential content representation: in, , This represents a learnable projection function. , , and These are learnable parameters; For application Potential content representation, For cloud API Potential content representation; Map the connectivity representations of different hop counts to respectively: 3D structured collaborative conditions: in, , Indicates the first Jump connectivity represents the corresponding learnable projection function. and These are the learnable parameters corresponding to the application side. and These are the learnable parameters corresponding to the cloud API side; Indicates application The Skip structured collaborative conditions. Indicates cloud API The Skip structured collaborative conditions; Since the content representation and the connectivity representation with different hop counts have different original dimensions and semantic spaces, this embodiment sets learnable projection functions to map them to potential representations with the same dimensions so as to enable conditional interaction during the diffusion process.
[0063] S402: Perform forward noise addition on the potential content representation.
[0064] by As an application The initial potential content is represented at the diffusion time. Inject Gaussian noise according to the following formula: in, , , For diffusion time Noise scheduling parameters, For diffusion time The noise content is represented as follows: For application The initial potential content representation at diffusion time 0, Gaussian noise sampled from a standard Gaussian distribution, It has a mean of 0 and a covariance matrix that is the identity matrix. The standard Gaussian distribution is used. Noise scheduling parameters control the amount of Gaussian noise injected at each diffusion time step. As the diffusion time increases, the latent content representation gradually transforms into a state with a higher noise level, enabling the model to learn to recover the target content representation from different noise levels. The same forward noise addition method is used on the cloud API side.
[0065] S403: Using connectivity representations with different hop counts as structured cooperative conditions to guide inverse denoising.
[0066] Application The Skip to structured collaborative conditions and diffusion time Noise content representation Expanded to matrix: in, For application The The matrix obtained after the jump structured cooperative condition expansion. For application At the diffusion moment The noise content is represented by the expanded matrix. For the first The learnable extension vector corresponding to the jump structured collaborative condition. The noise content is represented by the corresponding learnable expansion vector. T It is the transpose operator; With the first Using the skip structured collaborative condition as the query, and the noise content as the key and value, respectively, the following is determined: ; ; in, For the first Skip the query matrix corresponding to the structured collaborative conditions. For diffusion time The noise content represents the corresponding key matrix. For diffusion time The noise content is represented by the corresponding value matrix. These are the learnable projection matrices corresponding to the query matrix, key matrix, and value matrix, respectively. The first is obtained according to the following formula. Skip-structured collaborative conditional guided cross-attention representation: in, For the first Skip-structured collaborative conditional guided cross-attention representation. For normalized exponential functions, It is the transpose operator; Cross attention with the first The skip structured collaborative condition is used as a query, with the noise content representation at the current diffusion time as the key and value. This enables the collaborative condition of the corresponding order to select potential content information that is relevant to the actual calling preferences and suppress content components that are irrelevant to the recommendation task.
[0067] For applications , No. The prediction result of the content representation in the reverse denoising process is as follows: in, Indicates application In the The content representation obtained by prediction during the reverse denoising process; Indicates the first The fusion weights corresponding to the order-cooperative conditions are used to measure the relative contribution of different order-cooperative signals to inverse denoising. This represents the nonlinear transformation function. After the inverse denoising process is completed, it is applied... The final calibration result is denoted as .
[0068] For cloud APIs , No. The prediction result of the content representation in the reverse denoising process is as follows: in, Indicates cloud API In the The content representation obtained by prediction during the reverse denoising process. Indicates the first The fusion weights corresponding to the order-coordination conditions are defined, and the meanings of the remaining symbols are the same as those on the application side described above. After the reverse denoising process is completed, the cloud API... The final calibration result is denoted as .
[0069] The fusion weights corresponding to different hop counts are used to measure the relative contribution of each order of collaborative signal to the current inverse denoising step. After completing all inverse denoising steps, the calibrated content representations for the application and cloud API are obtained respectively. During training, a target content representation prediction method can be adopted, with the mean square error between the latent content representation and the corresponding prediction result used as a diffusion training constraint.
[0070] S50: Comparative learning is performed on the cooperative representation and the calibration content representation to constrain the consistency between the cooperative representation and the calibration content representation.
[0071] In some embodiments, the collaborative representation and calibration content representation of the same node are used as positive sample pairs, and the representations of other nodes in the collaborative view and calibration content view are used as negative samples to calculate the application-side contrast loss: in, This is a temperature parameter shared by both the application side and the cloud API side. This indicates the calculation of cosine similarity.
[0072] The comparison loss on the cloud API side is: in, Indicates the number of cloud APIs. and They represent cloud APIs respectively. The collaborative representation and calibration content representation, and They represent cloud APIs respectively. The collaborative representation and calibration content representation, This is a temperature parameter shared by both the application side and the cloud API side. This indicates the calculation of cosine similarity.
[0073] The overall comparative loss is: Contrastive learning brings the collaborative representations and calibrated content representations of the same node closer to each other in the latent space, while keeping the representations of different nodes further apart, thereby enhancing the consistency between different representation views and the discriminability between different nodes.
[0074] S60: Based on collaborative representation, it controls the fusion amount of calibration content representation through a gating mechanism to obtain the final representation of application and cloud API.
[0075] In some embodiments, the final representation of the application is obtained by fusing the collaborative representation and calibration content representation of the application using gated residual connections: in, This represents a vector concatenation operation. This indicates element-wise multiplication. and These are learnable parameters. This is a gating vector used to control the injection intensity of the calibration content representation. Similarly, the cloud API is obtained. The final expression .
[0076] Asymmetric gated fusion uses collaborative representation as the basic representation and leverages gated vectors to control the injection strength of calibration content representations dimension by dimension. This allows task-related semantic information to supplement sparse interaction signals while avoiding excessive interference from content information with preferences learned from real-world call behavior.
[0077] S70: Calculate the prediction score based on the final representation of the target application and the final representation of the candidate cloud APIs, and determine the cloud API recommendation result corresponding to the target application based on the prediction score.
[0078] In some embodiments, step S70 specifically includes the following steps S701-S703.
[0079] S701: Calculate the predicted score between the target application and the candidate cloud API.
[0080] Calculate the target application according to the following formula. The final representation of the candidate cloud API The inner product between the final representations yields the predicted score. : in, For application The final expression, Candidate cloud APIs The final representation.
[0081] S702: Training the cloud API recommendation model.
[0082] Using a target content representation prediction method, the diffusion loss is calculated separately for the application side and the cloud API side: in, For application-side diffusion loss, Indicates about the application diffusion time and Gaussian noise Expectations For cloud API side diffusion loss, Indicates information about cloud APIs diffusion time and Gaussian noise Expectations For application The initial potential content representation, For application In the The content representation obtained by prediction during the reverse denoising process. For cloud API The initial potential content representation, For cloud API In the The content representation obtained by prediction during the reverse denoising process. This is due to the loss from diffusion.
[0083] By employing Bayesian personalized ranking loss, the combination of applications with observed call relationships and cloud APIs achieves a higher prediction score than the combination without observed relationships. in, To train the set of triples, For the set of unobserved call relationships, For the observed call relationships, The regularization coefficient is . These are the learnable parameters for the recommendation model.
[0084] Combined with the overall contrast loss obtained in step S50 The overall training objective of building the recommendation model is: in, These are the weighting coefficients for diffusion loss. To compare the weight coefficients of the loss, the overall training objective is minimized through backpropagation. Update the learnable parameters in the recommendation model.
[0085] S703: Rank and recommend candidate cloud APIs.
[0086] For the target application, calculate its predicted score with each candidate cloud API, sort them from highest to lowest predicted score, and select the top-ranked applications. The candidate cloud APIs were selected as the recommended results.
[0087] This embodiment collects data from two real cloud API ecosystems, ProgrammableWeb and Huawei AppGallery, and constructs the PWA dataset and HGA dataset respectively. Both datasets contain historical call relationships between applications and cloud APIs, as well as corresponding auxiliary content information, and their statistical characteristics are shown in Table 1.
[0088] Table 1 Statistical characteristics of PWA and HGA datasets
[0089] In this embodiment, the observed call relationships in each dataset are randomly divided into training, validation, and test sets in an 8:1:1 ratio. The model is trained using the Adam optimizer, with a batch size of 128, an embedding dimension of 64, and a diffusion step of 5. To evaluate the recommendation performance, this embodiment uses Recall@K, NDCG@K, F1-score, and AUC as evaluation metrics. Recall@K measures the proportion of the top K recommendations that cover the actual cloud API calls; NDCG@K further considers the ranking position of the recommendation results based on relevance; F1-score comprehensively measures precision and recall; and AUC measures the model's ability to rank observed call relationships before unobserved call relationships.
[0090] To fully verify the effectiveness of the method in this application, this embodiment compares its performance with 14 representative baseline methods: (1) BPR-MF uses matrix factorization to learn the latent representation of the application and cloud API, and utilizes Bayesian personalized ranking loss to optimize the recommendation order.
[0091] (2) NGCF captures cooperative signals contained in higher-order connectivity by propagating node embeddings on the application-cloud API interaction graph.
[0092] (3) LightGCN removes feature transformation and nonlinear activation on the basis of NGCF, and only retains the neighborhood aggregation process to learn collaborative representation.
[0093] (4) DHCF, which models the high-order collaborative relationship between the application side and the cloud API side through a dual-channel hypergraph structure.
[0094] (5) HCCF captures higher-order collaborative dependencies beyond local call relationships by learning adaptive hypergraph structures.
[0095] (6)MCCLK enhances collaborative representation learning by introducing semantic and structural information from knowledge graphs.
[0096] (7) CCFCRec learns co-embedding based on content features and improves content representation by utilizing co-occurrence co-embedding signals between cloud APIs.
[0097] (8) LSRCC, through cross-view representation learning, integrates text description, tags and historical call information to achieve long-tail cloud API recommendation.
[0098] (9) LHGCL constructs a heterogeneous hypergraph based on historical call relationships and various auxiliary attributes, and uses lightweight heterogeneous hypergraph comparative learning to capture high-order dependencies between applications and cloud APIs.
[0099] (10)MGCL, using auxiliary content information to model the functional complementarity and semantic association between the application and the cloud API respectively.
[0100] (11)MDCL, through multi-level contrastive learning, ensures that the content representation and collaborative representation of cloud API remain consistent at different levels.
[0101] (12) DiffRec models the recommendation process as an iterative denoising process, and restores the call probability by reverse denoising the disturbed historical interaction vector.
[0102] (13) CF-Diff introduces higher-order connectivity into a diffusion-based collaborative filtering process to learn richer collaborative signals.
[0103] (14) CoDMR uses a diffusion model to denoise the auxiliary relation features and uses the denoised auxiliary features to enhance collaborative filtering.
[0104] Table 2 presents the performance comparison results of the method in this application (denoted as Our) and all baseline methods on two datasets.
[0105] Table 2. Performance Comparison of Cloud API Recommendation Methods
[0106] Experimental results show that the proposed method achieves optimal results on all evaluation metrics for both the PWA and HGA datasets, demonstrating its effectiveness in improving cloud API recommendation performance. The advantages of this method primarily stem from the following aspects: (1) Content representation calibration for recommendation tasks. This application models content representation calibration as a denoising process in a diffusion potential space, and uses the cooperative signal reflected by historical call relationships to guide reverse denoising, so that the calibrated content representation is more in line with the actual call preferences of the application, thereby reducing the impact of task-irrelevant noise in auxiliary content information on the recommendation results.
[0107] (2) Structured collaborative guidance for higher-order connectivity. This application extracts first-order and higher-order connectivity from the application-cloud API interaction graph, generates connectivity representations based on reachable neighbors with different hop counts and walk counts, and introduces them as structured collaborative conditions into the reverse denoising process through cross attention, thereby providing hierarchical collaborative guidance for content representation recovery under different noise conditions.
[0108] (3) Cooperative optimization of cooperative representation and calibration content representation. This application enhances the consistency between cooperative representation and calibration content representation of the same node and the discriminativeness of node representation through contrastive learning. It also uses an asymmetric gating mechanism to adaptively control the injection intensity of calibration content representation with cooperative representation as the basic representation, so as to make full use of semantic information related to recommendation task while preserving historical call preferences.
[0109] To further verify the impact of connectivity of different orders on the recommended performance of the method in this application, this embodiment, while keeping other model parameters unchanged, extracts the maximum number of hops from connectivity. The values were set to 1, 2, 3, and 4 respectively, and experiments were conducted on the PWA and HGA datasets. This indicates that only the first-order connectivity between the application node and the cloud API node is extracted; This indicates that, based on first-order connectivity, higher-order connectivity within a corresponding hop count range is further extracted. Experimental results for different maximum hop counts are shown in Table 3.
[0110] Table 3. Comparison of Recommendation Performance under Different Maximum Hops
[0111] Experimental results show that when the maximum hop count increases from 1 to 2 or 3, the overall performance of the proposed method improves on both datasets, indicating that higher-order connectivity can capture potential cooperative relationships and provide effective structured guidance for content representation calibration. When the maximum hop count increases to 4, the recommendation performance decreases, indicating the presence of more distant reachable neighbors.
[0112] This application also provides a high-order connectivity-guided diffusion collaborative calibration cloud API recommendation device, used to implement the methods described in any of the above embodiments, such as... Figure 4 As shown, the device includes: The data acquisition module 401 is configured to acquire historical call relationship data between the application and the cloud API, as well as auxiliary content information of the application and the cloud API, and construct an application-cloud API interaction graph based on the historical call relationship data. The dual-branch feature encoding module 402 is configured to perform feature encoding on the application-cloud API interaction graph and the auxiliary content information respectively, to obtain the collaborative representation and content representation of the application and cloud API respectively; The higher-order connectivity extraction module 403 is configured to extract the first-order and higher-order connectivity of application nodes and cloud API nodes from the application-cloud API interaction graph, and generate connectivity representations corresponding to different hop counts. The diffusion calibration module 404 is configured to map the content representation and the connectivity representation to a shared diffusion latent space, perform forward noise processing on the latent content representation corresponding to the content representation, and in the reverse denoising process, use the connectivity representation as a structured cooperative condition, determine the association between the structured cooperative condition and the noisy content representation through cross attention, and perform iterative denoising on the noisy content representation according to the association to obtain the calibration content representation of the application and cloud API; The contrastive learning module 405 is configured to perform contrastive learning on the collaborative representation and the calibration content representation to constrain the consistency between the collaborative representation and the calibration content representation; The gated fusion module 406 is configured to use the collaborative representation as the base representation and control the fusion amount of the calibration content representation through a gating mechanism to obtain the final representation of the application and cloud API; The recommendation prediction module 407 is configured to calculate a prediction score based on the final representation of the target application and the final representation of the candidate cloud API, and determine the cloud API recommendation result corresponding to the target application based on the prediction score.
[0113] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When the at least one processor executes the computer program, it can implement the technical solution of the high-order connectivity-guided diffusion collaborative calibration cloud API recommendation method described in the above embodiments.
[0114] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0115] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.
[0116] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.
[0117] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.
[0118] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.
[0119] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.
[0120] Buses can be Industry Standard Architecture (ISA) buses, Peripheral Component Interconnect (PCI) buses, or Extended Industry Standard Architecture (EISA) buses, etc. Buses can be categorized into address buses, data buses, control buses, etc.
[0121] The aforementioned storage medium 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 storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0122] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. The processor and storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic control unit or main control device.
[0123] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A high-order connectivity-guided diffusion-based collaborative calibration cloud API recommendation method, characterized in that, The method includes: Obtain historical call relationship data between the application and the cloud API, as well as auxiliary content information of the application and the cloud API, and construct an application-cloud API interaction graph based on the historical call relationship data; The application-cloud API interaction graph and the auxiliary content information are respectively feature-encoded to obtain the collaborative representation and content representation of the application and cloud API, respectively. Extract the first-order and higher-order connectivity of application nodes and cloud API nodes from the application-cloud API interaction graph to generate connectivity representations corresponding to different hop counts; The content representation and the connectivity representation are mapped to a shared diffusion potential space. Forward noise processing is performed on the potential content representation corresponding to the content representation. In the reverse denoising process, the connectivity representation is used as a structured cooperative condition. The association between the structured cooperative condition and the noisy content representation is determined by cross attention. The noisy content representation is iteratively denoised according to the association to obtain the calibrated content representation of the application and cloud API. The collaborative representation and the calibration content representation are compared and learned to constrain the consistency between the collaborative representation and the calibration content representation; Based on the collaborative representation, the fusion amount of the calibration content representation is controlled by a gating mechanism to obtain the final representation of the application and cloud API; A predicted score is calculated based on the final representation of the target application and the final representation of the candidate cloud APIs, and the recommended cloud API for the target application is determined based on the predicted score.
2. The method for recommending cloud APIs based on high-order connectivity-guided diffusion-based collaborative calibration according to claim 1, characterized in that, Construct an application-cloud API interaction graph based on the historical call relationship data, including: Let the application set be The cloud API collection is The observation interaction set is ,in For application sets, For cloud API collection, It is a Cartesian product. For the number of applications, The number of cloud APIs; , and They are the 1st, 2nd and 3rd respectively. One application, , and They are the 1st, 2nd and 3rd respectively. A cloud API, Indicates application I have called the cloud API. ; Get each application Auxiliary content information and each cloud API Auxiliary content information The auxiliary content information includes text descriptions, tags, service provider information, and related metadata; According to the observation interaction set Application Building - Cloud API Two-Part Interaction Diagram ,in For a set of nodes, Let be the set of edges. , .
3. The method for recommending cloud APIs based on high-order connectivity-guided diffusion-based collaborative calibration according to claim 2, characterized in that, The application-cloud API interaction graph and the auxiliary content information are respectively feature-encoded to obtain the collaborative representation and content representation of the application and cloud API, including: Retrieve the initial ID embedding matrix of the application and cloud API from the embedding lookup table: in, For the initial ID embedding matrix of the application and cloud API, and The first application and the second application, respectively. Initial ID embedding for each application, and The first cloud API and the second Embed the initial ID of each cloud API; The initial ID embedding matrix is input into a two-branch feature encoder containing an interaction branch and a content branch. The interaction branch uses a LightGCN encoder. Layer propagation is as follows: in, and Representing applications respectively HeYun API The set of first-order neighbors, and Representing applications respectively In the Layer and first Layer embedding representation, and They represent cloud APIs respectively. In the Layer and first Layer embedding representation; After completion After layer propagation, the representations of each layer are aggregated to obtain the application. Collaborative representation and cloud API Collaborative representation : in, l For the propagation layer index of the LightGCN encoder, This represents the propagation layer number of the LightGCN encoder; The auxiliary content information is preprocessed to obtain the initial content feature vector: in, For application The initial content feature vector, This is a preprocessing function for content information on the application side. For application Supplementary content information, For cloud API The initial content feature vector, This is a preprocessing function for content information on the cloud API side. For cloud API Supplementary content information; The content branch uses a two-layer feedforward neural network as a content encoder, and the application is obtained through the content encoder. Content representation HeYun API Content representation : in, , , , , , , , For learnable parameters, For the real number field, d For embedded dimensions, o m This serves as the initial content feature dimension for the application. o a For the initial content feature dimensions of the cloud API, This represents a non-linear activation function.
4. The method for recommending cloud APIs based on high-order connectivity-guided diffusion-based collaborative calibration according to claim 3, characterized in that, Extract the first-order and higher-order connectivity of application nodes and cloud API nodes from the application-cloud API interaction graph, and generate connectivity representations corresponding to different hop counts, including: Determine the application First-order reachable neighbor set : in, For application Any cloud API in the set of first-order reachable neighbors; for Recursively determine the target node Jump reachable neighbor set, and in determining When a neighbor is reachable by hop, the target node itself is excluded. Jumpable Neighbor Set for: in, To differentiate from the target application Other applications, For application collection Exclude target application The resulting application set For application The Jump-reachable neighbor set; make Indicates application and Jump to Neighbor The length between is The number of walks is determined using a counting-aware multi-hot encoding function. Generate application of Jump connectivity representation : in, u For application of Jump to reach your neighbor. For application and Jump to Neighbor The length between is The number of walks, H The maximum number of hops to consider for connectivity extraction; Generate cloud APIs in the same way of Jump connectivity representation .
5. The method for recommending cloud APIs based on high-order connectivity-guided diffusion-based collaborative calibration according to claim 4, characterized in that, The methods for obtaining calibration content representations from applications and cloud APIs include: Application Content representation HeYun API Content representation Mapped to respectively Dimensional potential content representation: in, , Represents a learnable projection function; , , and These are learnable parameters; For application Potential content representation, For cloud API Potential content representation; Map the connectivity representations with different hop counts to respectively 3D structured collaborative conditions: in, , Indicates the first Jump connectivity represents the corresponding learnable projection function; and These are the learnable parameters corresponding to the application side. and These are the learnable parameters corresponding to the cloud API side; Indicates application The Skip structured collaborative conditions. Indicates cloud API The Skip structured collaborative conditions; by As an application The initial potential content is represented at the diffusion time. Inject Gaussian noise according to the following formula: in, , , For diffusion time Noise scheduling parameters, For diffusion time The noise content is represented as follows: For application The initial potential content representation at diffusion time 0, Gaussian noise sampled from a standard Gaussian distribution, It has a mean of 0 and a covariance matrix that is the identity matrix. The standard Gaussian distribution; Application The Skip to structured collaborative conditions and diffusion time Noise content representation Expanded to matrix: in, For application The The matrix obtained after the jump structured cooperative condition expansion. For application At the diffusion moment The noise content is represented by the expanded matrix. For the first The learnable extension vector corresponding to the jump structured collaborative condition. The noise content is represented by the corresponding learnable expansion vector. T It is the transpose operator; With the first The skip structured collaborative condition is used as the query, and the noise content is used as the key and value to determine them respectively: ; ; in, For the first Skip the query matrix corresponding to the structured collaborative conditions. For diffusion time The noise content represents the corresponding key matrix. For diffusion time The noise content is represented by the corresponding value matrix. These are the learnable projection matrices corresponding to the query matrix, key matrix, and value matrix, respectively. The first is obtained according to the following formula. Skip-structured collaborative conditional guided cross-attention representation: in, For the first Skip-structured collaborative conditional guided cross-attention representation. For normalized exponential functions, It is the transpose operator; For applications , No. The prediction result of the content representation in the reverse denoising process is as follows: in, Indicates the first The fusion weights corresponding to the order of collaboration conditions. Represents a nonlinear transformation function. Indicates application In the The content representation obtained by prediction during the reverse denoising process; After the reverse denoising process is completed, the application The final calibration result is denoted as ; Calculate cloud APIs in the same way The calibration content indicates .
6. The method for recommending cloud APIs based on high-order connectivity-guided diffusion-based collaborative calibration according to claim 5, characterized in that, Comparative learning is performed on the cooperative representation and the calibration content representation to constrain the consistency between the cooperative representation and the calibration content representation, including: The collaborative representation and calibration content representation of the same node are used as positive sample pairs, and the representations of other nodes are used as negative samples to calculate the contrast loss on the application side. : in, It's a temperature parameter. This indicates the calculation of cosine similarity, and the contrast loss on the cloud API side is calculated in the same way. The overall comparative loss was obtained. .
7. The method for recommending cloud APIs based on high-order connectivity-guided diffusion-based collaborative calibration according to claim 6, characterized in that, Based on the aforementioned collaborative representation, the fusion amount of the calibration content representation is controlled through a gating mechanism to obtain the final representation of the application and cloud API, including: Utilizing gated residual connection fusion applications The collaborative representation and calibration content representation are obtained. The final expression : in, This represents a vector concatenation operation. This represents element-wise multiplication. and For learnable parameters, This is a gate vector used to control the injection intensity of the calibration content representation; The cloud API was calculated in the same way. The final expression .
8. The method for recommending cloud APIs based on high-order connectivity-guided diffusion-based collaborative calibration according to claim 7, characterized in that, A prediction score is calculated based on the final representation of the target application and the final representation of the candidate cloud APIs, and the cloud API recommendation result corresponding to the target application is determined based on the prediction score, including: Calculate the target application according to the following formula. The final representation of the candidate cloud API The inner product between the final representations yields the predicted score. : in, For application The final expression, Candidate cloud APIs The final representation; Using a target content representation prediction method, the diffusion loss is calculated separately for the application side and the cloud API side: in, For application-side diffusion loss, Indicates about the application diffusion time and Gaussian noise Expectations For cloud API side diffusion loss, Indicates information about cloud APIs diffusion time and Gaussian noise Expectations For application The initial potential content representation, For application In the The content representation obtained by prediction during the reverse denoising process. For cloud API The initial potential content representation, For cloud API In the The content representation obtained by prediction during the reverse denoising process. For diffusion loss; By employing Bayesian personalized ranking loss, the combination of applications with observed call relationships and cloud APIs achieves a higher prediction score than the combination without observed calls. in, To train the set of triples, For the set of unobserved call relationships, For the observed call relationships, The regularization coefficient is . These are the learnable parameters for the recommendation model. Combined with comparative loss The overall training objective of building the recommendation model is: in, These are the weighting coefficients for diffusion loss. Weighting coefficients for comparison losses; Minimize the overall training objective through backpropagation. Update the learnable parameters in the recommendation model; The candidate cloud APIs are sorted in descending order according to the predicted scores, and the top-k cloud APIs are selected as the recommended results.
9. A high-order connectivity-guided diffusion-coordinated calibration cloud API recommendation device, characterized in that, The device includes: The data acquisition module is configured to acquire historical call relationship data between the application and the cloud API, as well as auxiliary content information of the application and the cloud API, and construct an application-cloud API interaction graph based on the historical call relationship data. The dual-branch feature encoding module is configured to encode the features of the application-cloud API interaction graph and the auxiliary content information respectively, so as to obtain the collaborative representation and content representation of the application and the cloud API respectively. The higher-order connectivity extraction module is configured to extract the first-order and higher-order connectivity of application nodes and cloud API nodes from the application-cloud API interaction graph, and generate connectivity representations corresponding to different hop counts. The diffusion calibration module is configured to map the content representation and the connectivity representation to a shared diffusion latent space, perform forward noise addition on the latent content representation corresponding to the content representation, and in the reverse denoising process, use the connectivity representation as a structured cooperative condition, determine the association between the structured cooperative condition and the noisy content representation through cross attention, and iteratively denoise the noisy content representation according to the association to obtain the calibration content representation of the application and cloud API. The contrastive learning module is configured to perform contrastive learning on the collaborative representation and the calibration content representation to constrain the consistency between the collaborative representation and the calibration content representation; The gated fusion module is configured to use the collaborative representation as the base representation and control the fusion amount of the calibration content representation through a gating mechanism to obtain the final representation of the application and cloud API; The recommendation prediction module is configured to calculate a prediction score based on the final representation of the target application and the final representation of the candidate cloud APIs, and determine the cloud API recommendation result corresponding to the target application based on the prediction score.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the high-order connectivity-guided diffusion collaborative calibration cloud API recommendation method as described in any one of claims 1-8.