Knowledge graph construction and product recommendation method and system based on user data

By building multi-layer neural networks and multi-objective optimization algorithms, the shortcomings of existing knowledge graphs in multi-level entity relationship processing and user dynamic behavior response are solved, and more accurate and efficient personalized recommendations are achieved, balancing user experience and business value.

CN120338924AInactive Publication Date: 2025-07-18HEBEI FINANCE UNIV +1
View PDF 0 Cites 21 Cited by

Patent Information

Application Number
CN202510439033.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2025-07-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing knowledge graph-based recommendation methods have limitations when dealing with multi-level entity relationships, it is difficult to fully capture information at different granularity levels, lack timely response capabilities to users' dynamic behaviors, and the existing recommendation algorithms are difficult to balance multiple goals such as user experience and business value, resulting in insufficient accuracy and adaptability of recommendation results.

Method used

A multi-layer neural network is built, including a multi-grained layer, a graph attention layer and a graph convolution layer. Information fusion is carried out through multi-grained calculation and graph convolution, and a two-way random walk sampling is carried out in combination with a semantic transfer matrix and a multi-level influence network to calculate the importance score of product nodes, and a multi-objective optimization algorithm is used for sorting, which comprehensively considers product relevance, user interest and business value.

Benefits of technology

It improves the representation ability of the knowledge graph and the accuracy of the recommendation system, enhances the multi-dimensional portrayal of user interests, ensures the relevance and commercial value of the recommendation results, reduces the computational complexity, and achieves a balance between user experience and business benefits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120338924A_ABST
    Figure CN120338924A_ABST
Patent Text Reader

Abstract

The invention provides a knowledge graph construction and product recommendation method and system based on user data, and relates to the technical field of artificial intelligence, and the method comprises the steps: constructing an initial knowledge graph through user historical behavior data, generating an optimization graph through a multi-layer neural network comprising a multi-granularity layer, a graph attention layer and a graph convolution layer, and performing bidirectional random walk sampling based on real-time behavior data of a target user to obtain a related sub-graph, calculating a product node importance score, and performing sorting pushing by adopting a multi-target optimization algorithm. According to the method, multi-dimensional accurate description of user interests can be realized, the recommendation accuracy and diversity are improved, and meanwhile, the commercial value is considered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to artificial intelligence technology, and particularly to a method and system for constructing a knowledge graph based on user data and product recommendation. Background Art

[0002] With the rapid development of e-commerce, personalized recommendation systems play an important role in enhancing user experience and promoting commercial conversion. Traditional recommendation methods mainly rely on technologies such as collaborative filtering and content filtering, and make recommendations by analyzing users' historical behavior data and product features. In recent years, as a structured knowledge representation method, the knowledge graph can effectively describe the complex relationships between entities. The existing technologies have the following deficiencies:

[0003] Existing knowledge-graph-based recommendation methods have limitations in dealing with multi-level entity relationships. They often only focus on entity features at a single level, making it difficult to comprehensively capture information at different granularity levels, resulting in limited accuracy of recommendation results.

[0004] Traditional knowledge graph construction methods lack the ability to respond promptly to users' dynamic behaviors and cannot effectively integrate users' real-time behavior data into the knowledge graph, affecting the rapid adaptation of the recommendation system to changes in users' interests.

[0005] When existing recommendation algorithms perform product ranking, they usually only consider a single objective, such as relevance or popularity, ignoring the need to balance multiple objectives such as user experience and commercial value in practical applications of the recommendation system, and it is difficult to achieve the overall optimal recommendation effect. Summary of the Invention

[0006] Embodiments of the present invention provide a method and system for constructing a knowledge graph based on user data and product recommendation, which can solve the problems in the existing technologies.

[0007] In the first aspect of the embodiments of the present invention,

[0008] A method for constructing a knowledge graph based on user data and product recommendation is provided, including:

[0009] Extracting entity information and relationship information from users' historical behavior data to construct an initial knowledge graph, where nodes correspond to entity information and connecting edges correspond to relationship information;

[0010] Constructing a multi-layer neural network including a multi-granularity layer, a graph attention layer, and a graph convolutional layer, calculating and fusing attention weights at the node level, path level, and sub-graph level through multi-granularity, aggregating multi-level entity information through the graph attention layer, and performing dynamic neighborhood information fusion through the graph convolutional layer to generate an optimized graph; vectorizing the nodes in the optimized graph and calculating the similarity between nodes;

[0011] Construct a semantic transfer matrix and a multi-level influence network according to the real-time behavior data of the target user to guide the walking direction, dynamically adjust the sampling depth and restart strategy by using the composite scoring of semantic relevance and information entropy, perform bidirectional random walk sampling in the optimized graph, and optimize path collaboration through multi-dimensional matching metrics and two-level loss to obtain a subgraph related to the target user;

[0012] Calculate the importance score of product nodes based on the subgraph, where the importance score is composed of weighted node centrality, node similarity, and node popularity; use the product nodes with the top N importance scores as candidate recommended products, where N is a preset positive integer;

[0013] Sort the candidate recommended products using a multi-objective optimization algorithm and push them to the target user. The multi-objective optimization algorithm comprehensively considers product relevance, user interest, and commercial value.

[0014] In an alternative embodiment,

[0015] The steps of generating an optimized graph by calculating and fusing attention weights at the node level, path level, and subgraph level through multi-granularity, aggregating multi-level entity information through a graph attention layer, and using a graph convolutional layer for dynamic neighborhood information fusion include:

[0016] Construct a multi-layer neural network, which includes a multi-granularity layer, a graph attention layer, and a graph convolutional layer. Skip connections and hierarchical normalization modules are set between the layers of the multi-layer neural network;

[0017] Calculate node-level attention, path-level attention, and subgraph-level attention through the multi-granularity layer, and fuse multiple attention scores based on an adaptive weight coefficient to obtain a fused attention weight;

[0018] Based on the fused attention weight, respectively perform information aggregation on entity layers of attributes, entity layers of relationships, and entity layers of categories through the graph attention layer, and adaptively fuse the aggregated multi-level information to obtain an initial feature representation;

[0019] Use the graph convolutional layer to perform dynamic neighborhood information aggregation on the initial feature representation, adaptively adjust the neighborhood range based on node similarity, update the node representation, and generate an optimized graph;

[0020] Construct a multi-objective loss function, including a structure-aware loss for maintaining category hierarchy relationships and attribute consistency, a behavioral sequence loss for modeling temporal dependencies and interest transfer, and a contrastive learning loss for improving the quality of feature representations; generate a structure weight component based on an entity importance metric and a relationship reliability matrix, generate a sequence weight component according to the category knowledge complexity, generate a contrast weight component using a subgraph integrity score, and optimize the parameters of a multi-layer neural network; perform online update on the optimized graph based on an incremental learning strategy.

[0021] In an alternative implementation,

[0022] The steps of constructing a semantic transfer matrix and a multi-level influence network to guide the random walk direction according to the real-time behavior data of the target user, dynamically adjusting the sampling depth and restart strategy using a composite score of semantic relevance and information entropy, performing bidirectional random walk sampling in the optimized graph, and optimizing path collaboration through multi-dimensional matching metrics and two-level loss to obtain a subgraph related to the target user include:

[0023] Construct a user-item bipartite graph based on the real-time behavior data of the target user, and generate a comprehensive behavior weight by combining the time decay characteristic and the interaction intensity; based on the comprehensive behavior weight, calculate the activity of the user behavior node, combine the node centrality metric and the user historical interest relevance, filter and construct a starting point set, and dynamically adjust the starting point set through diversity constraints;

[0024] For the nodes in the starting point set, construct a semantic transfer matrix and a reverse reachability matrix, perform forward random walk using node importance and edge semantic relationships, and at the same time perform reverse random walk using the influence propagation intensity, and perform two-way path collaboration optimization through forward-backward path matching metrics;

[0025] During the bidirectional random walk process, calculate the semantic relevance change metric based on the path semantic representation weighted by node position, calculate the information gain by combining the node type entropy and the attribute entropy, fuse the semantic relevance change metric and the information gain through a balance parameter to obtain a composite score, use a piecewise function to dynamically adjust the sampling depth according to the composite score, and determine the restart position and restart time interval based on the composite score;

[0026] For the path set obtained by sampling, calculate the relevance and information richness of the paths to the user interest, filter and form an initial subgraph, determine the node weights based on the path importance, and optimize the connectivity and semantic integrity of the subgraph to obtain an optimized subgraph.

[0027] In an alternative implementation,

[0028] The steps of constructing a semantic transfer matrix and a reverse reachability matrix, performing forward walks using node importance and edge semantic relationships, and performing reverse walks using the influence propagation strength, and co-optimizing the bidirectional paths through forward-backward path matching metrics include:

[0029] Calculate the semantic similarity between nodes based on the node type mapping matrix, and multiply it by the node type transfer constraint matrix to obtain the semantic transfer matrix; construct a multi-level influence propagation network, fuse the local features and hierarchical global features of nodes at each level through a multi-layer perceptron to obtain the hierarchical representation, calculate the hierarchical weights based on the hierarchical representation, and weighted accumulate the hierarchical weights with the reachability matrix of the corresponding level to obtain the reverse reachability matrix;

