Intelligent grass planting scheme recommendation method and system based on graph neural network

By constructing heterogeneous dynamic graphs and relationship-aware graph neural networks, and combining them with reinforcement learning algorithms to optimize parameters, the problems of dynamic changes in user preferences and scene migration in product recommendation were solved, thereby improving the adaptability and stability of the recommendation results.

CN121807919BActive Publication Date: 2026-05-05GUANGZHOU YUNZHIDACHUANG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU YUNZHIDACHUANG TECH CO LTD
Filing Date
2026-03-04
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing product recommendation methods cannot effectively capture dynamic changes in user preferences, lack analysis of edge weight perturbations caused by user scenario migration, have insufficient adaptability and stability of recommendation results, and lack of pre-defined ranking rules, resulting in insufficient recommendation consistency.

Method used

A heterogeneous dynamic graph is constructed, edge weights are updated through a time decay accumulation rule, and the dynamic edge weights of the relation-aware graph neural network drive the attention mechanism. The ranking sensitivity energy is calculated, and the parameters of the graph neural network and the policy network are optimized through a reinforcement learning algorithm to achieve collaborative optimization of feature extraction and policy modeling.

Benefits of technology

Effectively capture dynamic changes in user preferences, improve the adaptability and stability of recommendation results, ensure the consistency of recommendation lists, meet the dynamic needs of users, and enhance the quality of product recommendation services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121807919B_ABST
    Figure CN121807919B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of deep learning, and discloses an intelligent grass planting scheme recommendation method and system based on a graph neural network, the intelligent grass planting scheme recommendation method based on the graph neural network comprises the following steps: step S101, constructing a heterogeneous dynamic graph; step S102, generating node representation; step S103, calculating a gradient direction vector; step S104, updating a scene migration disturbance covariance matrix; step S105, calculating ranking sensitivity energy; step S106, calculating reinforcement learning rewards; step S107, updating the graph neural network; and step S108, outputting a commodity recommendation list. The application updates the dynamic edge weight of a grass planting link by constructing a heterogeneous dynamic graph and introducing a time decay cumulative rule, combines a relationship perception graph neural network to drive an attention mechanism based on the dynamic edge weight, captures the dynamic change and scene migration characteristics of user preferences, and thus gives consideration to the adaptability and stability of a recommendation result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of deep learning technology, and more specifically, to a method and system for recommending intelligent planting schemes based on graph neural networks. Background Technology

[0002] Product recommendation has become a core function for e-commerce and content platforms to improve user conversion. Current technologies generally use static graph structures to depict the relationships between products in user scenarios, with fixed edge weights or updates based solely on single interactions. They lack time-decay rules and fail to reflect the time-sensitive differences in users' historical interactions. This results in early, low-value interactions being treated the same as recent, high-value interactions, making it difficult to capture dynamic changes in user preferences.

[0003] Traditional graph neural networks' attention mechanisms do not incorporate dynamic edge weights, and the neighborhood feature aggregation process relies solely on initial node features, making it difficult to accurately match users' current preferences. Furthermore, existing technologies lack quantitative analysis methods for edge weight perturbations caused by user scenario transitions, failing to assess the sensitivity of recommendation ranking to such perturbations, resulting in a significant decrease in the adaptability of recommendation results after scenario switching.

[0004] Furthermore, the recommendation ranking lacks pre-defined fixed rules when candidate combinations have equal probability values, resulting in only random ranking and insufficient consistency in recommendation results. Additionally, the existing technology optimizes the parameters of the feature extraction module and the strategy modeling module separately, preventing them from synergistically improving performance and further reducing the adaptability of the recommendation scheme. These combined problems make traditional product recommendation methods unable to meet the dynamically changing needs of users, and unable to balance the dual goals of recommendation accuracy and stability, thus hindering the improvement of product recommendation service quality. Summary of the Invention

[0005] This invention provides a method and system for recommending intelligent grass planting schemes based on graph neural networks, which solves the technical problems mentioned in the background.

[0006] This invention provides a method for recommending intelligent grass planting solutions based on graph neural networks, comprising the following steps:

[0007] Step S101: Construct a heterogeneous dynamic graph that includes users, scenarios, seeding schemes and products, lock the seeding link consisting of users to scenarios, users to seeding schemes, and seeding schemes to products, and update the dynamic edge weight vector of the seeding link according to the time decay accumulation rule.

[0008] Step S102: Using a relation-aware graph neural network, a dynamic edge weight vector is used to drive the attention calculation mechanism to aggregate neighborhood information and generate node representations.

[0009] Step S103: For the candidate combinations of the recommendation scheme and the product, calculate the recommendation score based on the node representation, and calculate the gradient direction vector of the recommendation score with respect to the user node representation;

[0010] Step S104: When the user-associated scene identifier changes, the scene migration perturbation covariance matrix is ​​recursively updated using the change in the dynamic edge weight vector.

[0011] Step S105: Calculate the user node representation of the user sensitivity Jacobian matrix to the dynamic edge weight vector, multiplicatively couple the gradient direction vector, the user sensitivity Jacobian matrix and the scene migration perturbation covariance matrix, and calculate the sorting sensitivity energy.

[0012] Step S106: The node representation, target scene representation and ranking sensitivity energy are concatenated into a state vector. The policy network generates a recommendation list of products and product recommendations based on the policy distribution constructed by the recommendation score. The reinforcement learning reward is calculated by combining the user feedback intensity and the ranking sensitivity energy as a penalty.

[0013] Step S107: Based on reinforcement learning rewards, the parameters of the graph neural network and the policy network are jointly updated using the policy gradient algorithm.

[0014] Step S108: Output the seeding scheme and product recommendation list containing the sorting position during the real-time reasoning stage.

[0015] This invention provides an intelligent grass-planting scheme recommendation system based on graph neural networks, comprising:

[0016] The heterogeneous dynamic graph construction module constructs a heterogeneous dynamic graph that includes users, scenarios, seeding schemes, and products. It locks the seeding link consisting of users to scenarios, users to seeding schemes, and seeding schemes to products, and updates the dynamic edge weight vector of the seeding link according to the time decay accumulation rule.

[0017] The node representation generation module uses a relation-aware graph neural network with a dynamic edge weight vector-driven attention calculation mechanism to aggregate neighborhood information and generate node representations.

[0018] The gradient direction vector calculation module calculates the recommendation score based on the node representation for the candidate combination of the recommendation scheme and the product, and calculates the gradient direction vector of the recommendation score with respect to the user node representation.

[0019] The scene migration perturbation update module recursively updates the scene migration perturbation covariance matrix when the user's associated scene identifier changes, using the change in the dynamic edge weight vector.

[0020] The sorting sensitivity energy calculation module calculates the user node representation's sensitivity Jacobian matrix to the dynamic edge weight vector, and multiplicatively couples the gradient direction vector, the user sensitivity Jacobian matrix, and the scene migration perturbation covariance matrix to calculate the sorting sensitivity energy.

[0021] The reinforcement learning reward calculation module concatenates the node representation, target scene representation, and ranking sensitivity energy into a state vector. It generates a recommendation list of products and product recommendations based on the policy distribution constructed by the policy network based on the recommendation score. The reinforcement learning reward is calculated by combining the intensity of user feedback and the ranking sensitivity energy as a penalty.

[0022] The gradient update module uses a policy gradient algorithm based on reinforcement learning rewards to jointly update the parameters of the graph neural network and the policy network.

[0023] The product recommendation list output module outputs a product recommendation list with sorted ranking during the real-time reasoning stage.

[0024] The beneficial effects of this invention are as follows:

[0025] This invention constructs a heterogeneous dynamic graph and introduces a time decay accumulation rule to update the dynamic edge weights of the recommendation chain. Combined with a relationship-aware graph neural network's dynamic edge weight-driven attention mechanism, it effectively captures dynamic changes in user preferences and scene migration features. It quantifies the sensitivity of recommendation ranking to scene migration perturbations by calculating ranking sensitivity energy, and combines reinforcement learning algorithms to jointly update the parameters of the graph neural network and policy network, achieving collaborative optimization of feature extraction and policy modeling. Simultaneously, a deterministic ranking operator is used in the real-time inference stage, sorting according to a fixed order when probabilities are equal, ensuring the consistency of the recommendation list. This balances the adaptability and stability of the recommendation results, meets the dynamically changing needs of users, and improves the overall quality of the recommendation service. Attached Figure Description

