Item recommendation method and device based on graph attention network

By constructing a heterogeneous graph data and graph attention network model, and combining multiple self-attention mechanisms and feature fusion, the problems of high computational complexity, data sparsity, and insufficient mining of high-order relationships in existing models are solved, achieving more efficient and accurate product recommendations.

CN121458412BActive Publication Date: 2026-06-16CHAOHU UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHAOHU UNIV
Filing Date
2025-10-31
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

Existing graph attention network models suffer from high computational complexity, slow training speed, difficulty in handling data sparsity, and difficulty in mining high-order relationship information when processing large-scale product data and user behavior data, resulting in poor product recommendation performance.

Method used

Heterogeneous graph data between products and users is constructed. Based on the heterogeneous graph data, a graph attention network model is built to obtain user and product feature data. Through multiple self-attention mechanism layers and multi-level feature fusion modules, feature fusion and recommendation result calculation are performed using multiple self-attention operators. The model is optimized using the cross-entropy loss function.

Benefits of technology

It improves the accuracy of matching recommendation results with users' actual needs, enhances the effectiveness and efficiency of product recommendations, better captures user preferences and product relationships, and strengthens the diversity and accuracy of recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121458412B_ABST
    Figure CN121458412B_ABST
Patent Text Reader

Abstract

The application provides a commodity recommendation method and device based on a graph attention network, relates to the field of intelligent business platforms, and solves the technical problem of poor commodity recommendation effect of related technologies. The method comprises the following steps: constructing heterogeneous graph data between commodities and users, and constructing a corresponding graph attention network model based on the heterogeneous graph data; the heterogeneous graph data is used to represent the association relationship between the users and the commodities; user feature data and commodity feature data are obtained; the user feature data comprises at least one of age, gender, region and historical purchase preference; the commodity feature data comprises at least one of category, price, brand and score; the user feature data and the commodity feature data are input into the graph attention network model to obtain recommendation result information of the user for various commodities. The application is used in the commodity recommendation process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent business platforms, and in particular to a product recommendation method and apparatus based on graph attention networks. Background Technology

[0002] With the rapid development of the internet and e-commerce, product recommendation systems are playing an increasingly important role in improving user experience and increasing platform sales. In real-world scenarios, user-product interactions are often highly complex. For example, e-commerce platforms typically have a massive and ever-expanding number of products and users, posing a challenge to the data training capabilities of models. Furthermore, most users usually only interact with a small number of products, and most products are only viewed or purchased by a few users, resulting in sparse user-product interaction data. Additionally, after purchasing a product, a user may become interested in other related products, or there may be functional complementarity or brand associations between certain products; these complex relationships are difficult to effectively uncover.

[0003] However, existing graph attention network models are difficult to apply to the complex product recommendation scenarios mentioned above, resulting in poor product recommendation performance. Summary of the Invention

[0004] This application provides a product recommendation method and apparatus based on graph attention networks, which solves the technical problem of poor product recommendation performance in the prior art.

[0005] To achieve the above objectives, this application adopts the following technical solution:

[0006] Firstly, a product recommendation method based on graph attention networks is provided, comprising: constructing heterogeneous graph data between products and users, and constructing a corresponding graph attention network model based on the heterogeneous graph data; the heterogeneous graph data is used to represent the relationship between users and products; acquiring user feature data and product feature data; the user feature data includes at least one of age, gender, region, and historical purchase preferences; the product feature data includes at least one of category, price, brand, and rating; and inputting the user feature data and product feature data into the graph attention network model to obtain the user's recommendation results for various types of products.

[0007] Based on the above technical solution, this application can construct heterogeneous graph data between products and users, and build a corresponding graph attention network model based on the heterogeneous graph data. Then, this application can obtain user feature data and product feature data, and input the user feature data and product feature data into the graph attention network model to obtain user recommendation results for various products. Heterogeneous graph data can represent the relationship between users and products, addressing the current problems of fragmentation and insufficient utilization of feature dimensions caused by user-product associations. Furthermore, this application achieves structured associations through user and product feature data across multiple dimensions, avoiding the limitations of modeling a single relationship. Thus, through the constructed graph attention network model, this application can improve the matching accuracy between recommendation results and users' actual needs, thereby improving the product recommendation effect.

[0008] In conjunction with the first aspect mentioned above, in one possible implementation, the method includes: treating users and products as nodes in a heterogeneous graph, determining the edges between users and products based on the interaction operations between them; the interaction operations include at least one of purchasing, rating, browsing, favorites, and adding to cart; determining the weights of the edges based on the interaction strength of the interaction operations between users and products, and generating heterogeneous graph data.

[0009] In conjunction with the first aspect mentioned above, in one possible implementation, the graph attention network model includes multiple self-attention mechanism layers, a multi-level feature fusion module, and a classification module. The self-attention mechanism layer includes a self-attention search space, which is composed of various types of self-attention operators.

[0010] In conjunction with the first aspect above, in one possible implementation, the type of self-attention operator includes at least one of the following:

[0011] Connect self-attention operators;

[0012] Cosine self-attention operator;

[0013] Additive self-attention operator;

[0014] Dot product self-attention operator;

[0015] Subtraction self-attention operator;

[0016] Hadamard multiplies the self-attention operator.

[0017] In conjunction with the first aspect mentioned above, in one possible implementation, the method includes: for each self-attention mechanism layer, inputting the corresponding user feature data and product feature data into the self-attention search space of the self-attention mechanism layer, and adaptively searching for the optimal combination of self-attention operators in the self-attention search space based on a probability continuous approach; the optimal combination of self-attention operators is the combination of self-attention operators with the largest weight among various combinations of self-attention operators determined based on node features; adaptively fusing the feature data obtained based on the optimal combination of self-attention operators at each level through mixed weights, and calculating the user's recommendation results for various types of products through the cross-entropy loss function.