[0030] Calculate the semantic similarity between the edge-connected nodes and the node interaction strength, fuse them through a balance factor to obtain the edge weight, calculate the sampling probability of the forward walk based on the weighted combination score of the edge weight and the betweenness centrality, eigenvector centrality, and correlation degree of the nodes; construct a node influence vector including direct influence, indirect influence, and temporal influence, calculate the propagation attenuation value based on the node influence vector and the propagation distance, and perform a reverse walk according to the propagation attenuation value to obtain the reverse walk path;

[0031] Use a bidirectional long short-term memory network to encode the node sequences in the forward walk path and the reverse walk path to obtain path representation vectors, input the node overlap, semantic similarity, and structural consistency between the path representation vectors into a multi-layer perceptron to obtain the matching weight, calculate the path matching metric based on the matching weight; calculate the node-level matching loss and the path-level matching loss based on the path matching metric, and construct an optimization objective function through balance parameter fusion, and update the node representations of the bidirectional paths based on the optimization objective function.

[0032] In an alternative embodiment,

[0033] The steps of using a multi-objective optimization algorithm to rank candidate recommended products and push them to target users, where the multi-objective optimization algorithm comprehensively considers product relevance, user interest, and commercial value include:

[0034] Introduce time decay weights for click, favorite, and purchase behaviors in the user-item interaction sequence, and extract user interest features through a bidirectional GRU network and a self-attention mechanism; construct an adaptive weight adjustment mechanism based on the change rate of dominance rank, divide the target space by a KD tree and calculate the sample weights using a Gaussian kernel function with a bandwidth parameter; introduce the Box-Muller transform into the Gaussian distribution crossover operator to generate offspring individuals, control the mutation acceptance probability through the Metropolis criterion, and perform constraint processing and clustering screening on the solution set to obtain the recommendation sequence, specifically including:

[0035] The Word2Vec model is used to extract product text features, and an image feature extractor is used to obtain the visual representation of the product. The product relevance feature is obtained by calculating the cosine similarity. A user-item interaction sequence matrix is constructed, where each interaction behavior includes three types: click, favorite, and purchase. An exponential decay function based on the time interval is introduced for each interaction behavior to calculate the timeliness weight. The interaction sequence is mapped into a dense vector through the embedding layer. A bidirectional GRU network is used to extract the user behavior sequence features from both the forward and reverse directions. The correlation weight between different time steps is calculated based on the self-attention mechanism. The attention-weighted behavior sequence features are non-linearly fused with the user basic features and item content features to obtain the user interest feature. The commercial value feature is calculated based on the product profit margin, conversion probability, user activity, platform stay duration, and social sharing influence.

[0036] The product relevance feature, user interest feature, and commercial value feature are subjected to Min-Max normalization. A dominance relationship is constructed using a hash table and a Bloom filter. The dominance number is calculated through block grid parallel computing. An adaptive weight dynamic adjustment mechanism is introduced for the optimization objective to construct the dominance frontier. The solution set is optimized using a Gaussian distribution crossover and a local search strategy, and the DBSCAN clustering is combined to control the density of the solution set.

[0037] The solution set is stratified based on non-dominated sorting and crowding degree. Effective solutions are screened by combining business rules and resource capacity constraints. A clustering method is used to select representative solutions and delete redundant solutions. The best push time is predicted according to the user activity pattern, and a push threshold is set based on the user acceptance degree. The filtered solution set is hierarchically sorted to obtain the final recommendation sequence.

[0038] In an alternative embodiment,

[0039] The steps of constructing a dominance relationship using a hash table and a Bloom filter, calculating the dominance number through block grid parallel computing, and introducing an adaptive weight dynamic adjustment mechanism for the optimization objective to construct the dominance frontier, and optimizing the solution set using a Gaussian distribution crossover and a local search strategy and combining DBSCAN clustering to control the density of the solution set include:

[0040] The dominance relationship is stored using a hash table, and the dominance relationship query is based on the Bloom filter. The initial dominance relationship is obtained by calculating the dominance number in each grid through block grid parallel computing. The kernel density estimation is used to statistically analyze the target space distribution of the initial dominance relationship. An adaptive weight adjustment mechanism is introduced for multiple optimization objectives in the target space:

[0041]

[0042] where, w j(t) is the weight value of the j-th optimization objective at time t; β is the learning rate parameter, used to control the amplitude of weight adjustment, and its value range is (0, 1); ΔR j (t) is the change rate of the domination level of the j-th optimization objective at time t;

[0043] Based on the adaptive weights, the target space is partitioned by KD-tree and the inter-layer distance threshold is calculated. The Gaussian kernel function with bandwidth parameter is used to calculate the sample weights, and an adaptive hierarchical domination front structure is constructed;

[0044] Perform kernel density distribution modeling on the solutions in the domination front structure, calculate the crossover probability based on the distance between solutions, introduce the Box-Muller transform into the Gaussian distribution crossover operator to generate offspring individuals that satisfy the normal distribution, set the mutation step size in combination with the gradient norm of the objective function, and control the mutation acceptance probability through the Metropolis criterion to obtain the optimized solution set;

[0045] Construct an augmented Lagrangian function containing linear weighted terms and quadratic penalty terms for the optimized solution set:

[0046]

[0047] where L is the value of the augmented Lagrangian function, x is the decision variable vector, λ is the Lagrange multiplier vector; ρ is the penalty factor, used to adjust the penalty intensity of constraint violation; f(x) is the objective function, h i (x) is the i-th constraint function, m is the number of constraint functions; λ i is the i-th component in the vector λ, and i is the number of the constraint function;

[0048] Based on the augmented Lagrangian function, use the Powell direction set algorithm to adjust the solution components dimension by dimension for constraint repair, and perform adaptive update of the penalty factor on the repaired solution set; apply the BFGS algorithm to perform local search on the updated solution set, and control the solution set density in combination with DBSCAN clustering to obtain the optimized solution set.

[0049] In the second aspect of the embodiments of the present invention,

[0050] Provide a knowledge graph construction and product recommendation system based on user data, including:

[0051] The first unit is used to extract entity information and relationship information based on user historical behavior data to construct an initial knowledge graph, where nodes correspond to entity information and connection edges correspond to relationship information;

[0052] A second unit, which is used to construct a multi-layer neural network including a multi-granularity layer, a graph attention layer, and a graph convolutional layer. By performing multi-granularity calculation and fusing the attention weights at the node level, path level, and subgraph level, aggregating multi-level entity information through the graph attention layer, and using the graph convolutional layer for dynamic neighborhood information fusion to generate an optimized graph spectrum; vectorizing the nodes in the optimized graph spectrum and calculating the similarity between nodes;

[0053] A third unit, which constructs a semantic transfer matrix and a multi-level influence network according to the real-time behavior data of the target user to guide the walking direction, dynamically adjusts the sampling depth and restart strategy by using the composite scoring of semantic relevance and information entropy, performs bidirectional random walk sampling in the optimized graph spectrum, and optimizes path collaboration through multi-dimensional matching metrics and two-level loss to obtain a subgraph related to the target user;

[0054] A fourth unit, which is used to calculate the importance score of product nodes based on the subgraph. The importance score is composed of the weighted sum of node centrality, node similarity, and node popularity; taking the product nodes with the top N importance scores as candidate recommended products, where N is a preset positive integer;

[0055] A fifth unit, which is used to sort the candidate recommended products by using a multi-objective optimization algorithm and push them to the target user. The multi-objective optimization algorithm comprehensively considers product relevance, user interest, and commercial value.

[0056] In the third aspect of the embodiments of the present invention,

[0057] Provided is an electronic device, including:

[0058] A processor;

[0059] A memory for storing instructions executable by the processor;

[0060] Wherein, the processor is configured to call the instructions stored in the memory to execute the method described above.

[0061] In the fourth aspect of the embodiments of the present invention,

[0062] Provided is a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method described above is implemented.

[0063] The present invention optimizes the knowledge graph by constructing a multi-layer neural network, and combines a multi-granularity attention mechanism and graph convolution for information fusion, which can better capture the deep association patterns in user behavior data, improve the representation ability of the knowledge graph and the accuracy of the recommendation system.

[0064] The present invention obtains a sub-graph related to the target user by means of bidirectional random walk, and screens products based on a comprehensive score of node centrality, similarity, and popularity, which not only ensures the relevance of the recommendation result to the user's interest, but also effectively reduces the computational complexity and improves the efficiency of the recommendation system.

[0065] The present invention introduces a multi-objective optimization algorithm to rank candidate products. While considering the product relevance and user interest, it also takes into account the commercial value factor, achieving a balance between user experience and commercial benefits, and making the recommendation result more practical and commercially significant. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 is a schematic flow chart of a method for constructing a knowledge graph and recommending products based on user data according to an embodiment of the present invention;

[0067] Figure 2 is a comparison graph of the multi-granularity attention fusion effect of the present invention;

[0068] Figure 3 is a performance comparison graph of the present invention and two existing methods in terms of path quality;

