Product recommendation method and device, recommendation model training method and device and related equipment

By dynamically updating node characterization vectors and hash vectors in the graph structure, combining semantics and structural features, the problem of insufficient recommendation accuracy and efficiency in the prior art is solved, and efficient product recommendation is achieved.

CN120410690APending Publication Date: 2025-08-01CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510744707.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

Existing product recommendation technologies are difficult to effectively capture complex structural features, resulting in insufficient recommendation accuracy or ineffective computing efficiency.

Method used

By constructing node characterization vectors and hash vectors in the graph structure, dynamically update node features, combining semantic information and structural features, using preset recommendation models to fusion of multi-dimensional features, improve recommendation accuracy and efficiency.

Benefits of technology

It significantly improves the accuracy and computing efficiency of product recommendations, adapts to the real-time recommendation needs of large-scale dynamic graph structures, and captures the high-order topological characteristics of user-product relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120410690A_ABST
    Figure CN120410690A_ABST
Patent Text Reader

Abstract

The invention discloses a product recommendation method and device, a recommendation model training method and device and related equipment, and relates to the technical field of computers.The method comprises the steps that a first representation vector and a first hash vector of each node in a pre-constructed graph structure are obtained; according to the first representation vectors and the first hash vectors of all neighbor nodes adjacent to the target node in the graph structure, updating to obtain a second representation vector and a second hash vector of the target node; the target node is a first node or a second node; determining structural features between the first node and the second node based on the second hash vector of the first node and the second hash vector of the second node; and inputting the second representation vector of the first node, the second representation vector of the second node and the structural feature into a preset recommendation model to obtain a recommendation score between the first node and the second node. According to the embodiment of the invention, node information in the graph structure can be fully utilized, calculation redundancy is reduced, and recommendation precision and calculation efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a product recommendation method, a recommendation model training method, an apparatus, and related devices. Background Art

[0002] As a technology that uses data analysis and algorithms to provide personalized recommendations for users, product recommendation technology can predict the products or services that users may like based on users' historical behaviors, preferences, and interests. Currently, product recommendation technology mainly relies on graph structure modeling to construct a user-product interaction graph, and learns node representations through message passing mechanisms or subgraph feature extraction. In related technologies, although graph convolutional-based models are computationally efficient, they are difficult to capture complex structural features, such as shortest paths, higher-order topologies, etc. And although subgraph extraction methods can model complex structures, they need to sample subgraphs separately for each pair of user-products, resulting in redundant calculations and low efficiency. It can be seen that the product recommendation methods in related technologies have problems of insufficient utilization of structural information or high computational costs, which restrict the recommendation accuracy and computational efficiency. Summary of the Invention

[0003] Embodiments of this application provide a product recommendation method, a recommendation model training method, an apparatus, and related devices, which can make full use of node information in the graph structure, reduce computational redundancy, and improve recommendation accuracy and computational efficiency.

[0004] In a first aspect, embodiments of this application provide a product recommendation method, including:

[0005] Obtain a first representation vector and a first hash vector of each node in a pre-constructed graph structure; wherein, the graph structure includes at least one user node and at least one product node;

[0006] Update to obtain a second representation vector and a second hash vector of the first node according to the first representation vectors and first hash vectors of all neighbor nodes adjacent to the first node in the graph structure, and update to obtain a second representation vector and a second hash vector of the second node according to the first representation vectors and first hash vectors of all neighbor nodes adjacent to the second node in the graph structure; wherein, the first node is any user node among the at least one user node, and the second node is any product node having an interaction relationship with the first node among the at least one product node;

[0007] Determine the structural features between the first node and the second node based on the second hash vector of the first node and the second hash vector of the second node;

[0008] Input the second representation vector of the first node, the second representation vector of the second node, and the structural feature into a preset recommendation model to obtain the recommendation score between the first node and the second node.

[0009] Optionally, before obtaining the first representation vector of each node in the pre-constructed graph structure, the method further includes at least one of the following:

[0010] Obtain the user feature or product feature of at least one third node, and construct the first representation vector of the third node based on the user feature or the product feature;

[0011] Construct the Gaussian random vector of at least one fourth node to obtain the first representation vector of the fourth node;

[0012] Wherein, the third node is a node in the graph structure with the user feature or the product feature, and the fourth node is a node in the graph structure without the user feature or the product feature.

[0013] Optionally, the obtaining of the first hash vector of each node in the pre-constructed graph structure includes:

[0014] Construct at least two permutation functions on the set composed of n nodes in the graph structure;

[0015] Based on the at least two permutation functions, obtain the first hash vector of each of the n nodes;

[0016] Wherein, the n nodes include the at least one user node and the at least one product node, and n is an integer greater than or equal to 2.

[0017] Optionally, before updating the second representation vector and the second hash vector of the first node according to the first representation vectors and the first hash vectors of all neighbor nodes adjacent to the first node in the graph structure, and updating the second representation vector and the second hash vector of the second node according to the first representation vectors and the first hash vectors of all neighbor nodes adjacent to the second node in the graph structure, the method further includes:

[0018] Iteratively update the first representation vector of the target node according to the representation vectors of all neighbor nodes adjacent to the target node in the graph structure until the number of iterations reaches a preset hyperparameter; wherein, the target node is any node in the graph structure;

[0019] Iteratively update the first hash vector of the target node according to the hash vectors of all neighbor nodes adjacent to the target node in the graph structure until the number of iterations reaches a preset hyperparameter.

[0020] Optionally, updating the second representation vector of the first node according to the first representation vectors and the first hash vectors of all neighbor nodes adjacent to the first node in the graph structure includes:

[0021] Obtaining all neighbor nodes adjacent to the first node from the graph structure;

[0022] Adding the first representation vectors of all neighbor nodes adjacent to the first node and then performing a linear transformation to obtain a first vector;

[0023] Performing a linear transformation on the first representation vector of the first node to obtain a second vector;

[0024] Inputting the first vector and the second vector into a non-linear activation function to obtain the second representation vector of the first node;

[0025] Updating the second representation vector of the second node according to the first representation vectors and the first hash vectors of all neighbor nodes adjacent to the second node in the graph structure includes:

[0026] Obtaining all neighbor nodes adjacent to the second node from the graph structure;

[0027] Adding the first representation vectors of all neighbor nodes adjacent to the second node and then performing a linear transformation to obtain a third vector;

[0028] Performing a linear transformation on the first representation vector of the second node to obtain a fourth vector;

[0029] Inputting the third vector and the fourth vector into a non-linear activation function to obtain the second representation vector of the second node.

[0030] Optionally, updating the second hash vector of the first node according to the first hash vectors of all neighbor nodes adjacent to the first node includes:

[0031] Updating the first target element in the first hash vector of the first node to the minimum value of the first hash vectors of all neighbor nodes in the dimension where the first target element is located, to obtain the second hash vector of the first node;

[0032] Updating the second hash vector of the second node according to the first hash vectors of all neighbor nodes adjacent to the second node includes:

[0033] Update the second target element in the first hash vector of the second node to the minimum value of the first hash vectors of all neighbor nodes in the dimension where the second target element is located, to obtain the second hash vector of the second node;

[0034] Wherein, the first target element is any element in the first hash vector of the first node, and the second target element is any element in the first hash vector of the second node.

[0035] Optionally, determining the structural features between the first node and the second node based on the second hash vector of the first node and the second hash vector of the second node includes:

[0036] Determine the Hamming distance between the first node and the second node based on the second hash vector of the first node and the second hash vector of the second node;

[0037] Obtain the structural features based on the Hamming distance.

[0038] Optionally, the preset recommendation model is used to perform non-linear transformation after concatenating and processing the second representation vector of the first node, the second representation vector of the second node, and the structural features, to obtain the recommendation score between the first node and the second node.

[0039] In a second aspect, an embodiment of the present application provides a recommendation model training method, including:

[0040] Obtain target training data based on at least two user nodes and at least two product nodes in a pre-generated graph structure;

[0041] Input the target training data into an initial recommendation model for training to obtain at least one recommendation score corresponding to the target training data;

[0042] Determine the loss value of the loss function based on at least one recommendation score corresponding to the target training data;

[0043] Optimize the initial recommendation model based on the loss value until the loss value of the loss function converges to obtain a preset recommendation model.

[0044] Optionally, the at least two user nodes include a first user node and at least one second user node, the at least two product nodes include at least one first product node and at least one second product node, and there is no connected edge between any one of the second user nodes and any one of the second product nodes in the graph structure;

[0045] The target training data includes a positive sample set and a negative sample set. The positive sample set includes at least one edge in a pre-constructed graph structure for connecting a first user node and a first product node. The negative sample set includes at least two negative samples composed of at least two second user nodes and at least two second product nodes in the graph structure.

[0046] Optionally, obtaining target training data based on at least two user nodes and at least two product nodes in a pre-generated graph structure includes:

[0047] [[ID=!6]]Obtaining the edges between each of the first user nodes and the at least one first product node in the graph structure to obtain at least two edges;

[0048] Randomly sampling at least one edge from the at least two edge pairs as the positive sample set;

[0049] Randomly sampling the at least two second user nodes and the at least two second product nodes from the graph structure to construct the at least two negative samples, obtaining the negative sample set.