[0018] In conjunction with the first aspect mentioned above, in one possible implementation, the self-attention search based on probability continuity is achieved through the following formula:

[0019]

[0020] in, , They represent i Nodes and j Node characteristics j Node is i The set of neighboring nodes of a node The nodes in For the first f Each self-attention operator corresponds to i Node to j Weights between nodes.

[0021] In conjunction with the first aspect mentioned above, in one possible implementation, the feature data obtained based on the optimal combination of self-attention operators is processed using the following formula:

[0022]

[0023] Where Z represents the processed feature data. Let be the probability weight corresponding to the l-th self-attention operator. Let be the output feature corresponding to the l-th self-attention operator.

[0024] In conjunction with the first aspect mentioned above, in one possible implementation, the cross-entropy loss function satisfies the following formula:

[0025]

[0026] in, The cross-entropy loss is given by m, where m is the number of nodes and C is the number of classes. For the first i The true category label of each node For the firsti Each node belongs to the category j The probability of.

[0027] Secondly, a product recommendation device is provided, comprising: a communication unit and a processing unit; the processing unit is used to construct heterogeneous graph data between products and users, and to construct a corresponding graph attention network model based on the heterogeneous graph data; the heterogeneous graph data is used to characterize the relationship between users and products; the communication unit is used to acquire user feature data and product feature data; the user feature data includes at least one of age, gender, region, and historical purchase preferences; the product feature data includes at least one of category, price, brand, and rating; the processing unit is used to input the user feature data and product feature data into the graph attention network model to obtain recommendation results information for various types of products.

[0028] In conjunction with the second aspect above, in one possible implementation, the processing unit is used to: treat users and products as nodes in a heterogeneous graph, determine the edges between users and products based on the interaction operations between users and products; the interaction operations include at least one of purchasing, rating, browsing, favorites, and adding to cart; determine the weights of the edges based on the interaction strength of the interaction operations between users and products, and generate heterogeneous graph data.

[0029] In conjunction with the second aspect mentioned above, in one possible implementation, the graph attention network model includes multiple self-attention mechanism layers, a multi-level feature fusion module, and a classification module. The self-attention mechanism layer includes a self-attention search space, which is composed of various types of self-attention operators.

[0030] In conjunction with the second aspect above, in one possible implementation, the type of self-attention operator includes at least one of the following:

[0031] Connect self-attention operators;

[0032] Cosine self-attention operator;

[0033] Additive self-attention operator;

[0034] Dot product self-attention operator;

[0035] Subtraction self-attention operator;

[0036] Hadamard multiplies the self-attention operator.

[0037] In conjunction with the second aspect above, in one possible implementation, the processing unit is used to: for each self-attention mechanism layer, input the corresponding user feature data and product feature data into the self-attention search space of the self-attention mechanism layer, and adaptively search for the optimal combination of self-attention operators in the self-attention search space based on a probability continuous approach; the optimal combination of self-attention operators is the combination of self-attention operators with the largest weight among various combinations of self-attention operators determined based on node features; for the feature data obtained based on the optimal combination of self-attention operators at each level, adaptively fuse them through mixed weights, and calculate the user's recommendation results for various types of products through the cross-entropy loss function.

[0038] In conjunction with the second aspect above, in one possible implementation, the self-attention search based on probability continuity is achieved through the following formula:

[0039]

[0040] in, , They represent i Nodes and j Node characteristics j Node is i The set of neighboring nodes of a node The nodes in For the first f Each self-attention operator corresponds to i Node to j Weights between nodes.

[0041] In conjunction with the second aspect above, in one possible implementation, the feature data obtained based on the optimal combination of self-attention operators is processed using the following formula:

[0042]

[0043] Where Z represents the processed feature data. Let be the probability weight corresponding to the l-th self-attention operator. Let be the output feature corresponding to the l-th self-attention operator.

[0044] In conjunction with the second aspect above, in one possible implementation, the cross-entropy loss function satisfies the following formula:

[0045]

[0046] in, The cross-entropy loss is given by m, where m is the number of nodes and C is the number of classes. For the first i The true category label of each node For the firsti Each node belongs to the category j The probability of.

[0047] Thirdly, this application provides a product recommendation device, comprising: a processor and a storage medium; the storage medium includes instructions, and the processor is configured to execute the instructions to implement the method described in any of the above embodiments. This product recommendation device can be an electronic device or a chip within an electronic device.

[0048] Fourthly, this application provides a computer-readable storage medium storing instructions that, when executed on a product recommendation device, cause the product recommendation device to perform the method described in any of the above embodiments.

[0049] Fifthly, this application provides a computer program product containing instructions that, when run on a product recommendation device, cause the product recommendation device to perform the method described in any of the above embodiments.

[0050] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description

[0051] Figure 1 A system architecture diagram of a product recommendation system provided in this application embodiment;

[0052] Figure 2 A schematic flowchart illustrating a product recommendation method based on graph attention networks provided in this application embodiment;

[0053] Figure 3 A structural diagram of a graph attention network model provided in an embodiment of this application;

[0054] Figure 4 Structural diagrams of the respective attention operators provided in the embodiments of this application;

[0055] Figure 5A flowchart illustrating another product recommendation method provided in this application embodiment;

[0056] Figure 6 This is a schematic diagram of the structure of a product recommendation device provided in an embodiment of this application;

[0057] Figure 7 This is a schematic diagram of the hardware structure of a product recommendation device provided in an embodiment of this application. Detailed Implementation