[0026] Figure 1 This is a flowchart of the intelligent grass planting scheme recommendation method based on graph neural networks of the present invention;

[0027] Figure 2 This is a schematic diagram of the intelligent grass planting solution recommendation system based on graph neural networks of the present invention;

[0028] Figure 3 This is a schematic diagram of the computational logic of the present invention.

[0029] In the diagram: Heterogeneous dynamic graph construction module 201, node representation generation module 202, gradient direction vector calculation module 203, scene migration perturbation update module 204, sorting sensitivity energy calculation module 205, reinforcement learning reward calculation module 206, gradient update module 207, and product recommendation list output module 208. Detailed Implementation

[0030] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification.

[0031] like Figures 1-3 As shown, the intelligent grass-planting solution recommendation method based on graph neural networks includes the following steps:

[0032] Step S101: Construct a heterogeneous dynamic graph that includes users, scenarios, seeding schemes and products, lock the seeding link consisting of users to scenarios, users to seeding schemes, and seeding schemes to products, and update the dynamic edge weight vector of the seeding link according to the time decay accumulation rule.

[0033] Step S102: Using a relation-aware graph neural network, a dynamic edge weight vector is used to drive the attention calculation mechanism to aggregate neighborhood information and generate node representations.

[0034] Step S103: For the candidate combinations of the recommendation scheme and the product, calculate the recommendation score based on the node representation, and calculate the gradient direction vector of the recommendation score with respect to the user node representation;

[0035] Step S104: When the user-associated scene identifier changes, the scene migration perturbation covariance matrix is ​​recursively updated using the change in the dynamic edge weight vector.

[0036] Step S105: Calculate the user node representation of the user sensitivity Jacobian matrix to the dynamic edge weight vector, multiplicatively couple the gradient direction vector, the user sensitivity Jacobian matrix and the scene migration perturbation covariance matrix, and calculate the sorting sensitivity energy.

[0037] Step S106: The node representation, target scene representation and ranking sensitivity energy are concatenated into a state vector. The policy network generates a recommendation list of products and product recommendations based on the policy distribution constructed by the recommendation score. The reinforcement learning reward is calculated by combining the user feedback intensity and the ranking sensitivity energy as a penalty.

[0038] Step S107: Based on reinforcement learning rewards, the parameters of the graph neural network and the policy network are jointly updated using the policy gradient algorithm.

[0039] Step S108: Output the seeding scheme and product recommendation list containing the sorting position during the real-time reasoning stage.

[0040] All user data involved in this invention is collected and used with the user's consent. The collection process follows the principle of minimum necessary data, acquiring only the user data required to support the training and real-time inference of the product recommendation model, including basic user attribute data, user scenario association data, and user interaction data with product recommendation schemes and products. Strict anonymization processing is performed on the collected user data; user identification information is anonymized, and additional information that can be associated with specific users is removed from the interaction data. Data storage employs encryption technology and a strict access control mechanism is in place, authorizing only relevant technical personnel to access the data within a limited scope. Furthermore, the data is used solely for parameter training and real-time inference of the product recommendation model and is not used for any purpose other than the recommendation service of this invention. The security and compliance of user data are ensured throughout its entire lifecycle.

[0041] In one embodiment of the present invention, a heterogeneous dynamic graph comprising users, scenarios, product seeding schemes, and products is constructed. A product seeding link consisting of user-to-scenario, user-to-product seeding scheme, and product seeding scheme-to-product seeding link is identified. The dynamic edge weight vector of the product seeding link is updated according to a time decay accumulation rule, including:

[0042] Define a set of nodes And construct heterogeneous dynamic graphs :

[0043]

[0044]

[0045] in For user collection, For scene collection, This is a collection of plant-planting schemes. For a collection of goods, The set union operator. For time The set of edges below;

[0046] Locking the set of seeding link relationship types :

[0047]

[0048] in For user-to-scenario relationship types, The relationship type between users and product recommendation strategies. From the seeding plan to the product relationship type, For user nodes belonging to the user set, These are scene nodes belonging to the scene set. This refers to a node representing a planting scheme that belongs to the planting scheme set. These are the product nodes that belong to the product set;

[0049] Calculate dynamic edge weights :

[0050]

[0051] in For time Next node With nodes Dynamic edge weights between them This is a set of relationship types belonging to the seeding link. Node pairs, For occurring at node With nodes The collection of interaction events between them For interactive events in the set of interactive events, Interactive events Event timestamp, This indicates that only interaction events prior to the current time will be counted. It is an exponential function. The time decay coefficient is greater than zero. This is the time difference. This is an event intensity mapping function that maps interactive events to positive real numbers;

[0052] Generate dynamic edge weight vector :

[0053]

[0054] in This is a dynamic edge weight vector. This indicates traversing all existing edges within the set of grass-planting link relationship types. This is a vectorized concatenation operator used to combine all dynamic edge weights. The data is concatenated into a one-dimensional vector according to the deterministic arrangement of the grass planting link relationship type set and the deterministic order of graph data storage.

[0055] The user set is the collection of all registered users on the platform, reflecting the user coverage of product recommendations. It can be collected from the platform's user registration database. The scenario set is the collection of all user life scenarios preset by the platform, reflecting the scenario dimension of product recommendations. It can be collected from platform operators' presets combined with user behavior tags. The product recommendation solution set is the collection of all product recommendation content carriers on the platform, reflecting the content foundation of product recommendations. It can be collected from the platform's content publishing system. The product set is the collection of all products to be recommended on the platform, reflecting the product objects of product recommendations. It can be collected from the platform's product management database. The node set is the union of the user set, scenario set, product recommendation solution set, and product set. The edge set is the collection of all relational edges between nodes in the heterogeneous dynamic graph, reflecting the association between nodes. The user-scenario relationship type is the association between the user and the scenario they are in, reflecting the user's affiliation with the scenario. The user-product recommendation solution relationship type is the interaction between the user and the product recommendation solution, reflecting the user's interest in the solution. The product recommendation solution-product relationship type is the directional relationship between the solution and the recommended product, reflecting the compatibility between the solution and the product. The set of relationship types for product seeding links is a collection of the three types of relationships mentioned above, reflecting the core association path of product seeding recommendations.

[0056] A node pair is two related nodes within the set of relationship types in the seeding link, reflecting the node association units in the core link. The set of interaction events is the collection of all user interactions between node pairs, reflecting the interaction between users and node pairs. The time decay coefficient is a coefficient used to calculate the degree of weight decay of historical interaction events, reflecting the rate of decay of the influence of historical events. The event intensity mapping function is a function that converts different types of interaction events into positive real numbers, reflecting the seeding intention intensity of different interaction behaviors. The dynamic edge weight is the weighted interaction intensity of the node pair at the current time, reflecting the dynamic correlation between node pairs. The deterministic arrangement is the fixed arrangement order of the seeding link relationship type set. The dynamic edge weight vector is a one-dimensional vector formed by concatenating all dynamic edge weights in a fixed order, reflecting the overall dynamic weight characteristics of the core link.

[0057] The preferred value range for the time decay coefficient is 0.05 to 0.2. This range balances timeliness and historical reference in practical applications. When the value is less than 0.05, historical events decay too slowly, and the weight is easily dominated by outdated behaviors; when the value is greater than 0.2, historical events decay too quickly, and the weight only reflects recent behaviors, lacking stability. The specific mapping rule for the event intensity mapping function is as follows: click events are mapped to 1, collection events to 2, events with a long dwell time of more than 30 seconds to 3, and sharing events to 4. This is based on the different conversion potential of different interaction behaviors. Sharing behavior has the strongest willingness to be planted, followed by long dwell time and collection, and click is the weakest. This rule can be fine-tuned according to the actual business needs of the platform. The specific rule for the deterministic arrangement of the set of planted product link relationship types is arranged in the order of user to scenario, user to planted product solution, and planted product solution to product. This order is consistent with the user intent conversion path of planted product recommendations, that is, the user is first in a certain scenario, then comes into contact with the planted product solution in that scenario, and finally learns about the product through the solution, ensuring the logical consistency of vector splicing. The specific rule for the deterministic order of graph data storage is that edges within the same relation type are arranged in ascending order of source node ID, and edges with the same source node ID are arranged in ascending order of target node ID. This rule facilitates fast data querying and batch processing, and avoids inconsistencies in vector concatenation results due to disordered storage order. The specific implementation of dynamic edge weight vectorized concatenation is as follows: First, traverse each type of relation according to the deterministic order of the grass planting link relation type set; second, for each type of relation, traverse all edges according to the deterministic order of graph data storage; third, extract the dynamic edge weights of each edge sequentially and stack them into a one-dimensional vector; fourth, store the vector in array format.

