Multi-scene recommendation method and system based on heterogeneous knowledge embedding fusion and medium
By mapping user-item interaction data and knowledge graph data to a unified low-dimensional space, and combining matrix factorization and knowledge graph embedding techniques, the heterogeneity and sparsity problems in recommendation systems are solved, enabling efficient recommendations in multiple scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-04-07
AI Technical Summary
Existing recommendation systems face heterogeneity and discreteness when utilizing knowledge graph data, making it difficult to calculate the similarity between users and items, especially in cold start and data sparse scenarios where performance is insufficient.
By using matrix factorization models and knowledge graph embedding techniques, user-item interaction data and knowledge graph entity-relationship data are mapped to a unified low-dimensional vector space. A joint optimization objective function is established, which integrates user features, item features, and knowledge graph structure. A similarity function is designed, and recommendation strategies are implemented for different scenarios.
It improves the adaptability and generalization ability of the recommendation system in multiple scenarios, alleviates the cold start problem, increases the coverage and diversity of recommendation results, and maintains robustness.
Smart Images

Figure CN121808404A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of item recommendation, and particularly relates to a multi-scene recommendation method, system and medium based on heterogeneous knowledge embedding fusion. BACKGROUND
[0002] With the rapid development of e-commerce and social networks, recommendation systems, as the core tools of intelligent and personalized information filtering and pushing, have been widely applied in various online service platforms. At present, almost all large online systems are equipped with recommendation systems, for example, e-commerce platforms recommend goods according to user historical purchase and browsing behaviors, music and video platforms push content based on user preferences, and social network platforms introduce potential contacts or interest groups to users. Practice shows that a recommendation system with excellent performance can not only effectively improve user experience, but also create significant economic and social benefits.
[0003] At the same time, the rise of knowledge graph provides a new opportunity for the iterative upgrade of recommendation systems. Knowledge graph takes entities and relationships between entities as the core, and organizes and stores facts in the real world in the form of triples. This structure can integrate multi-dimensional massive data and contains rich semantic information, and has been widely used in core tasks of artificial intelligence fields such as search engines, intelligent question answering and machine translation.
[0004] However, the existing recommendation system still faces technical bottlenecks in actual application: the recommendation data and the knowledge graph data generally present heterogeneous and discrete characteristics, which leads to challenges in the direct calculation of the similarity between users and items. How to efficiently utilize the semantic information in the knowledge graph to improve the accuracy, diversity and robustness of the recommendation system, especially the performance in the cold start and data sparse scenarios, has become a key technical problem to be solved at present. SUMMARY
[0005] The technical problem to be solved by the present application is to overcome the technical scheme that the existing item recommendation system cannot effectively apply knowledge graph data to realize efficient recommendation, so as to provide a multi-scene recommendation method, system and medium based on heterogeneous knowledge embedding fusion.
[0006] The present application provides a multi-scene recommendation method based on heterogeneous knowledge embedding fusion, comprising the following steps: Step S1: using a matrix decomposition model to perform low-dimensional embedding representation on user-item interaction data to obtain user features and item features, and representing the user-item interaction relationship as an interaction matrix; Step S2: using knowledge graph embedding technology to model entities and relationships in the knowledge graph to form a knowledge graph, wherein the knowledge graph is represented as a triple set of two entities and their relationships; Step S3: establishing a first optimization target based on real interaction records, optimizing the similarity of user features and item features; establishing a second optimization target based on real knowledge graph structure, optimizing the established relationship of triples in the triple set; fusing the target optimization functions of the first optimization target and the second optimization target, mapping the item features and the entities in the knowledge graph into the same vector, and realizing joint optimization; Step S4: setting a similarity function to complete the relationship establishment between users and users, items and items, and users and items. Step S5: calculating the similarity based on user features and item features; when the number of interactions between users and items in the system is less than a preset threshold, realizing sparse scene recommendation based on the similarity of item features and item features; when the number of interactions of the to-be-recommended item or user is less than a preset threshold, realizing ordinary scene recommendation based on the similarity of user features and item features; when the number of interactions of the to-be-recommended item or user is greater than a preset threshold, realizing cold start scene recommendation based on the similarity of user features and item features and the similarity of item features and item features.
[0007] Further, the user-item interaction data is represented by a low-dimensional embedding model, specifically: The users and items are mapped into a d-dimensional vector space in order, to obtain user features and item features , and the real user-item interaction relationship is represented as an interaction matrix , where represents that the user has interacted with the item ; the inner product between the user and item features is used to represent the feature similarity of the user and the item.
[0008] Further, the entities and relationships in the knowledge graph are modeled by using a knowledge graph embedding technology, specifically: The knowledge graph is represented as a triple set , where is an entity, is a relationship; the entities and relationships are mapped into a d-dimensional vector space in order by using a TransE model; based on the constraint assumption of the TransE model, the difference between the vectors of the head and tail entities and the relationship in the triple is used to represent the established credibility of the triple.
[0009] Further, the fusion target optimization function is The knowledge graph embedding of each entity is simultaneously used as a recommended feature of the user or the item to participate in loss calculation, and based on the calculated loss value, the embedding representation of the user and the item, the entity and the relationship is updated through gradient back propagation to obtain consistent low-dimensional semantic representation.
[0010] Further, in the similarity function, the similarity between the user and the item is the inner product of the embedding representation of the user and the item; the similarity between the items is the two-norm of the difference between the embedding representations of the items obtained by the TransE model; the similarity between the users is the inner product of the two user features, and the user feature is represented as the sum of the TransE model embedding representations of all the items interacted by the user.
[0011] Further, in the general recommendation scenario, recommend an item to a user The recommendation index of the user is the average value of the similarity between the item and the user and the similarity between the item and the historical interaction item of the user : +
[0012] wherein represents the set of all items.
[0013] Further, the cold start scenario includes user cold start and item cold start: The user cold start scenario is represented as when the interaction items of the user are less than a preset threshold, the user with the highest user similarity is selected , and the historical interaction items of the user are used as the recommendation list of the user; The item cold start scenario is represented as when the item does not exist the recommended historical record, the item-item similarity between each existing item and the item is calculated, and the top items with the highest similarity are retained, for each item in the retained item list, the user-item similarity is calculated, and the top users with the highest similarity are retained for each item, to obtain the top users most similar to the new item, and the item is recommended to the users Further, in the sparse recommendation scenario, the knowledge graph relationship is used as the recommendation source. Sparse processing is performed on the sparse recommendation data, and n interacted items are randomly discarded for each user u; Respectively analyze the user and the item to be recommended, whether it belongs to the cold start recommendation scene, and set a threshold And If the historical interaction data of a user u is less than the threshold , the user is regarded as a cold start user, and the recommendation method under the cold start scene is used; if the number of times an item i is interacted is less than the threshold , the item is regarded as a cold start item, and the recommendation method under the cold start scene is used.
[0014] A multi-scene recommendation system based on heterogeneous knowledge embedding fusion includes a data embedding module, a knowledge graph processing module, a joint optimization module, a similarity calculation module and a scene processing module; the data embedding module is used to obtain user features and item features by using a matrix decomposition model for low-dimensional embedding representation of user-item interaction data; the knowledge graph processing module is used to model entities and relationships in the knowledge graph by using knowledge graph embedding technology to obtain entity vectors and relationship vectors; the joint optimization module is used to fuse the target optimization functions of matrix decomposition and knowledge graph embedding, and the embedding representation is updated by gradient backpropagation to obtain consistent low-dimensional semantic representation; the similarity calculation module is used to design a similarity function to complete the relationship description between users, items and users and items; the scene processing module is used to construct differentiated recommendation rules for ordinary, cold start and data sparse scenes, generate candidate sets and confidence scores, and obtain recommendation results.
[0015] A computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the multi-scene recommendation method based on heterogeneous knowledge embedding fusion.
[0016] Beneficial effects: the user-item interaction data in the recommendation system and the entity-relation data in the knowledge graph are mapped to a unified low-dimensional vector space, realizing deep and efficient fusion of heterogeneous information. On this basis, multi-layer similarities between users, items and users and items are further calculated, and adaptive recommendation strategies are designed for three typical scenes of ordinary recommendation, cold start recommendation and data sparse recommendation, effectively improving the scene adaptability and generalization ability of the recommendation system.
[0017] Compared with the existing recommendation method which only relies on user historical interaction records, the present application can supplement potential semantic information by means of the knowledge graph when the user interaction data is insufficient or the item lacks exposure, effectively solving the cold start problem; in the face of large-scale sparse interaction scenes, the coverage and diversity of the recommendation results are significantly improved through similarity modeling and knowledge completion mechanism.
[0018] The experimental results show that the present application is superior to the traditional matrix decomposition model and part of the existing knowledge graph recommendation method in the commonly used recommendation evaluation indexes such as NDCG, HR and Recall, the recommendation result is more accurate and more personalized, and a high robustness is maintained. In summary, the present application is not only suitable for e-commerce, social network and other interactive application scenarios, but also can stably operate under the actual conditions of insufficient interaction data and unbalanced data distribution, and has good universality and promotion value. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed to be used in the embodiment or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0020] Figure 1 The main method flow steps of the present application are shown in the figure. Figure 2 The method of the present application is shown in the figure. Figure 3 The experimental recommendation effect of the present application is shown in the figure. DETAILED DESCRIPTION
[0021] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application will be described in detail below. In the following description, a lot of specific details are set forth in order to fully understand the present application. However, the present application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without departing from the connotation of the present application, therefore the present application is not limited by the specific embodiments disclosed below.
[0022] In the description of the present application, the terms "first", "second" are only used for description purpose, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features limited by "first", "second" can be explicitly or implicitly included at least one of the features. In the description of the present application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise specifically limited.
[0023] Embodiment one: Referring to Figure 1 and Figure 2 The present embodiment provides a multi-scene recommendation method based on heterogeneous knowledge embedding fusion, including the following steps: Step S1: using a matrix decomposition model to perform low-dimensional embedding representation on user-item interaction data, to obtain user features and item features, and representing the user-item interaction relationship as an interaction matrix; Map the users and items to d-dimensional vector spaces in order of numbering, to obtain user features and item features , and represent the real user-item interaction relationship as an interaction matrix , where represents that the user has interacted with the item ; use the inner product between the user and item features to represent the similarity of the features of the user and the item, where , m is the total number of users, and n is the total number of items.
[0024] Establish a first optimization objective to make the similarity relationship between the user and the item features closer to the real interaction record, and the similarity of the items that the user has clicked or purchased will be greater than the similarity of other items that have not interacted, and a regularization term is added to avoid the user features and the item features being too dense, where the first optimization objective is represented as: .
[0025] Step S2: using knowledge graph embedding technology to model entities and relationships in the knowledge graph to form a knowledge graph, and the knowledge graph is represented as a set of triples of two entities and their relationships; Represent the knowledge graph as a set of triples , where is an entity, is a relationship; map the entities and relationships to d-dimensional vector spaces in order of numbering using the TransE model; based on the constraint assumption of the TransE model , use the difference between the vectors of the head and tail entities and the relationship in the triple to represent the credibility of the existence of the triple, and the higher the credibility, the more likely it is that the triple exists.
[0026] Design a second optimization objective to make the existence of the triple closer to the real knowledge graph structure, and the existence credibility of the triple that already exists in the current knowledge graph is higher than the existence credibility of the triple that does not exist in the knowledge graph, where the second optimization objective is represented as: ; where represents a negative sampling triple that does not exist in the real knowledge graph.
[0027] Step S3: establishing a first optimization target based on real interaction records, optimizing the similarity of user features and item features; establishing a second optimization target based on real knowledge graph structure, optimizing the established relationship of triples in the triple set; fusing the target optimization functions of the first optimization target and the second optimization target, mapping the item features and the entities in the knowledge graph into the same vector, and realizing joint optimization; The fused target optimization function is Wherein the knowledge graph embedding of each entity participates in loss calculation as the recommended features of users or items, and based on the calculated loss value, the embedding representation of users and items, entities and relationships is updated through gradient backpropagation, to obtain consistent low-dimensional semantic representation.
[0028] Step S4: setting a similarity function to complete the relationship establishment between users and users, items and items, and users and items. In the similarity function, the similarity between users and items is the inner product of the embedding representation of users and items The similarity between items and items is the two-norm of the difference between the item embedding representations obtained by the TransE model The similarity between users and users is the inner product of the two user features The user feature is represented by the sum of the TransE model embedding representations of all items interacted by the user . The sum of the TransE model embedding representations of all items of two users is used to represent the user, and the inner product of the corresponding representations of the two users is used to calculate the similarity.
[0029] Step S5: calculating the similarity based on user features and item features; when the number of interactions between users and items in the system is less than a preset threshold, realizing sparse scene recommendation based on the similarity of item features and item features; when the number of interactions of the to-be-recommended item or user is less than a preset threshold, realizing ordinary scene recommendation based on the similarity of user features and item features; when the number of interactions of the to-be-recommended item or user is greater than a preset threshold, realizing cold start scene recommendation based on the similarity of user features and item features and the similarity of item features and item features.
[0030] In the ordinary recommendation scene, it is necessary to recommend to the existing user the items that he or she may like but has not interacted with, and comprehensive recommendation is made in combination with user-item similarity and item-item similarity.
[0031] The recommendation index of an item to a user is the similarity of the item and the user and the similarity of the item and the item With users The average similarity between historically interacted items: +
[0032] in Indicates all A collection of items, sorting all candidate items, and retaining the user's... The item with the highest recommendation index Each item constitutes a user Recommended list.
[0033] The cold start scenario includes user cold start and item cold start. In the cold start scenario, recommendations need to be made for users or items with very few interactions. The user cold start scenario is represented as follows: when a user's interactive items are less than a preset threshold, analogy recommendations are made based on user-user similarity, selecting two users with high similarity... Top user and will users The user's historical interactive items are used as a recommended list; The cold start scenario for an item is represented as when the item... When a new item enters the recommendation system and has no prior recommendation history, each existing item... Calculation and Items Items - Item Similarity Keep the one with the highest similarity For each item in the retained item list, calculate the user-item similarity. Retain the user with the highest similarity for each item Get the item most similar to the new item Individual users, items Recommended to this individual users In the sparse recommendation scenario, there are very few user-item interactions in the entire system. If the recommendation is mainly based on the interaction relationships, it may lead to inaccurate recommendations. Therefore, the knowledge graph relationships with more information are used as the recommendation source. Perform sparsity processing on the sparse recommendation data, and randomly discard n interacted items for each user u; Analyze the users and items to be recommended separately to determine if they fall under the cold start recommendation scenario, and set thresholds accordingly. and If a user's historical interaction data is less than a threshold If the number of interactions of a certain item i is less than a threshold , the item is regarded as a cold-start item, and the recommendation method under the cold-start scenario is used.
[0034] As a preferred embodiment of the present embodiment, the user cold-start threshold threshold has a value of 5, and the item cold-start threshold threshold has a value of 10.
[0035] Specifically, in the sparse recommendation scenario, since the number of non-zero elements in the user-item interaction matrix is extremely low , the preference features of the user cannot be stably estimated depending on the behavior data, and the recommendation formula in the normal recommendation scenario is not applicable.
[0036] Therefore, the sparse recommendation scenario specifically includes the following recommendation methods: In the sparse recommendation scenario, to simulate a real weak interaction environment and avoid the influence of reliable historical interaction data on the recommendation effect, the present embodiment randomly discards the historical interaction set of each user . This process reduces the reliability of the behavior data, so that the recommendation calculation naturally relies more on the entity relationship represented by the knowledge graph semantic vector .
[0037] By using random discarding to sparsify the interaction matrix to in the training stage, a more consistent and sparse training environment is formed, and the supervision signal obtained by the recommendation loss is further weakened. The recommendation loss can be represented as: ; At the same time, the semantic constraint of the knowledge graph accounts for a higher proportion in the overall loss + ; Therefore, random discarding can construct a uniform sparse distribution in the training stage, so that the model automatically prefers knowledge graph semantic information in optimization, and can still learn stable item representations under extremely sparse conditions.
[0038] Specifically, due to the high noise caused by too few interaction samples in the sparse scenario, it cannot be used as a stable recommendation basis. By introducing a uniform sparsity level through random discarding, it can avoid the dominance of a small number of relatively dense users in the training process. The number of interactions of different users varies greatly, and a small number of users with slightly more interactions may appear dense in sparse data, but their interaction quantity is still far from sufficient to support stable training. If random discarding is not performed, these users will dominate the recommendation loss , causing the model to continue to rely on the interaction co-occurrence signal and fail to effectively utilize the knowledge graph semantic information.
[0039] In the sparse scenario, the random dropout can enhance the dependence on the knowledge graph semantics in the training stage. Random dropout makes the behavior quantity of more users decrease to the point where it is difficult to form a stable preference vector, so that the recommendation model has to rely more on the semantic representation of items obtained by the knowledge graph inference when optimizing the joint loss. This promotes the model to learn a more robust and consistent semantic space in the sparse scenario.
[0040] In the present embodiment, the user recommendation method in the sparse scenario includes the following steps: User historical interaction quantity determination: for any user , the number of interactions after sparsification is counted and compared with the threshold to determine whether the user has sufficient behavior data to support the recommendation modeling in the ordinary scenario.
[0041] If the interaction set is large, it is considered to be in a non-cold start state in the sparse scenario, and the recommendation index in the ordinary recommendation scenario is used: + ; Wherein, the first term depends on the user aggregation vector , which is derived from limited historical interactions and can reflect the user's preference structure to a certain extent, so it is still available.
[0042] If the interaction set is below the preset threshold, it is considered to be a user cold start in the sparse scenario. If , the available behavior data is not enough to construct a stable and generalizable user preference vector . At this time, the recommendation formula in the ordinary scenario which depends on behavior statistics is no longer used, and user-user semantic similarity is used for analogy recommendation, and the interaction items of the most similar user are directly selected as the recommendation results for the user .
[0043] Due to the user aggregation vector , the essence is composed of item embedding vectors , and the item embedding vectors are derived from the knowledge graph entity embedding modeled by the TransE model. Therefore, when the number of user interactions is extremely low: the user vector is actually mainly controlled by the knowledge graph semantics; and the user-user similarity The user similarity based on the KG semantics is equivalent; the recommendation process is as follows: the item semantic similarity of the knowledge graph is used to find the closest user in the semantics, and the item preference is copied. The real item preference information of other users is used to enrich the recommendation effect of the sparse user.
[0044] Under the cold start condition, the user recommendation process is naturally transformed into: item semantic based on the knowledge graph→recommendation migration of the cold start user. This process does not need to rely on the dense interaction information, but uses the structural prior of the knowledge graph, uses the preference information of other users to realize effective completion, and meets the recommendation demand under the sparse condition.
[0045] The item recommendation method under the sparse scene comprises the following steps: The historical interaction quantity of the item is determined: for any item The sum of the interaction times is counted: And compared with the threshold .
[0046] If the historical interaction quantity is sufficient, it is considered that the non-cold start state under the sparse scene, and the user-item similarity under the ordinary scene is used to complete the recommendation.
[0047] If the historical interaction is insufficient, it is considered that the item cold start under the sparse scene. When , the item cannot learn the characteristics from the historical behavior, and the item-item similarity driven by the knowledge graph semantics is used And the top Item with the highest similarity is retained, and the user-item similarity Is used to determine a plurality of users who are most likely to be interested in the item, so that the recommendation process mainly depends on the knowledge graph semantics rather than the sparse behavior data.
[0048] The user-item interaction data in the recommendation system and the entity-relation data in the knowledge graph are mapped to a unified low-dimensional vector space, and the heterogeneous information is deeply and efficiently fused. On this basis, the multi-layer similarity between users, items and users and items is further calculated, and the adaptive recommendation strategy is designed for the three typical scenes of ordinary recommendation, cold start recommendation and data sparse recommendation, which effectively improves the scene adaptability and generalization ability of the recommendation system.
[0049] Compared with the existing recommendation method which only depends on the user historical interaction record, the present application can supplement the potential semantic information by means of the knowledge graph when the user interaction data is insufficient or the item lacks exposure, effectively solving the cold start problem; in the face of large-scale sparse interaction scene, through the similarity modeling and knowledge completion mechanism, the coverage and diversity of the recommendation result are significantly improved.
[0050] Embodiment two: The embodiment provides a multi-scene recommendation system based on heterogeneous knowledge embedding fusion, which is used for realizing the recommendation method in the embodiment one, and comprises a data embedding module, a knowledge graph processing module, a joint optimization module, a similarity calculation module and a scene processing module. The data embedding module is used for obtaining user features and item features by using a matrix decomposition model to perform low-dimensional embedding representation on user-item interaction data. The knowledge graph processing module is used for modeling entities and relations in a knowledge graph by using a knowledge graph embedding technology to obtain entity vectors and relation vectors. The joint optimization module is used for fusing a target optimization function of matrix decomposition and knowledge graph embedding, updating embedding representation by gradient back propagation, and obtaining consistent low-dimensional semantic representation. The similarity calculation module is used for designing a similarity function to complete the relationship description between users, items and users and items. The scene processing module is used for constructing differentiated recommendation rules for three types of scenes, namely, ordinary, cold start and data sparse, generating a candidate set and a confidence score, and obtaining a recommendation result.
[0051] Embodiment three: The embodiment provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the multi-scene recommendation method based on heterogeneous knowledge embedding fusion in the embodiment one.
[0052] The embodiment designs an experiment, three types of indexes commonly used in the field of recommendation systems are used in the experiment, and the advantages and disadvantages of the recommendation result are quantified, including normalized discounted cumulative gain (NDCG), hit rate (HR) and recall rate (Recall). The normalized discounted cumulative gain has a value range of 0 to 1, and the larger the value is, the more relevant items contained in the front position of the recommendation list are. The hit rate is used to measure whether the target item in the test set appears in the Top-10 recommendation list. The recall rate is used to measure the proportion of relevant items in the test set covered in the recommendation list.
[0053] Referring to Figure 3 As shown in the figure, in the ordinary recommendation scene, the experimental group is better than the control group in NDCG, HR and Recall, which indicates that the introduction of the knowledge graph can more accurately depict the semantic relationship between the user and the item, thereby improving the recommendation accuracy and result diversity. In the cold start recommendation scene, when a new user or a new item appears, the control group MF model tends to recommend popular items, while the experimental group can capture the personalized preferences of the user based on limited interaction records while retaining part of the hot recommendation, thereby realizing more accurate recommendation effect. Data sparse recommendation scene: In the sparse recommendation scenario, the MF model of the control group has a certain degree of decline in recommendation accuracy compared with the general scenario, and the recommendation model combined with the knowledge graph in the application can keep the original recommendation accuracy almost unchanged. This shows that the introduction of the knowledge graph can well alleviate the problem of data sparsity, because the knowledge graph can help to "complete" the information missing problem caused by data sparsity.
[0054] The experimental results show that the application is superior to the traditional matrix decomposition model and part of the existing knowledge graph recommendation method in NDCG, HR, Recall and other commonly used recommendation evaluation indexes, and the recommendation result is more accurate and more personalized, and has high robustness. In summary, the application is not only suitable for e-commerce, social network and other interactive frequent application scenarios, but also can stably run under the actual conditions of insufficient interactive data and unbalanced data distribution, and has good universality and promotion value.
[0055] The technical features of the above-described embodiments can be combined arbitrarily, and to make the description concise, all possible combinations of the technical features in the above-described embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.
[0056] The above-described embodiments only express several implementation manners of the application, and the description is more specific and detailed, but it should not be understood as a limitation on the patent application scope. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the application, a number of modifications and improvements can be made, which all belong to the protection scope of the application. Therefore, the patent protection scope of the application should be subject to the appended claims.
Claims
1. A multi-scenario recommendation method based on heterogeneous knowledge embedding and fusion, characterized in that, Includes the following steps: The user-item interaction data is embedded in a low dimension using a matrix factorization model to obtain user features and item features, and the user-item interaction relationship is represented as an interaction matrix. The entities and relationships in the knowledge graph are modeled using knowledge graph embedding technology to form a knowledge graph, which is represented as a set of triples of two entities and their relationships. A first optimization objective is established, based on real interaction records, to optimize the similarity between user features and item features. A second optimization objective is established, based on a real knowledge graph structure, to optimize the formation relationship of triples in the triple set. The objective optimization functions of the first and second optimization objectives are merged to map the item features and entities in the knowledge graph to the same vector, achieving joint optimization. A similarity function is set to establish relationships between users, items, and users and items. Similarity is calculated based on user features and item features. When the number of user-item interactions in the system is less than a preset threshold, sparse scene recommendation is achieved based on the similarity between item features. When the number of interactions between the item or user to be recommended is less than a preset threshold, normal scene recommendation is achieved based on the similarity between user features and item features. When the number of interactions between the item or user to be recommended is greater than a preset threshold, cold start scene recommendation is achieved based on the similarity between user features and item features and the similarity between item features.
2. The multi-scenario recommendation method based on heterogeneous knowledge embedding and fusion according to claim 1, characterized in that, The method of using a matrix factorization model to perform low-dimensional embedding representation of user-item interaction data specifically includes: Users and items are mapped to a multidimensional vector space in numerical order to obtain user features and item features, and the real user-item interaction relationship is represented as an interaction matrix; the inner product between user and item features is used to represent the feature similarity between users and items.
3. The multi-scenario recommendation method based on heterogeneous knowledge embedding and fusion according to claim 1, characterized in that, The method of modeling entities and relationships in a knowledge graph using knowledge graph embedding technology specifically includes: The knowledge graph is represented as a set of triples; the TransE model is used to map entities and relations to a multidimensional vector space in numerical order; the difference between the vectors of the head and tail entities and relations in the triples is used to represent the credibility of the triples.
4. The multi-scenario recommendation method based on heterogeneous knowledge embedding and fusion according to claim 1, characterized in that, The fusion objective optimization function is as follows: the knowledge graph embedding of each entity is used as a recommendation feature for users or items in the loss calculation. Based on the calculated loss value, the embedding representations of users and items, entities and relationships are updated through gradient backpropagation to obtain a consistent low-dimensional semantic representation.
5. The multi-scenario recommendation method based on heterogeneous knowledge embedding and fusion according to claim 1, characterized in that, In the similarity function, the similarity between a user and an item is the inner product of the embedding representations of the user and the item; the similarity between items is the L2 norm of the difference between the item embedding representations obtained by the TransE model; and the similarity between users is the inner product of two user features, where the user feature is the sum of the TransE model embedding representations of all items that the user has interacted with.
6. The multi-scenario recommendation method based on heterogeneous knowledge embedding and fusion according to claim 1, characterized in that, In the aforementioned typical recommendation scenario The recommendation index for recommending an item to a user is the average of the similarity between the item and the user and the similarity between the item and the user's historical interaction items.
7. The multi-scenario recommendation method based on heterogeneous knowledge embedding and fusion according to claim 1, characterized in that, The cold start scenarios include user cold start and item cold start: The user cold start scenario is represented as follows: when a user's interactive items are less than a preset threshold, the user with the highest similarity between two users is selected, and the user's historical interactive items are used as the user's recommendation list. The cold start scenario for items is as follows: when an item has no history of being recommended, calculate the item-item similarity with each existing item, retain the item with the highest similarity, and for each item in the retained item list, calculate the user-item similarity, retain the user with the highest similarity for each item, obtain the user most similar to the new item, and recommend the item to the user.
8. The multi-scenario recommendation method based on heterogeneous knowledge embedding and fusion according to claim 1, characterized in that, In the sparse recommendation scenario, knowledge graph relationships are used as the recommendation source; Sparsity processing is applied to sparse recommendation data, and items that a user has interacted with are randomly discarded for each user. For each user and item to be recommended, an analysis is performed to determine whether it falls under the cold start recommendation scenario. A threshold is set. If a user's historical interaction data is less than the threshold, the user is considered a cold start user and the cold start recommendation method is used. Similarly, if an item is interacted with less than the threshold, the item is considered a cold start item and the cold start recommendation method is used.
9. A multi-scenario recommendation system based on heterogeneous knowledge embedding and fusion, characterized in that, The system includes a data embedding module, a knowledge graph processing module, a joint optimization module, a similarity calculation module, and a scene processing module. The data embedding module uses a matrix factorization model to perform low-dimensional embedding representation of user-item interaction data, obtaining user features and item features. The knowledge graph processing module uses knowledge graph embedding technology to model entities and relationships in the knowledge graph, obtaining entity vectors and relationship vectors. The joint optimization module fuses the objective optimization functions of matrix factorization and knowledge graph embedding, updates the embedding representation through gradient backpropagation, and obtains a consistent low-dimensional semantic representation. The similarity calculation module designs a similarity function to characterize the relationships between users, between items, and between users and items. The scenario processing module is used to construct differentiated recommendation rules for three types of scenarios: normal, cold start, and data sparse, generate candidate sets and confidence scores, and obtain recommendation results.
10. A computer-readable storage medium, characterized in that, The system contains a computer program that, when executed by a processor, implements the multi-scenario recommendation method based on heterogeneous knowledge embedding and fusion as described in any one of claims 1-8.