[0058] In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" means one or more, and "multiple" means two or more. The terms "first," "second," etc., do not limit the quantity or order of execution, and "first," "second," etc., do not necessarily imply differences.

[0059] It should be noted that, in this application, the terms "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or illustration. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0060] With the rapid development of the internet and e-commerce, product recommendation systems are playing an increasingly important role in improving user experience and increasing platform sales. Product recommendation models based on graph attention networks have become a research hotspot in recent years, and although they have achieved some results, they still have many performance shortcomings.

[0061] First, existing graph attention network models often face problems of high computational complexity and slow training speed when processing large-scale product data and user behavior data. As the number of products and the user base on e-commerce platforms continue to expand, the massive amounts of data make the training and inference processes of these models extremely time-consuming. This not only affects the real-time performance of recommendation systems but also increases their operational costs. For example, on some large e-commerce platforms, massive amounts of user browsing and purchasing behavior data are generated daily. Traditional graph attention network models require a significant amount of time for computation and iteration when processing this data, making it difficult to provide accurate recommendation results to users in a short period of time.

[0062] Secondly, existing graph attention network models have limited ability to handle data sparsity. In real-world product recommendation scenarios, user-product interaction data is often very sparse; that is, most users have only interacted with a small number of products, and most products have only been viewed or purchased by a few users. This data sparsity makes it difficult for models to accurately capture user preferences and potential relationships between products, leading to decreased accuracy in recommendation results. For example, for some niche or newly listed products, due to the limited number of users interacting with them, the model struggles to learn their characteristics and potential related products from the limited interaction data, thus failing to provide effective recommendations to users.

[0063] Furthermore, existing graph attention network models are insufficient in mining higher-order relationship information. In product recommendation, complex higher-order relationships often exist between users and products, and between products themselves. For example, after purchasing a product, a user may become interested in other related products, or there may be functional complementarity or brand association between certain products. However, traditional graph attention network models typically only capture first- or second-order relationship information, failing to fully mine these higher-order relationships, thus limiting the diversity and accuracy of recommendation results. For instance, on a home furnishing e-commerce platform, a user who buys a sofa may also need to purchase matching coffee tables, rugs, and other items. However, existing models, unable to effectively mine such higher-order relationships, may only recommend products similar to the sofa, ignoring these complementary products.

[0064] In summary, existing graph attention network models are difficult to apply to the complex product recommendation scenarios described above, resulting in poor product recommendation performance.

[0065] In view of this, this application provides a product recommendation based on graph attention networks. By constructing heterogeneous graph data between products and users, and building a corresponding graph attention network model based on this heterogeneous graph data, this application can then obtain user feature data and product feature data. These user feature data and product feature data are then input into the graph attention network model to obtain the user's recommendation results for various products. The heterogeneous graph data can represent the relationship between users and products, addressing the current problems of fragmentation and insufficient utilization of feature dimensions caused by user-product associations. Furthermore, this application achieves structured associations through user and product feature data across multiple dimensions, avoiding the limitations of modeling single relationships. Thus, through the constructed graph attention network model, this application can improve the matching accuracy between recommendation results and users' actual needs, thereby improving the product recommendation effect.

[0066] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0067] Figure 1 This is an architecture diagram of a product recommendation system provided in an embodiment of this application. Figure 1 As shown, the product recommendation system includes a computing device 101 and a terminal device 102.

[0068] The computing device 101 and the terminal device 102 are communicatively connected. For example, the computing device 101 and the terminal device 102 can be connected via a wired network or a wireless network.

[0069] The computing device 101 can be a server. This server can be a standalone physical server, such as a general-purpose server, a graphics processing unit (GPU) server, a data processing unit (DPU) server, an artificial intelligence (AI) server, or a server cluster or distributed file system composed of multiple physical servers. It can also be at least one of the following cloud servers that provide basic cloud computing services: cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks, and big data or artificial intelligence platforms. This embodiment of the application does not limit the specific implementation of these features.

[0070] In some embodiments, computing device 101 is used to store and maintain various types of data in a project. For example, computing device 101 may be used to store data required for building a graph attention network model and feature data required for model inference based on the graph attention network model.

[0071] In some embodiments, the terminal device 102 may be a personal computer such as a desktop computer, tablet computer, or laptop computer, or it may be a remote terminal, user terminal equipment (TE), or mobile device. This application does not limit the form of the terminal device 102; the device used to implement the terminal's functions may be the terminal itself, or it may be a device capable of supporting the terminal in implementing those functions, such as a chip system. This device may be installed in the terminal or used in conjunction with the terminal. In this application embodiment, the chip system may consist of chips, or it may include chips and other discrete components.

[0072] For example, the terminal device 102 can be a device for users to access e-commerce platforms. The terminal device 102 is used to collect user feature data and send the user feature data to the computing device 101.

[0073] It should be understood that the product recommendation device in this application embodiment can be any type of device in the aforementioned product recommendation system. For example, the product recommendation device can be the aforementioned computing device 101, or it can be a module of the computing device 101. As another example, the product recommendation device can be the aforementioned terminal device 102, or it can be a module of the terminal device 102. This module can be a software module, a hardware module, or a combination of software and hardware modules. Furthermore, the aforementioned computing device 101 and terminal device 102 can be modules within the same electronic device, and the product recommendation device can be the aforementioned computing device 101, terminal device 102, or other modules within the electronic device, connected via an internal communication circuit.

[0074] It should be noted that the various embodiments of this application can be referenced or learned from each other. For example, the same or similar steps, method embodiments, system embodiments and device embodiments can be referenced from each other without limitation.