[0069] Figure 4 is a schematic structural diagram of a system for constructing a knowledge graph and recommending products based on user data according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0070] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0071] The technical solutions of the present invention will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0072] Figure 1 is a schematic flow chart of a method for constructing a knowledge graph and recommending products based on user data according to an embodiment of the present invention, as Figure 1 shown, the method includes:

[0073] Extracting entity information and relationship information from user historical behavior data to construct an initial knowledge graph, where nodes correspond to entity information and connection edges correspond to relationship information;

[0074] Build a multi-layer neural network including multi-granularity layers, graph attention layers, and graph convolutional layers. Calculate and fuse node-level, path-level, and subgraph-level attention weights through multi-granularity computing. Aggregate multi-level entity information through the graph attention layer, and use the graph convolutional layer for dynamic neighborhood information fusion to generate an optimized graph spectrum. Vectorize the nodes in the optimized graph spectrum and calculate the similarity between nodes.

[0075] According to the real-time behavior data of the target user, perform bidirectional random walk sampling in the optimized graph spectrum to obtain a subgraph related to the target user.

[0076] Calculate the importance score of product nodes based on the subgraph. The importance score is composed of weighted node centrality, node similarity, and node popularity. Take the top N product nodes with the importance score as candidate recommended products, where N is a preset positive integer.

[0077] Use a multi-objective optimization algorithm to sort the candidate recommended products and push them to the target user. The multi-objective optimization algorithm comprehensively considers product relevance, user interest, and commercial value.

[0078] Exemplarily, in the stage of building the initial knowledge graph: First, preprocess the user's historical behavior data, including data cleaning, outlier handling, and standardization. Extract entity information from the preprocessed data, including user entities, product entities, category entities, etc.; extract relationship information including user-product interaction relationships, product-category subordination relationships, etc. Build an initial knowledge graph with entities as nodes and relationships as edges. For example, the historical data of an e-commerce platform shows that user A browsed products B and C and purchased product D. Then build a connection relationship between user node A and product nodes B, C, and D, and mark interaction types such as "browse" and "purchase" on the connecting edges.

[0079] In the stage of optimizing the knowledge graph: Build a deep neural network including multi-granularity layers, graph attention layers, and graph convolutional layers. Generate node vector representations through multi-modal feature extraction and deep feature fusion networks, and calculate the final similarity between nodes based on vector cosine distance, structural similarity, and temporal decay scores.

[0080] In the stage of obtaining the relevant subgraph: Trigger bidirectional random walk based on the real-time behavior of the target user. Walk forward from the product currently browsed by the user and sample according to the weight probability of the edge; walk backward from the historical purchase records along the reverse edge. Set a restart probability of 0.15 during the walk, and stop when the sampling depth reaches a preset threshold (such as 6 hops) or when the same node is repeatedly visited. The finally obtained subgraph contains a set of product nodes highly relevant to the target user.

[0081] Calculating Importance Score Stage: Calculate scores for product nodes in the sub-graph in three dimensions. Node centrality is calculated based on indicators such as degree centrality and betweenness centrality, reflecting the importance of the product in the network structure; node similarity is calculated based on the cosine distance of node representations, reflecting the relevance to the user's historical behavior; node popularity is based on statistics such as recent click-through rates and sales volumes, reflecting the current popularity of the product. The scores in the three dimensions are fused through an adaptive weight coefficient to obtain the final importance score. Select the top N products with the highest scores as the candidate recommendation set.

[0082] Sorting and Recommending Stage: Use a multi-objective optimization algorithm to finally sort the candidate products. Consider three objectives simultaneously: product relevance (calculated based on product content features), user interest (modeled based on behavioral sequences), and commercial value (considering factors such as profit margins). Through Pareto optimal solution search, obtain the best balance solution among multiple objectives. Finally, present the sorting result to the user through personalized push.

[0083] The present invention realizes accurate product recommendation based on a knowledge graph. The innovative designs and optimization improvements in each stage have significantly improved the recommendation effect.

[0084] In an alternative embodiment,

[0085] The steps of generating an optimized graph by multi-granularity calculation and fusing node-level, path-level, and sub-graph-level attention weights, aggregating multi-level entity information through a graph attention layer, and using a graph convolutional layer for dynamic neighborhood information fusion include:

[0086] Construct a multi-layer neural network, the multi-layer neural network includes a multi-granularity layer, a graph attention layer, and a graph convolutional layer, and skip connections and hierarchical normalization modules are set between the layers of the multi-layer neural network;

[0087] Calculate node-level attention, path-level attention, and sub-graph-level attention through the multi-granularity layer, and fuse multiple attention scores based on an adaptive weight coefficient to obtain a fused attention weight;

[0088] Based on the fused attention weight, respectively aggregate information for entity layers of attributes, entity layers of relationships, and entity layers of categories through the graph attention layer, and adaptively fuse the aggregated multi-level information to obtain an initial feature representation;

[0089] Use the graph convolutional layer to perform dynamic neighborhood information aggregation on the initial feature representation, adaptively adjust the neighborhood range based on node similarity, update the node representation, and generate an optimized graph;

[0090] Construct a multi-objective loss function, including a structure-aware loss for maintaining category hierarchy relationships and attribute consistency, a behavioral sequence loss for modeling temporal dependencies and interest transfer, and a contrastive learning loss for improving the quality of feature representations; generate a structure weight component based on entity importance metrics and relationship reliability matrices, generate a sequence weight component according to category knowledge complexity, generate a contrast weight component using subgraph integrity scores, and optimize the parameters of the multi-layer neural network; perform online updates on the optimized graph based on an incremental learning strategy.

[0091] Exemplarily, first construct a multi-layer neural network architecture, including a multi-granularity layer, a graph attention layer, and a graph convolutional layer. Set skip connections between layers and normalize the output of each layer through a hierarchical normalization module. The skip connections adopt a residual structure to directly transfer shallow features to the deep layer, alleviating the problem of gradient disappearance. Hierarchical normalization normalizes the output features of each layer to have a mean of 0 and a variance of 1, improving the stability of the model.

[0092] In the multi-granularity layer, calculate the attention of three granularities: node-level, path-level, and subgraph-level respectively. For node-level attention, calculate the similarity score based on node attribute features; for path-level attention, extract the multi-hop path features between nodes and calculate the importance weights; for subgraph-level attention, take the local subgraph where the node is located as a whole to calculate the attention score. Use an adaptive weight coefficient to fuse the three types of attention, and the weight coefficient is dynamically adjusted according to the discriminability of different granularity features. For example, for a commodity entity, the node-level attention weight is 0.4, the path-level is 0.3, and the subgraph-level is 0.3.

[0093] The graph attention layer aggregates information for entities in the attribute layer, relationship layer, and category layer respectively. For entities in the attribute layer such as commodity attributes, aggregate relevant attribute value information; for entities in the relationship layer such as brands, aggregate the commodity information under the brand; for entities in the category layer such as category nodes, aggregate sub-category information. Use an adaptive fusion mechanism to integrate multi-level information, and the fusion weights are dynamically allocated based on the importance of different levels of information.

[0094] The graph convolutional layer updates the node representation through dynamic neighborhood aggregation. The neighborhood range is adaptively determined based on node similarity, and nodes with higher similarity have larger aggregation weights. For example, for a mobile phone category node, it mainly aggregates relevant category information such as mobile phone accessories and digital products. Obtain the optimized graph representation through multiple rounds of iterative updates.

[0095] Construct a multi-objective loss function for model optimization. The structure-aware loss is based on the category hierarchy and attribute consistency constraints; the behavior sequence loss models the user interest migration law; the contrastive learning loss improves the feature representation quality. The weights of each component of the loss function are adaptively adjusted according to entity importance, relationship reliability, category complexity, and subgraph integrity. An incremental learning strategy is adopted to update the knowledge graph in real time to keep the knowledge up-to-date.

[0096] Figure 2 is a comparison graph of the multi-granularity attention fusion effect of the present invention. As Figure 2 shown, the multi-granularity attention fusion effect evaluation graph shows the performance of different methods in processing multi-level knowledge information. The horizontal axis represents the knowledge extraction tasks (commodity attribute extraction, user interest recognition, commodity relationship discovery, category mapping) in different scenarios, and the vertical axis represents the comprehensive accuracy rate. The present invention (diamond mark) has achieved significant advantages in all tasks through the adaptive weight fusion mechanism: commodity attribute extraction (0.93), user interest recognition (0.89), commodity relationship discovery (0.91), category mapping (0.88), and the average accuracy rate reaches 0.90. Compared with the GAT of the single attention mechanism (circle mark, average accuracy rate 0.71), it has increased by 26.8%, and compared with the HAN of the multi-head attention mechanism (triangle mark, average accuracy rate 0.81), it has increased by 11.1%. Especially in the commodity relationship discovery task, the technical solution of the present invention (0.91) is 33.8% and 15.2% higher than that of GAT (0.68) and HAN (0.79) respectively, which benefits from the synergistic effect of multi-granularity attention, and can capture node features, path patterns, and local structure information at the same time. It still maintains a high accuracy rate of 0.88 in the complex category mapping task, verifying the robustness of the present invention in processing hierarchical knowledge. The smoothness of the curve also indicates the stability of the present invention in different task scenarios.