[0050] In a third aspect, an embodiment of the present application further provides a product recommendation device, including:

[0051] A first acquisition module, configured to acquire a first feature vector and a first hash vector of each node in a pre-constructed graph structure; wherein, the graph structure includes at least one user node and at least one product node;

[0052] A vector update module, configured to update to obtain a second feature vector and a second hash vector of the first node according to the first feature vectors and first hash vectors of all neighbor nodes adjacent to the first node in the graph structure, and update to obtain a second feature vector and a second hash vector of the second node according to the first feature vectors and first hash vectors of all neighbor nodes adjacent to the second node in the graph structure; wherein, the first node is any one of the at least one user nodes, and the second node is any one of the at least one product nodes having an interaction relationship with the first node;

[0053] A first determination module, configured to determine a structural feature between the first node and the second node based on the second hash vector of the first node and the second hash vector of the second node;

[0054] A second acquisition module, configured to input the second feature vector of the first node, the second feature vector of the second node, and the structural feature into a preset recommendation model to obtain a recommendation score between the first node and the second node.

[0055] Fourthly, an embodiment of the present application further provides a recommendation model training device, including:

[0056] A data acquisition module, configured to obtain target training data based on at least two user nodes and at least two product nodes in a pre-generated graph structure;

[0057] A model training module, configured to input the target training data into an initial recommendation model for training to obtain at least one recommendation score corresponding to the target training data;

[0058] A second determination module, configured to determine a loss value of a loss function based on at least one recommendation score corresponding to the target training data;

[0059] A third acquisition module, configured to adjust parameters of the initial recommendation model based on the loss value until the loss value of the loss function converges to obtain a preset recommendation model.

[0060] Fifthly, an embodiment of the present application provides an electronic device, including: a processor, a memory, and a program stored on the memory and executable on the processor, where when the program is executed by the processor, it implements the steps in the product recommendation method described in any item of the first aspect, or implements the steps in the recommendation model training method described in any item of the second aspect.

[0061] Sixthly, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the steps in the product recommendation method described in any item of the first aspect, or implements the steps in the recommendation model training method described in any item of the second aspect.

[0062] Seventhly, an embodiment of the present application further provides a computer program product, where the computer program product is stored in a storage medium, and the computer program product is executed by at least one processor to implement the steps in the product recommendation method described in any item of the first aspect, or implement the steps in the recommendation model training method described in any item of the second aspect.

[0063] This application realizes in-depth modeling of the relationship between users and products by pre-constructing a graph structure of user-product interaction and using the joint optimization of the representation vectors and hash vectors of the nodes therein. First, the first representation and the first hash vector of the nodes in the graph structure are obtained, and then the representation vectors and hash vectors of the first node and the second node are updated by aggregating neighbor nodes to strengthen the semantic expression of the node features. Subsequently, the structural features between the user and the product are calculated by combining the updated second hash vectors of the first node and the second node, and the second representation vector, the second hash vector, and the structural features of the nodes are input into the recommendation model to achieve accurate score prediction with multi-dimensional feature fusion. The embodiments of this application can effectively capture the high-order topological characteristics of the user-product relationship, improve the accuracy and generalization ability of the recommendation results, and at the same time reduce the computational complexity through the efficient encoding of the hash vectors to meet the real-time recommendation requirements of large-scale dynamic graph structures, significantly improving the recommendation accuracy and computational efficiency. Description of the Drawings

[0064] To more clearly illustrate the technical solutions of the embodiments of this application, the following will briefly introduce the drawings required for the description of the embodiments of this application. Obviously, the following described drawings are only some embodiments of this application, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.

[0065] Figure 1 One of the flowcharts of a product recommendation method in the embodiments of this application;

[0066] Figure 2 Another flowchart of a product recommendation method in the embodiments of this application;

[0067] Figure 3 is Figure 1 The schematic diagram of the model framework of the preset recommendation model in

[0068] Figure 4 One of the flowcharts of a recommendation model training method in the embodiments of this application;

[0069] Figure 5 Another flowchart of a recommendation model training method in the embodiments of this application;

[0070] Figure 6 The schematic diagram of a product recommendation device in the embodiments of this application;

[0071] Figure 7 The schematic diagram of a recommendation model training device in the embodiments of this application;

[0072] Figure 8 The schematic diagram of an electronic device in the embodiments of this application;

[0073] Figure 9 It is a schematic diagram of another electronic device in an embodiment of the present application. Specific implementation manners

[0074] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present application.

[0075] The embodiments of the present application provide a product recommendation method, a recommendation model training method, an apparatus and related devices. Next, the embodiments of the present application will be described in detail with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0076] Please refer to Figure 1 , a product recommendation method in the embodiments of the present application specifically includes the following steps:

[0077] Step 101: Obtain the first representation vector and the first hash vector of each node in the pre-constructed graph structure; wherein, the graph structure includes at least one user node and at least one product node.

[0078] It should be noted that the graph structure is the basis of the preset recommendation model in the embodiments of the present application and can be used to capture the topological relationship between users and products, such as neighbor nodes, path length, structural features, etc. The above graph structure can be a pre-constructed bipartite graph structure of users and products, which is constructed through user historical interaction records. Specifically, in the graph structure, each user and product can be regarded as a separate node. Exemplarily, if user u has purchased product v or has an interaction operation with product v, such as adding it to the shopping cart, clicking, browsing, or searching for the product, then an edge can be constructed between node u and node v. The graph structure thus formed is denoted as G(V, E). Wherein, V represents the set of pairs of user and product nodes with interactions; E represents the set of edges corresponding to V. In the graph structure, multiple nodes can be included. n represents the total number of nodes, and m represents the number of edges. In addition, a number between 0 and n - 1 can be assigned to each node to represent a specific user node.

[0079] The above-mentioned first representation vector can be understood as the initial representation vector of a node. The initial feature vectors of each user node or product node can be generated based on information such as the user's historical behavior and product attributes. Exemplarily, the representation vector of a user node can include the user's historical purchase records, browsing preferences, etc. The representation vector of a product node can include product categories, prices, tags, etc. Specifically, the first representation vector can be generated by means of random initialization, feature-based embedding, etc.

[0080] The above-mentioned first hash vector can be the structural feature vector of each node, generated by a permutation hash function, and is used to save the structural information of the node in the graph, such as neighbor relationships, path lengths, etc. Exemplarily, the hash vector of user A may represent the structural features of its neighbor nodes. For example, the neighbors of user A are user B and product X, and the hash vector can reflect these relationships. In the embodiments of the present application, the hash vector is generated by a permutation function to ensure the uniqueness of the "password" of each node while retaining the local information of the graph structure.

[0081] In the specific steps, the initial representation vectors and hash vectors of all nodes in the graph structure are obtained, providing a basis for subsequent node update and score prediction. A graph structure is constructed, with users and products as nodes and interaction relationships as edges, forming a graph structure G(V, E). Subsequently, a first representation vector is generated for each node, and a first hash vector is generated through a permutation hash function. In this way, the above steps generate the representation vectors and hash vectors of all nodes in the graph through initialization and hash functions, providing a basis for subsequent node update and score prediction.

[0082] Step 102: Update to obtain the second representation vector and the second hash vector of the first node according to the first representation vectors and the first hash vectors of all neighbor nodes adjacent to the first node in the graph structure, and update to obtain the second representation vector and the second hash vector of the second node according to the first representation vectors and the first hash vectors of all neighbor nodes adjacent to the second node in the graph structure; wherein, the first node is any one of the at least one user nodes, and the second node is any one of the at least one product nodes that has an interaction relationship with the first node.

[0083] It is worth mentioning that the target node can be the first node or the second node. The first node can be any user node in the graph structure, and the second node can be any product node in the graph structure that has an interaction relationship with the first node. Exemplarily, if the target node is User A (the first node), its neighbor nodes may include other users or products. If the target node is Product X (the second node), its neighbor nodes may include users or other products. Additionally, the neighbor nodes can be nodes directly connected to the target node, i.e., they can be connected by edges. Exemplarily, the neighbors of User A may include Product X, User B, etc. The neighbors of Product X may include User A, User C, etc.

[0084] In the above steps, by aggregating the representation vectors and hash vectors of the neighbor nodes, the representation vector and hash vector of the target node are dynamically updated to more accurately reflect the semantic information and structural information of the node. Specifically, the representation vector of the target node can be updated by aggregating the representation vectors of the neighbor nodes, i.e., from the first representation vector to the second representation vector. In applications, the first representation vectors of all neighbor nodes of the target node can be weighted averaged or concatenated to obtain the second representation vector. Also, the hash vector of the target node can be updated by aggregating the hash vectors of the neighbor nodes, i.e., from the first hash vector to the second hash vector. In applications, the minimum value of each element or other operations can be performed on the first hash vectors of all neighbor nodes of the target node.

[0085] Thus, the updated second representation vector and second hash vector are obtained. Among them, the second representation vector can reflect the semantic information of the target node, such as user interests, product attributes, etc., and is dynamically updated through neighbor information. The second hash vector can reflect the structural information of the target node, such as neighbor relationships, graph structures, etc., and can be generated by aggregating neighbor hash vectors.