[0075] Figure 2 This is a flowchart illustrating a product recommendation method based on a graph attention network, provided as an embodiment of this application. Figure 2 As shown, the method includes the following steps:

[0076] Step 201: Construct heterogeneous graph data between products and users, and build a corresponding graph attention network model based on the heterogeneous graph data.

[0077] Heterogeneous graph data is used to characterize the relationship between users and products.

[0078] In one possible implementation, the product recommendation device can treat users and products as nodes in a heterogeneous graph, determine the edges between users and products based on the interaction between them, determine the weights of the edges based on the interaction strength between users and products, and generate heterogeneous graph data.

[0079] The interactive operations include at least one of the following: purchasing, rating, browsing, adding to favorites, and adding to cart.

[0080] For example, in this embodiment of the application, users and products can be regarded as nodes respectively, and edges can be constructed between users and products based on user behaviors such as purchasing, browsing, and collecting products, thereby forming heterogeneous graph data. For example, when user A purchases product M, an edge is established between the node corresponding to user A and product M, so as to intuitively reflect the interaction relationship between users and products.

[0081] In some embodiments, the weights of different interactive operations can be determined based on the corresponding interaction intensity. For example, the weight of a purchase behavior can be greater than the weight of a collection behavior, and the weight of a collection behavior can be greater than the weight of a browsing behavior.

[0082] It should be noted that, by combining the characteristics of the user-product interaction graph in the product recommendation scenario, this application can construct heterogeneous graph data suitable for product recommendation. Considering the diversity and complexity of node features in product recommendation, the embodiments of this application can use weights to represent the association strength of different relationships, thereby improving the model performance.

[0083] Step 202: Obtain user feature data and product feature data.

[0084] The user characteristic data includes at least one of age, gender, region, and historical purchase preferences, while the product characteristic data includes at least one of category, price, brand, and rating. Furthermore, both user and product characteristic data may include dynamic data, such as user behavior data and product sales data.

[0085] In some embodiments, this application can acquire user feature data and product feature data in real time to achieve dynamic updates of product recommendations. For example, e-commerce platforms collect user feature data in real time, especially dynamic behavioral data, such as user browsing history (e.g., time of entry into product details page, duration of stay, order of product categories browsed), purchase operations (purchased product list, purchase time interval, purchase amount distribution, etc.), and collection and evaluation behaviors (collected product sets, evaluation content and sentiment, etc.). Based on this feature data, the user's current product preferences can be determined in real time.

[0086] In this embodiment, the nodes (user nodes and product nodes) in the heterogeneous graph between products and users can have their corresponding feature data extracted and updated in real time using the methods described above. For user nodes, in addition to basic demographic features (age, gender, region, etc.), their recent interaction behavior features (such as the distribution of product categories viewed in the past week, changes in purchase frequency and amount, and the clustering of collected products) can be combined to dynamically generate feature vectors using a pre-trained feature extraction model (such as a deep learning-based user behavior feature encoder). For product nodes, in addition to the inherent attribute features of the product (category, price, brand, etc.), real-time sales data features (such as current sales volume, sales growth rate, inventory status, etc.) and user evaluation features (the sentiment analysis results of the latest evaluations, evaluation keyword extraction, etc.) are incorporated, and a comprehensive product feature vector is generated using a multi-source feature fusion algorithm (such as weighted average fusion, attention fusion, etc.). Thus, by inputting these dynamically generated user and product feature vectors into the constructed graph attention network model, this application can provide real-time and comprehensive input data for accurate product recommendations.

[0087] Step 203: Input user feature data and product feature data into the graph attention network model to obtain the user's recommendation results for various types of products.

[0088] For example, after receiving feature data about users and products, the graph attention network model can perform feature processing and inference calculations according to a predetermined computational logic. For instance, feature extraction can uncover potential relationships between users and products, including direct relationships (such as relationships between products a user has purchased) and indirect relationships (such as relationships passed down through similar users or similar products). This not only considers users' direct preferences for product categories but also incorporates current market trends for that category, expanding and accurately matching users' potential needs. Finally, by processing the features through a classifier, recommendation results for various products can be obtained. For example, this recommendation result information can be a list of recommended products, sorted from highest to lowest recommendation score. The recommendation score comprehensively considers multiple factors such as the user's interest in the product, the match between the product and the user, and the product's market popularity.

[0089] In some embodiments, this application can also collect user feedback data on the recommended results in real time after displaying the generated product recommendation list to the user, including whether the user clicked on the recommended products, the purchase conversion rate after clicking, and the evaluation and feedback on the recommended products. This feedback data is used as new user feature data and periodically input into the graph attention network model for incremental training and real-time inference to adapt to dynamic changes in user behavior and the continuous evolution of the market environment. For example, if it is found that the click-through rate of a certain type of product (such as summer clothing) has significantly increased recently, incremental training can be used to strengthen the model's focus on the relevant features of this type of product, adjust the relevant parameters in the model, and optimize the feature weights related to seasonal and fashion trends. This allows the model to maintain high adaptability to product recommendation scenarios and high accuracy of recommendation results, forming a virtuous cycle of "recommendation-feedback-optimization" and continuously improving the performance and user experience of the product recommendation system.

[0090] Based on the above technical solution, this application can construct heterogeneous graph data between products and users, and build a corresponding graph attention network model based on the heterogeneous graph data. Then, this application can obtain user feature data and product feature data, and input the user feature data and product feature data into the graph attention network model to obtain the user's recommendation results for various products. Heterogeneous graph data can represent the relationship between users and products, addressing the current problem of fragmentation and insufficient utilization of feature dimensions caused by user-product associations. Furthermore, this application achieves structured associations through user and product feature data across multiple dimensions, avoiding the limitations of modeling a single relationship. Thus, through the constructed graph attention network model, this application can improve the matching accuracy between recommendation results and users' actual needs, thereby improving the product recommendation effect.