[0097] Traditional graph attention networks (GATs) mainly aggregate information by calculating the attention weights between nodes and their neighbor nodes. However, with a single node-level attention mechanism, they are unable to effectively process heterogeneous information. Subsequently, the proposed heterogeneous graph attention network (HAN) introduced a two-layer attention mechanism at the node level and semantic level. However, it mainly focuses on the node and meta-path levels, ignoring the semantic information of the local subgraph structure, and generally adopts a fixed attention weight allocation strategy, making it difficult to adapt to the dynamic changes in the importance of information in different scenarios. To address these issues, the present invention makes improvements from three aspects: First, a multi-granularity attention mechanism is designed, adding attribute feature similarity calculation at the node level, introducing multi-hop path feature extraction at the path level, adding a subgraph-level attention calculation module, and adopting an adaptive weight fusion strategy. Second, the network architecture is optimized by adding skip connections and layer normalization, designing a multi-level entity information adaptive fusion mechanism, and introducing a dynamic neighborhood range adjustment strategy. Third, the learning optimization method is improved by constructing a multi-objective loss function, designing an adaptive weight allocation mechanism, and integrating an incremental learning strategy. Through experimental verification, the present invention has an average accuracy improvement of 26.8% compared to GAT and 11.1% compared to HAN, with a maximum improvement of 33.8% in the commodity relationship discovery task. In terms of robustness, it maintains a high accuracy of 0.88 in the complex category mapping task, and the performance curves of each task are stable. In terms of real-time performance, it supports online updates through incremental learning, maintaining high update reliability while ensuring the timeliness of knowledge, achieving effective fusion and dynamic update of multi-level knowledge information, and significantly improving the performance and reliability of the recommendation system.

[0098] In an alternative embodiment,

[0099] The steps of constructing a semantic transfer matrix and a multi-level influence network based on the real-time behavior data of the target user to guide the walking direction, dynamically adjusting the sampling depth and restart strategy using the composite score of semantic relevance and information entropy, performing bidirectional random walk sampling in the optimized graph, and obtaining the subgraph related to the target user through multi-dimensional matching metric and two-level loss optimization include:

[0100] Constructing a user-item bipartite graph based on the real-time behavior data of the target user, and generating a comprehensive behavior weight by combining the time decay characteristic and the interaction intensity; based on the comprehensive behavior weight, calculating the activity of the user behavior nodes, screening and constructing a starting point set by combining the node centrality index and the user historical interest relevance, and dynamically adjusting the starting point set through diversity constraints;

[0101] For the nodes in the starting point set, constructing a semantic transfer matrix and a reverse reachability matrix, performing forward walking using node importance and edge semantic relationships, and at the same time performing reverse walking using the influence propagation intensity, and performing two-way path collaborative optimization through forward-backward path matching metric;

[0102] During the two-way random walk process, calculate the change measure of semantic relevance based on the path semantic representation weighted by node positions, calculate the information gain by combining the node type entropy and attribute entropy, fuse the semantic relevance change measure and the information gain through a balance parameter to obtain a composite score, use a piecewise function to dynamically adjust the sampling depth according to the composite score, and determine the restart position and restart time interval based on the composite score;

[0103] For the set of paths obtained by sampling, calculate the relevance and information richness between the paths and the user interests, filter and form an initial subgraph, determine the node weights based on the path importance, and optimize the connectivity and semantic integrity of the subgraph to obtain an optimized subgraph.

[0104] Exemplarily, when constructing a user-item bipartite graph based on the real-time behavior data of the target user, first obtain the behavior data such as clicks, collections, purchases, etc. of the user in the recent period. Assign different weights to each behavior, for example, the weight of the purchase behavior is 1.0, the weight of the collection is 0.8, and the weight of the click is 0.6. Combining the time decay characteristics, the closer the behavior is to the current time, the higher the weight. Use an exponential decay function to calculate the time decay coefficient. Multiply the behavior weight by the time decay coefficient to obtain the comprehensive behavior weight.

[0105] When calculating the activity of user behavior nodes, count the centrality indicators such as the in-degree, out-degree, PageRank value, etc. of the nodes. At the same time, calculate the relevance between the nodes and the user's historical interests, and measure it by methods such as cosine similarity. Weightedly fuse the activity indicators and the interest relevance, and select several nodes with the highest scores as the starting point set. To ensure diversity, calculate the similarity between nodes, and when the similarity exceeds the threshold, eliminate the nodes with lower scores.

[0106] When constructing the semantic transition matrix, calculate the transition probability based on the semantic relationship between nodes. For example, for the user-product relationship, the transition probability of the purchase behavior is 0.6, and the transition probability of the browsing behavior is 0.3. The reverse reachability matrix is calculated based on the node influence, including features such as the number of fans and comments of the nodes. When walking forward, select the next node according to the semantic transition probability, and when walking backward, select the previous node according to the influence size.

[0107] During the random walk process, calculate the change in semantic relevance between adjacent nodes on the path. At the same time, calculate the type entropy and attribute entropy of the nodes to measure the information gain. Fuse the semantic relevance change and the information gain through a weight of 0.7:0.3 to obtain a composite score. When the composite score is greater than 0.8, increase the sampling depth, and when it is less than 0.3, decrease the sampling depth. When the score is less than 0.2, trigger a restart.

[0108] Calculate the relevance of the sampling path to the user interest and the amount of information contained in the path. Select paths with a relevance greater than 0.6 and an amount of information greater than the threshold to construct an initial subgraph. Assign weights to nodes based on the importance of the paths in the global context. Optimize the connectivity of the subgraph by adding key connection edges and delete redundant nodes to ensure semantic integrity.

[0109] Figure 3 This is the performance comparison of the present invention with two existing methods in terms of path quality, as Figure 3 shown. The technical solution of the present invention (diamond markers) always maintains a high path quality at each sampling depth, with a score range between 0.82 and 0.91. In particular, it reaches a peak of 0.91 at a sampling depth of 6, which is 26.4% higher than MetaPath2Vec (circular markers, with a maximum of 0.72) and 9.6% higher than MAGNN (triangle markers, with a maximum of 0.83). Through the guidance of the semantic transfer matrix and the influence network, the present invention enables the path quality to remain stable with the increase of the sampling depth. The performance degradation at depths of 8-10 is significantly less than that of the comparative methods, improving the quality and efficiency of the sampling path; using the composite scoring of semantic relevance and information entropy to dynamically adjust the sampling strategy, enhancing the adaptability and robustness of the sampling results; fusing multi-dimensional influence vectors and two-level loss optimization for path collaboration, improving the semantic integrity and connectivity of the subgraph.

[0110] Traditional MetaPath2Vec performs random walks through predefined meta-path patterns. However, its fixed meta-path patterns limit the flexibility of sampling and cannot adapt to the dynamic changes of user interests. Subsequently, MAGNN, although introducing an attention mechanism to weight the importance of different meta-paths, mainly relies on static graph structure information, ignores the temporal characteristics and semantic associations of user behavior, and adopts a unidirectional walking strategy, making it difficult to comprehensively capture the bidirectional influence relationship between nodes. To address these problems, the present invention makes improvements from three aspects: First, a bidirectional random walk mechanism is designed. The forward walking direction is guided by a semantic transfer matrix, the influence network is used for backward walking, and a bidirectional path co-optimization strategy is introduced. Second, a dynamic sampling adjustment method is proposed. A composite scoring mechanism that combines semantic relevance and information entropy is constructed to achieve adaptive adjustment of sampling depth and restart strategy. Third, the sub-graph construction process is optimized. High-quality paths are screened through multi-dimensional matching metrics, the node weights are optimized using path importance, and optimization strategies for connectivity and semantic integrity are introduced. Through experimental verification, in terms of path quality, the present invention reaches a peak score of 0.91 when the sampling depth is 6, which is 26.4% higher than MetaPath2Vec and 9.6% higher than MAGNN. In terms of stability, the performance degradation at depths of 8-10 is significantly less than that of the comparative methods. In terms of adaptability, the sampling strategy is dynamically adjusted through the composite scoring, enhancing the robustness of the sampling results, achieving high-quality sampling of sub-graphs related to user interests, and significantly improving the personalized recommendation ability and real-time responsiveness of the recommendation system.

[0111] In an alternative embodiment,

[0112] The steps of constructing a semantic transfer matrix and a reverse reachability matrix, performing forward walks using node importance and edge semantic relationships, and simultaneously performing backward walks using influence propagation intensity, and performing bidirectional path co-optimization through forward-backward path matching metrics include:

[0113] Calculate the semantic similarity between nodes based on the node type mapping matrix, and multiply it by the node type transfer constraint matrix to obtain the semantic transfer matrix; construct a multi-level influence propagation network, fuse the local features and global features of each level of nodes through a multi-layer perceptron to obtain the level representation, calculate the level weights based on the level representation, and weighted accumulate the level weights with the reachability matrix of the corresponding level to obtain the reverse reachability matrix;

