A recommendation method based on time preference and knowledge perception collaborative attention mechanism
By introducing a collaborative attention mechanism based on time preference and knowledge awareness into power material management, and combining user behavior history and time information, the problems of data isolation and inaccurate demand forecasting in power material management are solved, enabling more accurate material recommendations and inventory optimization, and reducing operating costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HEFEI UNIV OF TECH
- Filing Date
- 2024-11-13
- Publication Date
- 2026-05-29
AI Technical Summary
The management of power materials suffers from problems such as isolated data, inefficient information retrieval, and inaccurate forecasting of material demand, leading to supply chain disruptions and inventory imbalances, and increasing operating costs.
By adopting a collaborative attention mechanism based on time preference and knowledge perception, and combining user behavior history and time information, a temporal dynamic multi-head attention network is designed through collaborative filtering and knowledge graph to capture users' dynamic preferences and recommend power materials.
It has improved the level of intelligence in power material management, accurately predicted demand, optimized inventory, reduced enterprise operating costs, and improved the accuracy and efficiency of the recommendation system.
Smart Images

Figure CN119577241B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a power material recommendation method based on a collaborative attention mechanism of time preference and knowledge perception in the context of power material management. Background Technology
[0002] With the deepening of digital transformation in the power industry, power material management faces challenges such as data silos, low information retrieval efficiency, and inaccurate material demand forecasting. These problems not only restrict management efficiency but may also trigger risks such as supply chain disruptions and inventory imbalances, thereby increasing operating costs. Therefore, overcoming these shortcomings and improving the level of intelligence in material management has become an urgent issue for the power industry.
[0003] Against this backdrop, forecasting power grid material demand based on big data and machine learning theories has become an important means of material management reform. Recommendation systems, as information filtering tools based on big data and artificial intelligence technologies, have demonstrated their powerful application potential in various fields, such as product recommendations on e-commerce platforms, song recommendations on music platforms, and article push notifications on news clients. These application cases show that recommendation systems can effectively analyze users' historical behavior and preferences to provide personalized recommendation services, thereby improving user experience and satisfaction. In power material management, recommendation systems help reduce enterprise operating costs by accurately predicting demand, optimizing inventory, and improving procurement efficiency.
[0004] Recommender systems predict and recommend items that a user might be interested in by analyzing the interaction between the user and the item. Key techniques include matrix factorization, collaborative filtering, and deep learning, which have achieved significant success in personalized recommendations. However, recommender systems still face challenges in practical applications, such as data sparsity, the cold start problem, and insufficient interpretability of recommendations. Knowledge graphs provide rich semantic information, helping to address data sparsity and the cold start problem, and more accurately capture user preferences by mapping user and item information. While knowledge graphs excel at mitigating data sparsity and the cold start problem, their static structure limits the understanding of dynamic changes in user interests. Recommendation task datasets contain rich user behavior history and temporal information, but current knowledge graph-based recommendation models neglect the importance of temporal information. Summary of the Invention
[0005] This application addresses the problems and shortcomings of existing technologies by incorporating temporal factors into current knowledge graph-based recommendation systems to solve the problem of recommending power resources. As a solution, this application proposes a novel power resource recommendation method based on a collaborative attention mechanism that integrates time preference and knowledge awareness. This method comprehensively utilizes user behavior history and temporal information, fusing collaborative filtering and knowledge graph information within the same framework. It learns the weights of different neighboring nodes in the knowledge graph through an attention mechanism to extract key collaborative information. Then, a temporal dynamic multi-head attention network is designed to capture time preferences from users' historical behavior.
[0006] Technical solution:
[0007] A recommendation method based on a collaborative attention mechanism of time preference and knowledge awareness includes the following steps:
[0008] (1) Establish a knowledge graph based on power materials. The knowledge graph includes various attribute information of power materials and integrates the correlation between materials.
[0009] (2) Establish an interactive dataset between each power supply company and materials, including the power supply company's purchase records of various materials, the order of purchase time, and the rating of materials;
[0010] (3) Based on steps (1) and (2), through collaborative propagation, determine the initial entity set of the power supply company and materials in the knowledge graph propagation, as well as the material sequence collected by the power supply company according to time.
[0011] (4) According to step (3), a knowledge graph attention network is used to carry out knowledge-based deep propagation on the knowledge graph; starting from the initial entity set, it expands outward layer by layer in the layered structure of the knowledge graph to capture the high-order association information of users and items in the knowledge graph.
[0012] (5) According to step (3), based on the material sequence collected by the power supply company, a temporal multi-head attention network is used to effectively integrate time information into neighbor embedding learning, thereby capturing the user's dynamic preferences that change over time, so that the recommendation results are more in line with the user's current needs.
[0013] (6) Based on steps (2) and (3), the obtained user representations and project representations are aggregated and then recommendations are made.
[0014] Preferably, the construction of the knowledge graph based on power materials in step (1) specifically includes:
[0015] (1-1) Collect and organize relevant data on power materials, including the basic attributes, usage scenarios, and order details of various materials;
[0016] (1-2) Data processing is performed on the collected information, including merging duplicate and redundant entities and reasoning and completing missing relationships;
[0017] (1-3) The processed data is classified according to the category of power materials to form a hierarchical structure of major, medium and minor categories; the key attributes of each type of material and their interrelationships are extracted to construct a knowledge graph structure.
[0018] Preferably, step (2) includes:
[0019] Rate the product A based on the number of times the user has purchased it, with a rating range of 0-5 points; Rate the product B based on the total number of times all users have purchased it, with a rating range of 0-5 points.
[0020] A weighted average method was used to comprehensively consider both factors, and the final score was calculated using the following formula: Score = A * 50% + B * 50%, thus constructing an interaction dataset between the power supply company and the materials. Then, based on the signing date of the power supply company's contract, the order of the interaction datasets of each power supply company's materials was determined.
[0021] Preferably, step (3) includes:
[0022] The power company is represented by the materials it has interacted with, and the initial entity set of the power company is defined as follows:
[0023]
[0024] In the formula, u and v represent the power supply company and materials, respectively, and ε = {e1, e2, ..., e} S} represents all entities. v∈V, e∈ε} means that each material in the power supply company set corresponds to an entity e in the entity set. This represents the interaction between the target user u and the target item v that has not been interacted with.
[0025] Multiple resources interacting with the same power supply company constitute a collaborative resource set. The collaborative neighbors of resources are defined as follows:
[0026]
[0027] In the formula, v u This refers to other materials exchanged between the same power supply company. This represents the interaction between the target user u and other resources;
[0028] After mapping the collaborating neighbors of an item to entities in the knowledge graph, the initial entity set for the propagation of the item in the knowledge graph is obtained, defined as:
[0029]
[0030] In the formula, This represents the initial set of items, composed of other resources, which have the same interactive users as the requested resource;
[0031] The power supply company's material sequence is constructed according to the order in the power supply company's material interaction dataset:
[0032] S u ={v1, v2, ..., v n}
[0033] Preferably, in step (4), based on the initial entity set of the power supply company and materials, the knowledge graph is used to propagate auxiliary knowledge associations using entities and relationships, thereby obtaining multi-hop datasets for relevant users and projects, and thus expanding the potential vector representation of entities.
[0034] Preferably, step (4) specifically includes:
[0035] The power company and the neighbors of the materials are:
[0036]
[0037] In the formula, l represents the number of hops from the neighbor to the initial entity set, while o is used as a unified placeholder for the power company u or the material v; G = {(h, r, t) | h, t ∈ ε, r ∈ R} represents a knowledge graph, where each (h, r, t) triple represents a relationship r between the head entity h and the tail entity t.
[0038] The l-th order triplet set representing the power supply company and materials in the knowledge graph propagation is:
[0039]
[0040] Incorporate an attention mechanism to distinguish individual tail entities that integrate multiple layers of information:
[0041]
[0042] In the formula, a i This indicates that in the i-th triplet, the information propagated by the tail entity is obtained by multiplying the tail entity by the attention weight; Indicates attention weight;
[0043] The specific calculation process is as follows:
[0044]
[0045] In the formula, ";" indicates the connection of matrices. and r iThese represent the head entity and relation in the triple, respectively, and W1, W2, W3, b1, and b2 represent parameters.
[0046] The triplet representation of the power supply company or resources at level 1 of the knowledge graph is as follows:
[0047]
[0048] In the formula, It is an aggregation of the tail entity information of the l-th level triple;
[0049] To accurately capture the inherent characteristics of materials and reduce potential distortions during multi-layered information transmission, the representation of materials incorporates their core information, expressed as follows:
[0050]
[0051] Preferably, step (5) includes:
[0052] Based on the power company's historical purchase information and the time sequence of material acquisition, a location code is first added to this sequence:
[0053]
[0054] In the formula, This represents the initial vector of the power supply company's historical material time series. Represents the position vector of the sequence;
[0055] A multi-head attention mechanism is introduced to capture temporal information from multiple angles, and a dynamic attention strategy is adopted to adaptively track the evolution of user interests:
[0056]
[0057]
[0058] In the formula, X0 is the input matrix, W i (Q) W i (K) W i (V) d is the learnable weight parameter of the i-th head. K W represents the dimension of K. D It is an influence on attention distribution and Parameters;
[0059]
[0060] r u =FeedForward(h u ) = max(0, hu W1+b1)W2+b2,
[0061] In the formula, r u This represents the temporal neighbor embedding generated by multi-head attention, where i represents the number of attention heads. This indicates that the parameters are trainable;
[0062] The final temporal vector representation of the user is obtained by using average pooling:
[0063]
[0064] Preferably, step (6) includes:
[0065] The final representations of the power company and materials are then pieced together:
[0066]
[0067]
[0068] In the formula, t represents the vector representation of the power company learned through the knowledge graph attention network. u This represents the power company's representation obtained through a temporal attention network. The initial vector representation of the materials. This represents the material vector representation learned through the knowledge graph attention network.
[0069] Prediction is based on the following formula:
[0070]
[0071] Beneficial effects of the present invention
[0072] This application investigates a recommendation method for power supply management. To accurately recommend power supplies, we conducted an in-depth analysis of users' historical purchasing behavior. This behavioral data was used to extract user preferences and interests, providing a strong basis for subsequent recommendations. Furthermore, to enhance recommendation accuracy, auxiliary information from a knowledge graph was integrated with collaborative information from user-item interactions, forming a unified information space. An attention mechanism was introduced, learning the weights of neighbor nodes under different conditions to accurately extract key elements from the collaborative information. The impact of time on recommendation results was emphasized, effectively integrating temporal information into neighbor embedding learning. This method captures the changing preferences of users and items over time, making the recommendations more aligned with users' current needs. Attached Figure Description
[0073] Figure 1 This is a basic framework diagram of a power material recommendation method based on a collaborative attention mechanism of time preference and knowledge perception.
[0074] Figure 2 yes Figure 1 A flowchart of the dynamic attention mechanism in a temporal attention network. Detailed Implementation
[0075] The present invention will be further described below with reference to embodiments, but the scope of protection of the present invention is not limited thereto:
[0076] This example provides a power resource recommendation method based on a collaborative attention mechanism of time preference and knowledge awareness, and details it through an architectural example. Figure 1 As shown, the model consists of five modules: (1) a data input module, which includes knowledge graph data and time data reflecting users' historical behavior; (2) a collaborative propagation module, which extracts historical interaction information between users and items to obtain collaborative information; (3) a knowledge-aware attention network module, which obtains representations of users and items through knowledge graph information; (4) a time attention network module, which extracts users' historical behavior information to obtain representations of user interests; and (5) a prediction module, which integrates the representations of users and items to generate the final recommendation results.
[0077] The specific implementation steps are as follows:
[0078] (1) After the model receives the global model parameters, it divides the local dataset into multiple batches according to the set batch size. The data of each batch will be sent to the model for training in sequence.
[0079] (2) Obtain vector representations of users and items through knowledge-aware attention networks and temporal attention networks. Specifically: Based on the initial entity sets of the power company and materials, entity and relation propagation is used in the knowledge graph to assist in knowledge association, obtaining multi-hop datasets for related users and items, thereby expanding the potential vector representations of entities. The neighbor sets of the power company and materials are as follows:
[0080]
[0081] The first-order triplet set representing the power supply company and materials in the knowledge graph propagation is:
[0082]
[0083] Furthermore, considering that different tail entities have different head entities and relationships in the knowledge graph, such as Figure 2 An attention mechanism is added to distinguish the tail entities that incorporate multiple layers of information.
[0084]
[0085] The specific calculation process is as follows:
[0086]
[0087] The triplet representation of the power supply company or resources at level 1 of the knowledge graph is as follows:
[0088]
[0089] To accurately capture the inherent characteristics of materials and reduce potential distortions during multi-layered information transmission, the representation of materials incorporates their core information, expressed as follows:
[0090]
[0091] Based on the power company's historical purchase information and the time sequence of material acquisition, a location code is first added to this sequence:
[0092]
[0093] To enhance the expressiveness of temporal networks, a multi-head attention mechanism is introduced to capture temporal information from multiple angles, and a dynamic attention strategy is adopted to adaptively track the evolution of user interests.
[0094]
[0095]
[0096] Attention outputs from different heads are merged along the feature dimension, and then a feedforward neural network is applied for dimensionality transformation:
[0097]
[0098] r u =FeedForward(h u ) = max(0, h u W1+b1)W2+b2,
[0099] The final temporal vector representation of the user is obtained by using average pooling:
[0100]
[0101] The final representations of the power company and materials are then pieced together.
[0102]
[0103]
[0104] Then, a recommendation score is calculated between the user and the project.
[0105] (3) Calculate the gradient of the loss function with respect to the model parameters through backpropagation. This includes calculating the gradient of each parameter using the chain rule. Update the model parameters using the Adam algorithm.
[0106] (4) After each training cycle, evaluate the model's performance using the validation set. Adjust the model's hyperparameters or structure based on the validation results to improve model performance. Repeat the above steps until the preset number of training cycles is reached.
[0107] After training is complete, the final model is evaluated using a test set to test its performance on unseen data.
[0108] The specific embodiments described herein are merely illustrative of the spirit of the invention. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to substitute them, without departing from the spirit of the invention or exceeding the scope defined by the appended claims.
Claims
1. A recommendation method based on a collaborative attention mechanism of time preference and knowledge perception, characterized in that... It includes the following steps: (1) Establish a knowledge graph based on power materials. The knowledge graph includes various attribute information of power materials and integrates the correlation between materials. (2) Establish an interactive dataset between each power supply company and the materials, including the power supply company's purchase records of various materials, the order of purchase time, and the rating of the materials; (3) Based on steps (1) and (2), through collaborative propagation, determine the initial entity set of the power supply company and materials in the knowledge graph propagation, as well as the material sequence collected by the power supply company according to time; (4) According to step (3), a knowledge graph attention network is used to carry out knowledge-based deep propagation on the knowledge graph; starting from the initial entity set, the knowledge graph is expanded outward layer by layer in the hierarchical structure to capture the high-order association information of users and items in the knowledge graph. (5) Based on step (3), according to the material sequence collected by the power supply company, a temporal multi-head attention network is used to effectively integrate time information into neighbor embedding learning, thereby capturing the user's dynamic preferences that change over time, making the recommendation results more in line with the user's current needs; including: Based on the power company's historical purchase information and the time sequence of material acquisition, a location code is first added to this sequence: In the formula, This represents the initial vector of the power supply company's historical material time series. Represents the position vector of the sequence; A multi-head attention mechanism is introduced to capture temporal information from multiple angles, and a dynamic attention strategy is adopted to adaptively track the evolution of user interests: In the formula, It is the input matrix. It is the first Learnable weight parameters for each head, express Dimensions It is an influence on attention distribution and Parameters; In the formula, This represents the temporal neighbor embedding generated by multi-head attention. This indicates the number of heads to focus on. This indicates that the parameters are trainable; The final temporal vector representation of the user is obtained by using average pooling: ; (6) Based on steps (2) and (3), the obtained user representations and project representations are aggregated and then recommendations are made.
2. The method according to claim 1, characterized in that... The construction of the knowledge graph based on power materials in step (1) specifically includes: (1-1) Collect and organize relevant data on power materials, including the basic attributes, usage scenarios, and order details of various materials; (1-2) Perform data processing on the collected information, including merging duplicate and redundant entities, and reasoning and completing missing relationships; (1-3) The processed data is classified according to the category of power materials to form a hierarchical structure of major, medium and minor categories; the key attributes of each type of material and their interrelationships are extracted to construct a knowledge graph structure.
3. The method according to claim 1, characterized in that... Step (2) includes: Rate the product based on the number of times the user has purchased it (A), with a rating range of 0-5 points; rate the product based on the total number of times all users have purchased it (B), with a rating range of 0-5 points. A weighted average method was used to comprehensively consider both factors, and the final score was calculated using the following formula: Score = A * 50% + B * 50%, thus constructing an interaction dataset between the power supply company and the materials. Then, based on the signing date of the power supply company's contract, the order of the interaction datasets of each power supply company's materials was determined.
4. The method according to claim 1, characterized in that... Step (3) includes: The power company is represented by the materials it has interacted with, and the initial entity set of the power company is defined as follows: In the formula, They represent the power supply company and the materials, respectively. Represents all entities, This means that each material in the power supply company set corresponds to an entity in the entity set. , Indicates target user and non-interactive target items Interaction between them; Multiple resources interacting with the same power supply company constitute a collaborative resource set. The collaborative neighbors of resources are defined as follows: In the formula, This refers to other materials exchanged between the same power supply company. Indicates target user Interaction with other supplies; After mapping the collaborating neighbors of an item to entities in the knowledge graph, the initial entity set for the propagation of the item in the knowledge graph is obtained, defined as: In the formula, This represents the initial set of items, composed of other resources, which have the same interactive users as the requested resource; The power supply company's material sequence is constructed according to the order in the power supply company's material interaction dataset: .
5. The method according to claim 1, characterized in that... In step (4), based on the initial entity set of the power supply company and materials, the knowledge graph is used to propagate auxiliary knowledge associations using entities and relationships, thereby obtaining multi-hop datasets for relevant users and projects, and thus expanding the potential vector representation of entities.
6. The method according to claim 5, characterized in that... Step (4) specifically includes: The power company and the neighbors of the materials are: In the formula, This represents the number of hops from the neighbors to the initial entity set, while Used as a power supply company or supplies Uniform placeholders; Representing a knowledge graph, each The triplet represents the head entity. and tail body There is a relationship ; The role of power companies and materials in knowledge graph dissemination The set of triples of order 1 is represented as: Incorporate an attention mechanism to distinguish individual tail entities that integrate multiple layers of information: In the formula, Indicates the first In each triplet, the tail entity is multiplied by the attention weight to obtain the information propagated by the final tail entity; Indicates attention weight; The specific calculation process is as follows: In the formula, ";" indicates the concatenation of matrices. and These represent the head entity and relation in the triple, respectively. Indicates parameters; The triple representation of the power supply company or materials in the knowledge graph at level l is as follows: In the formula, It is the first Aggregation of tail entity information in layer triplet; To accurately capture the inherent characteristics of materials and reduce potential distortions during multi-layered information transmission, the representation of materials incorporates their core information, expressed as follows: 。 7. The method according to claim 1, characterized in that... Step (6) includes: The final representations of the power company and materials are then pieced together: In the formula, This represents the vector representation of the power company learned through the knowledge graph attention network. This represents the power company's representation obtained through a temporal attention network. The initial vector representation of the materials. ; Prediction is based on the following formula: 。