[0091] As one possible implementation, the graph attention network model includes multiple self-attention mechanism layers, a multi-level feature fusion module, and a classification module. The self-attention mechanism layer includes a self-attention search space, which is composed of various types of self-attention operators.

[0092] For example, such as Figure 3 As shown, the graph attention network model includes: multiple self-attention mechanism layers, a multi-level feature fusion module, and a classification module.

[0093] The self-attention mechanism layer includes a self-attention search space, which is composed of various types of self-attention operators.

[0094] For example, taking the first self-attention mechanism layer as an example, after the feature data X is input into the graph attention network model system, feature extraction is performed through the neural network structure, that is, the feature vector in X is compared with the weight matrix W (e.g., ...). Figure 3 After calculating W1, W2...Wh, the processed feature data F is obtained (e.g., W1, W2...Wh). Figure 3 (F1, F2...Fh in the self-attention search space). Then, the self-attention operators in the self-attention search space are used for calculation and normalization, thereby aggregating the representation information of adjacent nodes and enhancing the stability and expressive power of the model.

[0095] In one example, the self-attention operators in this embodiment may include multiple types, such as connection self-attention operators, cosine self-attention operators, addition self-attention operators, dot product self-attention operators, subtraction self-attention operators, and Hadamard product self-attention operators. Compared to previous graph attention networks that typically use only one type of self-attention operator, which may lead to poor network adaptability, this embodiment achieves a certain degree of complementarity through different self-attention operators and continuously searches for self-attention operators using a probabilistic (Softmax) approach to meet the fusion requirements in different scenarios.

[0096] The multi-order feature fusion module is used to process node features at each order after optimal self-attention operator combination, and then perform fusion using mixed weights (such as...). Figure 3 Adaptive fusion is performed on λ_1, λ_1……λ_k in the matrix.

[0097] It should be noted that the node features processed in multiple self-attention mechanism layers are currently discrete multi-level feature fusion operations, which leads to inconsistent feature dimensions and affects the final model performance. Therefore, in this embodiment, a multi-level feature fusion module can be used to make the discrete multi-level feature fusion operations continuous, allowing the network's adaptive search to be more generalized to the self-attention structure. Then, the obtained node features of each level are adaptively fused to improve the performance of the graph attention network.

[0098] The classification module is used to calculate the probability information of a node belonging to each category by using the cross-entropy loss function to combine the fused node features, thereby achieving node classification.

[0099] In some embodiments, the type of self-attention operator includes at least one of the following:

[0100] Connect self-attention operators;

[0101] Cosine self-attention operator;

[0102] Additive self-attention operator;

[0103] Dot product self-attention operator;

[0104] Subtraction self-attention operator;

[0105] Hadamard multiplication by self-attention operator.

[0106] In some embodiments, the self-attention operator is used to perform computation operations on node features corresponding to the type of self-attention operator, and to process them based on the activation function.

[0107] For example, the self-attention operator is used to characterize the following formula:

[0108]

[0109] in, For the first f Each self-attention operator corresponds to i Node to j Weights between nodes For the first f The activation function of a self-attention operator, , They represent i Nodes and j Node characteristics For the first f The computational operations corresponding to the type of each self-attention operator.

[0110] The following sections introduce each self-attention operator, such as... Figure 4 The diagram shown is a structural diagram of the attention operators provided in the embodiments of this application. For example, the self-attention operator connects X... i and X j Feature concatenation is performed, multiplied by the learnable parameter β, and then calculated using an activation function (LeakyReLU) followed by a normalization (Softmax) operation. This connection self-attention operator can fully fuse the features of two nodes and achieve dimensionality expansion.

[0111] The cosine self-attention operator is used to compute X. i and X j The cosine similarity is calculated and then normalized (Softmax) after being multiplied by the learnable parameter β. This cosine self-attention operator can characterize the similarity of feature directions between two nodes, and is suitable for measuring semantic-level associations (such as the directional consistency of word vectors). Since the calculation of cosine similarity can normalize feature values ​​to [-1, 1], it does not need to be calculated through an activation function.

[0112] The addition self-attention operator is to add X i and X j Element-wise addition is performed, multiplied by the learnable parameter β, and then calculated using the ReLU activation function, followed by a softmax normalization operation. This additive self-attention operator can enhance co-activated features (the larger the value, the more prominent they are) and filter out negative interactions.

[0113] The dot product self-attention operator is to multiply X i and X jThe inner product is calculated, multiplied by the learnable parameter β, and then processed using the ReLU activation function, followed by a softmax normalization operation. This dot-multiplication self-attention operator measures global similarity (the larger the value, the stronger the overall association). ReLU can further filter negative scores and strengthen positive associations.

[0114] The subtraction self-attention operator is to subtract X i and X j Element-wise subtraction is performed, multiplied by the learnable parameter β, and then calculated using the ReLU activation function, followed by a softmax normalization operation. This subtraction self-attention operator is used to highlight feature differences.

[0115] The Hadamard multiplicative self-attention operator performs element-wise multiplication, multiplies with a learnable parameter β, computes the result using an activation function (ReLU), and then performs a normalization (Softmax) operation. This Hadamard multiplicative self-attention operator focuses on the joint activity of local locations (the product is large only when corresponding locations have large values ​​simultaneously), emphasizing the "local cooperation" feature.