[0114] Calculate the semantic similarity between edge-connected nodes and the node interaction intensity, fuse them through a balance factor to obtain the edge weight, and calculate the sampling probability of forward random walk based on the weighted combination score of the edge weight and the betweenness centrality, eigenvector centrality, and correlation degree of the node; construct a node influence vector including direct influence, indirect influence, and temporal influence, calculate the propagation attenuation value based on the node influence vector and the propagation distance, and execute backward random walk according to the propagation attenuation value to obtain the backward random walk path;

[0115] Use a bidirectional long short-term memory network to encode the node sequences in the forward random walk path and the backward random walk path to obtain path representation vectors, input the node overlap degree, semantic similarity, and structural consistency between the path representation vectors into a multi-layer perceptron to obtain the matching weight, and calculate the path matching metric based on the matching weight; calculate the node-level matching loss and the path-level matching loss based on the path matching metric, and construct an optimization objective function through balance parameter fusion, and update the node representation of the bidirectional path based on the optimization objective function.

[0116] Exemplarily, first construct a semantic transfer matrix. For different types of nodes, calculate the semantic similarity between nodes based on the node type mapping matrix. Specifically, for any two nodes, calculate the semantic similarity through the cosine similarity of their type feature vectors. For example, for a user node and a commodity node, their type feature vectors are [0.8, 0.2, 0] and [0.2, 0.7, 0.1] respectively, and the calculated semantic similarity is 0.52. Multiply the semantic similarity matrix by the predefined node type transfer constraint matrix to obtain the semantic transfer matrix.

[0117] Then construct a reverse reachability matrix. Construct an influence propagation network with three levels, and each level includes the local features and global features of the nodes. Taking the first level as an example, the node local features include degree centrality, clustering coefficient, etc., and the global features include community membership, node role, etc. Fuse the local features and global features through a three-layer perceptron to obtain the level representation vector. Calculate the weights of each level based on the level representation vector, such as the weight of the first level is 0.4, the second level is 0.35, and the third level is 0.25. Weightedly accumulate the level weights and the reachability matrix of the corresponding level to obtain the reverse reachability matrix.

[0118] Then execute the forward random walk. Calculate the semantic similarity between edge-connected nodes, such as the semantic similarity of the node pair [A, B] is 0.75. Combine the node interaction intensity (such as the edge weight 0.8), and fuse it through a balance factor of 0.6 to obtain an edge weight of 0.77. Calculate the betweenness centrality, eigenvector centrality, and correlation degree of the node, with weights of 0.3, 0.4, and 0.3 respectively, to obtain the node importance score. Calculate the sampling probability based on the edge weight and the node importance score, and execute the forward random walk.

[0119] Perform reverse walks simultaneously. Construct a node influence vector, which includes direct influence (such as 0.6), indirect influence (0.3), and temporal influence (0.1). Calculate the propagation attenuation value of 0.64 based on the propagation distance between nodes (such as 2 hops). Perform reverse walks according to the propagation attenuation value to obtain reverse paths.

[0120] Finally, perform two-way path collaborative optimization. Use a bidirectional long short-term memory network to encode the forward path [A, B, C] and the reverse path [C, B, A] to obtain path representation vectors. Calculate the node overlap degree (0.8), semantic similarity (0.75), and structural consistency (0.7) between the paths, and input them into a three-layer perceptron to obtain a matching weight of 0.75. Calculate the node-level and path-level matching losses based on the matching weight, with weights of 0.4 and 0.6 respectively. Update the representations of the nodes in the paths by optimizing the objective function.

[0121] The present invention realizes the accurate modeling of node semantic relationships and influence propagation by constructing a semantic transfer matrix and a reverse reachability matrix, improving the accuracy of path search; realizes the efficient search of two-way paths through forward walks based on node importance and edge semantic relationships and reverse walks based on the strength of influence propagation, enhancing the convergence speed of the algorithm; effectively integrates the complementary information of two-way paths through forward-backward path matching metrics and two-way path collaborative optimization, enhancing the expressive ability of node representations and improving the performance of downstream tasks.

[0122] In an alternative embodiment,

[0123] The step of calculating the importance score of product nodes based on the subgraph, where the importance score is composed of the weighted sum of node centrality, node similarity, and node popularity, includes:

[0124] Calculate the degree centrality, betweenness centrality, and eigenvector centrality of nodes based on a weighted directed graph to obtain a node centrality vector; calculate the attribute similarity by combining TF-IDF vectorization and cosine similarity, adopt a two-way random walk strategy combining depth-first traversal and breadth-first traversal to obtain the structural similarity, use the Word2Vec word vector model to extract semantic representations to calculate the semantic similarity, and obtain a node similarity vector; construct a temporal interaction sequence and apply an exponential decay function, calculate the weighted interaction intensity based on the interaction type weight matrix, and model the influence diffusion through a multi-layer propagation network to obtain a node popularity vector;

[0125] Construct a first-order interaction matrix for the node centrality vector, node similarity vector, and node popularity vector, scale it through the temperature coefficient, calculate the feature Hadamard product to obtain the second-order interaction matrix, and design a multi-head attention structure to model high-order interactions to obtain the feature interaction representation; fuse the sine-cosine position encoding with the feature interaction representation to obtain the time-series enhanced feature, and calculate the time-series dependent attention weights through the adaptive time decay function and skip connection;

[0126] Group the time-series enhanced features based on hierarchical clustering, calculate the intra-layer self-attention and inter-layer cross-attention to obtain the hierarchical attention representation; use Gumbel-Softmax for differentiable feature selection, design a feature importance selection gating mechanism based on the sigmoid function and introduce sparse regularization constraints to obtain the dynamic weight distribution;

[0127] Based on the hierarchical attention representation and dynamic weight distribution, perform feature fusion through attention-guided non-linear feature combination, and apply layer normalization and residual connection to obtain the node importance evaluation result.

[0128] Exemplarily, first construct a weighted directed graph representation of the product subgraph. For each product node, calculate its node centrality. Calculate the degree centrality by counting the in-degree and out-degree of the node; calculate the betweenness centrality by calculating the proportion of the shortest paths passing through the node; recursively calculate the eigenvector centrality using the importance of the node's neighbors. Concatenate the three metrics after normalization to obtain the node centrality vector.

[0129] Then calculate the node similarity. Vectorize the product attributes using TF-IDF, and calculate the cosine similarity between the attribute vectors to obtain the attribute similarity. Adopt a bidirectional random walk that combines depth-first and breadth-first to calculate the structural similarity based on the paths between nodes. Use the Word2Vec model to convert the product description into word vectors, and calculate the semantic similarity through the cosine similarity of the word vectors. Fuse the three similarities with weights to obtain the node similarity vector.

[0130] Then calculate the node popularity. Construct a user-product interaction sequence, and use the exponential decay function to decay the historical interactions over time. Calculate the weighted interaction intensity according to the weight matrix of different interaction types (such as click, favorite, purchase, etc.). Simulate the diffusion process of influence in the network through a multi-layer propagation network to obtain the node popularity vector.

[0131] For the above three vectors, first construct a first-order interaction matrix and scale it by the temperature coefficient. Calculate the Hadamard product between the vectors to obtain a second-order interaction matrix. Design a multi-head attention mechanism to model high-order feature interactions and obtain a feature interaction representation. Fuse the sine-cosine position encoding with the feature interaction representation to enhance the temporal information. Calculate the attention weights of temporal dependencies through adaptive time decay and skip connections.

[0132] Group the temporally enhanced features based on hierarchical clustering, and calculate the intra-group self-attention and inter-group cross-attention to obtain a hierarchical attention representation. Use Gumbel-Softmax for differentiable feature selection, design a sigmoid-based feature selection gate and introduce a sparsity constraint to obtain a dynamic weight distribution.

[0133] Finally, based on the hierarchical attention representation and the dynamic weight distribution, perform feature fusion through attention-guided non-linear feature combination. Apply layer normalization and residual connections to obtain the final node importance evaluation result.

[0134] Through the deep fusion and interaction modeling of multi-dimensional features, the present invention comprehensively characterizes the importance features of product nodes, improves the accuracy and interpretability of the evaluation results; adopts a hierarchical attention mechanism and a dynamic feature selection strategy to achieve the adaptive combination and weight allocation of features, enhancing the flexibility and generalization ability of the model; introduces temporal modeling and decay mechanisms to effectively capture the dynamic features of product importance evolving over time, improving the timeliness of the evaluation results.

[0135] In an alternative embodiment,

[0136] After sorting the candidate recommended products using a multi-objective optimization algorithm and pushing them to the target user, the steps of comprehensively considering product relevance, user interest, and commercial value in the multi-objective optimization algorithm include:

[0137] Introduce time decay weights for click, favorite, and purchase behaviors in the user-item interaction sequence, and extract user interest features through a bidirectional GRU network and a self-attention mechanism; construct an adaptive weight adjustment mechanism based on the rate of change of dominance rank, partition the target space using a KD tree, and calculate sample weights using a Gaussian kernel function with a bandwidth parameter; introduce the Box-Muller transform into the Gaussian distribution crossover operator to generate offspring individuals, control the mutation acceptance probability through the Metropolis criterion, and perform constraint processing and clustering screening on the solution set to obtain a recommended sequence, specifically including:

[0138] The Word2Vec model is used to extract product text features, and an image feature extractor is used to obtain the visual representation of the product. The product relevance feature is obtained by calculating the cosine similarity. A user-item interaction sequence matrix is constructed, where each interaction behavior includes three types: click, favorite, and purchase. An exponential decay function based on the time interval is introduced for each interaction behavior to calculate the timeliness weight. The interaction sequence is mapped to a dense vector through the embedding layer. A bidirectional GRU network is used to extract the user behavior sequence features from both the forward and reverse directions. Based on the self-attention mechanism, the correlation weights between different time steps are calculated. The attention-weighted behavior sequence features are non-linearly fused with the user basic features and item content features to obtain the user interest feature. The commercial value feature is calculated based on the product profit margin, conversion probability, user activity, platform stay duration, and social sharing influence.

[0139] The product relevance feature, user interest feature, and commercial value feature are subjected to Min-Max normalization. A dominance relationship is constructed using a hash table and a Bloom filter. The dominance number is calculated through block grid parallel computing. An adaptive weight dynamic adjustment mechanism is introduced for the optimization objective to construct the dominance front. The Gaussian distribution crossover and local search strategy are used for solution set optimization, and the DBSCAN clustering is combined to control the solution set density.

[0140] The solution set is stratified based on non-dominated sorting and crowding degree. Effective solutions are screened by combining business rules and resource capacity constraints. The clustering method is used to select representative solutions and delete redundant solutions. The best push time is predicted according to the user activity pattern, and the push threshold is set based on the user acceptance. The filtered solution set is hierarchically sorted to obtain the final recommendation sequence.

[0141] Exemplarily, first, the product features are extracted and processed. The Word2Vec model is used to vectorize the text information such as the product title and description. The context size is set to 5 through a sliding window, and a 300-dimensional text feature vector is obtained through training. The pre-trained ResNet50 network is used to extract 2048-dimensional visual features for the product image. The text features and visual features are mapped to the same dimension through a fully connected layer and concatenated, and the cosine similarity between different products is calculated to obtain the product relevance matrix.

[0142] Next, construct the user behavior sequence features. Sort the historical interaction behaviors of each user by timestamp, including three types: click (weight 0.2), favorite (weight 0.5), and purchase (weight 1.0). Introduce a time decay function with a decay coefficient set to 0.1 to calculate the timeliness weight of each behavior. Map the user ID and product ID into 64-dimensional vectors through the embedding layer. Use a bidirectional GRU network with a hidden layer dimension of 128 to process the behavior sequence from both the forward and backward directions. Introduce an 8-head self-attention mechanism to calculate the correlation weights at different time steps. Concatenate the attention-weighted sequence features with the user's basic features (such as age, gender, etc.) and the product content features, and obtain the user interest representation through a three-layer fully connected network (dimensions 512-256-128).

[0143] When calculating the commercial value features, comprehensively consider indicators such as product profit margin (0-1 standardization), historical conversion rate, user activity in the past 30 days, average stay duration, and number of social shares. Use the Min-Max method to normalize all features.

[0144] In the multi-objective optimization stage, first construct the dominance relationship. Use a 16×16 grid to divide the objective space and calculate the dominance number of each solution in parallel. Introduce the dominance level change rate to adaptively adjust the objective weights, with the initial weights set to [0.4, 0.3, 0.3]. Use the Box-Muller transform to generate a crossover operator that follows a Gaussian distribution, with a standard deviation set to 0.1. Set the mutation probability to 0.1 and use the Metropolis criterion to control the acceptance probability. Use DBSCAN clustering (eps = 0.1, minPts = 4) to control the density of the solution set.

[0145] Finally, stratify the solution set based on non-dominated sorting and crowding degree calculation. Combine the resource capacity constraint (no more than 10 pushes at a time) and business rules (similar products should have an interval of ≥3) to screen the valid solutions. Use K-means clustering (K = 20) to select the representative solutions. Predict the best push time based on the user's historical active periods, set the acceptance threshold to 0.6, and sort the screened solution set to obtain the final recommendation sequence.

[0146] The present invention can better capture the dynamic evolution law of user interests by introducing time decay weights and a bidirectional GRU network, improving the timeliness and personalization of recommendations; the adaptive weight adjustment mechanism based on the dominance level change rate can dynamically balance multiple objectives according to the optimization process, avoiding falling into local optima and enhancing the global optimality of the recommendation results; using a combination of Gaussian distribution crossover and clustering control to optimize the solution set not only ensures the diversity of solutions but also avoids the solution set from being too scattered, improving the quality and usability of the recommendation sequence.

[0147] In an alternative embodiment

[0148] Construct the domination relationship using a hash table and a Bloom filter, calculate the domination number through parallel calculation of a block grid, introduce an adaptive weight dynamic adjustment mechanism for the optimization objective to construct the domination front; the steps of optimizing the solution set using Gaussian distribution crossover and local search strategies and combining DBSCAN clustering to control the solution set density include:

[0149] Store the domination relationship using a hash table, query the domination relationship based on the Bloom filter, and obtain the initial domination relationship by parallelly calculating the domination number within each grid of the block grid; use kernel density estimation to statistically analyze the objective space distribution of the initial domination relationship; introduce an adaptive weight adjustment mechanism for multiple optimization objectives in the objective space:

[0150]

[0151] where, w j (t) is the weight value of the j-th optimization objective at time t; β is the learning rate parameter used to control the amplitude of weight adjustment, with a value range of (0, 1); ΔR j (t) is the change rate of the domination level of the j-th optimization objective at time t;

[0152] Based on the adaptive weights, perform KD-tree partitioning on the objective space and calculate the inter-layer distance threshold, calculate the sample weights using a Gaussian kernel function with a bandwidth parameter, and construct an adaptive hierarchical domination front structure;

[0153] Perform kernel density distribution modeling on the solutions in the domination front structure, calculate the crossover probability based on the distance between solutions, introduce the Box-Muller transform into the Gaussian distribution crossover operator to generate offspring individuals that satisfy the normal distribution, set the mutation step size in combination with the gradient norm of the objective function, and control the mutation acceptance probability through the Metropolis criterion to obtain the optimized solution set;

[0154] Construct an augmented Lagrangian function containing a linear weighting term and a quadratic penalty term for the optimized solution set:

[0155]

[0156] where, L is the value of the augmented Lagrangian function, x is the decision variable vector, λ is the Lagrange multiplier vector; ρ is the penalty factor used to adjust the penalty intensity for constraint violation; f(x) is the objective function, h i (x) is the i-th constraint function, m is the number of constraint functions; λ i is the i-th component in the vector λ, and i is the number of the constraint function;

[0157] Based on the augmented Lagrangian function, the Powell direction set algorithm is used to adjust the solution components dimension by dimension for constraint repair, and the penalty factor of the repaired solution set is adaptively updated; the BFGS algorithm is applied to the updated solution set for local search, and the DBSCAN clustering is combined to control the density of the solution set to obtain the optimized solution set.

[0158] Exemplarily, a dominance relation storage structure is first constructed. A hash table is used to store the dominance relation information, where the key value is the identifier of the solution and the value is the set of other solutions dominated by this solution. The Bloom filter is used to quickly judge the dominance relation. By setting an appropriate number of hash functions and the size of the bit array, the misjudgment rate is reduced through multiple hash mappings. The target space is divided into grids, and the size of each grid is determined according to the distribution density of the solutions. The dominance numbers of the solutions within each grid are calculated in parallel.

[0159] Kernel density estimation is performed on the target space, and the radial basis function is used as the kernel function. The bandwidth parameter is determined through cross-validation. Based on the kernel density estimation results, the distribution characteristics of the target space are analyzed, and the solution density of each region is calculated. An adaptive weight adjustment mechanism is introduced. The initial weights are set to equal values, and the weight values are dynamically adjusted according to the change rate of the dominance level. The learning rate parameter is set to 0.1.

[0160] The KD tree is used to partition the target space, and the dimension with the largest variance is selected as the splitting dimension. The inter-layer distance threshold is calculated, and the minimum distance between adjacent layers is not less than the threshold. The Gaussian kernel function is used to calculate the sample weights, and the kernel function bandwidth parameter decreases with the number of layers. A dominance front structure is constructed based on the inter-layer distance and sample weights.

[0161] Kernel density distribution modeling is performed on the solutions in the dominance front, and the KDE method is used to estimate the probability density function. The crossover probability is calculated based on the Euclidean distance between the solutions. The closer the distance, the greater the crossover probability. Gaussian distribution crossover is achieved through the Box-Muller transform to generate offspring individuals that satisfy the normal distribution. The mutation step size is determined according to the gradient norm of the objective function. The larger the norm, the smaller the step size. The Metropolis criterion is used to control the mutation acceptance probability.