[0058] This design locks onto a set of relationship types for the product recommendation chain, including user-to-scenario, user-to-product recommendation, and product recommendation chain. Only edges within this set are created and their weights updated. This design focuses on the core conversion path of product recommendation and excludes interference from irrelevant relationships such as user reviews of products and user sharing of products. For example, if a user is in a commuting scenario and clicks on a commuting outfit recommendation that points to a sneaker product, only three edges are created and their weights are updated: user-commuting scenario, user-commuting outfit recommendation, and commuting outfit recommendation and sneakers. Other irrelevant edges are not included in the calculation, improving the efficiency and relevance of weight calculation and ensuring that the subsequent model focuses on the core product recommendation chain. This invention constructs a heterogeneous dynamic graph, calculates dynamic edge weights by combining time decay accumulation rules with the intensity of interaction events, and then generates weight vectors in a fixed order. This accurately depicts the dynamic changes in user interactions across scenarios, providing structured weight inputs for subsequent models. It thus locks in core links, eliminates irrelevant interference, and improves the efficiency and relevance of weight calculation. The time decay rule reflects recent user preferences, allowing weights to update dynamically with user behavior. This ensures that the recommendation model can capture dynamic user preferences, improving the rationality and interpretability of recommendations.

[0059] In one embodiment of the present invention, a relation-aware graph neural network is used, employing a dynamic edge weight vector-driven attention calculation mechanism to aggregate neighborhood information and generate node representations, including:

[0060] Initialize node representation :

[0061]

[0062] in For the set of nodes The node, For nodes The initial feature vector of the node, This represents the node representation of the zeroth layer relation-aware graph neural network;

[0063] Calculate attention weights :

[0064]

[0065] in In the first Layer and in relation type From neighboring nodes Point to target node Attention weights It is an exponential function. This is the attention scaling factor. For time Next node With nodes Dynamic edge weights between them To traverse the neighbor set The neighboring nodes;

[0066] Calculate message vector :

[0067]

[0068] in In the first Layer aggregation to target node The message vector, This is a set of relationship types for the seeding link. In the first Layers based on relation types The linear transformation matrix, In the first Neighbor nodes of the layer The node representation;

[0069] Update node representation :

[0070]

[0071] in In the first Layer node representation, It is a non-linear activation function. In the first The self-loop linear transformation matrix of the layer is iterated to the th Layer output user node representation Grass planting plan node representation Product node representation and target scene node representation .

[0072] Relationship-aware graph neural networks (GNNs) are graph neural networks capable of distinguishing different relationship types, reflecting their ability to model heterogeneous associations in the product seeding chain. The initial feature vector of a node is a vector characterizing the node's basic attributes, reflecting its initial feature state. This vector can be collected from the platform database; user nodes collect attributes such as age preference tags, scene nodes collect attributes such as scene type descriptions, product seeding plan nodes collect attributes such as content format, and product nodes collect attributes such as category parameters. The target node is the core node in the graph neural network that needs to have its representation updated, reflecting the object of the current feature aggregation. A specific relationship type is a particular relationship in the set of relationship types in the product seeding chain, reflecting the category of association attributes between nodes. Neighbor nodes are the adjacent nodes of the target node under a specific relationship type, reflecting the neighborhood association of the target node. The attention scaling factor is a coefficient that adjusts the influence of dynamic edge weights on attention weights, reflecting the strength of the edge weights' effect on attention allocation. The normalized attention weights are the normalized contribution weights of neighbor nodes, reflecting the degree of influence of neighbor nodes on the target node's representation. The linear transformation matrix is ​​a feature transformation matrix for a specific relationship type. The message vector is an aggregated vector of neighboring node features after weighted transformation, reflecting the comprehensive contribution of neighborhood information to the target node. The self-loop linear transformation matrix is ​​a transformation matrix applied to the target node's own features. The nonlinear activation function is preferably the ReLU function. The next layer node representation is the updated representation of the target node after message aggregation and nonlinear transformation. The number of iterative layers is the number of feature aggregation iterations in the graph neural network.

[0073] The relation-aware graph neural network has 2 to 4 layers. The input layer receives the initial feature vectors of the nodes, the hidden layer aggregates and transforms neighborhood features, and the output layer outputs the final node representation. The attention scaling factor ranges from 0.5 to 2. A value less than 0.5 has too weak an impact on the attention weights due to edge weight differences, while a value greater than 2 has too strong an impact, potentially leading to a single neighbor dominating the aggregation process. This range has been validated in real-world scenarios and is suitable for most edge weight distributions in product recommendation. The dimensionality of the linear transformation matrix and the self-loop linear transformation matrix is ​​set according to the rule that the input dimension of the matrix equals the dimension of the source node representation of the corresponding relation, and the output dimension equals the dimension of the target node representation. Typically, all node representation dimensions are set to 256, therefore the dimensions of both the linear transformation matrix and the self-loop linear transformation matrix are 256 x 256, ensuring dimensionality matching before and after feature transformation. The normalized attention weights are implemented using Softmax normalization. By employing a relation-aware graph neural network and using a dynamic edge weight vector to drive the attention calculation mechanism, node representations are generated by aggregating neighborhood information. The core of this design is to integrate the dynamic correlation features of heterogeneous links into the node representations, which differs from the traditional graph neural network model that uniformly processes all relationships. For example, for a user node, its neighbors include scene nodes and recommendation solution nodes. The relation-aware feature will use different transformation matrices to handle these two types of relationships. At the same time, the dynamic edge weights will determine the attention weights of the neighbors. Recommendation solution nodes that the user has recently interacted with frequently will receive higher attention weights, making the node representation more in line with the user's current preferences.

[0074] This invention employs a relation-aware graph neural network with a dynamic edge weight-driven attention computation mechanism. By hierarchically aggregating neighborhood information under specific relationships and combining self-loop feature transformation and nonlinear activation, it iteratively generates node representations of user-defined product scenarios. This allows the node representations to fully integrate the dynamic heterogeneous association information of the product recommendation chain. The relation-aware characteristic can distinguish the role of different product recommendation chains, avoiding mutual interference between different relationship features. The dynamic edge weight-driven attention mechanism allows neighborhood contributions to be dynamically adjusted according to user interactions, aligning with real-time user preferences. Multi-level iterative aggregation and nonlinear activation can deeply mine node association features, improving feature representation capabilities. The output multi-class node representations provide an accurate feature foundation for subsequent recommendation scoring and ranking stability analysis, thereby ensuring the rationality and interpretability of the recommendation model.

[0075] In one embodiment of the present invention, for candidate combinations of product recommendation schemes and products, a recommendation score is calculated based on node representation, and the gradient direction vector of the recommendation score with respect to the user node representation is calculated, including:

[0076] Determine the set of candidate combinations :

[0077]

[0078] in For the candidate combination set, For subset notation, This is a collection of plant-planting schemes. For a collection of goods, The Cartesian product symbol represents the elements within a set. Indicates the grass planting plan With goods Candidate combinations constituted;

[0079] Calculate recommendation score :

[0080]

[0081] in Candidate combinations Recommendation rating, Represented as a user node, This represents the nodes of the grass planting scheme. For product nodes, The symbol for vector transpose. This is a user-to-product recommendation interaction matrix used to characterize the bilinear interaction between user node representations and product recommendation suggestion node representations. This is a product adaptation matrix used to characterize the bilinear interaction between the product node representation and the product node representation.

[0082] Calculate the gradient direction vector :

[0083]

[0084] in The gradient direction vector. For the gradient operator with respect to the user node representation, This represents the partial derivative with respect to the user node representation. Since the second term in the recommendation scoring formula does not include the user node representation, its partial derivative with respect to the user node representation is zero. The gradient direction vector is derived solely from the user-to-recommendation scheme interaction matrix. Representation of grass planting plan nodes The product is determined.