[0116] As one possible implementation, combined with Figure 2 ,like Figure 5 As shown, step 203 above can be achieved through the following steps.

[0117] Step 501: For each self-attention mechanism layer, input the corresponding user feature data and product feature data into the self-attention search space of the self-attention mechanism layer, and adaptively search for the optimal combination of self-attention operators in the self-attention search space based on the probability continuity method.

[0118] The optimal self-attention operator combination is the combination with the largest weight among various self-attention operator combinations determined based on node features. These node features can be the user features corresponding to the user nodes or the product features corresponding to the product nodes.

[0119] It should be noted that traditional graph attention networks typically use only one type of self-attention operator, which makes it difficult for the network to adapt to the complex application scenarios of product recommendation, resulting in poor product recommendation performance. To address this issue, this embodiment achieves a certain degree of complementarity through different self-attention operators. Furthermore, to ensure that the combination of self-attention operators in the self-attention search space can achieve better feature representation results, this embodiment can select the optimal combination of self-attention operators based on the weights of various combinations. That is, it performs an adaptive search in the self-attention search space based on a continuous probability approach to meet the needs of product recommendation scenarios.

[0120] For example, when dealing with high-dimensional, sparse user purchase preference features, the search algorithm is prioritized to try combinations of dot product self-attention operators and additive self-attention operators. The dot product operator accurately captures feature relevance, while the additive operator supplements and integrates feature information to better uncover potential user needs. For categorical features like product categories, the focus is on combining cosine self-attention operators and connection self-attention operators. The cosine operator effectively measures category similarity, and the connection operator integrates category information, improving the modeling ability of product category relationships. Simultaneously, based on the real-time requirements of product recommendations, the time complexity of operator computation within the search space is limited, selecting computationally efficient operator combinations suitable for product recommendation scenarios to construct a targeted, efficient, and feasible self-attention search space.

[0121] In some embodiments, the probability-based continuous approach in self-attention search is implemented using the following formula:

[0122]

[0123] in, , They represent i Nodes and j Node characteristics j Node is i The set of neighboring nodes of a node The nodes in For the first f Each self-attention operator corresponds to i Node to j Weights between nodes.

[0124] This application can transform discrete operator search into differentiable probability calculation through the above formula, allowing the model to consider the combined effects of multiple operators at the same time, normalizing weights using the Softmax function, retaining the optimal operator combination, and improving the model's adaptability to different features.

[0125] Step 502: For the feature data obtained based on the optimal combination of self-attention operators at each level, adaptive fusion is performed through mixed weights, and the recommendation results of users for various types of products are calculated through the cross-entropy loss function.

[0126] It should be noted that the node features processed in multiple self-attention mechanism layers are currently discrete multi-level feature fusion operations, which leads to inconsistent feature dimensions and thus affects the final model performance. Therefore, in this embodiment, the discrete multi-level feature fusion operations can be made continuous, allowing the network to adaptively search for a more general self-attention structure. Then, the obtained node features of each level can be adaptively fused to improve the performance of the graph attention network.

[0127] For example, during the fusion process, this application not only considers users' direct preferences for product categories but also incorporates current market trends for those categories (market trend features mined through multi-level feature fusion) to expand and accurately match users' potential needs. Finally, the fused features are processed using the cross-entropy loss function to generate a product recommendation list, sorted from high to low according to recommendation scores. The recommendation scores comprehensively consider multiple factors such as users' interest in products, the matching degree between products and users, and the market popularity of products, ensuring that the recommendation results not only meet users' personalized needs but also possess market rationality and attractiveness.

[0128] In some embodiments, the feature data obtained based on the optimal combination of self-attention operators is processed by the following formula:

[0129]

[0130] Where Z represents the processed feature data. Let be the probability weight corresponding to the l-th self-attention operator. Let be the output feature corresponding to the l-th self-attention operator.

[0131] It should be noted that different self-attention operators have certain complementarities; therefore, a self-attention mechanism module is an organic combination of multiple self-attention operators. Finally, in order to make the discrete multi-order feature fusion operation continuous, the embodiments of this application can achieve structural fusion through the above formula. The learnable mixing weights of various fusion operations can be represented by λ_l, and Z can be used as the input for subsequent cross-entropy loss.

[0132] In some embodiments, the cross-entropy loss function satisfies the following formula:

[0133]

[0134] in, The cross-entropy loss is given by m, where m is the number of nodes and C is the number of classes. For the first i The true category label of each node For the first i Each node belongs to the category j The probability of.

[0135] The foregoing mainly describes the solutions of the embodiments of this application from the perspective of device implementation. It is understood that each device, such as a product recommendation device, includes at least one of the hardware structures and software modules corresponding to the execution of each function in order to achieve the above-mentioned functions. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0136] This application embodiment can divide the product recommendation device into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0137] When using integrated units, Figure 6 A possible structural schematic diagram of the product recommendation device (referred to as product recommendation device 60) involved in the above embodiments is shown. The product recommendation device 60 includes a processing unit 601 and a communication unit 602, and may also include a storage unit 603. Figure 6 The structural diagram shown can be used to illustrate the structure of the product recommendation device involved in the above embodiments.

[0138] when Figure 6 The schematic diagram shown illustrates the structure of the product recommendation device involved in the above embodiments. The processing unit 601 is used to control and manage the operation of the product recommendation device, the communication unit 602 is used for the product recommendation device to communicate with other devices, and the storage unit 603 is used to store the program code and data of the product recommendation device.

[0139] For example, the processing unit 601 is used to construct heterogeneous graph data between products and users, and to construct a corresponding graph attention network model based on the heterogeneous graph data; the heterogeneous graph data is used to characterize the relationship between users and products;