[0086] Step 103: Determine the structural features between the first node and the second node based on the second hash vector of the first node and the second hash vector of the second node;

[0087] In the embodiments of the present application, by comparing the second hash vectors of the first node (user node) and the second node (product node), the structural features between them can be extracted for subsequent recommendation score prediction.

[0088] It should be noted that the above structural features can be a quantitative representation of the relationship between two nodes in the graph structure, reflecting their topological relationship, such as neighbor similarity, path length, structural similarity, etc. Exemplarily, the structural features of user A and product X may indicate whether they share similar neighbor nodes in the graph or whether they are in similar structural positions. In the embodiments of the present application, the structural features are an abstraction of the graph structure information, used to supplement the characterization vector or semantic information, improving the accuracy of recommendation.

[0089] Specifically, the structural features can be determined by calculating the Hamming distance between the second hash vector of the first node and the second hash vector of the second node to determine the number of different elements in the two hash vectors. Or, the similarity of the two hash vectors (the closer the value is to 1, the more similar) can be measured to determine the structural features. Or, the two hash vectors can be concatenated and input into a neural network to extract high-order structural features. The present application does not make specific limitations on this process.

[0090] It is worth mentioning that the above structural features are a quantitative representation of the graph structure information and are complementary to the characterization vector. Thus, the characterization vector (i.e., semantic information) and the structural features (i.e., structural information) can jointly describe the relationship between the user and the product. Exemplarily, the characterization vector of user A may represent their interests, such as liking technology products, while the structural features may indicate whether user A and product X share similar neighbors, such as other users who like technology products. In this way, the structural features can capture high-order relationships in the graph, such as multi-hop paths between users and products, triangular structures in the graph, etc., making up for the deficiencies of traditional methods in terms of structural information and improving the accuracy of recommendation.

[0091] Step 104: Input the second characterization vector of the first node, the second characterization vector of the second node, and the structural features into a preset recommendation model to obtain the recommendation score between the first node and the second node.

[0092] In the above steps, the semantic information (i.e., the second representation vector) and the structural information (i.e., the structural feature) of the user node and the product node can be input into a preset recommendation model, and finally the recommended score of the user for the product is output. The above preset recommendation model can be a Multilayer Perceptron (MLP) or a Graph Neural Network (GNN), which is used to fuse semantic information and structural information. Specifically, the second representation vector of the first node, the second representation vector of the second node, and the structural feature can be concatenated into a long vector, input into the MLP, and the representation vector and the structural feature are weighted by learnable weights, and finally the final score is generated through a fully connected layer (such as Sigmoid or Softmax). In the application, products can be selectively recommended to the user through the ratings of the user for each product, so as to achieve Personalized Recommendation (PR).

[0093] As can be seen from the foregoing embodiments, the embodiments of the present application solve the deficiencies of the traditional recommendation system in semantic information capture and graph structure modeling through graph structure modeling, dynamic update of the representation vector and the hash vector, structural feature extraction, and multimodal fusion recommendation model. Through the joint modeling of semantic information (representation vector) and structural information (hash vector), the multi-dimensional relationship between the user and the product is captured, avoiding the limitation of the traditional method that only relies on a single information source. Moreover, the hash vector effectively retains the local information of the graph structure through the full permutation function and neighbor aggregation, solving the problem of insufficient modeling of high-order structures by the traditional graph convolution method. In addition, the generation and comparison operations of the hash vector are computationally efficient and suitable for large-scale graph data; the model structure is flexible and supports multi-task and real-time recommendation. Therefore, the embodiments of the present application realize the comprehensive modeling of the relationship between the user and the product, solve the deficiencies of the traditional recommendation system in semantic information capture and graph structure modeling, and significantly improve the accuracy, efficiency, and scalability of the recommendation.

[0094] Please refer to Figure 2 , Figure 2 is the second schematic flowchart of a product recommendation method in the embodiments of the present application. The method specifically includes the following steps:

[0095] Step 201, based on the historical user-product interaction records, construct a graph structure, where the graph structure includes at least one user node and at least one product node;

[0096] Step 202: Obtain the user features or product features of at least one third node, and construct a first representation vector of the third node based on the user features or the product features; construct Gaussian random vectors of at least one fourth node to obtain a first representation vector of the fourth node; wherein, the third node is a node in the graph structure with the user features or the product features, and the fourth node is a node in the graph structure without the user features or the product features;

[0097] Step 203: Obtain all neighbor nodes adjacent to the target node from the graph structure; add the first representation vectors of all neighbor nodes adjacent to the target node and then perform a linear transformation process to obtain a first vector; perform a linear transformation process on the first representation vector of the target node to obtain a second vector; input the first vector and the second vector into a non-linear activation function to obtain a second representation vector of the target node;

[0098] Step 204: Construct at least two permutation functions on a set composed of n nodes in the graph structure; based on the at least two permutation functions, obtain a first hash vector of each node in the n nodes; wherein, the n nodes include the at least one user node and the at least one product node, and n is an integer greater than or equal to 2;

[0099] Step 205: Update the target element in the first hash vector of the target node to the minimum value of the first hash vectors of all neighbor nodes in the dimension where the target element is located, to obtain a second hash vector of the target node; wherein, the target element is any element in the first hash vector of the target node;

[0100] Step 206: Determine the Hamming distance between the first node and the second node based on the second hash vector of the first node and the second hash vector of the second node; obtain the structural feature based on the Hamming distance;

[0101] Step 207: Input the second representation vector of the first node, the second representation vector of the second node, and the structural feature into a preset recommendation model to obtain a recommendation score between the first node and the second node.

[0102] Optionally, before obtaining the first representation vector of each node in the pre-constructed graph structure, the method further includes at least one of the following:

[0103] Obtain the user features or product features of at least one third node, and construct the first representation vector of the third node based on the user features or the product features;

[0104] Construct at least one Gaussian random vector for the fourth node to obtain the first representation vector of the fourth node;

[0105] Among them, the third node is the node in the graph structure with the user feature or the product feature, and the fourth node is the node in the graph structure without the user feature or the product feature.

[0106] In some embodiments, before obtaining the first representation vector of each node in the graph structure, the following two strategies can be introduced to address the situation of missing node features or incomplete data, and improve the robustness and adaptability of the model. Specifically, it includes:

[0107] In a specific embodiment, a first representation vector can be generated for the nodes in the graph structure with user features or product features, such as the third node. For user nodes, user features can be extracted, such as historical behavior, age, gender, interest tags, etc. For product nodes, product features can be extracted, such as category, price, tags, description text, etc. Subsequently, the user features or product features can be converted into vectors with a fixed dimension through an embedding layer or a feature encoder (such as MLP, Transformer). Exemplarily, for user features, for example, historical purchase records can be mapped to a vector h u . For product features, for example, product categories generate a vector h through one-hot encoding or an embedding layer v . Thus, the encoded feature vectors h u , h v , etc. can be used as the first representation vectors of the nodes. In this way, this embodiment directly uses user / product features to generate the first representation vector, avoiding representation bias caused by insufficient graph structure information. At the same time, accurate modeling can be performed on nodes with clear features (such as old users, popular products), improving the recommendation quality.

[0108] In another specific embodiment, a first representation vector can be generated for the nodes in the graph structure without user features or product features, such as the fourth node. Among them, the fourth node can be a node without provided user features (such as new users) or product features (such as new products). Random sampling can be performed from the Gaussian distribution N(0,σ 2 ) to generate a vector h with a fixed dimension i , for example, with a mean of 0 and a variance of Random generation from a Gaussian distribution. Furthermore, the Gaussian random vector can be used as the first representation vector of the node for subsequent steps. In this way, nodes without features (such as new users and new products) can be provided with initialized representation vectors, avoiding the situation where the model cannot be processed due to lack of features. Through random initialization, the model automatically learns the potential features of these nodes during training, improving the adaptability to the cold start problem.

[0109] In this way, in the embodiments of the present application, the construction of the third node feature is applicable to nodes with clear features, and the generation of the fourth node Gaussian random vector is applicable to nodes without features. The two jointly cover the representation generation requirements of all nodes in the graph structure. Moreover, the generation method can be dynamically selected according to the integrity of the node features, avoiding the deviation caused by the unified initialization strategy. In addition, the embodiments of the present application also support dynamic update (such as automatically triggering the generation of Gaussian random vectors when new nodes are added), adapting to real-time recommendation scenarios.

[0110] Optionally, the obtaining of the first hash vector of each node in the pre-constructed graph structure includes:

[0111] Construct at least two permutation functions on the set of n nodes in the graph structure;

[0112] Based on the at least two permutation functions, obtain the first hash vector of each of the n nodes;

[0113] Wherein, the n nodes include the at least one user node and the at least one product node, and n is an integer greater than or equal to 2.

[0114] In some embodiments, when obtaining the first hash vector of each node in the graph structure, generating the hash vector by constructing a permutation function can effectively capture the local information of the graph structure while ensuring the uniqueness and structural sensitivity of the hash vector.

[0115] The above first hash vector can be constructed by a permutation function. d different permutation functions p1,..., p d can be selected. The k-th dimension of the hash vector m i of each node i stores the value of p k (i), that is, m i [k] = p <> k (i). It can be seen that this first hash vector encodes the structural information between nodes, providing a basis for subsequent neighbor aggregation and feature learning.