[0085] The candidate combination set is a set of pairings between product recommendations and recommended products, with a preferred value of 100 to 500 combinations. The user-to-product interaction matrix is ​​a matrix characterizing the interaction pattern between user node representations and product recommendation node representations, reflecting the matching characteristics between users and product recommendations. The product-to-product adaptation matrix is ​​a matrix characterizing the adaptation pattern between product recommendation node representations and product node representations, reflecting the association characteristics between product recommendations and products. The bilinear interaction calculation result is a scalar value obtained after operating on the node representation and the corresponding interaction matrix, reflecting the interaction strength between the two types of nodes. The recommendation score is the sum of the results of the two bilinear interaction calculations, reflecting the recommendation priority of the candidate combination. The gradient direction vector is the result of calculating the partial derivative of the recommendation score with respect to the user node representation, reflecting the sensitive direction of the recommendation score to changes in the user node representation.

[0086] When the node representation dimension is set to 256, both the interaction matrix and the adaptation matrix have dimensions of 256 x 256. The specific steps for bilinear interaction computation are: first, transpose the source node representation; second, multiply the transposed vector by the corresponding interaction matrix; and third, perform a dot product operation between the multiplication result and the target node representation, ultimately obtaining the scalar form of the bilinear interaction computation result. The selection rule for the candidate combination set is based on the historical correlation between the recommendation scheme and the product. Historical correlation is the proportion of times the recommendation scheme recommends the product to the total number of recommendations. Combinations with a correlation greater than 0.1 are included in the candidate set. The scale is set based on a combination of computing resources and recommendation diversity requirements: 100 combinations for small-scale scenarios and 500 combinations for large-scale scenarios. The normalization method for recommendation scoring can be the Min-Max method. Furthermore, a bilinear interaction calculation method is employed, calculating two types of interaction results separately using the user-to-product interaction matrix and the product-to-product matching matrix, and then summing them to obtain the recommendation score. The core of this design is to capture the non-linear correlation features between users and product recommendations, and between product recommendations and products, through bilinear interactions, unlike simple vector dot products. For example, if a user node represents features indicating a liking for review-type products, and a product recommendation node represents features indicating a review-type tag, the user-to-product interaction matrix will strengthen the matching weight of these features, making the interaction calculation results more closely reflect actual preferences. Similarly, the product recommendation-to-product matching matrix will strengthen the matching strength between review products and corresponding review products. The sum of the two calculation results more reasonably reflects the recommendation value of candidate combinations and improves the score's discriminative power.

[0087] In one embodiment of the present invention, when the user-associated scene identifier changes, the scene migration perturbation covariance matrix is ​​recursively updated using the change in the dynamic edge weight vector, including:

[0088] Determine scene changes and dynamic edge weight vectors:

[0089] When the user's associated scenario identifier is at time From scene nodes Change to scene node At that time, retain the time. Dynamic edge weight vector With time Dynamic edge weight vector ,in The time window length is fixed.

[0090] Calculate the weight increment vector :

[0091]

[0092] in To collect the types of relationships in the grass planting chain Dynamic edge weights of all internal edges Vectors formed by concatenating elements in a fixed order For a fixed time window length The weight increment vector within;

[0093] Recursive update of scene migration perturbation covariance matrix :

[0094]

[0095] in For the purpose of starting from scene nodes Migrate to scene node The ordered migration affects the maintained scene migration perturbation covariance matrix. For the assignment update symbol, To update the step size, It is the outer product of the weight increment vector and its transpose, used to represent the unbiased directional intensity matrix.

[0096] User-associated scene identifiers are information indicating the user's current scene, reflecting the user's real-time scene affiliation. Fixed time window length is the time interval used to capture edge weight changes after a scene change. Weight increment vector is the difference between the dynamic edge weight vectors before and after the fixed time window, reflecting the magnitude and direction of edge weight changes caused by scene switching. Ordered migration pairs are directed scene combinations composed of the current scene node and the target scene node, reflecting the directional attribute of scene migration. Scene migration perturbation covariance matrix is ​​a matrix characterizing the statistical features of edge weight perturbation during scene migration, reflecting the association pattern and strength of edge weight perturbation. Unbiased directional strength matrix is ​​the outer product of the weight increment vector and its transpose, reflecting the unbiased statistical strength of edge weight changes. Update step size is the weight coefficient balancing the historical covariance matrix and the current unbiased directional strength matrix, reflecting the contribution of the current observation to the covariance update.

[0097] The fixed time window length ranges from 5 to 30 minutes, and can be adjusted according to the type of scene transition. For scenarios requiring deep user switching intentions, such as commuting to home, a window of 10 to 30 minutes is used; for shallow switching scenarios, such as lunch break to travel, a window of 5 to 10 minutes is used. This setting ensures that complete edge weight changes are captured based on the differences in the time consumption of intention switching in different scenarios. The update step size ranges from 0.05 to 0.2. A step size of 0.2 is used initially during model training to accelerate the update speed of the covariance matrix. Once the model stabilizes, the step size is adjusted to 0.05 to stably preserve historical statistical patterns. The initialization method for the scene transition perturbation covariance matrix is ​​to initialize the matrix as an identity matrix multiplied by a small constant of 0.01, avoiding matrix singularity issues caused by initial values ​​of zero. This will not be elaborated further. The convergence criterion for the scene transition perturbation covariance matrix during the recursive update process is that after two consecutive recursive updates, the Frobenius norm difference of the covariance matrix is ​​less than 10 to the power of -5. When this condition is met, the update of the covariance matrix for the ordered transition is paused to reduce unnecessary computation. In addition, the strategy of independently maintaining the covariance matrix of different ordered migration pairs allocates storage space and calculates and updates independently for each ordered migration pair. Commuting to home and home to commuting are regarded as two different ordered migration pairs, and the corresponding covariance matrix is ​​maintained separately to ensure that the statistical features of each matrix are specifically matched to the specific scenario migration direction.

[0098] This invention monitors user cross-scene switching events, captures dynamic edge weight changes within a fixed time window before and after scene changes, constructs an unbiased directional strength matrix through the outer product of weight increment vectors, and recursively updates the scene migration perturbation covariance matrix using an update step size, characterizing the statistical regularity of edge weight perturbations caused by similar scene migrations. The recursive update method takes into account both historical statistical features and current observation information, making the statistical regularity of the covariance matrix more closely reflect the actual perturbation situation of scene migrations. It independently maintains the covariance matrices of different ordered migration pairs, ensuring the specificity of statistical features. The output covariance matrix provides core perturbation statistics input for subsequent ranking sensitivity energy calculations, supporting the quantitative analysis of cross-scene recommendation stability.

[0099] In one embodiment of the present invention, the user node representation is calculated to the user sensitivity Jacobian matrix to the dynamic edge weight vector. The gradient direction vector, the user sensitivity Jacobian matrix, and the scene migration perturbation covariance matrix are multiplicatively coupled to calculate the ranking sensitivity energy, including:

[0100] Define the user sensitivity Jacobian matrix :

[0101]

[0102] in The user sensitivity Jacobian matrix. Represents the dynamic edge weight vector Find the partial derivative. Represented as a user node;

[0103] Recursively calculate the derivative vector within the layer :

[0104]

[0105] in In the first Layer nodes Regarding dynamic edge weight components The intralayer derivative vector, For nodes With nodes Dynamic edge weight components between them In the first The self-loop linear transformation matrix of the layer, In the first Layers based on relation types The linear transformation matrix, In the first Neighbor nodes of the layer The node representation, Attention weights;

[0106] Calculate the element-wise derivative diagonal matrix With attention derivative:

[0107]

[0108]

[0109] in The operator for converting a vector to a diagonal matrix. The derivative of the nonlinear activation function. For aggregated message vectors, This is the attention scaling factor. For the characteristic function, when neighboring nodes Equal to node The value is 1 if the condition is met, and 0 otherwise.

[0110] Concatenate to generate user sensitivity Jacobian matrix :

[0111]

[0112] in To recursively proceed to the th The layer's user node representation relates to the dynamic edge weight components. The in-layer derivative vector, matrix concatenation order, and dynamic edge weight vector The order of arrangement is consistent;

[0113] Calculate the energy of sorting sensitivity :

[0114]

[0115] in For sorting sensitivity energy, For the candidate combination set, The gradient direction vector. This is the transpose of the gradient direction vector. For the scene migration perturbation covariance matrix, This is the transpose of the user sensitivity Jacobian matrix.