[0162] An augmented Lagrangian function is constructed for constraint handling, which includes a linear weighted term and a quadratic penalty term. The Powell direction set algorithm is used for constraint repair, and the solution components are adjusted sequentially along the coordinate axes. The penalty factor is adaptively updated according to the degree of constraint violation. The BFGS algorithm is applied for local search, and the search direction is approximately calculated using the second derivative. The DBSCAN clustering is combined to control the density of the solution set, and the density parameter is determined according to the size of the solution space.

[0163] The present invention stores the domination relationship using a hash table and a Bloom filter, and combines block grid parallel computing, significantly improving the computing efficiency of the domination relationship and reducing the storage overhead. The adaptive weight adjustment mechanism can dynamically adjust the target weight according to the optimization process, improving the convergence performance of the algorithm. The combination of Gaussian distribution crossover and local search strategy enhances the global search and local refinement capabilities of the algorithm. The Box-Muller transform ensures the distribution characteristics of the offspring individuals, and the Metropolis criterion effectively controls the convergence direction of the solution. The combination of the augmented Lagrangian function and DBSCAN clustering not only ensures constraint satisfaction but also controls the density of the solution set, obtaining a high-quality solution set with uniform distribution and satisfying constraints. The adaptive penalty factor update mechanism improves the robustness of constraint handling.

[0164] The traditional NSGA-II algorithm uses non-dominated sorting and crowding degree calculation for multi-objective optimization. However, its fixed-weight optimization strategy is difficult to balance the dynamic relationship between multiple objectives, and the solution set is prone to falling into local optima. Although MOEA / D introduces a decomposition strategy to handle multi-objective problems, it mainly relies on static weight vectors, ignoring the dynamic changes in the importance of objectives during the optimization process, and uses a simple SBX crossover operator, making it difficult to ensure the distribution quality of the offspring individuals. To address these problems, the present invention makes improvements from three aspects: First, it designs a fast computing framework for the domination relationship, stores the domination relationship using a hash table and a Bloom filter, combines block grid parallel computing to improve efficiency, and introduces an adaptive weight adjustment mechanism based on the change rate of domination rank. Second, it optimizes the crossover and mutation strategies, introduces the Box-Muller transform into the Gaussian distribution crossover operator, and controls the mutation acceptance probability through the Metropolis criterion to achieve efficient exploration of the solution set. Third, it proposes a constraint handling and solution set optimization method, constructs an augmented Lagrangian function for constraint repair, and combines BFGS local search and DBSCAN clustering to control the quality of the solution set. In terms of computing efficiency, the present invention reduces the computing time of the domination relationship by 40% and reduces the storage overhead by 35%. In terms of optimization performance, the convergence speed is increased by 25%, the obtained solution set is more evenly distributed, and the local optima are reduced by 50%. In terms of robustness, through the adaptive weight adjustment and constraint handling mechanisms, it ensures stable performance in different scenarios, realizes the efficient optimization of multiple objectives in the recommendation system, and significantly improves the quality and usability of the recommendation results.

[0165] Figure 4 FIG. is a schematic structural diagram of a knowledge graph construction and product recommendation system based on user data according to an embodiment of the present invention, as Figure 4 shown, the system includes:

[0166] A first unit for extracting entity information and relationship information based on user historical behavior data to construct an initial knowledge graph, where nodes correspond to entity information and connection edges correspond to relationship information;

[0167] A second unit for constructing a multi-layer neural network including a multi-granularity layer, a graph attention layer, and a graph convolutional layer. By multi-granularity calculation and fusion of node-level, path-level, and sub-graph-level attention weights, aggregating multi-level entity information through the graph attention layer, and using the graph convolutional layer for dynamic neighborhood information fusion to generate an optimized graph spectrum; vectorizing the nodes in the optimized graph spectrum and calculating the similarity between nodes;

[0168] A third unit for constructing a semantic transfer matrix and a multi-level influence network according to the real-time behavior data of the target user to guide the walking direction, dynamically adjusting the sampling depth and restart strategy using the composite scoring of semantic relevance and information entropy, performing bidirectional random walk sampling in the optimized graph spectrum, and optimizing path collaboration through multi-dimensional matching metrics and two-level loss to obtain a sub-graph related to the target user;

[0169] A fourth unit for calculating the importance score of product nodes based on the sub-graph, where the importance score is composed of weighted node centrality, node similarity, and node popularity; taking the top N product nodes with the importance score as candidate recommended products, where N is a preset positive integer;

[0170] A fifth unit for sorting the candidate recommended products using a multi-objective optimization algorithm and pushing them to the target user, where the multi-objective optimization algorithm comprehensively considers product relevance, user interest, and commercial value.

[0171] In the third aspect of the embodiments of the present invention,

[0172] Provided is an electronic device, including:

[0173] A processor;

[0174] A memory for storing instructions executable by the processor;

[0175] Wherein, the processor is configured to call the instructions stored in the memory to execute the method described above.

[0176] In the fourth aspect of the embodiments of the present invention,

[0177] Provided is a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method described above is implemented.

[0178] The present invention can be a method, apparatus, system, and / or computer program product. The computer program product can include a computer-readable storage medium, on which computer-readable program instructions for executing various aspects of the present invention are uploaded.

[0179] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for constructing a knowledge graph and product recommendation based on user data, characterized in that Including: Extracting entity information and relationship information from user historical behavior data to construct an initial knowledge graph, where nodes correspond to entity information and connecting edges correspond to relationship information; Constructing a multi-layer neural network including a multi-granularity layer, a graph attention layer, and a graph convolutional layer, calculating and fusing attention weights at the node level, path level, and sub-graph level through multi-granularity computing, aggregating multi-level entity information through the graph attention layer, and using the graph convolutional layer for dynamic neighborhood information fusion to generate an optimized graph; Vectorizing the nodes in the optimized graph and calculating the similarity between nodes; According to the real-time behavior data of the target user, constructing a semantic transfer matrix and a multi-level influence network to guide the walking direction, dynamically adjusting the sampling depth and restart strategy using the composite scoring of semantic relevance and information entropy, performing bidirectional random walk sampling in the optimized graph, and optimizing path collaboration through multi-dimensional matching metrics and two-level loss to obtain a sub-graph related to the target user; Calculating the importance score of product nodes based on the sub-graph, where the importance score is composed of the weighted sum of node centrality, node similarity, and node popularity; taking the top N product nodes with the importance score as candidate recommended products, where N is a preset positive integer; Using a multi-objective optimization algorithm to sort the candidate recommended products and push them to the target user, where the multi-objective optimization algorithm comprehensively considers product relevance, user interest, and commercial value.

2. The method according to claim 1, wherein The steps of calculating and fusing attention weights at the node level, path level, and sub-graph level through multi-granularity computing, aggregating multi-level entity information through the graph attention layer, and using the graph convolutional layer for dynamic neighborhood information fusion to generate an optimized graph include: Constructing a multi-layer neural network, where the multi-layer neural network includes a multi-granularity layer, a graph attention layer, and a graph convolutional layer, and skip connections and layer normalization modules are set between the layers of the multi-layer neural network; Calculating node-level attention, path-level attention, and sub-graph-level attention through the multi-granularity layer, and fusing multiple attention scores based on an adaptive weight coefficient to obtain a fused attention weight; Based on the fused attention weight, respectively aggregating information of entity layers of attributes, entity layers of relationships, and entity layers of categories through the graph attention layer, and adaptively fusing the aggregated multi-level information to obtain an initial feature representation; Using the graph convolutional layer to perform dynamic neighborhood information aggregation on the initial feature representation, adaptively adjusting the neighborhood range based on node similarity, updating the node representation, and generating an optimized graph; Constructing a multi-objective loss function, including a structure-aware loss for maintaining category hierarchy relationships and attribute consistency, a behavior sequence loss for modeling temporal dependencies and interest transfer, and a contrastive learning loss for improving the quality of feature representation; generating a structure weight component based on entity importance indicators and relationship reliability matrices, generating a sequence weight component according to category knowledge complexity, generating a contrast weight component using sub-graph integrity scores, and optimizing the parameters of the multi-layer neural network; online updating the optimized graph based on an incremental learning strategy.

3. The method according to claim 1, characterized in that, According to the real-time behavior data of the target user, construct a semantic transfer matrix and a multi-level influence network to guide the walking direction, dynamically adjust the sampling depth and restart strategy using the composite scoring of semantic relevance and information entropy, and perform bidirectional random walk sampling in the optimized graph. The steps of obtaining the subgraph related to the target user through multi-dimensional matching metrics and two-level loss optimization include: Construct a user-item bipartite graph based on the real-time behavior data of the target user, and generate the comprehensive behavior weight by combining the time decay characteristic and the interaction intensity; Based on the comprehensive behavior weight, calculate the activity of the user behavior node, combine the node centrality index and the user historical interest relevance, screen and construct the starting point set, and dynamically adjust the starting point set through diversity constraints; For the nodes in the starting point set, construct a semantic transfer matrix and a reverse reachability matrix, perform forward walking using node importance and edge semantic relationships, and at the same time perform reverse walking using the influence propagation intensity. Perform two-way path collaborative optimization through forward-backward path matching metrics; During the two-way walking process, calculate the semantic relevance change metric based on the path semantic representation weighted by node position, calculate the information gain by combining the node type entropy and the attribute entropy, fuse the semantic relevance change metric and the information gain through a balance parameter to obtain a composite score, use a piecewise function to dynamically adjust the sampling depth according to the composite score, and determine the restart position and restart time interval based on the composite score; For the path set obtained by sampling, calculate the relevance and information richness of the path and the user interest, screen and form the initial subgraph, determine the node weights based on the path importance, and optimize the connectivity and semantic integrity of the subgraph to obtain the optimized subgraph.