[0116] Specifically, at least two permutation functions are generated on the set of n nodes of the graph structure for generating hash vectors. The n nodes (including user nodes and product nodes) in the graph structure are numbered as 0, 1, 2, …, n - 1. Example: If there are 3 nodes (User A, Product X, User B) in the graph, they are numbered as 0, 1, 2. Randomly generate at least two permutation functions p1, …, p d , where each function can map {0, 1, …, n - 1} to a unique permutation. Thus, based on the permutation functions, a first hash vector can be generated for each node. The first hash vector of each node obtained in this way is its mapping result in all permutation functions.

[0117] It is worth mentioning that the randomness of the permutation functions ensures the uniqueness of the hash vectors, avoiding the generation of the same hash vectors for different nodes. The diversity of the permutation functions (such as multiple functions) can also enhance the sensitivity of the first hash vectors in the embodiments of the present application to the graph structure. The above-mentioned first hash vectors are generated through the mapping results of the permutation functions and directly reflect the structural positions of the nodes in the graph. In addition, the dimension of the first hash vector is determined by the number of permutation functions (for example, when d = 2, the length of the hash vector is 2).

[0118] In this way, in the above embodiments, the mapping results of the permutation functions are related to the numbers of the nodes, can capture the local information of the graph structure, and improve the accuracy of the recommendation system. At the same time, the randomness of the permutation functions ensures the uniqueness of the hash vectors of each node, avoiding the generation of the same hash vectors for different nodes and enhancing the robustness of the model. In addition, the generation of the permutation functions and the calculation of the hash vectors only involve simple array mapping and do not require complex calculations, which is suitable for large-scale graph data.

[0119] Optionally, before updating the second representation vector and the second hash vector of the first node according to the first representation vectors and the first hash vectors of all neighbor nodes adjacent to the first node in the graph structure, and updating the second representation vector and the second hash vector of the second node according to the first representation vectors and the first hash vectors of all neighbor nodes adjacent to the second node in the graph structure, the method further includes:

[0120] Iteratively updating the first representation vector of the target node according to the representation vectors of all neighbor nodes adjacent to the target node in the graph structure until the number of iterations reaches a preset hyperparameter; where the target node is any node in the graph structure;

[0121] Iteratively updating the first hash vector of the target node according to the hash vectors of all neighbor nodes adjacent to the target node in the graph structure until the number of iterations reaches a preset hyperparameter.

[0122] It should be noted that in the graph structure, the representation vectors and hash vectors of nodes need to dynamically reflect the features and structural information of their neighbor nodes. However, aggregating neighbor information once may not fully capture the complex relationships in the graph (such as multi-hop paths, high-order structures). Through multiple rounds of iterative updates, nodes can gradually integrate neighbor information at greater distances, thereby generating more robust representations.

[0123] In some embodiments, the iterative process is divided into two parts, namely the iterative update of the representation vector and the iterative update of the hash vector, both based on the current state of the neighbor nodes. Among them, for the iterative update of the representation vector, the representation vector of each node (such as the historical behavior of the user, product attributes, etc.) has been initialized, which may be generated through feature embedding or random initialization. In each round of iteration, the target node collects the current representation vectors of all its neighbor nodes. Subsequently, the neighbor representation vectors can be weighted and summed or concatenated to generate an aggregated vector (such as weighted average). Furthermore, a linear transformation (such as matrix multiplication) can be performed on the representation vector of the target node itself. Finally, the aggregated vector is combined with the current representation vector of the target node and input into a non-linear activation function (such as ReLU) to generate a new representation vector. Thus, the above process is repeated multiple times (controlled by hyperparameters) until a preset number of iterations is reached.

[0124] For the iterative update of the hash vector, the hash vector of each node is generated through a permutation function, encoding its structural information (such as neighbor relationships). In each round of iteration, the target node collects the current hash vectors of all its neighbor nodes. For each dimension of the hash vector, the minimum value of all neighbor nodes in this dimension is calculated. Subsequently, the corresponding dimension of the hash vector of the target node can be replaced with this minimum value to generate a new hash vector. Thus, the above process is repeated multiple times until a preset number of iterations is reached.

[0125] It is worth mentioning that the number of iterations can be set by hyperparameters (such as T = 5 or T = 10), which needs to be adjusted according to the graph scale and task requirements.

[0126] In the embodiments of the present application, if new nodes or edges are added to the graph, the iterative update can gradually adjust the representation vector and the hash vector, avoiding the limitations of static representations. Moreover, through multiple rounds of information propagation, the representation vectors and hash vectors of nodes can capture more complex semantic and structural relationships (such as multi-hop paths, triangle structures). In addition, by combining semantic information (representation vectors) and structural information (hash vectors), the model can more comprehensively model the relationship between users and commodities, reducing the dependence on a single information source in traditional methods.

[0127] Optionally, updating the second representation vector of the first node according to the first representation vectors and the first hash vectors of all neighbor nodes adjacent to the first node in the graph structure includes:

[0128] Obtain all neighbor nodes adjacent to the first node from the graph structure;

[0129] Add up the first representation vectors of all neighbor nodes adjacent to the first node and then perform a linear transformation to obtain a first vector;

[0130] Perform a linear transformation on the first representation vector of the first node to obtain a second vector;

[0131] Input the first vector and the second vector into a non-linear activation function to obtain the second representation vector of the first node;

[0132] Updating the second representation vector of the second node according to the first representation vectors and the first hash vectors of all neighbor nodes adjacent to the second node in the graph structure includes:

[0133] Obtain all neighbor nodes adjacent to the second node from the graph structure;

[0134] Add up the first representation vectors of all neighbor nodes adjacent to the second node and then perform a linear transformation to obtain a third vector;

[0135] Perform a linear transformation on the first representation vector of the second node to obtain a fourth vector;

[0136] Input the third vector and the fourth vector into a non-linear activation function to obtain the second representation vector of the second node.

[0137] In some embodiments of the present application, the representation vectors of the first node and the second node can be dynamically updated through the aggregation and non-linear transformation of the neighbor node representation vectors, so that they can more accurately reflect the structural relationship and semantic information of the nodes in the graph.

[0138] In application, first, neighbor nodes directly connected to the first node can be extracted from the graph structure. By aggregating the representation vectors of all neighbor nodes of the first node, a preliminary updated vector of the first node is generated. Among them, the neighbor representation vectors can be added up, that is, the first representation vectors of all neighbor nodes can be added up to obtain an aggregated vector. Subsequently, a linear transformation (such as weighted summation) is performed on the aggregated vector v1 to generate a first hash vector v1'. Secondly, the representation vector of the first node itself is transformed to generate a second vector. Among them, a linear transformation can be performed on the first representation vector of the first node to generate a second vector v2. Finally, through non-linear transformation, the aggregated information is combined with the information of the first node itself to generate a final second representation vector. In this process, the first vector and the second vector can be concatenated and then input into a non-linear activation function (such as ReLU, Sigmoid), and finally the second representation vector h of the first node is obtained.i 。

[0139] In a specific embodiment, the second representation vector can be calculated by the following formula:

[0140]

[0141] where h j represents the neighbor nodes adjacent to the target node; N i represents the set of neighbor nodes of node i; W nei , W self respectively represent the learned feature transformation matrices, which are used to linearly transform the node features at each layer; ReLU(·) represents the ReLU activation function, which can be used as an activation function to non-linearly transform the features, and the value of the ReLU activation function can be:

[0142]

[0143] where x represents a variable.