[0116] The user sensitivity Jacobian matrix is ​​the partial derivative matrix of the user node representation with respect to the dynamic edge weight vector, reflecting the sensitivity of the user node representation to changes in dynamic edge weights. The intra-layer derivative vector is the partial derivative vector of a node representation in a graph neural network layer with respect to the dynamic edge weight components, reflecting the response characteristics of a node representation within a single layer to changes in edge weights. The element-wise derivative diagonal matrix is ​​a diagonal matrix composed of the derivatives of the activation function, reflecting the moderating strength of the activation function on each feature dimension. The explicit derivative term is the direct partial derivative of the attention weight with respect to the dynamic edge weight components, reflecting the direct impact of edge weight changes on the attention weights. The implicit chain term is the indirect partial derivative term passed through the intra-layer derivative vectors of neighboring nodes, reflecting the indirect impact of edge weight changes on the target node through neighboring nodes. The ranking sensitivity energy is the cumulative value of the multiplicative coupling of the gradient direction vector, the Jacobian matrix, and the covariance matrix, reflecting the sensitivity of the recommendation ranking to edge weight perturbations caused by scene migration.

[0117] The detailed derivation steps for the explicit derivative term are as follows: First, calculate the partial derivative of the dynamic edge weight component based on the formula for calculating attention weights; second, substitute the expression for attention weights and simplify to obtain the final form of the explicit derivative term, which is the difference between the attention weight multiplied by the attention scaling factor multiplied by the characteristic function and the corresponding attention weight. The implicit chain term is propagated among neighboring nodes according to the rule that the implicit chain term of the target node is equal to the sum of the in-layer derivative vectors of all neighboring nodes multiplied by the corresponding attention weights and the linear transformation matrix. The method for verifying the dimensionality consistency of the Jacobian matrix concatenation is to calculate whether the number of rows in the concatenated Jacobian matrix equals the dimension represented by the user node, and whether the number of columns equals the dimension of the dynamic edge weight vector. If they are not equal, the extraction order and dimension of the in-layer derivative vectors are re-checked. Furthermore, the user sensitivity Jacobian matrix is ​​defined as the partial derivative matrix of the user node representation with respect to the dynamic edge weight vector. This directly links the changes in the user node representation with the changes in edge weights, which differs from the traditional model that only focuses on the node representation itself. For example, if the dynamic edge weight vector includes the edge weights of the user and the commuting plan, the element at the corresponding position in the Jacobian matrix is ​​the partial derivative of the user node representation with respect to that edge weight. The larger the value, the stronger the impact of the edge weight change on the user node representation, providing a core quantitative basis for subsequent sensitivity analysis.

[0118] This invention calculates the Jacobian matrix of the user node representation with respect to the dynamic edge weight vector layer by layer, integrates the multiplicative coupling results of the gradient direction vector and the scene migration perturbation covariance matrix, and accumulates them to obtain the ranking sensitivity energy, thereby quantifying the sensitivity of recommendation ranking to edge weight perturbations caused by scene migration. The layer-by-layer recursive derivative calculation method aligns with the hierarchical structure of the relation-aware graph neural network, ensuring the accuracy of the Jacobian matrix; the fixed-order matrix concatenation ensures dimensionality matching, facilitating subsequent calculations; the multiplicative coupling calculation method integrates multi-dimensional sensitive features, and the output ranking sensitivity energy provides a quantitative indicator for recommendation stability analysis, supporting subsequent reward calculation and parameter optimization in reinforcement learning, thereby improving the robustness and interpretability of the recommendation scheme.

[0119] In one embodiment of the present invention, the node representation, the target scene representation, and the ranking sensitivity energy are concatenated into a state vector. A policy network is used to generate a recommendation list of product recommendations based on a policy distribution constructed using recommendation scoring. The reinforcement learning reward is calculated by combining the user feedback intensity and the ranking sensitivity energy as a penalty, including:

[0120] Constructing state vectors :

[0121]

[0122] in For state vectors, Represented as a user node, This represents the nodes of the target scene. For sorting sensitivity energy, This is the vector concatenation operator;

[0123] Computational strategy distribution :

[0124]

[0125] in For the state vector Next, select candidate combinations The probability value, For the candidate combination set, It is an exponential function. Rate it as a recommendation. For the set of policy network parameters, The positive real-valued scaling factor output by the policy network is used to adjust the sensitivity of the recommendation score to the policy distribution.

[0126] Generate a recommendation list action :

[0127]

[0128] in For recommended list actions, This represents the number of ordered positions contained in the recommended list. The selection operator indicates that the candidate combinations are selected from the set of probabilities in descending order of probability value. Each candidate combination is selected and kept in order.

[0129] Computational reinforcement learning rewards :

[0130]

[0131] in For single-step reinforcement learning rewards, Based on user feedback intensity, It is an energy penalty coefficient that is greater than zero.

[0132] The state vector is a vector formed by concatenating the user node representation, the target scene node representation, and the ranking sensitivity energy. The policy network is a neural network used to generate positive real-number scaling coefficients. These positive real-number scaling coefficients are output by the policy network and are used to adjust the recommendation score, reflecting the degree of influence of the recommendation score on the policy distribution. The policy distribution is the probability allocation result of candidate combinations, reflecting the recommendation priority of candidate combinations. The probability value is the probability of a candidate combination in the policy distribution, reflecting the recommendation likelihood of a single candidate combination. The number of ordered positions in the recommendation list is the number of candidate combinations in the recommendation list. The recommendation list actions are a list of recommended solutions and product combinations generated according to probability ranking, reflecting the final recommendation decision result. The user feedback intensity is a quantitative value of the user's interaction with the recommendation list, reflecting the user's satisfaction with the recommendation result. The energy penalty coefficient is a coefficient used to weight the ranking sensitivity energy, reflecting the degree of influence of ranking stability on the reinforcement learning reward. The reinforcement learning reward is a value calculated by combining the user feedback intensity and the ranking sensitivity energy penalty term, reflecting the quality of the recommendation list actions.

[0133] The specific network structure of the policy network is a two-layer fully connected network. The input layer dimension equals the sum of the user node representation dimension and the target scene node representation dimension plus 1. The hidden layer dimension is 256, using the ReLU activation function. The output layer dimension is 1, using a linear activation function to ensure that the output is a positive real number. The number of layers is set to two to avoid overfitting caused by too many layers, while ensuring sufficient feature fitting ability. The positive real number scaling factor ranges from 0.5 to 2. The adjustment mechanism is as follows: 2 is used in the early stage of model training to amplify the scoring difference and accelerate model convergence; 1 is used in the middle stage of model training to balance recommendation diversity and accuracy; and 0.5 is used in the later stage of model training to increase recommendation diversity and meet the potential needs of users. The number of ordered positions in the recommendation list is set based on the average browsing time of users and the platform's recommendation scenario. The dynamic adjustment rule is 50 for e-commerce promotion scenarios, 10 for daily recommendation scenarios, and 20 for short video recommendation scenarios, adapting the number of positions in different scenarios to users' browsing habits. The quantitative standard for user feedback intensity is as follows: 1 point for clicking, 2 points for adding to favorites, 3 points for adding to cart, 5 points for purchasing, and 10 points for sharing. Scores are accumulated when multiple behaviors are combined. The energy penalty coefficient ranges from 0.01 to 0.1. The adaptive adjustment method is as follows: when the ranking sensitivity energy is greater than 0.5, the coefficient is adjusted to 0.1 to increase the penalty; when the ranking sensitivity energy is less than 0.5, the coefficient is adjusted to 0.01 to decrease the penalty, thus matching the penalty intensity with the ranking sensitivity.

[0134] By concatenating user node representations, target scene node representations, and ranking sensitivity energy in a predetermined order to generate a state vector, the policy network can simultaneously capture user preference features, scene attribute features, and ranking stability features, which differs from traditional policy modeling methods that only use user preferences. For example, if the user node representation includes the feature of liking home goods, the target scene node representation is a home scene, and the ranking sensitivity energy is high, the state vector will integrate these three types of information. When generating scaling coefficients, the policy network will take into account ranking stability and avoid combinations that are too sensitive to edge weight perturbations. This invention concatenates user node representation, target scene node representation, and ranking sensitivity energy into a state vector. A scaling factor is generated through a policy network to adjust the recommendation score, constructing a policy distribution and generating a recommendation list of actions. A reinforcement learning reward is calculated by combining user feedback intensity and ranking sensitivity energy penalty terms, thus allowing the recommendation policy to simultaneously consider user preference scene attributes and ranking stability. The state vector integrates multi-dimensional features, providing comprehensive input information for policy modeling. The dynamic scaling factor flexibly adjusts the discriminative power of the policy distribution, balancing recommendation accuracy and diversity. The recommendation list generated in descending probability order meets user needs and priorities. The reinforcement learning reward mechanism guides model optimization, balancing user feedback and ranking stability, and improving the rationality and robustness of the recommendation scheme.

