A method, medium, device, and product for recommending third-party libraries for mobile applications.
By constructing homogeneous and heterogeneous graphs and leveraging graph neural networks to enhance multimodal features, the problem of modality imbalance in third-party library recommendations for mobile applications is solved, thereby improving the accuracy and contextual relevance of recommendations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2026-04-03
AI Technical Summary
Existing technologies face the problem of modal information imbalance when recommending third-party libraries for mobile applications, which leads to weight imbalance and representation degradation, affecting the recommendation effect.
We construct isomorphic and heteromorphic graphs, enhance multimodal features using graph neural networks, combine entity ID embedding, extract multimodal information through pre-trained language models and convolutional neural networks, perform feature enhancement and fusion, and calculate matching scores for recommendation.
It improves the contextual relevance and accuracy of recommendation results, and enhances recommendation performance under modality imbalance conditions.
Smart Images

Figure CN121071239B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mobile application third-party library recommendation technology, and in particular to a method, medium, device, and product for recommending mobile application third-party libraries. Background Technology
[0002] The current mobile application market is highly competitive. To meet the demands of frequent iterations and diverse functionalities, developers generally rely on third-party libraries to shorten development cycles and reduce implementation costs. However, the coexistence of a vast number of third-party libraries significantly increases the burden of selection and learning, prolongs development cycles, and impacts product agility and competitiveness. Therefore, it is necessary to automatically recommend suitable third-party libraries based on actual needs.
[0003] Early research largely relied on collaborative filtering to mine similarities from the interaction matrix between mobile applications and third-party libraries for recommendations. While these methods are simple to implement, they are significantly affected by data sparsity and the cold-start problem, and struggle to characterize complex high-order relationships. To alleviate these issues, subsequent work introduced graph neural networks for representation learning on the mobile application-third-party library interaction graph. By aggregating neighborhood information, these networks capture richer context and high-order associations, thereby improving recommendation performance.
[0004] In feature modeling, some studies have attempted to fuse multimodal information to enhance expressive power and discriminative ability. Attention mechanisms, as a representative technique of dynamic fusion, can assign differentiated weights to different modalities: coarse-grained methods focus on the overall importance of the modality; fine-grained methods perform cross-modal semantic alignment (such as aligning image details with text keywords in clothing recommendations). Considering computational costs, lightweight feature concatenation and gating mechanisms are also widely adopted, achieving a trade-off between effectiveness and efficiency.
[0005] Nevertheless, simultaneously introducing multi-source modal information from both mobile applications and third-party libraries presents the problem of modal information imbalance: First, there is an imbalance in the types of modal information: a mobile application's modal information includes both descriptive text and visual information, while the third-party libraries it references only contain descriptive text information, making it difficult to collect other modal information or resulting in insignificant feature representation. Second, there is an imbalance within the same modality: regarding text modal information, the descriptive text from the mobile application side is significantly longer and richer in vocabulary than the descriptive text from the third-party library side. These imbalances will lead to weight imbalance and representation degradation in the cross-modal fusion stage, while weakening the model's ability to characterize code semantics and functional features, ultimately affecting matching scores and Top-K recommendation performance. Summary of the Invention
[0006] The purpose of this invention is to address the recommendation problem under conditions of imbalanced modal information between mobile applications and third-party libraries, and to propose a method for recommending third-party libraries in mobile applications, comprising the following steps:
[0007] S1. Obtain multiple modal information from mobile applications and third-party libraries, and embed entity IDs from mobile applications and third-party libraries;
[0008] S2. Construct a recommendation model, including a multimodal feature extraction module, a feature enhancement module, a feature fusion module, and a third-party library recommendation module;
[0009] The multimodal feature extraction module is used to extract multimodal features containing information from multiple modalities.
[0010] The feature enhancement module is used to enhance the representation of multimodal features and entity ID embeddings, resulting in enhanced multimodal features and enhanced entity ID embeddings;
[0011] The feature fusion module is used to combine the enhanced entity ID embedding to fuse the enhanced multimodal features on the mobile application side and the third-party library side respectively, so as to obtain the mobile application representation and the third-party library representation in the same vector space;
[0012] The third-party library recommendation module is used to calculate a matching score based on the mobile application representation and the third-party library representation, and to recommend third-party libraries based on the matching score.
[0013] S3. Train the recommendation model based on the supervised loss function. During the inference phase, output the sorted list of third-party library recommendations according to the matching score results.
[0014] Furthermore, multiple modal information is obtained from mobile applications and third-party libraries, including:
[0015] Retrieve text descriptions and app screenshots from mobile applications; retrieve text descriptions from third-party libraries.
[0016] Furthermore,
[0017] In the multimodal feature extraction module, the pre-trained language model BERT is used to extract text features from the text description, and the pre-trained convolutional neural network is used to extract visual features from the application screenshot.
[0018] Furthermore, the feature enhancement module is used to enhance the representation of the multimodal features and entity ID embeddings, resulting in enhanced multimodal features and enhanced entity ID embeddings, specifically:
[0019] Construct an isomorphic graph of mobile applications based on the interaction records between each pair of mobile applications. The visual features of mobile applications are encoded using a graph neural network on an isomorphic graph to obtain the encoded visual features. ;
[0020] Adjacency matrix of isomorphic graphs for:
[0021]
[0022] in, This indicates the relationship between the i-th mobile application and the j-th mobile application. , This represents the number of times the i-th mobile application and the j-th mobile application call the same third-party library, and m is the threshold for filtering low-frequency co-occurrence signals to ensure that connections in the mobile application isomorphism graph are only established between nodes with high similarity.
[0023] Constructing a heterogeneous bipartite graph based on the interaction relationships between mobile applications and third-party libraries. Graph neural network encoding is performed on the text features of mobile applications and third-party libraries on a heterogeneous bipartite graph to obtain encoded semantic features. and ;
[0024] Graph neural network encoding is performed on the entity ID embeddings from mobile applications and third-party libraries on a heterogeneous bipartite graph B to obtain context-enhanced ID embeddings. and .
[0025] Furthermore, the feature fusion module is used to combine the enhanced entity ID embedding to fuse the enhanced multimodal features on both the mobile application side and the third-party library side, respectively, to obtain the mobile application representation and the third-party library representation in the same vector space, specifically:
[0026] On the mobile application side, semantic features and visual features The data is then concatenated, semantically aligned and dimensionality reduced using a multilayer perceptron, and then embedded with the enhanced ID of the mobile application. By combining the data, we obtain the mobile application representation. ;
[0027] On the third-party library side, semantic features ID embedding after dimensionality reduction via a fully connected layer and enhancement from a third-party library. By concatenating the components, a representation from a third-party library can be obtained. .
[0028] Furthermore, the matching score is calculated by comparing the mobile application representation with the third-party library representation.
[0029]
[0030] in, This indicates that the mobile application represents the calculation of a matching score with a third-party library. Represents the similarity function. This indicates that the mobile application represents... This indicates a third-party library representation.
[0031] Furthermore, the loss function is expressed as:
[0032]
[0033] in, Let M be the loss function, and let N represent the number of mobile applications and third-party libraries, respectively. This represents the binary cross-entropy loss function. This indicates that the mobile application represents the calculation of a matching score with a third-party library.
[0034] The present invention also proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for recommending third-party libraries for mobile applications.
[0035] The present invention also proposes an electronic device, including a processor and a memory, wherein the processor and the memory are interconnected, the memory is used to store a computer program, the computer program including computer-readable instructions, and the processor is configured to invoke the computer-readable instructions to execute the above-described method for recommending third-party libraries for mobile applications.
[0036] The present invention also proposes a computer program product, including a computer program / instruction that, when executed by a processor, implements the steps of the above-described mobile application third-party library recommendation method.
[0037] The beneficial effects of the technical solution provided by this invention are:
[0038] This invention extracts multimodal information from mobile applications and third-party libraries, constructs isomorphic and heteromorphic graphs based on the calling behavior between mobile applications and third-party libraries, and uses graph neural networks to enhance multimodal features on the isomorphic and heteromorphic graphs. To address the modal imbalance between mobile applications and third-party libraries, entity-oriented ID embedding is introduced to compensate for modal missing features and improve system adaptability and robustness. Based on the hybrid encoding of application-application isomorphic graphs and application-library heteromorphic graphs, the representation ability of neighborhood context on different modalities is enhanced, thereby improving the contextual relevance and accuracy of recommendation results. Attached Figure Description
[0039] Figure 1 This is a flowchart of a mobile application third-party library recommendation method according to an embodiment of the present invention;
[0040] Figure 2 This is an example of constructing an isomorphic graph adjacency matrix according to an embodiment of the present invention;
[0041] Figure 3 This is a comparison chart of the effects of embodiments of the present invention under different isomorphic graph screening thresholds;
[0042] Figure 4 This is a block diagram of an electronic device according to an exemplary embodiment of the present invention. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0044] The flowchart of the mobile application third-party library recommendation method in this embodiment of the invention is as follows: Figure 1 Specifically, it includes the following steps:
[0045] S1. Obtain various modal information from mobile applications and third-party libraries. In this embodiment of the invention, text descriptions and application screenshots are obtained from the mobile application; text descriptions are obtained from the third-party library. Entity IDs embedded in the mobile application and third-party library are also obtained.
[0046] S2. Construct a recommendation model, including a multimodal feature extraction module, a feature enhancement module, a feature fusion module, and a third-party library recommendation module. The multimodal feature extraction module extracts multimodal features from various modalities. The feature enhancement module enhances the representations of the multimodal features and entity ID embeddings, resulting in enhanced multimodal features and enhanced entity ID embeddings. The feature fusion module combines the enhanced entity ID embeddings and fuses the enhanced multimodal features on both the mobile application and third-party library sides, obtaining mobile application representations and third-party library representations in the same vector space. The third-party library recommendation module calculates a matching score based on the mobile application representation and the third-party library representation, and recommends third-party libraries based on the matching score.
[0047] In a preferred embodiment of the present invention, the multimodal feature extraction module uses a pre-trained language model BERT to extract textual features from the text description and a pre-trained convolutional neural network to extract visual features from the application screenshot. Specifically:
[0048] (1) For text information in mobile applications and third-party libraries, consider the imbalance between the two in terms of text length, noise and semantic density: use a pre-trained language model to calculate the similarity between the encoded word / sub-word units and the sentence representation as its semantic saliency weight:
[0049]
[0050] in, For statement-level feature vectors, For the first in the statement Feature vectors of each positional word.
[0051] Then, based on the weights, the elements are sorted in descending order and non-semantic components such as modal particles and adverbs are filtered out. Finally, the top n word vectors with the highest similarity are retained as the key semantic units of the sentence to obtain semantic feature representations with higher information density. The pre-trained language model includes, but is not limited to, BERT; the parameter n can be selected from the validation set and is not a fixed value.
[0052] (2) For visual information (such as screenshots) in mobile applications, the input image is scaled and normalized to the input size of the convolutional network used (e.g., 224×224 pixels) and converted into a normalized tensor; then, features are extracted using a pre-trained convolutional neural network; finally, global average pooling and flattening operations are performed on each channel of the output features to obtain the visual features of the mobile application. .
[0053] In a preferred embodiment of the present invention, the feature enhancement module is specifically as follows:
[0054] (1) Encode the visual features of the mobile application on the isomorphic graph using a graph neural network to obtain the encoded visual features. .
[0055] Specifically, based on the interaction records between each pair of mobile applications, the number of identical third-party libraries called by the mobile applications is counted to obtain the co-occurrence frequency between each pair of mobile applications, thereby constructing a mobile application-to-mobile application isomorphism graph. .
[0056] Then, extract the adjacency matrix of the isomorphic graph. for:
[0057]
[0058] in, This indicates whether the i-th mobile application and the j-th mobile application are associated, where This indicates the association between the i-th mobile application and the j-th mobile application. This indicates that the i-th mobile application and the j-th mobile application are not related. This represents the number of times the i-th mobile application and the j-th mobile application call the same third-party library, and m is the threshold for filtering low-frequency co-occurrence signals to ensure that connections in the mobile application isomorphism graph are established only between nodes with high similarity.
[0059] The motivation for constructing a mobile application isomorphism graph based on co-occurrence counts stems from a key observation: mobile applications with similar functions often call the same third-party libraries. An example of constructing the isomorphism graph adjacency matrix in this invention is provided below. Figure 2When the co-occurrence threshold m=2, only application pairs with a co-occurrence count greater than or equal to 2 are retained, and edges are created for them in the isomorphism graph to represent functional similarity. By setting the threshold m, low-frequency noise associations can be effectively filtered out and significant co-occurrence relationships can be retained, thereby explicitly modeling the similarity between mobile applications at the structural level.
[0060] The visual features of the mobile application are encoded using a graph neural network on the isomorphic graph:
[0061]
[0062] in, Indicates mobile application In the isomorphism graph, the first Visual representation of layers This represents the normalized adjacency matrix of the mobile application. Indicates the first Visual representation matrix of all mobile applications in the convolutional layers.
[0063] Finally, the encoded visual features are obtained:
[0064]
[0065] here, represents the total number of layers in the graph neural network, and represents an adjustable hyperparameter.
[0066] (2) Constructing a heterogeneous bipartite graph based on the interaction relationship between mobile applications and third-party libraries Graph neural network encoding is performed on the text features of mobile applications and third-party libraries on a heterogeneous bipartite graph to obtain encoded semantic features. and .
[0067]
[0068]
[0069] in, and These represent the mobile application and third-party library in the heterogeneous graph, respectively. The text representation of a layer, where L represents the number of layers in a graph neural network.
[0070]
[0071]
[0072] in, and These represent the normalized adjacency matrices for mobile applications and third-party libraries, respectively. and Indicates the first The semantic representation matrix of all mobile applications and third-party libraries in the convolutional layer. This represents a fully connected layer or a multilayer perceptron.
[0073] (3) ID embedding is introduced to enrich the representation of mobile applications and third-party libraries. Graph neural network encoding is performed on the entity ID embeddings in mobile applications and third-party libraries on the heterogeneous bipartite graph B to obtain context-enhanced ID embeddings. and .
[0074] In a preferred embodiment of the present invention, the feature fusion module is specifically as follows:
[0075] On the mobile application side, semantic features and visual features The data is then concatenated, semantically aligned and reduced in dimensionality using a multilayer perceptron (MLP), and then embedded with the enhanced ID of the mobile application. By combining the data, we obtain the mobile application representation. , is represented as:
[0076]
[0077] On the third-party library side, semantic features ID embedding after dimensionality reduction via a fully connected layer and enhancement from a third-party library. By concatenating the components, a representation from a third-party library can be obtained. , is represented as:
[0078]
[0079] Where W and b represent the weights and bias parameters of the fully connected layer.
[0080] In a preferred embodiment of the present invention, the third-party library recommendation module is specifically as follows:
[0081] The matching score is calculated using a similarity function. The matching score is calculated using the mobile application representation and the third-party library representation.
[0082]
[0083] in, This indicates that the mobile application represents the calculation of a matching score with a third-party library. Similarity functions include, but are not limited to, inner product, cosine similarity, bilinear scoring, or multilayer perceptron-based scoring functions. This indicates that the mobile application represents... This indicates a third-party library representation.
[0084] S3. Train the recommendation model based on the supervised loss function, and output the sorted list of third-party library recommendations according to the scoring results during the inference phase.
[0085] Using binary cross-entropy loss combined with L2 regularization, the loss function is expressed as:
[0086]
[0087] in, Let M be the loss function, and let N represent the number of mobile applications and third-party libraries, respectively. This represents the binary cross-entropy loss function. This indicates that the mobile application represents and a third-party library represents the calculation of a matching score. During training, the parameters of the loss function are updated using gradient descent.
[0088] For each mobile application The top-k third-party libraries with the highest matching scores to the mobile application are selected as the final recommendation list. .
[0089] On three datasets of different sizes (APP_5K / APP_10K / APP_20K), the results of this invention were compared with those of different baseline methods, using Recall and HR at @5 and @10 as evaluation metrics.
[0090] Recall@k: Recall measures the model's ability to correctly recommend actual libraries, and is reflected as the proportion of libraries that are hit in the recommendation list (of length k) to the total number of libraries actually called in the test set.
[0091]
[0092] HR@k: Hit rate assessment determines whether the recommended list contains at least one actually called third-party library. Statistical analysis of the percentage of apps that meet this condition can intuitively reflect the coverage of the recommendation method's needs for developers.
[0093]
[0094] in, This is the recommendation list for the model. For mobile applications The actual interaction list. We chose list length K=5, 10 as the evaluation criterion.
[0095] Baseline methods include: POP (popularity-based recommendation model), BPR (Bayesian personalized ranking), LightGCN (lightweight graph convolutional network), DiffRec (DiffusionRecommender Model), and SVD-AE (SVD-AE: Simple Autoencoders for Collaborative Filtering).
[0096] The experimental results are shown in Table 1. Under different data scales and different recommendation list lengths, the present invention significantly outperforms traditional popularity / ranking methods (POP, BPR), autoencoder / difference classification methods (SVD-AE, DiffRec), and graph learning baseline methods (LightGCN), demonstrating a stable advantage in capturing complex interaction patterns between mobile applications and third-party libraries.
[0097] Table 1
[0098]
[0099] Meanwhile, considering that adjusting the threshold m alters the co-occurrence edges retained in the mobile application-mobile application isomorphism graph, thus affecting the encoding effect of visual information in the graph neural network, experiments were conducted on the APP_5K and APP_10K datasets with K=5 as an example to evaluate the impact of m on the performance of this invention. The results are as follows... Figure 3 As shown, the performance of this invention exhibits a "first increase, then decrease" trend with increasing m. The reason for this is:
[0100] When m is too small, a large number of low-frequency co-occurrence relationships are preserved, and noisy edges create invalid connections between dissimilar apps, interfering with the aggregation of visual features. When m is too large, valid associations are mistakenly deleted, making the isomorphic graph structure too sparse, hindering information transmission, and causing performance degradation. The above shows that there exists a moderate threshold m that can strike a balance between "noise suppression" and "structure fidelity," thereby achieving better recommendation performance.
[0101] In one exemplary embodiment, a computer-readable storage medium is included, which stores a computer program that, when executed by a processor, implements the above-described method for recommending third-party libraries for mobile applications.
[0102] Please see Figure 4 In one exemplary embodiment, the device further includes an electronic device including at least one processor, at least one memory, and at least one communication bus.
[0103] The memory stores a computer program, which includes computer-readable instructions. The processor calls the computer-readable instructions stored in the memory via a communication bus to execute the aforementioned method for recommending third-party libraries for mobile applications.
[0104] In one exemplary embodiment, a computer program product is proposed, including a computer program / instructions that, when executed by a processor, implement the steps of the mobile application third-party library recommendation method described above.
[0105] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for recommending third-party libraries for mobile applications, characterized in that, Includes the following steps: S1. Obtain multiple modal information from mobile applications and third-party libraries, and embed entity IDs from mobile applications and third-party libraries; S2. Construct a recommendation model, including a multimodal feature extraction module, a feature enhancement module, a feature fusion module, and a third-party library recommendation module; The multimodal feature extraction module is used to extract multimodal features containing information from multiple modalities. The feature enhancement module is used to enhance the representation of multimodal features and entity ID embeddings, resulting in enhanced multimodal features and enhanced entity ID embeddings; specifically: Construct an isomorphic graph of mobile applications based on the interaction records between each pair of mobile applications. The visual features of mobile applications are encoded using a graph neural network on an isomorphic graph to obtain the encoded visual features. ; Adjacency matrix of isomorphic graphs for: in, This indicates whether the i-th mobile application and the j-th mobile application are associated. This represents the number of times the i-th mobile application and the j-th mobile application call the same third-party library, and m is the threshold for filtering low-frequency co-occurrence signals; Constructing a heterogeneous bipartite graph based on the interaction relationships between mobile applications and third-party libraries. Graph neural network encoding is performed on the text features of mobile applications and third-party libraries on a heterogeneous bipartite graph to obtain encoded semantic features. and ; Graph neural network encoding is performed on the entity ID embeddings from mobile applications and third-party libraries on a heterogeneous bipartite graph B to obtain context-enhanced ID embeddings. and ; The feature fusion module combines enhanced entity ID embeddings to fuse enhanced multimodal features on both the mobile application and third-party library sides, resulting in mobile application and third-party library representations in the same vector space; specifically: On the mobile application side, semantic features and visual features The data is then concatenated, semantically aligned and dimensionality reduced using a multilayer perceptron, and then embedded with the enhanced ID of the mobile application. By combining the data, we obtain the mobile application representation. ; On the third-party library side, semantic features ID embedding after dimensionality reduction via a fully connected layer and enhancement from a third-party library. By concatenating the components, a representation from a third-party library can be obtained. ; The third-party library recommendation module is used to calculate a matching score based on the mobile application representation and the third-party library representation, and to recommend third-party libraries based on the matching score. S3. Train the recommendation model based on the supervised loss function. During the inference phase, output the sorted list of third-party library recommendations according to the matching score results.
2. The method for recommending third-party libraries for mobile applications according to claim 1, characterized in that, Obtain various modal information from mobile applications and third-party libraries, including: Retrieve text descriptions and app screenshots from mobile applications; retrieve text descriptions from third-party libraries.
3. The method for recommending third-party libraries for mobile applications according to claim 2, characterized in that, In the multimodal feature extraction module, the pre-trained language model BERT is used to extract text features from the text description, and the pre-trained convolutional neural network is used to extract visual features from the application screenshot.
4. The method for recommending third-party libraries for mobile applications according to claim 1, characterized in that, The mobile application representation and the third-party library representation are used to calculate the matching score. in, This indicates that the mobile application represents the calculation of a matching score with a third-party library. Represents the similarity function. This indicates that the mobile application represents... This indicates a third-party library representation.
5. The method for recommending third-party libraries for mobile applications according to claim 1, characterized in that, The loss function is expressed as: in, Let M be the loss function, and let N represent the number of mobile applications and third-party libraries, respectively. This represents the binary cross-entropy loss function. This indicates that the mobile application represents the score calculated by comparing it with the score calculated by the third-party library.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the method as described in any one of claims 1-5.
7. An electronic device, characterized in that, The device includes a processor and a memory, the processor being interconnected with the memory, wherein the memory is used to store a computer program, the computer program including computer-readable instructions, and the processor is configured to invoke the computer-readable instructions to perform the method as described in any one of claims 1-5.
8. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1-5.
Citation Information
Patent Citations
Visual perception recommendation method and system based on cross-modal semantic reasoning and fusion
CN114936901A
Multi-modal robust recommendation method and system based on self-supervised learning
CN119579269A