[0144] It is worth mentioning that in the above embodiment, through the aggregation of the neighbor node representation vectors, the second representation vector of the first node can reflect its local structural relationship in the graph, such as the semantic features of the neighbors. Exemplarily, the neighbors of user A include product X and user B, and their representation vectors will fuse the features of product X and user B to more accurately represent the potential interests of user A. In addition, the linear transformation and the non-linear activation function allow the model to learn different weights and dynamically adjust the representation vector of the first node to adapt to the changes in the graph structure. Exemplarily, when the neighbor nodes of user A change, its representation vector will be automatically updated to avoid the recommendation bias caused by static representation. At the same time, the combination of the linear transformation and the non-linear activation function enhances the expressive ability of the model and can capture more complex semantic and structural relationships. Exemplarily, through the ReLU activation function, the model can learn non-linear relationships (for example, the user's preference for a product may be non-linearly related to the features of the neighbor nodes).

[0145] It can be understood that the update of the second representation vector of the second node can be implemented by referring to the update process of obtaining the second representation vector of the first node. To avoid repetition, it will not be elaborated here.

[0146] In this way, through neighbor representation vector aggregation, linear transformation, and non-linear activation function, the above embodiments of the present application dynamically update the representation vector of the target node, making it more accurately reflect the semantic and structural information of the graph structure, and significantly improving the accuracy and robustness of the recommendation results.

[0147] Optionally, updating the second hash vector of the first node according to the first hash vectors of all neighbor nodes adjacent to the first node includes:

[0148] Update the first target element in the first hash vector of the first node to the minimum value of the first hash vectors of all neighbor nodes in the dimension where the first target element is located, to obtain the second hash vector of the first node;

[0149] The updating the second hash vector of the second node according to the first hash vectors of all neighbor nodes adjacent to the second node includes:

[0150] Update the second target element in the first hash vector of the second node to the minimum value of the first hash vectors of all neighbor nodes in the dimension where the second target element is located, to obtain the second hash vector of the second node;

[0151] Wherein, the first target element is any element in the first hash vector of the first node, and the second target element is any element in the first hash vector of the second node.

[0152] In some embodiments, by taking the minimum value element by element, the hash vector of the first node is dynamically updated to more accurately reflect the local information of the graph structure. Specifically, the hash vector of the target node can be updated according to the hash vectors of the neighbor nodes of the first node. First, obtain the hash vectors of the neighbor nodes, and extract the hash vectors of all neighbor nodes of the first node from the graph structure. Exemplarily, if the first node is user A, its neighbor nodes may include product X, user B, etc., and the hash vector of each neighbor node is m j . Secondly, the hash vector of the first node can be updated element by element. For each element (target element) in the hash vector of the first node, calculate the minimum value of all neighbor nodes in this dimension, and replace the corresponding element of the first node. Finally, use the updated hash vector as the second hash vector m i ' of the first node.

[0153] In a specific embodiment, the second hash vector M i can be determined by the following formula:

[0154]

[0155] Wherein, m j represents the first hash vector of the neighbor nodes of the first node; min(·) represents taking the minimum value element by element.

[0156] It is worth mentioning that in the above embodiments, by taking the minimum value, the hash vector of the first node can reflect the simplest information of the neighbor nodes in this dimension, and may capture the local similarity or compactness of the graph structure. Exemplarily, if the hash vectors of the neighbor nodes have a small value in a certain dimension, it may indicate that there is some association between the first node and these neighbors in this dimension (such as common structural features). In addition, the element-wise minimum operation only requires comparison and selection, with low computational complexity, and is suitable for large-scale graph data. Moreover, the update of the hash vector depends on the current state of the neighbor nodes and can dynamically reflect changes in the graph structure (such as newly added nodes or edges). For example, when the neighbor nodes of the first node change, its hash vector will be automatically updated, avoiding recommendation biases caused by static representations. At the same time, uniqueness can be guaranteed, that is, the hash vector is generated through the minimum value strategy to ensure the difference of the hash vectors of different nodes and avoid conflicts. Exemplarily, if the minimum values of the neighbor nodes of two nodes are the same in all dimensions, their hash vectors may be the same, but through the diversity design of the permutation function, the conflict probability can be further reduced.

[0157] It can be understood that the update of the second hash vector of the second node can be implemented by referring to the update process of obtaining the second hash vector of the first node. To avoid repetition, it will not be elaborated here.

[0158] In this way, in the above embodiments, the hash vectors of the first node and the second node are dynamically updated by taking the element-wise minimum value, making them more accurately reflect the local information of the graph structure.

[0159] Optionally, determining the structural features between the first node and the second node based on the second hash vector of the first node and the second hash vector of the second node includes:

[0160] Determining the Hamming distance between the first node and the second node based on the second hash vector of the first node and the second hash vector of the second node;

[0161] Obtaining the structural features based on the Hamming distance.

[0162] In some embodiments, the Hamming distance between the second hash vectors of the target nodes (the first node and the second node) can be calculated to generate structural features for capturing local relationships in the graph structure.

[0163] It can be understood that the Hamming distance can quantify the difference between two hash vectors and reflect the similarity or difference of nodes in the graph structure. In applications, hash vector comparison can be performed first, comparing the second hash vector m of the first node u and the second hash vector m of the second node v. Subsequently, the Hamming distance is calculated by comparing each element in each dimension element by element and counting the number of different values. Specifically, the Hamming distance d between the first node and the second node u,v can be calculated by the following formula:

[0164]

[0165] where d represents the dimension of the hash vector; if m u [i] is equal to m v [i], (m u [i] == m v [i]) returns 1, otherwise it returns 0.

[0166] Furthermore, after obtaining the Hamming distance, it can be transformed to extract semantic information, and finally the structural feature f is obtained u,v . Specifically, the transformation process for obtaining the structural feature can be expressed by the following formula:

[0167] F u,v = ReLU(W trans d u,v ) (5)

[0168] where W trans is a learnable parameter matrix; ReLU(·) is the ReLU activation function mentioned in the aforementioned formula (2).

[0169] Thus, the Hamming distance in the above embodiments directly reflects the differences between two nodes in the hash vector and captures the local relationships of the graph structure (such as neighbor similarity, path length). By quantifying the differences in the hash vectors of the target nodes with the Hamming distance, structural features are generated for capturing the local relationships of the graph structure.

[0170] Optionally, the preset recommendation model is used to splice and process the second representation vector of the first node, the second representation vector of the second node, and the structural feature, and then perform a non-linear transformation to obtain the recommendation score between the first node and the second node.

[0171] In some other embodiments, by splicing the representation vectors and the structural features and introducing non-linear transformation, multi-modal information can be fused into the recommendation score to improve the accuracy and generalization ability of the recommendation system.

[0172] It is worth mentioning that the above-mentioned splicing process is to combine the second representation vector and structural features of the user node (first node) and the product node (second node) into a unified input. The goal of non-linear transformation is to learn the complex relationship between the representation vector and the structural features through a neural network to generate a recommendation score. Therefore, the output after nonlinear transformation can be used as the user's recommendation score for the product. In this way, by splicing the representation vector (semantic information) and structural features (structural information), the model can simultaneously capture the semantic attributes and graph structure relationship between users and products.

[0173] In a specific embodiment, Figure 3 As shown, the structural features and the representation vectors of the two nodes can be fused and transformed to obtain the recommendation score between the two nodes. u,v and the characterization vectors h of the two nodes u ,h v After splicing, a nonlinear transformation is performed to give the score p between the user and the product u,v , the specific calculation process is as follows:

[0174] P u,v =σ(W1(h u ||f u,v )+W2(h v ||f u,v )+b) (6)

[0175] Among them, W1, W2, and b are all learnable parameter matrices, whose parameters can be determined by the subsequent loss function optimization model; σ(·) is the Sigmoid function, whose value is:

[0176]

[0177] Among them, the Sigmoid function can be used to convert numerical values in the real number range into probabilities in the range of (0,1).

[0178] Therefore, the above embodiment can obtain the ratings between users and products, which is applicable to various recommendation scenarios.

[0179] Please refer to Figure 4 , the embodiment of the present application provides a recommendation model training method, which specifically includes the following steps:

[0180] Step 301: Acquire target training data based on at least two user nodes and at least two product nodes in a pre-generated graph structure;

[0181] Step 302: Input the target training data into the initial recommendation model for training to obtain at least one recommendation score corresponding to the target training data;

[0182] Step 303: Determine the loss value of the loss function based on at least one recommended score corresponding to the target training data;

[0183] Step 304: Optimize the initial recommendation model based on the loss value until the loss value of the loss function converges, and obtain a preset recommendation model.

[0184] In the embodiments of the present application, target training data can be obtained based on a pre-constructed graph structure. By extracting the interaction data of user nodes and product nodes, it is used as the input data for training the recommendation model. Specifically, the interaction records of user nodes and product nodes in the graph structure can be obtained, such as user ID, product ID, score, timestamp, etc. User features (such as the historical behavior of the user), product features (such as the attributes of the product, etc.), and interaction information (such as the interaction records between the user and the product, such as scores, click times, etc.) are used as target training data.

[0185] After constructing the target training data, the initial recommendation model can be trained using the random batch training method. The initial recommendation model can be a collaborative filtering, matrix factorization, neural network (such as MLP, GNN), etc. The embodiments of the present application do not make specific limitations here. Thus, the model can learn the complex relationship between users and products and generate more accurate predicted scores.

[0186] Furthermore, based on the difference between the predicted score and the true score, the loss value of the loss function is calculated for model optimization. Specifically, the cross-entropy loss function can be used as the loss function, which can be specifically represented by the following formula (8):

[0187]

[0188] where p u,v represents the recommended score of the node pair obtained by training the node pair features h u , h v input into the initial recommendation model; exp(·) represents taking the exponential element by element; log(·) represents taking the logarithm element by element; represents the set of positive samples.

[0189] Finally, the model parameters can be adjusted through an optimization algorithm to make the loss value converge, and finally a preset recommendation model is obtained. For example, the gradient can be calculated through backpropagation to update the model parameters. Thus, the embodiments of the present application achieve finding the optimal parameters through an optimization algorithm, improving the accuracy of recommendations. Moreover, the converged model performs more stably on new data, reducing the risk of overfitting and enhancing the stability of the recommendation results.

[0190] Optionally, the at least two user nodes include a first user node and at least one second user node, the at least two product nodes include at least one first product node and at least one second product node, and there is no connected edge between any one of the second user nodes and any one of the second product nodes in the graph structure;

[0191] The target training data includes a positive sample set and a negative sample set. The positive sample set includes at least one edge for connecting the first user node and the first product node in a pre-constructed graph structure, and the negative sample set includes at least two negative samples composed of at least two second user nodes and at least two second product nodes in the graph structure.

[0192] In some specific embodiments, the discrimination ability of the model for the user-product relationship can be effectively improved by constructing the positive sample set and the negative sample set. Specifically, the sources of the positive and negative samples can be clarified by distinguishing the user nodes and product nodes in the graph structure. Among them, the first user node can be a user node that has an edge with the first product node (i.e., the user has an interaction with the commodity). The first product node can be a product node that has an edge with the first user node. The second user node can be a user node that has no edge with the second product node. The second product node can be a product node that has no edge with the second user node. For example, in the graph structure, there is an edge between user A (the first user node) and commodity X (the first product node), and there is no edge between users B, C (the second user nodes) and commodities Y, Z (the second product nodes).

[0193] For the positive sample set, it can be sourced from all user-product pairs with edges in the graph structure. Among them, the user-product pair (such as (A,X), (B,Y)) indicates that the user has a clear interaction behavior with the commodity, such as purchase, rating and other behaviors. The positive sample set can directly reflect the actual relationship between the user and the commodity, ensuring that the model learns an effective recommendation pattern.

[0194] For the negative sample set, it can be generated by randomly sampling nodes where there is no interaction between the user and the commodity, and is used to train the model to distinguish positive and negative samples. Specifically, the second user nodes and the second product nodes can be selected from the graph structure to ensure that there is no edge between them. For example, there is no edge between user B (the second user node) and commodity Y (the second product node). In this way, the negative sample can help the model learn the patterns that the user is not interested in, improve the accuracy of the recommendation, and also avoid overfitting. By introducing the negative sample, the model is prevented from relying only on the features of the positive sample. In addition, it can also support cold start. The negative sample covers the user-product pairs that have not been interacted with, enhancing the adaptability of the model to the cold start scenario.

[0195] Optionally, obtaining the target training data based on at least two user nodes and at least two product nodes in the pre-generated graph structure includes:

[0196] Obtain the edges between each of the first user nodes and the at least one first product node in the graph structure, obtaining at least two edges;

[0197] Randomly sample at least one edge from the at least two edge pairs as the positive sample set;

[0198] Randomly sample the at least two second user nodes and the at least two second product nodes from the graph structure to construct the at least two negative samples, obtaining the negative sample set.

[0199] In a specific embodiment, the edge (u, v) between each user u and product v can be used as a positive sample pair for training. During the random batch training process, b edges can be randomly sampled from all the edge sets each time to form the positive sample set To reflect the true interaction between users and products.

[0200] Meanwhile, in the embodiments of the present application, a random negative sampling strategy can be used to construct negative samples of the training data. That is, for each (u, v), m users u′1,…,u m ′ and products v′1,…,v m ′ can be randomly selected to construct 2m negative sample pairs (u, v′1),…,(u, v′ m ); (u′1, v),…,(u′ m , v), and the set composed of these 2m edges is denoted as S (u,v) .

[0201] It is worth mentioning that m is an integer greater than or equal to 2, that is, at least two negative samples are generated to ensure the scale of the negative sample set, cover un-interacted user-product pairs, and enhance the adaptability of the model to the cold start scenario.

[0202] A recommendation model training method in the embodiments of the present application, as Figure 5 shown, specifically includes the following steps:

[0203] Step 401, based on historical user-product interaction records, construct a graph structure, where the graph structure includes at least one user node and at least one product node; the at least two user nodes include a first user node and at least one second user node, the at least two product nodes include at least one first product node and at least one second product node, and there is no connected edge between any one of the second user nodes and any one of the second product nodes in the graph structure;

[0204] Step 402: Obtain the edges between each of the first user nodes and the at least one first product node in the graph structure, obtaining at least two edges; randomly sample at least one edge from at least two edge pairs as the positive sample set;

[0205] Step 403: Randomly sample the at least two second user nodes and the at least two second product nodes from the graph structure to construct the at least two negative samples, obtaining the negative sample set;

[0206] Step 404: Input the target training data into the initial recommendation model for training to obtain at least one recommendation score corresponding to the target training data; the target training data includes the positive sample set and the negative sample set;

[0207] Step 405: Determine the loss value of the loss function based on at least one recommendation score corresponding to the target training data;

[0208] Step 406: Optimize the initial recommendation model based on the loss value;

[0209] Step 407: Determine whether the loss value of the loss function converges; if yes, execute Step 408; if not, execute Step 405;

[0210] Step 408: In the case where the loss value of the loss function has converged, obtain a preset recommendation model, and the preset recommendation model is used to obtain the recommendation score for the user-product pair.

[0211] It should be noted that for the implementation process of the recommendation model training method provided in the above embodiments, reference may specifically be made to the method embodiments shown above Figure 4 The implementation principle and technical effects are similar, and will not be elaborated here in this embodiment.

[0212] Please refer to Figure 6 , Figure 6 which is a schematic diagram of a product recommendation device in an embodiment of the present application. The product recommendation device 500 specifically includes:

[0213] A first acquisition module 501, configured to acquire the first representation vector and the first hash vector of each node in the pre-constructed graph structure; wherein, the graph structure includes at least one user node and at least one product node;

[0214] A vector update module 502, configured to update to obtain a second representation vector and a second hash vector of the first node according to first representation vectors and first hash vectors of all neighbor nodes adjacent to the first node in the graph structure, and update to obtain a second representation vector and a second hash vector of the second node according to first representation vectors and first hash vectors of all neighbor nodes adjacent to the second node in the graph structure; wherein, the first node is any user node among the at least one user node, and the second node is any product node having an interaction relationship with the first node among the at least one product node;

[0215] A first determination module 503, configured to determine a structural feature between the first node and the second node based on the second hash vector of the first node and the second hash vector of the second node;

[0216] A second acquisition module 504, configured to input the second representation vector of the first node, the second representation vector of the second node, and the structural feature into a preset recommendation model to obtain a recommendation score between the first node and the second node.

[0217] Optionally, before obtaining the first representation vector of each node in the pre-constructed graph structure, the product recommendation device 500 further includes at least one of the following:

[0218] A first construction module, configured to obtain user features or product features of at least one third node, and construct a first representation vector of the third node based on the user features or the product features;

[0219] A second construction module, configured to construct Gaussian random vectors of at least one fourth node to obtain first representation vectors of the fourth nodes;

[0220] wherein, the third node is a node having the user features or the product features in the graph structure, and the fourth node is a node not having the user features or the product features in the graph structure.

[0221] Optionally, the first acquisition module 501 is configured to:

[0222] Construct at least two permutation functions on a set composed of n nodes in the graph structure;

[0223] Obtain first hash vectors of each of the n nodes based on the at least two permutation functions;

[0224] wherein, the n nodes include the at least one user node and the at least one product node, and n is an integer greater than or equal to 2.

[0225] Optionally, the product recommendation device 500 further includes:

[0226] A first iteration module, configured to iteratively update to obtain a first representation vector of the target node according to the representation vectors of all neighbor nodes adjacent to the target node in the graph structure until the number of iterations reaches a preset hyperparameter; wherein, the target node is any node in the graph structure;

[0227] A second iteration module, configured to iteratively update to obtain a first hash vector of the target node according to the hash vectors of all neighbor nodes adjacent to the target node in the graph structure until the number of iterations reaches a preset hyperparameter.

[0228] Optionally, the vector update module 502 is configured to:

[0229] Obtain all neighbor nodes adjacent to the first node from the graph structure;

[0230] Add the first representation vectors of all neighbor nodes adjacent to the first node and then perform a linear transformation process to obtain a first vector;

[0231] Perform a linear transformation process on the first representation vector of the first node to obtain a second vector;

[0232] Input the first vector and the second vector into a non-linear activation function to obtain a second representation vector of the first node;

[0233] Updating to obtain the second representation vector of the second node according to the first representation vector and the first hash vector of all neighbor nodes adjacent to the second node in the graph structure includes:

[0234] Obtain all neighbor nodes adjacent to the second node from the graph structure;

[0235] Add the first representation vectors of all neighbor nodes adjacent to the second node and then perform a linear transformation process to obtain a third vector;

[0236] Perform a linear transformation process on the first representation vector of the second node to obtain a fourth vector;

[0237] Input the third vector and the fourth vector into a non-linear activation function to obtain a second representation vector of the second node.

[0238] Optionally, the vector update module 502 is configured to:

[0239] Update the first target element in the first hash vector of the first node to the minimum value of the first hash vectors of all neighbor nodes in the dimension where the first target element is located, to obtain the second hash vector of the first node;

[0240] The updating to obtain the second hash vector of the second node according to the first hash vectors of all neighbor nodes adjacent to the second node includes:

[0241] Update the second target element in the first hash vector of the second node to the minimum value of the first hash vectors of all neighbor nodes in the dimension where the second target element is located, to obtain the second hash vector of the second node;

[0242] Wherein, the first target element is any element in the first hash vector of the first node, and the second target element is any element in the first hash vector of the second node.

[0243] Optionally, the first determination module 503 is configured to:

[0244] Determine the Hamming distance between the first node and the second node based on the second hash vector of the first node and the second hash vector of the second node;

[0245] Obtain the structural feature based on the Hamming distance.

[0246] Optionally, the preset recommendation model is configured to perform non-linear transformation after concatenating the second representation vector of the first node, the second representation vector of the second node, and the structural feature, to obtain the recommendation score between the first node and the second node.

[0247] It should be noted that the above product recommendation device 500 can effectively capture the high-order topological characteristics of the user-product relationship, improve the accuracy and generalization ability of the recommendation result, and at the same time reduce the computational complexity through the efficient encoding of the hash vector, adapt to the real-time recommendation requirements of large-scale dynamic graph structures, and significantly improve the recommendation accuracy and computational efficiency. The product recommendation device 500 provided in the embodiment of the present application can specifically execute the above Figure 1 or Figure 2 The method embodiments shown, and their implementation principles and technical effects are similar, and will not be elaborated here in this embodiment.

[0248] Please refer to Figure 7 , a recommendation model training device 600 in the embodiment of the present application includes:

[0249] A data acquisition module 601, configured to acquire target training data based on at least two user nodes and at least two product nodes in a pre-generated graph structure;

[0250] The model training module 602 is configured to input target training data into an initial recommendation model for training to obtain at least one recommendation score corresponding to the target training data;

[0251] The second determination module 603 is configured to determine a loss value of a loss function based on at least one recommendation score corresponding to the target training data;

[0252] The third acquisition module 604 is configured to adjust parameters of the initial recommendation model based on the loss value until the loss value of the loss function converges to obtain a preset recommendation model.

[0253] Optionally, the at least two user nodes include a first user node and at least one second user node, the at least two product nodes include at least one first product node and at least one second product node, and there is no connected edge between any one of the second user nodes and any one of the second product nodes in the graph structure;

[0254] The target training data includes a positive sample set and a negative sample set. The positive sample set includes at least one edge for connecting a first user node and a first product node in a pre-constructed graph structure, and the negative sample set includes at least two negative samples composed of at least two second user nodes and at least two second product nodes in the graph structure.

[0255] Optionally, the data acquisition module 601 is configured to:

[0256] Obtain edges between each of the first user nodes and the at least one first product node in the graph structure to obtain at least two edges;

[0257] Randomly sample at least one edge from the at least two edge pairs as the positive sample set;

[0258] Randomly sample the at least two second user nodes and the at least two second product nodes from the graph structure to construct the at least two negative samples to obtain the negative sample set.

[0259] It should be noted that the recommendation model training device in the embodiments of the present application first generates target training data based on user nodes and product nodes in the graph structure, inputs the data into the initial recommendation model to obtain recommendation scores, then constructs a loss function by calculating the difference between the scores and the true labels, and adjusts the model parameters using an iterative optimization strategy until the loss value converges, finally obtaining a high-precision recommendation model. The embodiments of the present application strengthen the modeling of the relationship between users and products through graph structure data, enabling the model to effectively capture high-order interaction features, and can accurately adjust the model parameters based on the dynamic optimization mechanism of the loss function, improving prediction accuracy. At the same time, the introduction of the graph structure enhances the adaptability of the model to complex relationships, reduces the dependence on traditional collaborative filtering data, is applicable to dynamically changing user-product interaction scenarios, and significantly improves the generalization ability and computational efficiency of the recommendation system. The recommendation model training device 600 provided in the embodiments of the present application can specifically execute the above Figure 4 or Figure 5 The method embodiments shown, the implementation principles and technical effects are similar, and will not be elaborated here in this embodiment.

[0260] As Figure 8 shown, an electronic device in the embodiments of the present application includes: a processor 710, configured to read a program in a memory 720 and execute the following processes:

[0261] Obtain a first representation vector and a first hash vector of each node in the pre-constructed graph structure; wherein, the graph structure includes at least one user node and at least one product node;

[0262] Update to obtain a second representation vector and a second hash vector of the first node according to the first representation vectors and first hash vectors of all neighbor nodes adjacent to the first node in the graph structure, and update to obtain a second representation vector and a second hash vector of the second node according to the first representation vectors and first hash vectors of all neighbor nodes adjacent to the second node in the graph structure; wherein, the first node is any one of the at least one user nodes, and the second node is any one of the at least one product nodes that has an interaction relationship with the first node;

[0263] Determine the structural features between the first node and the second node based on the second hash vector of the first node and the second hash vector of the second node;

[0264] Input the second representation vector of the first node, the second representation vector of the second node, and the structural features into a preset recommendation model to obtain a recommendation score between the first node and the second node.

[0265] Wherein, in Figure 8Among them, the bus architecture may include any number of interconnected buses and bridges, and various circuits represented by one or more processors represented by processor 710 and a memory represented by memory 720 are linked together. The bus architecture may also link together various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art, and thus will not be further described herein. The bus interface provides an interface.

[0266] Optionally, the processor 710 is further configured to read a program in the memory 720 and execute at least one of the following steps:

[0267] Obtain user features or product features of at least one third node, and construct a first representation vector of the third node based on the user features or the product features;

[0268] Construct a Gaussian random vector of at least one fourth node to obtain a first representation vector of the fourth node;

[0269] Wherein, the third node is a node in the graph structure having the user features or the product features, and the fourth node is a node in the graph structure having no user features or product features.

[0270] Optionally, the processor 710 is further configured to read a program in the memory 720 and execute the following steps:

[0271] Construct at least two permutation functions on a set of n nodes in the graph structure;

[0272] Based on the at least two permutation functions, obtain a first hash vector of each node among the n nodes;

[0273] Wherein, the n nodes include the at least one user node and the at least one product node, and n is an integer greater than or equal to 2.

[0274] Optionally, the processor 710 is further configured to read a program in the memory 720 and execute the following steps:

[0275] Obtain all neighbor nodes adjacent to the target node from the graph structure;

[0276] Add the first representation vectors of all neighbor nodes adjacent to the target node and then perform a linear transformation process to obtain a first vector;

[0277] Perform a linear transformation process on the first representation vector of the target node to obtain a second vector;

[0278] Input the first vector and the second vector into a non-linear activation function to obtain a second representation vector of the target node.

[0279] Optionally, the processor 710 is further configured to read a program in the memory 720 and execute the following steps:

[0280] Update the target element in the first hash vector of the target node to the minimum value of the first hash vectors of all neighbor nodes in the dimension where the target element is located, to obtain a second hash vector of the target node;

[0281] Wherein, the target element is any element in the first hash vector of the target node.

[0282] Optionally, the processor 710 is further configured to read a program in the memory 720 and execute the following steps:

[0283] Determine the Hamming distance between the first node and the second node based on the second hash vector of the first node and the second hash vector of the second node;

[0284] Obtain the structural feature based on the Hamming distance.

[0285] Optionally, the preset recommendation model is configured to perform a non-linear transformation after splicing the second representation vector of the first node, the second representation vector of the second node, and the structural feature, to obtain a recommendation score between the first node and the second node.

[0286] The electronic device 700 provided in the embodiments of the present application can execute the above Figure 1 or Figure 2 The method embodiments shown, and the implementation principles and technical effects are similar, and will not be elaborated here in this embodiment.

[0287] The embodiments of the present application also provide an electronic device. Since the principle of solving problems by this electronic device is similar to the recommendation model training method in the embodiments of the present application, the implementation of this electronic device can refer to Figure 4 or Figure 5 The implementation of the method shown, and the repeated parts will not be elaborated.

[0288] As Figure 9 shown, an electronic device according to an embodiment of the present application includes: a processor 810, configured to read a program in a memory 820 and execute the following processes:

[0289] Obtain target training data based on at least two user nodes and at least two product nodes in a pre-generated graph structure;

[0290] Input the target training data into an initial recommendation model for training, to obtain at least one recommendation score corresponding to the target training data;

[0291] Determine the loss value of the loss function based on at least one recommended score corresponding to the target training data;

[0292] Optimize the initial recommendation model based on the loss value until the loss value of the loss function converges to obtain a preset recommendation model.

[0293] Among them, in Figure 9 The bus architecture can include any number of interconnected buses and bridges, specifically, various circuits represented by one or more processors represented by the processor 810 and the memory represented by the memory 820 are linked together. The bus architecture can also link together various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art, so they will not be further described herein. The bus interface provides an interface.

[0294] Optionally, the at least two user nodes include a first user node and at least one second user node, the at least two product nodes include at least one first product node and at least one second product node, and there is no connected edge between any one of the second user nodes and any one of the second product nodes in the graph structure;

[0295] The target training data includes a positive sample set and a negative sample set. The positive sample set includes at least one edge for connecting a first user node and a first product node in a pre-constructed graph structure, and the negative sample set includes at least two negative samples composed of at least two second user nodes and at least two second product nodes in the graph structure.

[0296] Optionally, the processor 810 is further configured to read a program in the memory 820 and execute the following steps:

[0297] Obtain the edges between each of the first user nodes and the at least one first product node in the graph structure to obtain at least two edges;

[0298] Randomly sample at least one edge from the at least two edge pairs as the positive sample set;

[0299] Randomly sample the at least two second user nodes and the at least two second product nodes from the graph structure to construct the at least two negative samples to obtain the negative sample set.

[0300] The embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements each process of the product recommendation method embodiment as described above in Figure 1 or Figure 2 or implements each process of the product recommendation method embodiment as described above in Figure 4 or Figure 5The processes of the embodiments of the product recommendation method are not repeated here to avoid redundancy, and they can achieve the same technical effects. The computer-readable storage medium mentioned above includes, for example, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disc, etc.

[0301] Another embodiment of the present application provides a computer program / program product. The computer program / program product is stored in a storage medium and is executed by at least one processor to implement the processes of the embodiments of the product recommendation method as described above Figure 1 or Figure 2 the processes of the embodiments of the recommendation model training method as described above, and can achieve the same technical effects. To avoid repetition, they are not described in detail here. Figure 4 or Figure 5 the processes of the embodiments of the recommendation model training method as described above, and can achieve the same technical effects. To avoid repetition, they are not described in detail here.

[0302] In several embodiments provided by the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the devices or units can be in an electrical, mechanical, or other form.

[0303] In addition, each functional unit in the various embodiments of the present application can be integrated in a processing unit, or each unit can be physically included separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware, or in the form of a combination of hardware and software functional units.

[0304] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit stored in a storage medium includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute some steps of the transceiver methods described in the various embodiments of the present application. The aforementioned storage medium includes: various media such as a USB flash drive, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disc that can store program codes.

[0305] The above are the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle described in the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.

Claims

1. A product recommendation method, characterized in that, Including: Obtain the first representation vector and the first hash vector of each node in the pre-constructed graph structure; wherein, the graph structure includes at least one user node and at least one product node; Update to obtain the second representation vector and the second hash vector of the first node according to the first representation vectors and the first hash vectors of all neighbor nodes adjacent to the first node in the graph structure, and update to obtain the second representation vector and the second hash vector of the second node according to the first representation vectors and the first hash vectors of all neighbor nodes adjacent to the second node in the graph structure; wherein, the first node is any one of the at least one user nodes, and the second node is any one of the at least one product nodes having an interaction relationship with the first node; Determine the structural features between the first node and the second node based on the second hash vector of the first node and the second hash vector of the second node; Input the second representation vector of the first node, the second representation vector of the second node, and the structural features into a preset recommendation model to obtain the recommendation score between the first node and the second node.

2. The method according to claim 1, characterized in that Before obtaining the first representation vector of each node in the pre-constructed graph structure, the method further includes at least one of the following: Obtain the user features or product features of at least one third node, and construct the first representation vector of the third node based on the user features or the product features; Construct the Gaussian random vectors of at least one fourth node to obtain the first representation vector of the fourth node; Wherein, the third node is a node in the graph structure having the user features or the product features, and the fourth node is a node in the graph structure not having the user features or the product features.

3. The method according to claim 1 or 2, characterized in that, The obtaining of the first hash vector of each node in the pre-constructed graph structure includes: Construct at least two permutation functions on the set composed of n nodes in the graph structure; Obtain the first hash vector of each of the n nodes based on the at least two permutation functions; Wherein, the n nodes include the at least one user node and the at least one product node, and n is an integer greater than or equal to 2.

4. The method according to claim 1, wherein Before updating to obtain the second representation vector and the second hash vector of the first node according to the first representation vectors and the first hash vectors of all neighbor nodes adjacent to the first node in the graph structure, and updating to obtain the second representation vector and the second hash vector of the second node according to the first representation vectors and the first hash vectors of all neighbor nodes adjacent to the second node in the graph structure, the method further includes: Iteratively update to obtain the first representation vector of the target node according to the representation vectors of all neighbor nodes adjacent to the target node in the graph structure until the number of iterations reaches a preset hyperparameter; wherein, the target node is any node in the graph structure. Iteratively update the first hash vector of the target node according to the hash vectors of all neighbor nodes adjacent to the target node in the graph structure until the number of iterations reaches a preset hyperparameter.

5. The method according to claim 1 or 4, characterized in that, Updating the second representation vector of the first node according to the first representation vectors and first hash vectors of all neighbor nodes adjacent to the first node in the graph structure includes: Obtain all neighbor nodes adjacent to the first node from the graph structure; Add the first representation vectors of all neighbor nodes adjacent to the first node and then perform a linear transformation to obtain a first vector; Perform a linear transformation on the first representation vector of the first node to obtain a second vector; Input the first vector and the second vector into a non-linear activation function to obtain the second representation vector of the first node; Updating the second representation vector of the second node according to the first representation vectors and first hash vectors of all neighbor nodes adjacent to the second node in the graph structure includes: Obtain all neighbor nodes adjacent to the second node from the graph structure; Add the first representation vectors of all neighbor nodes adjacent to the second node and then perform a linear transformation to obtain a third vector; Perform a linear transformation on the first representation vector of the second node to obtain a fourth vector; Input the third vector and the fourth vector into a non-linear activation function to obtain the second representation vector of the second node.

6. The method according to claim 1 or 4, characterized in that, Updating the second hash vector of the first node according to the first hash vectors of all neighbor nodes adjacent to the first node includes: Update the first target element in the first hash vector of the first node to the minimum value of the first hash vectors of all neighbor nodes in the dimension where the first target element is located, to obtain the second hash vector of the first node; Updating the second hash vector of the second node according to the first hash vectors of all neighbor nodes adjacent to the second node includes: Update the second target element in the first hash vector of the second node to the minimum value of the first hash vectors of all neighbor nodes in the dimension where the second target element is located, to obtain the second hash vector of the second node; Wherein, the first target element is any element in the first hash vector of the first node, and the second target element is any element in the first hash vector of the second node.

7. The method according to claim 1, wherein Determining the structural features between the first node and the second node based on the second hash vector of the first node and the second hash vector of the second node includes: Determine the Hamming distance between the first node and the second node based on the second hash vector of the first node and the second hash vector of the second node; Obtain the structural features based on the Hamming distance.

8. The method according to claim 1 or 7, characterized in that, The preset recommendation model is used to perform non-linear transformation after splicing the second representation vector of the first node, the second representation vector of the second node and the structural features, to obtain the recommendation score between the first node and the second node.

9. A method for training a recommendation model, characterized in that, Including: Obtain target training data based on at least two user nodes and at least two product nodes in a pre-generated graph structure; Input the target training data into an initial recommendation model for training to obtain at least one recommendation score corresponding to the target training data; Determine the loss value of a loss function based on at least one recommendation score corresponding to the target training data; Optimize the initial recommendation model based on the loss value until the loss value of the loss function converges to obtain a preset recommendation model.

10. The method according to claim 9, characterized in that, The at least two user nodes include a first user node and at least one second user node, and the at least two product nodes include at least one first product node and at least one second product node. There is no connected edge between any one of the second user nodes and any one of the second product nodes in the graph structure; The target training data includes a positive sample set and a negative sample set. The positive sample set includes at least one edge for connecting the first user node and the first product node in a pre-constructed graph structure, and the negative sample set includes at least two negative samples composed of at least two second user nodes and at least two second product nodes in the graph structure.

11. The method according to claim 10, characterized in that, The obtaining of target training data based on at least two user nodes and at least two product nodes in a pre-generated graph structure includes: Obtain the edges between each of the first user nodes and the at least one first product node in the graph structure to obtain at least two edges; Randomly sample at least one edge from the at least two edge pairs as the positive sample set; Randomly sample the at least two second user nodes and the at least two second product nodes from the graph structure to construct the at least two negative samples to obtain the negative sample set.

12. A product recommendation device, characterized in that, Include: A first obtaining module, configured to obtain a first representation vector and a first hash vector of each node in a pre-constructed graph structure; wherein, the graph structure includes at least one user node and at least one product node; A vector updating module, configured to update to obtain a second representation vector and a second hash vector of the first node according to the first representation vectors and first hash vectors of all neighbor nodes adjacent to the first node in the graph structure, and update to obtain a second representation vector and a second hash vector of the second node according to the first representation vectors and first hash vectors of all neighbor nodes adjacent to the second node in the graph structure; wherein, the first node is any one of the at least one user node, and the second node is any one of the at least one product node having an interaction relationship with the first node; A first determining module, configured to determine the structural feature between the first node and the second node based on the second hash vector of the first node and the second hash vector of the second node; A second obtaining module, configured to input the second representation vector of the first node, the second representation vector of the second node, and the structural feature into a preset recommendation model to obtain a recommendation score between the first node and the second node.

13. A recommended model training device, characterized in that, Include: A data acquisition module, configured to acquire target training data based on at least two user nodes and at least two product nodes in a pre-generated graph structure; A model training module, configured to input the target training data into an initial recommendation model for training to obtain at least one recommendation score corresponding to the target training data; A second determination module, configured to determine a loss value of a loss function based on at least one recommendation score corresponding to the target training data; A third acquisition module, configured to adjust parameters of the initial recommendation model based on the loss value until the loss value of the loss function converges, so as to obtain a preset recommendation model.

14. An electronic device, characterized in that, Comprising: A processor, a memory, and a program stored on the memory and executable on the processor, where when the program is executed by the processor, it implements the steps in the product recommendation method according to any one of claims 1 to 8, or implements the steps in the recommendation model training method according to any one of claims 9 to 11.

15. A computer-readable storage medium for storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps in the product recommendation method according to any one of claims 1 to 8, or implements the steps in the recommendation model training method according to any one of claims 9 to 11.

16. A computer program product, characterized in that, Including computer instructions, which when executed by the processor, implement the steps in the product recommendation method according to any one of claims 1 to 8, or implement the steps in the recommendation model training method according to any one of claims 9 to 11.