[0135] In one embodiment of the present invention, the parameters of the graph neural network and the policy network are jointly updated based on the policy gradient algorithm using reinforcement learning rewards, including:

[0136] Define discount rewards With optimization objectives :

[0137]

[0138]

[0139] in In exchange for a discount, The discount factor is a value between zero and one. For single-step rewards in future moments, For expectation operator, To optimize the objective, For the set of policy network parameters, This is a set of parameters related to graph neural networks and recommendation scoring.

[0140] Define log-likelihood :

[0141]

[0142] in To determine the log-likelihood of the recommended list of actions, For the candidate combination set, For the characteristic function, when candidate combinations Actions included in the recommended list The value is 1 if the condition is met, and 0 otherwise. is the logarithmic probability of the candidate combination;

[0143] Calculate the gradient of parameters and :

[0144]

[0145]

[0146] in For the gradient operator of the policy network parameter set, For the gradient operator of the parameter set related to graph neural networks and recommendation scoring, For expectation operators;

[0147] Calculate the approximate gradient of the sample and And update the parameters:

[0148]

[0149]

[0150]

[0151]

[0152] in For a batch of time steps, This represents the number of time steps in the batch. To accumulate time steps within a batch, The learning rate is the set of parameters for the policy network. The learning rate is the set of parameters related to the graph neural network and recommendation scoring. The assignment update symbol.

[0153] Single-step reward is the reward value corresponding to a single recommendation action in reinforcement learning, reflecting the quality of that single recommendation action. Discount factor is a coefficient that exponentially weights future single-step rewards, reflecting the importance of future rewards in overall optimization. Discounted reward is the result of weighting and accumulating single-step rewards using the discount factor, reflecting the long-term cumulative value of the recommendation action. Policy network parameter set is the set of all trainable parameters in the policy network, reflecting the model structure and feature fitting ability of the policy network. Graph neural network and recommendation scoring related parameter set is the set of trainable parameters for the graph neural network and recommendation scoring module. Optimization objective is the objective function value pursued during model training, reflecting the overall optimization direction of the model. Indicator function is a function used to mark whether a candidate combination is included in the recommendation list action, reflecting the selection status of the candidate combination. Sum of log probabilities is the accumulated log probability value of candidate combinations within the recommendation list action, reflecting the overall probability level of the recommendation list action. Log-likelihood of recommendation list action is the sum of the log probabilities corresponding to the recommendation list action, reflecting the probability reliability of the recommendation action. Unbiased estimate of parameter gradient is the unbiased estimate expression of the parameter gradient. Chain rule is an application of the chain rule for compound differentiation of multi-level functions, reflecting the way gradients are propagated between different levels of the model. The time step set is a collection of training time step data. The batch size is the number of time steps used in a single parameter update, reflecting the sample size for gradient calculation. The sampled approximate gradient is an approximation of the gradient calculated based on the batch of time step data, reflecting the actual calculated result of the parameter gradient. The learning rate is the step size coefficient for parameter updates, reflecting the rate of parameter updates.

[0154] A discount factor is defined to exponentially weight future rewards, resulting in a discounted return and determining the optimization objective. This guides the model to consider both short-term user feedback and long-term user preference cultivation, unlike optimization models that only focus on single-step rewards. The specific value range of the discount factor is 0.9 to 0.99. This range is set because recommendation scenarios need to balance short-term feedback and long-term preference cultivation. This range allows the weight of long-term rewards to gradually decrease with each time step, ensuring that recent user experience is not ignored while guiding the model to focus on long-term user stickiness. If the value is below 0.9, the weight of long-term rewards is too low, and the model will be biased towards short-term optimization. If the value is above 0.99, the weight of long-term rewards is too high, amplifying future uncertainty. The specific implementation logic of the indicator function is to traverse each combination in the candidate combination set, check if it exists in the recommendation list action, and return 1 if it exists and 0 otherwise. The standard size of the batch time step set is set to 32 to 128. The dynamic adjustment method is as follows: 32 is used in the early stage of model training to accelerate the iteration speed and quickly approach the optimal parameters; 64 is used in the middle stage of training to balance computational efficiency and gradient stability; and 128 is used in the later stage of training to further reduce gradient fluctuations and stabilize model performance. The specific value range of the learning rate is 0.01% to 0.05%, and the learning rate of graph neural network and recommendation scoring related parameters is 0.1% to 0.05%. The adaptive adjustment strategy is to halve the learning rate of the corresponding parameter when the reinforcement learning reward of the validation set decreases for three consecutive training rounds to avoid model overfitting and ensure the stability of the training process. In addition, the gradient vanishing or exploding problem in the chain derivative process is suppressed by using a gradient clipping strategy, which limits the L2 norm of the parameter gradient to within 10. When the gradient norm exceeds 10, the gradient is scaled proportionally to a norm of 10, thereby effectively suppressing the gradient vanishing or exploding problem and ensuring the effectiveness of the gradient in the chain propagation process. This will not be elaborated here.

[0155] This invention, based on a policy gradient algorithm, obtains a discount reward by weighting future rewards with a discount factor, determines an optimization objective comprising two types of parameters, calculates the log-likelihood of recommended list actions using an indicator function, derives unbiased estimates of parameter gradients based on the policy gradient principle, calculates approximate gradients through batch time steps, and jointly updates the parameters of the policy network and graph neural network by setting a learning rate, thereby achieving long-term stable optimization of the model. The introduction of the discount factor guides the model to consider both short-term feedback and long-term user preferences; the indicator function simplifies log-likelihood calculation and improves computational efficiency; chain-like differentiation ensures the accuracy of gradient propagation for both types of parameters; batch sampling approximate gradients reduce gradient variability; and joint parameter updates enable collaborative optimization of feature extraction and policy modeling, improving the overall performance and stability of the recommendation model.

[0156] In one embodiment of the present invention, the real-time inference stage outputs a list of recommended product recommendations and a ranking list, including:

[0157] Receive updated parameters and policy distribution :

[0158] Receive updated policy network parameters Parameters related to graph neural networks Obtain the state vector With policy distribution:

[0159]

[0160] in represents the scaling factor for the state vector generated by the policy network. Rate it as a recommendation. For the candidate combination set;

[0161] Perform deterministic sorting:

[0162]

[0163] in This is a deterministic sorting operator used to sort candidates in descending order of probability value, and when probabilities are equal, sorting is based on the set of candidate combinations. The pre-agreed and fixed order is used for stabilization. Indicates the sorted order of the first... One candidate combination;

[0164] Output Recommendation List :

[0165]

[0166]

[0167] in This is a rank function used to indicate the rank of candidate combinations in the sorting results. This represents the number of locations included in the recommended list. This is the final output of the product recommendation plan and list of recommended products.

[0168] The pre-defined and fixed order is the criterion for ranking candidate combinations when their probability values ​​are equal. The ranking result is an ordered list of candidate combinations processed by a deterministic ranking operator. The position function is a function that marks the specific position of a candidate combination in the ranking result, reflecting its recommendation priority. The recommendation list, including the ranking positions, is the final recommendation output, which extracts the top K items from the ranking result and marks their positions, reflecting the recommendation decision results in the real-time inference stage. The specific rule for the pre-defined and fixed order is that the unique global identifiers of the candidate combinations are arranged in ascending order. The unique global identifier is generated by concatenating the recommendation ID and the product ID, with the recommendation ID first and the product ID second. This rule ensures the uniqueness and stability of the order. The specific implementation of the deterministic ranking operator is as follows: first, calculate the probability value of all candidate combinations; second, arrange the candidate combinations in descending order of probability value; third, adjust the positions of candidate combinations with equal probability values ​​according to the pre-defined fixed order; and fourth, output the final ordered list. The specific assignment rule for the rank function is that the rank of the kth candidate combination in the sorting result is assigned the value k. The annotation format is to add a rank field to the candidate combination information, and the field value is the corresponding k value.