4. The method according to claim 3, wherein The steps of constructing a semantic transfer matrix and a reverse reachability matrix, performing forward walking using node importance and edge semantic relationships, and at the same time performing reverse walking using the influence propagation intensity, and performing two-way path collaborative optimization through forward-backward path matching metrics include: Calculate the semantic similarity between nodes based on the node type mapping matrix, and multiply it by the node type transfer constraint matrix to obtain the semantic transfer matrix; Construct a multi-level influence propagation network, fuse the local features and global features of each level of nodes through a multi-layer perceptron to obtain the level representation, calculate the level weight based on the level representation, and weighted accumulate the level weight and the reachability matrix of the corresponding level to obtain the reverse reachability matrix; Calculate the semantic similarity between the edge-connected nodes and the node interaction intensity, fuse them through a balance factor to obtain the edge weight, calculate the sampling probability of forward walking based on the weighted combination score of the edge weight and the betweenness centrality, eigenvector centrality, and association degree of the node; Construct a node influence vector including direct influence, indirect influence, and temporal influence, calculate the propagation attenuation value based on the node influence vector and the propagation distance, and perform reverse walking according to the propagation attenuation value to obtain the reverse walking path; Encode the node sequences in the forward and reverse walk paths using a bidirectional long short-term memory network to obtain path representation vectors. Input the node overlap degree, semantic similarity, and structural consistency between the path representation vectors into a multi-layer perceptron to obtain matching weights, and calculate the path matching metric based on the matching weights. Calculate the node-level matching loss and path-level matching loss based on the path matching metric, and construct an optimization objective function through balanced parameter fusion. Update the node representations of the bidirectional paths based on the optimization objective function.

5. The method according to claim 1, wherein Use a multi-objective optimization algorithm to rank candidate recommended products and push them to target users. The steps for the multi-objective optimization algorithm to comprehensively consider product relevance, user interest, and commercial value include: Introduce time decay weights for click, favorite, and purchase behaviors in the user-item interaction sequence, and extract user interest features through a bidirectional GRU network and self-attention mechanism. Construct an adaptive weight adjustment mechanism based on the rate of change of dominance level, partition the target space using a KD tree, and calculate sample weights using a Gaussian kernel function with a bandwidth parameter. Introduce the Box-Muller transform into the Gaussian distribution crossover operator to generate offspring individuals, control the mutation acceptance probability through the Metropolis criterion, and perform constraint processing and clustering screening on the solution set to obtain a recommended sequence, specifically including: Use the Word2Vec model to extract product text features and an image feature extractor to obtain the product visual representation, and calculate the product relevance feature through cosine similarity. Construct a user-item interaction sequence matrix, where each interaction behavior includes three types: click, favorite, and purchase, and introduce an exponential decay function based on the time interval to calculate the timeliness weight for each interaction behavior. Map the interaction sequence to a dense vector through an embedding layer, use a bidirectional GRU network to extract user behavior sequence features from both the forward and reverse directions, calculate the correlation weights between different time steps based on the self-attention mechanism, and perform non-linear feature fusion on the attention-weighted behavior sequence features, user basic features, and item content features to obtain the user interest feature. Calculate the commercial value feature based on the product profit margin, conversion probability, user activity, platform stay duration, and social sharing influence; Perform Min-Max normalization on the product relevance feature, user interest feature, and commercial value feature, construct a dominance relationship using a hash table and Bloom filter, calculate the dominance number through block grid parallel computing, and introduce an adaptive weight dynamic adjustment mechanism for the optimization objective to construct a dominance front. Use Gaussian distribution crossover and local search strategies to optimize the solution set, and combine DBSCAN clustering to control the density of the solution set; Stratify the solution set based on non-dominated sorting and crowding degree, screen out valid solutions in combination with business rules and resource capacity constraints, and use a clustering method to select representative solutions and delete redundant solutions. Predict the best push time according to the user activity pattern, set a push threshold based on the user acceptance degree, and perform hierarchical sorting on the screened solution set to obtain the final recommended sequence.

6. The method according to claim 5, wherein Construct the domination relationship using a hash table and a Bloom filter, calculate the domination number through parallel computing of block grids, and introduce an adaptive weight dynamic adjustment mechanism for the optimization objective to construct the domination frontier; adopt a Gaussian distribution crossover and local search strategy to optimize the solution set. The steps of combining DBSCAN clustering to control the solution set density include: Use a hash table to store the domination relationship, query the domination relationship based on the Bloom filter, and obtain the initial domination relationship by calculating the domination number in each grid through parallel computing of block grids; use kernel density estimation to statistically analyze the target space distribution of the initial domination relationship; introduce an adaptive weight adjustment mechanism for multiple optimization objectives in the target space: Among them, w j (t) is the weight value of the j-th optimization objective at time t; β is the learning rate parameter, which is used to control the amplitude of weight adjustment, and its value range is (0, 1); ΔR j (t) is the change rate of the domination level of the j-th optimization objective at time t; Based on the adaptive weights, perform KD-tree partitioning on the target space and calculate the inter-layer distance threshold, calculate the sample weights using a Gaussian kernel function with a bandwidth parameter, and construct an adaptive hierarchical domination frontier structure; Perform kernel density distribution modeling on the solutions in the domination frontier structure, calculate the crossover probability based on the distance between solutions, introduce the Box-Muller transform into the Gaussian distribution crossover operator to generate offspring individuals that satisfy the normal distribution, set the mutation step size in combination with the gradient norm of the objective function, and control the mutation acceptance probability through the Metropolis criterion to obtain the optimized solution set; Construct an augmented Lagrangian function containing a linear weighting term and a quadratic penalty term for the optimized solution set: Among them, \(L\) is the augmented Lagrangian function value, \(x\) is the decision variable vector, \(\lambda\) is the Lagrange multiplier vector; \(\rho\) is the penalty factor, used to adjust the penalty intensity for constraint violation; \(f(x)\) is the objective function, \(h i (x)\) is the \(i\)-th constraint function, \(m\) is the number of constraint functions; \(\lambda i is the \(i\)-th component in the vector \(\lambda\), and \(i\) is the number of the constraint function; Based on the augmented Lagrangian function, use the Powell direction set algorithm to adjust the solution components dimension by dimension for constraint repair, and perform adaptive update of the penalty factor on the repaired solution set; apply the BFGS algorithm to the updated solution set for local search, and combine DBSCAN clustering to control the solution set density to obtain the optimized solution set.

7. A knowledge graph construction and product recommendation system based on user data, for implementing the method according to any one of the preceding claims 1-6, characterized in that Including: The first unit is used to extract entity information and relationship information based on the user's historical behavior data to construct an initial knowledge graph, where the nodes correspond to entity information and the connecting edges correspond to relationship information; The second unit is used to construct a multi-layer neural network including a multi-granularity layer, a graph attention layer, and a graph convolutional layer, calculate and fuse the attention weights at the node level, path level, and sub-graph level through multi-granularity computing, aggregate multi-level entity information through the graph attention layer, and use the graph convolutional layer for dynamic neighborhood information fusion to generate an optimized graph; Perform vectorized representation on the nodes in the optimized graph and calculate the similarity between nodes; The third unit constructs a semantic transfer matrix and a multi-level influence network according to the real-time behavior data of the target user to guide the walking direction, dynamically adjusts the sampling depth and restart strategy using the composite scoring of semantic relevance and information entropy, performs bidirectional random walk sampling in the optimized graph, and optimizes the path collaboration through multi-dimensional matching metrics and double-level loss to obtain a sub-graph related to the target user; The fourth unit is used to calculate the importance score of the product nodes based on the sub-graph, and the importance score is composed of the weighted sum of node centrality, node similarity, and node popularity; take the top N product nodes with the highest importance score as candidate recommended products, where N is a preset positive integer; The fifth unit is used to push candidate recommended products to target users after sorting them by using a multi-objective optimization algorithm, and the multi-objective optimization algorithm comprehensively considers product relevance, user interest, and commercial value.

Citation Information

Cited By

  • Analysis method and device for screening target customer group, equipment and medium

    CN120561625A

  • Analysis methods, devices, equipment and media for screening target customer groups

    CN120561625B

  • Atmogram recommendation method based on multi-hop path enhancement and adaptive graph structure optimization

    CN120632222A

  • Graph recommendation method based on multi-hop path enhancement and adaptive graph structure optimization

    CN120632222B

  • Supplier portrait visual display method and system based on knowledge graph

    CN120744128A