[0140] The communication unit 602 is used to acquire user characteristic data and product characteristic data; the user characteristic data includes at least one of age, gender, region, and historical purchase preferences; the product characteristic data includes at least one of category, price, brand, and rating.

[0141] The processing unit 601 is used to input the user feature data and the product feature data into the graph attention network model to obtain the user's recommendation results for various types of products.

[0142] In conjunction with the second aspect above, in one possible implementation, the processing unit 601 is used to: treat users and products as nodes in a heterogeneous graph, determine the edges between users and products based on the interaction operations between users and products; the interaction operations include at least one of purchasing, rating, browsing, favorites, and adding to cart; determine the weights of the edges based on the interaction strength of the interaction operations between users and products, and generate heterogeneous graph data.

[0143] In conjunction with the second aspect mentioned above, in one possible implementation, the graph attention network model includes multiple self-attention mechanism layers, a multi-level feature fusion module, and a classification module. The self-attention mechanism layer includes a self-attention search space, which is composed of various types of self-attention operators.

[0144] In conjunction with the second aspect above, in one possible implementation, the type of self-attention operator includes at least one of the following:

[0145] Connect self-attention operators;

[0146] Cosine self-attention operator;

[0147] Additive self-attention operator;

[0148] Dot product self-attention operator;

[0149] Subtraction self-attention operator;

[0150] Hadamard multiplies the self-attention operator.

[0151] In conjunction with the second aspect above, in one possible implementation, the processing unit 601 is used to: for each self-attention mechanism layer, input the corresponding user feature data and product feature data into the self-attention search space of the self-attention mechanism layer, and adaptively search for the optimal combination of self-attention operators in the self-attention search space based on a probability continuous approach; the optimal combination of self-attention operators is the combination of self-attention operators with the largest weight among various combinations of self-attention operators determined based on node features; for the feature data obtained based on the optimal combination of self-attention operators at each level, adaptively fuse them through mixed weights, and calculate the user's recommendation results for various types of products through the cross-entropy loss function.

[0152] In conjunction with the second aspect above, in one possible implementation, the self-attention search based on probability continuity is achieved through the following formula:

[0153]

[0154] in, , They represent i Nodes and j Node characteristics j Node is i The set of neighboring nodes of a node The nodes in For the first f Each self-attention operator corresponds to i Node to j Weights between nodes.

[0155] In conjunction with the second aspect above, in one possible implementation, the feature data obtained based on the optimal combination of self-attention operators is processed using the following formula:

[0156]

[0157] Where Z represents the processed feature data. Let be the probability weight corresponding to the l-th self-attention operator. Let be the output feature corresponding to the l-th self-attention operator.

[0158] In conjunction with the second aspect above, in one possible implementation, the cross-entropy loss function satisfies the following formula:

[0159]

[0160] in, The cross-entropy loss is given by m, where m is the number of nodes and C is the number of classes. For the first i The true category label of each node For the first i Each node belongs to the category j The probability of.

[0161] The processing unit 601 can be a processor or a controller, and the communication unit 602 can be a communication interface, transceiver, transceiver circuit, transceiver device, etc. The term "communication interface" is a general term and may include one or more interfaces. The storage unit 603 can be a memory. When the product recommendation device 60 is a chip, the processing unit 601 can be a processor or a controller, and the communication unit 602 can be an input interface and / or an output interface, pins, or circuits, etc. The storage unit 603 can be a storage unit within the chip (e.g., a register, cache, etc.) or a storage unit located outside the chip (e.g., read-only memory (ROM), random access memory (RAM, etc.).

[0162] The communication unit can also be called a transceiver unit. The antenna and control circuit with transceiver functions in the product recommendation device 60 can be considered as the communication unit 602 of the product recommendation device 60, and the processor with processing functions can be considered as the processing unit 601 of the product recommendation device 60. Optionally, the device in the communication unit 602 that implements the receiving function can be considered as a communication unit, which is used to execute the receiving steps in the embodiments of this application. The communication unit can be a receiver, a receiver circuit, etc. The device in the communication unit 602 that implements the transmitting function can be considered as a transmitting unit, which is used to execute the transmitting steps in the embodiments of this application. The transmitting unit can be a transmitter, a transmitter, a transmitting circuit, etc.

[0163] Figure 6 If the integrated units in the process are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. Storage media for storing computer software products include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.

[0164] Figure 6 The units in the process can also be called modules; for example, a processing unit can be called a processing module.

[0165] This application embodiment also provides a hardware structure diagram of a product recommendation device (denoted as product recommendation device 70), see [link to diagram]. Figure 7The product recommendation device 70 includes a processor 701, and optionally, a memory 702 connected to the processor 701.

[0166] In the first possible implementation, see Figure 7 The product recommendation device 70 also includes a transceiver 703. The processor 701, memory 702, and transceiver 703 are connected via a bus. The transceiver 703 is used to communicate with other devices or communication networks. Optionally, the transceiver 703 may include a transmitter and a receiver. The device in the transceiver 703 that implements the receiving function can be considered as a receiver, which is used to perform the receiving steps in the embodiments of this application. The device in the transceiver 703 that implements the transmitting function can be considered as a transmitter, which is used to perform the transmitting steps in the embodiments of this application.

[0167] Based on the first possible implementation method Figure 7 The structural diagram shown can be used to illustrate the structure of the product recommendation device involved in the above embodiments.

[0168] in, Figure 7 This can also be illustrated by the system chip in the product recommendation device. In this case, the actions performed by the product recommendation device can be implemented by this system chip; the specific actions performed can be found above and will not be repeated here.

[0169] In implementation, each step of the method provided in this embodiment can be completed by integrated logic circuits in the processor or by instructions in software form. The steps of the method disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor.

[0170] The processor in this application may include, but is not limited to, at least one of the following: a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a microcontroller unit (MCU), or an artificial intelligence processor, etc., which are various computing devices that run software. Each computing device may include one or more cores for executing software instructions to perform calculations or processing. The processor may be a separate semiconductor chip or integrated with other circuits into a single semiconductor chip. For example, it may be integrated with other circuits (such as encoding / decoding circuits, hardware acceleration circuits, or various bus and interface circuits) to form a SoC (System-on-a-Chip), or it may be integrated as a built-in processor within an ASIC. The ASIC with the integrated processor may be packaged separately or together with other circuits. In addition to the cores for executing software instructions to perform calculations or processing, the processor may further include necessary hardware accelerators, such as field-programmable gate arrays (FPGAs), PLDs (programmable logic devices), or logic circuits that implement dedicated logic operations.

[0171] The memory in the embodiments of this application may include at least one of the following types: read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions; random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions; or electrically erasable programmable-only memory (EEPROM). In some scenarios, the memory may also be a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto.

[0172] This application also provides a computer-readable storage medium including instructions that, when run on a computer, cause the computer to perform any of the methods described above.

[0173] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the methods described above.

[0174] This application also provides a chip including a processor and an interface circuit. The interface circuit is coupled to the processor. The processor is used to run computer programs or instructions to implement the above-described method. The interface circuit is used to communicate with other modules outside the chip.

[0175] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device containing one or more servers, data centers, etc., that can be integrated with the medium. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks (SSDs)).