[0169] This invention receives updated model parameters during the real-time inference phase, obtains the state vector and policy distribution, uses a deterministic ranking operator to stably rank candidate combinations, annotates the recommendation order with a position function, and truncates the ranking results according to a set number of positions to generate a recommendation list containing the ranking order, thereby outputting stable and interpretable product recommendation results. The deterministic ranking operator avoids ranking fluctuations when probabilities are equal, improving the consistency of recommendation results; the position function annotation makes the recommendation priority more transparent and easier for users to understand; the fault-tolerant mechanism for parameter loading ensures the stability of the real-time inference service; and truncating a fixed number of results can adapt to the display needs of different scenarios, improving the user's browsing experience.

[0170] In one embodiment of the present invention, such as Figure 2 As shown, the intelligent grass-planting solution recommendation system based on graph neural networks includes:

[0171] The heterogeneous dynamic graph construction module 201 constructs a heterogeneous dynamic graph that includes users, scenarios, seeding schemes, and products. It locks the seeding link consisting of users to scenarios, users to seeding schemes, and seeding schemes to products, and updates the dynamic edge weight vector of the seeding link according to the time decay accumulation rule.

[0172] The node representation generation module 202 uses a relation-aware graph neural network with a dynamic edge weight vector-driven attention calculation mechanism to aggregate neighborhood information and generate node representations.

[0173] The gradient direction vector calculation module 203 calculates the recommendation score based on the node representation for the candidate combination of the recommendation scheme and the product, and calculates the gradient direction vector of the recommendation score to the user node representation.

[0174] The scene migration perturbation update module 204 updates the scene migration perturbation covariance matrix recursively by using the change in the dynamic edge weight vector when the user-associated scene identifier changes.

[0175] The sorting sensitivity energy calculation module 205 calculates the user node representation's sensitivity Jacobian matrix to the dynamic edge weight vector, and multiplicatively couples the gradient direction vector, the user sensitivity Jacobian matrix, and the scene migration perturbation covariance matrix to calculate the sorting sensitivity energy.

[0176] The reinforcement learning reward calculation module 206 concatenates the node representation, target scene representation, and ranking sensitivity energy into a state vector. It generates a recommendation list of products and product recommendations based on the policy distribution constructed by the policy network based on the recommendation score. It also calculates the reinforcement learning reward by combining the intensity of user feedback and the ranking sensitivity energy as a penalty.

[0177] Gradient update module 207, based on reinforcement learning reward, uses policy gradient algorithm to jointly update the parameters of graph neural network and policy network;

[0178] The product recommendation list output module 208 outputs a product recommendation list with sorted ranking during the real-time reasoning stage.

[0179] For example, if a user's associated scenario identifier changes from commuting to home during a scenario transition, the system obtains the scenario transition time and the dynamic edge weight vector 10 minutes later within a fixed time window. After calculating the weight increment vector, it updates the scenario migration perturbation covariance matrix from commuting to home. Using a relation-aware graph neural network and a dynamic edge weight-driven attention mechanism, it generates node representations for user A, home scenario nodes, and various recommended solutions and products. The system then sets a candidate combination set containing 20 paired solutions and products, calculates a recommendation score for each combination, and constructs a state vector based on ranking sensitivity energy. The policy network outputs a positive real number scaling factor of 0.8 based on the state vector, adjusting the recommendation scores to obtain the policy distribution. A deterministic ranking operator is used, sorting by probability value in descending order, and by combination unique identifier in ascending order when probabilities are equal. The number of positions in the recommendation list is set to 10, and the first 10 combinations are selected to generate the recommendation list.

[0180] For example, the final recommended list is as follows:

[0181] Rank 1: Home cleaning product review, multi-functional cleaning wipes, recommended score 8.2, strategy probability 0.15;

[0182] Rank 2: Home organization tips and solutions, product: layered drawer organizer, recommended score 7.9, strategy probability 0.13;

[0183] Rank 3: Home baking tutorial recommended by product: non-stick baking pan; rating: 7.7; strategy probability: 0.11.

[0184] Rank 4: Home Aromatherapy Buying Guide, Product: Flameless Reed Diffuser, Recommended Rating: 7.5, Strategy Probability: 0.10;

[0185] Rank 5: Home Pajama Comfort Review - Product: Pure Cotton Loose-fitting Pajamas - Recommendation Score: 7.3 - Strategy Probability: 0.09;

[0186] Rank 6: Recommended snacks for home consumption, non-fried puffed snacks, recommendation score 7.0, strategy probability 0.08;

[0187] Rank 7: Home Projector Review - Small Portable Projector, Recommended Score 6.8, Strategy Probability 0.07;

[0188] Rank 8: Recommended yoga mat for home use, product is non-slip and shock-absorbing yoga mat, recommended score is 6.5, strategy probability is 0.06;

[0189] Rank 9: Recommended Home Thermos Cup Selection, Product: 316 Stainless Steel Thermos Cup, Recommendation Rating: 6.3, Strategy Probability: 0.05;

[0190] Rank 10: Home Green Plant Care Guide, Product: Lazy Person's Automatic Watering Flower Pot, Recommended Score: 6.1, Strategy Probability: 0.04.

[0191] The interval and threshold sizes are set to facilitate comparison. The size of the threshold depends on the amount of sample data and the base number set by those skilled in the art for each set of sample data, as long as it does not affect the proportional relationship between the parameter and the quantized value. Furthermore, the above formulas are all dimensionless calculations, and the formulas are derived from software simulations using a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.

[0192] The embodiments of this example have been described above. However, this example is not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms based on the guidance of this example, and all of them are within the protection scope of this example.

Claims

1. A method for recommending intelligent grass planting solutions based on graph neural networks, characterized in that, Includes the following steps: Step S101: Construct a heterogeneous dynamic graph that includes users, scenarios, seeding schemes and products, lock the seeding link consisting of users to scenarios, users to seeding schemes, and seeding schemes to products, and update the dynamic edge weight vector of the seeding link according to the time decay accumulation rule. Step S102: Using a relation-aware graph neural network, a dynamic edge weight vector is used to drive the attention calculation mechanism to aggregate neighborhood information and generate node representations. Step S103: For the candidate combinations of the recommendation scheme and the product, calculate the recommendation score based on the node representation, and calculate the gradient direction vector of the recommendation score with respect to the user node representation; Step S104: When the user-associated scene identifier changes, the scene migration perturbation covariance matrix is ​​recursively updated using the change in the dynamic edge weight vector. Step S105: Calculate the user node representation of the user sensitivity Jacobian matrix to the dynamic edge weight vector, multiplicatively couple the gradient direction vector, the user sensitivity Jacobian matrix and the scene migration perturbation covariance matrix, and calculate the sorting sensitivity energy. Step S106: The node representation, target scene representation and ranking sensitivity energy are concatenated into a state vector. The policy network generates a recommendation list of products and product recommendations based on the policy distribution constructed by the recommendation score. The reinforcement learning reward is calculated by combining the user feedback intensity and the ranking sensitivity energy as a penalty. Step S107: Based on reinforcement learning rewards, the parameters of the graph neural network and the policy network are jointly updated using the policy gradient algorithm. Step S108: Output the seeding scheme and product recommendation list containing the sorting position during the real-time reasoning stage.

2. The intelligent grass planting scheme recommendation method based on graph neural networks according to claim 1, characterized in that, Define a node set consisting of a user set, a scenario set, a product recommendation set, and a product set, and build a heterogeneous dynamic graph containing the node set and the edge set; Lock the set of seeding link relationship types, which includes user-to-scene relationship type, user-to-seeding scheme relationship type, and seeding scheme-to-product relationship type, and only establish and update the weights of edges within the seeding link relationship type set; For any node pair belonging to the set of grass planting link relationship types, obtain the set of interaction events, use the time decay coefficient to perform exponential decay calculation on the difference between the current time and the event timestamp, and combine the event intensity mapping function to convert the values ​​of the interaction events to calculate the accumulated dynamic edge weight. Based on the deterministic arrangement of the grass planting link relationship type set and the deterministic order of graph data storage, a vectorized concatenation operation is performed on all dynamic edge weights to generate a dynamic edge weight vector.