[0176] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.

[0177] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.

Claims

1. A product recommendation method based on graph attention networks, characterized in that, include: Construct heterogeneous graph data between products and users, and build a corresponding graph attention network model based on the heterogeneous graph data; The heterogeneous graph data is used to characterize the relationship between users and products; Acquire user characteristic data and product characteristic data; the user characteristic data includes at least one of age, gender, region, and historical purchase preferences; the product characteristic data includes at least one of category, price, brand, and rating. The user feature data and the product feature data are input into the graph attention network model to obtain the user's recommendation results for various types of products; The graph attention network model includes multiple self-attention mechanism layers, a multi-level feature fusion module, and a classification module. The self-attention mechanism layer includes a self-attention search space, which is composed of various types of self-attention operators. The step of inputting the user feature data and the product feature data into the graph attention network model to obtain the user's recommendation results for various products includes: For each self-attention mechanism layer, the corresponding user feature data and product feature data are input into the self-attention search space of the self-attention mechanism layer. Based on the continuous probability approach, the optimal combination of self-attention operators is adaptively searched in the self-attention search space. The optimal combination of self-attention operators is the combination of self-attention operators with the largest weight among various combinations of self-attention operators determined based on node features. For the feature data obtained based on the optimal combination of self-attention operators at each level, adaptive fusion is performed through mixed weights, and the recommendation results of users for various types of products are calculated through the cross-entropy loss function; The self-attention operator is used to characterize the following formula: in, For the first f Each self-attention operator corresponds to i Node to j Weights between nodes For the first f The activation function of a self-attention operator, , They represent i Nodes and j Node characteristics For the first f The computational operations corresponding to the type of each self-attention operator.

2. The method according to claim 1, characterized in that, The construction of heterogeneous graph data between products and users includes: Users and products are treated as nodes in a heterogeneous graph, and the edges between users and products are determined based on the interaction operations between them; the interaction operations include at least one of purchasing, rating, browsing, adding to favorites, and adding to cart. The weights of the edges are determined based on the interaction strength between the user and the product, and heterogeneous graph data is generated.

3. The method according to claim 1, characterized in that, The self-attention operator includes at least one of the following types: Connect self-attention operators; Cosine self-attention operator; Additive self-attention operator; Dot product self-attention operator; Subtraction self-attention operator; Hadamard multiplies the self-attention operator.

4. The method according to claim 1, characterized in that, The probability-based continuity approach is implemented in the self-attention search using the following formula: in, , They represent i Nodes and j Node characteristics j Node is i The set of neighboring nodes of a node The nodes in For the first f Each self-attention operator corresponds to i Node to j Weights between nodes.

5. The method according to claim 1, characterized in that, The feature data obtained based on the optimal combination of self-attention operators is processed by the following formula: Where Z represents the processed feature data. Let be the probability weight corresponding to the l-th self-attention operator. Let be the output feature corresponding to the l-th self-attention operator.

6. The method according to claim 1, characterized in that, The cross-entropy loss function satisfies the following formula: in, The cross-entropy loss is given by m, where m is the number of nodes and C is the number of classes. For the first i The true category label of each node For the first i Each node belongs to the category j The probability of.

7. A product recommendation device employing the method according to any one of claims 1-6, characterized in that, The device includes: a communication unit and a processing unit; The processing unit is used to construct heterogeneous graph data between products and users, and to construct a corresponding graph attention network model based on the heterogeneous graph data; the heterogeneous graph data is used to represent the relationship between users and products. The communication unit is used to acquire user characteristic data and product characteristic data; the user characteristic data includes at least one of age, gender, region, and historical purchase preferences; the product characteristic data includes at least one of category, price, brand, and rating. The processing unit is used to input the user feature data and the product feature data into the graph attention network model to obtain the user's recommendation results for various types of products.

8. A product recommendation device, characterized in that, include: A processor and a communication interface; the communication interface is coupled to the processor, the processor being used to run computer programs or instructions to implement the method for constructing a graph attention network model as described in any one of claims 1-6.