3. The intelligent grass planting scheme recommendation method based on graph neural networks according to claim 1, characterized in that, Receive a heterogeneous dynamic graph and a set of dynamic edge weights, and initialize the node representation of the input layer of the relation-aware graph neural network using the node initial feature vectors; For any target node and its neighboring nodes under a specific relationship type, obtain the dynamic edge weights between the target node and its neighboring nodes, multiply the dynamic edge weights by the attention scaling factor and use the result as the input of the exponent to calculate the normalized attention weights. The attention weights are used to weight the node representations of neighboring nodes, and combined with the linear transformation matrix for a specific relationship type, the message vector aggregated to the target node is calculated. The current node representation of the target node is transformed using a self-loop linear transformation matrix. The transformation result is added to the message vector and then processed by a nonlinear activation function to obtain the updated node representation of the next layer. After multiple iterations, the user node representation, the seeding scheme node representation, the product node representation, and the target scene node representation are output.

4. The intelligent grass planting scheme recommendation method based on graph neural networks according to claim 1, characterized in that, Receive user node representation, seeding scheme node representation, and product node representation, and set a candidate combination set including seeding scheme and product; For any candidate combination in the candidate combination set, the user node representation and the product recommendation scheme node representation are calculated using the user-to-product recommendation scheme interaction matrix, and the product recommendation scheme node representation and the product recommendation scheme node representation are calculated using the product recommendation scheme adaptation matrix. The two calculation results are added together to obtain the recommendation score. The partial derivative operation of the recommendation score with respect to the user node representation is performed by performing matrix-vector multiplication between the user-to-product interaction matrix and the product node representation, to obtain the gradient direction vector of the recommendation score with respect to the user node representation.

5. The intelligent grass planting scheme recommendation method based on graph neural networks according to claim 1, characterized in that, Monitor the user-associated scene identifier. When the user-associated scene identifier changes from the current scene node to the target scene node, retain the scene change time and the dynamic edge weight vector after a fixed time window. The weight increment vector of the grass planting link within the fixed time window is calculated by subtracting the dynamic edge weight vector at the moment of scene change from the dynamic edge weight vector after a fixed time window. For ordered migration pairs from the current scene node to the target scene node, maintain the scene migration perturbation covariance matrix, calculate the unbiased direction intensity matrix using the outer product of the weighted increment vectors, and use the update step size as the weight to perform a weighted recursive update of the unbiased direction intensity matrix and the scene migration perturbation covariance matrix at historical time to obtain the scene migration perturbation covariance matrix at the current time.

6. The intelligent grass planting scheme recommendation method based on graph neural networks according to claim 1, characterized in that, Receive user node representation, dynamic edge weight vector, gradient direction vector set and scene migration perturbation covariance matrix, and define user sensitivity Jacobian matrix as the partial derivative matrix of user node representation with respect to dynamic edge weight vector; For any dynamic edge weight component in the dynamic edge weight vector, define the in-layer derivative vector and perform layer-by-layer recursive calculation based on the hierarchical structure of the relation-aware graph neural network. During the layer-by-layer recursive calculation, the derivative of the activation function is calculated and an element-wise derivative diagonal matrix is ​​constructed. The explicit derivative terms of the attention weights with respect to the dynamic edge weights are calculated, as well as the implicit chain terms passed through the intra-layer derivative vectors of neighboring nodes. The weighted sum of the results of the self-loop linear transformation, the explicit derivative transformation, and the implicit chain transformation is adjusted using the element-wise derivative diagonal matrix to obtain the intra-layer derivative vector of the next layer. The in-layer derivative vectors recursively up to the last layer are concatenated according to the deterministic arrangement order of the dynamic edge weight vectors to generate the user sensitivity Jacobian matrix. For any candidate combination in the candidate combination set, the gradient direction vector is transposed and then multiplied sequentially with the user sensitivity Jacobian matrix, the scene migration perturbation covariance matrix, the transpose of the user sensitivity Jacobian matrix, and the gradient direction vector. The results of the operations on all candidate combinations are summed to obtain the sorted sensitivity energy.

7. The intelligent grass planting scheme recommendation method based on graph neural networks according to claim 1, characterized in that, Receive user node representation, target scene node representation and sorting sensitivity energy, and perform vector concatenation operation in a predetermined order to generate state vector; A policy network is used to generate positive real-valued scaling factors with the state vector as input. The positive real-valued scaling factors are used to adjust the recommendation score. The policy distribution constructed based on the recommendation score is calculated using exponential normalization to obtain the probability value for the candidate combination. Set the number of ordered positions in the recommendation list, select candidate combinations from the candidate combination set in descending order of probability value, and form the recommendation list while maintaining the selection order; The system receives user feedback intensity, uses energy penalty coefficients to weight the ranking sensitivity energy to obtain a penalty term, and subtracts the penalty term from the user feedback intensity to calculate the reinforcement learning reward.

8. The intelligent grass planting scheme recommendation method based on graph neural networks according to claim 1, characterized in that, Receive single-step rewards, define a discount factor to exponentially weight and accumulate future rewards to obtain discounted returns, and determine the optimization objective that includes the set of policy network parameters, graph neural network parameters, and recommendation scoring parameters. For the candidate combination set, the indicator function is used to filter the candidate combinations of actions to be included in the recommendation list, and the sum of log probabilities is calculated to obtain the log likelihood of the actions in the recommendation list. Calculate the unbiased estimates of the parameter gradients for the policy network parameter set and the graph neural network and recommendation scoring parameter set, respectively, where the gradients for the graph neural network and recommendation scoring parameter set are obtained by chain rule differentiation through recommendation scoring. In a batch containing several time steps, the sampled approximate gradients with respect to the policy network parameter set, the graph neural network parameter set, and the recommendation scoring parameter set are calculated respectively. The learning rate is set, and the sampled approximate gradients are used to jointly update the policy network parameter set, the graph neural network parameter set, and the recommendation scoring parameter set.

9. The intelligent grass planting scheme recommendation method based on graph neural networks according to claim 1, characterized in that, The updated policy network parameters and graph neural network parameters are received, and the state vector and policy distribution constructed based on the recommendation score are obtained. The policy distribution is determined by the scaling factor generated by the policy network on the state vector and the recommendation score. Set the number of positions to include in the recommendation list, and for the candidate combination set, use a deterministic sorting operator that sorts the candidates in descending order of probability value and performs stable processing according to a pre-agreed and fixed order under the condition of equal probability to obtain the sorting result for the candidate combinations. Define a ranking function to mark the specific position of candidate combinations in the ranking results, and extract the ranking results based on the number of positions to generate a list of product recommendations and product suggestions that include the ranking positions.

10. A smart grass-planting scheme recommendation system based on graph neural networks, characterized in that, The method for recommending intelligent grass planting schemes based on graph neural networks as described in any one of claims 1 to 9 includes: The heterogeneous dynamic graph construction module constructs a heterogeneous dynamic graph that includes users, scenarios, seeding schemes, and products. It locks the seeding link consisting of users to scenarios, users to seeding schemes, and seeding schemes to products, and updates the dynamic edge weight vector of the seeding link according to the time decay accumulation rule. The node representation generation module uses a relation-aware graph neural network with a dynamic edge weight vector-driven attention calculation mechanism to aggregate neighborhood information and generate node representations. The gradient direction vector calculation module calculates the recommendation score based on the node representation for the candidate combination of the recommendation scheme and the product, and calculates the gradient direction vector of the recommendation score with respect to the user node representation. The scene migration perturbation update module recursively updates the scene migration perturbation covariance matrix when the user's associated scene identifier changes, using the change in the dynamic edge weight vector. The sorting sensitivity energy calculation module calculates the user node representation's sensitivity Jacobian matrix to the dynamic edge weight vector, and multiplicatively couples the gradient direction vector, the user sensitivity Jacobian matrix, and the scene migration perturbation covariance matrix to calculate the sorting sensitivity energy. The reinforcement learning reward calculation module concatenates the node representation, target scene representation, and ranking sensitivity energy into a state vector. It generates a recommendation list of products and product recommendations based on the policy distribution constructed by the policy network based on the recommendation score. The reinforcement learning reward is calculated by combining the intensity of user feedback and the ranking sensitivity energy as a penalty. The gradient update module uses a policy gradient algorithm based on reinforcement learning rewards to jointly update the parameters of the graph neural network and the policy network. The product recommendation list output module outputs a product recommendation list with sorted ranking during the real-time reasoning stage.

Citation Information

Patent Citations

  • Personalized commodity recommendation optimization method based on deep learning

    CN120374226A

  • Self-adaptive recommendation method based on dynamic strategy optimization

    CN120632212A