Medicinal and edible homology personalized recommendation method based on knowledge reasoning

By constructing a knowledge graph and a large language model of food and medicine homology, the problem of integrating multi-source knowledge is solved, and the accuracy and safety of personalized food and medicine homology recommendations are achieved, with dynamic adjustments to the recommended content to match users' health needs.

CN120954631APending Publication Date: 2025-11-14ZHENGSHANGYOU DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511047175.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-29
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively integrate multi-source knowledge systems, making it impossible to achieve personalized recommendations for food and medicine from the same source. Traditional methods also struggle to accurately match traditional Chinese medicine literature, modern nutritional data, and user health needs, lacking the ability to transform knowledge across disciplines.

Method used

We construct a knowledge graph of food and medicine homology, use the BFS algorithm to mine multi-hop association rules, dynamically adjust weights by combining a trial-and-error verification mechanism, and generate personalized suggestions using a large language model. Through multi-source data integration, knowledge graph construction, rule mining and optimization, personalized query generation, and credible suggestion generation, we ensure the accuracy and security of the recommendations.

Benefits of technology

It enables dynamic adjustment of recommended content based on users' real-time health data, provides traceable suggested paths, enhances user trust, avoids high-risk combinations, and ensures the accuracy and security of recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120954631A_ABST
    Figure CN120954631A_ABST
Patent Text Reader

Abstract

The invention discloses a medicinal and edible personalized recommendation method based on knowledge reasoning. The method comprises the following steps: acquiring medicinal and edible knowledge and constructing a medicinal and edible knowledge graph; performing rule mining and screening based on the medicinal and edible knowledge graph, and enriching reasoning paths in the medicinal and edible knowledge graph through rule combination to obtain a final knowledge graph; obtaining user data, and according to the final knowledge graph, generating a medicine and food homology personalized suggestion corresponding to the current user by using a large language model; according to the method, knowledge dispersed in different data sources can form a computable logic chain through multi-hop rule reasoning, so that more accurate medicine and food homology suggestions can be provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of large model application technology, and more specifically to a personalized recommendation method for food and medicine homology based on knowledge reasoning. Background Technology

[0002] The theory of food and medicine sharing the same origin is essentially a wise system for regulating health through daily diet. Its core value lies in using the natural properties of ingredients to construct preventative dietary plans. However, in modern health management practice, the widespread application of this theory faces three major practical gaps: First, there are integration barriers in multi-source knowledge systems—the descriptions of the properties and flavors of "dual-use" ingredients in traditional Chinese medicine literature, the quantitative analysis of dietary components in modern nutrition, and health intervention data in population dietary studies exist in heterogeneous forms such as natural language experience, laboratory data, and epidemiological reports, making it difficult for traditional methods to transform them into a structured knowledge network that can guide daily dietary combinations; Second, the complexity of individual health needs exceeds the scope of experience-based processing. The interplay of multiple factors, such as the constitution of different groups (e.g., those with a tendency towards heat or deficiency of qi and blood), lifestyle habits (those who frequently stay up late, those who follow a plant-based diet), and nutritional goals (such as blood sugar control diets and postoperative nutritional supplementation), makes it difficult for traditional "universal" dietary recommendations to accurately match individual differences; Third, there are technological gaps in the transformation of cross-domain knowledge. For example, the traditional understanding of oat's "spleen-strengthening and heart-nourishing" effects requires scientific interpretation by combining data such as β-glucan content and GI value from modern nutrition, while traditional methods lack the ability to automatically link traditional Chinese medicine dietary theories with modern nutritional science.

[0003] As health management moves towards precision, the technological upgrade of food and medicine homology recommendations faces unique challenges: On the one hand, it requires building a multi-dimensional knowledge network that integrates "ingredients - properties - nutritional components - applicable scenarios - pairing taboos." For example, as an ingredient, white fungus needs to be labeled with the "yin-nourishing and dryness-moistening" attributes in traditional Chinese medicine theory, as well as data such as polysaccharide content and amino acid composition in modern nutrition science. On the other hand, the recommendation logic needs to support multi-layered reasoning from "individual health characteristics - matching of ingredient attributes - synergistic effects of nutritional components." For example, when designing a "corn + celery" combination for sedentary people, it is necessary to consider both the traditional nutritional value of corn in "strengthening the spleen and stomach" and the role of dietary fiber and potassium in celery in metabolic regulation. Traditional recommendation algorithms struggle to handle such complex reasoning tasks that integrate traditional nutritional theories with modern nutritional science.

[0004] Therefore, how to establish an intelligent diet recommendation system that integrates knowledge graph reasoning and large language models is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] In view of this, the present invention provides a personalized recommendation method for food and medicine homology based on knowledge reasoning.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] A personalized recommendation method for food and medicine homology based on knowledge reasoning includes the following steps:

[0008] Acquire knowledge about the homology of food and medicine and construct a knowledge graph of the homology of food and medicine;

[0009] Based on the knowledge graph of food and medicine homology, the BFS algorithm is used to mine multi-hop association rules;

[0010] The reliability of the rules is verified by combining a trial-and-error verification mechanism, and their weights are dynamically adjusted according to the reliability to obtain the final knowledge graph;

[0011] Acquire user data and, based on the final knowledge graph, use a large language model to generate personalized recommendations for food and medicine homology for the current user.

[0012] Preferably, the step of acquiring knowledge about the homology of food and medicine includes:

[0013] Extracting information on food and medicine homology;

[0014] Clean the data and segment the retained information into words;

[0015] Each keyword obtained from word segmentation is labeled with corresponding tags to represent entities or relationships, generating structured data.

[0016] Preferably, the information on food and medicine homology is extracted from traditional Chinese medicine classics, modern nutrition literature, and clinical research data.

[0017] Preferably, the construction of the food-medicine homology knowledge graph includes: writing the structured data into a graph database according to its labels, and converting it into a structured triple form to obtain the food-medicine homology knowledge graph.

[0018] Preferably, the steps for mining multi-hop association rules include: adopting a progressive strategy, first mining single 2-hop rules, and then combining them into long-chain rules.

[0019] A personalized recommendation system for food and medicine homology based on knowledge reasoning includes:

[0020] The multi-source data integration and knowledge graph construction module is used to collect, clean, and store data from traditional Chinese medicine classics, modern nutrition literature, and clinical research. It eliminates redundant and contradictory data through adaptive algorithms, embeds taboo rules, labels entity relationships, and uses graph neural networks to align structured and unstructured knowledge to construct a multimodal knowledge graph that integrates traditional theories and modern science.

[0021] The rule mining and dynamic optimization module is used to mine multi-hop association rules based on the knowledge graph using a breadth-first search algorithm, dynamically adjust the rule weights by combining confidence and the number of supporting documents, introduce a trial-and-error mechanism to back-verify the reliability of the rules, and optimize error paths through reinforcement learning to achieve dynamic updates and precise iterations of the rule base.

[0022] The personalized query generation and adaptation module is used to dynamically generate search instructions based on user health data through an adaptive query generator, filter high-risk options by combining a taboo library, adjust rule priority according to user characteristics, and optimize query logic using deep reinforcement learning.

[0023] The credible suggestion generation and multi-dimensional verification module generates food and drug recommendations using a large language model. It calls a knowledge graph in real time to verify contraindications and logical chains, triggers alternative solutions, and outputs recommendations with traceable reasoning paths through dual verification of facts and semantic similarity calculations.

[0024] As can be seen from the above technical solution, compared with the prior art, the present invention discloses a personalized recommendation method for food and medicine homology based on knowledge reasoning, which has the following effects:

[0025] (1) Dynamic rule priority: The rule weight is dynamically adjusted according to the user's real-time health data. For example, the rule related to "low GI food" is given priority to diabetic patients to ensure that the recommended content is highly matched with the user's current health status.

[0026] (2) Causally traceable recommendations: Each suggestion is accompanied by a reasoning path, such as "Recommendation basis: wolfberry → wolfberry polysaccharide → activate AMPK pathway → improve insulin resistance (PMID:123456)", which enhances users' trust in the recommended content.

[0027] (3) Taboo perception generation: When generating suggestions in LLM, taboo rules in the knowledge graph, such as "Eighteen Antis", are embedded to directly block high-risk combinations and avoid recommending content that may harm the user's health.

[0028] (4) Progressive rule mining: A progressive rule combination strategy is adopted. First, single 2-hop rules are mined, and then combined into long chain rules based on confidence and F2 verification results to generate interpretable reasoning chains that support complex reasoning tasks.

[0029] (5) Trial and error verification and rule optimization: A trial and error mechanism is introduced in the rule mining stage. Candidate rules are back-searched to support the facts. If the evidence is insufficient, they are marked as "rules to be verified" and the error path is recorded for subsequent optimization to ensure the accuracy and reliability of the recommended content.

[0030] (6) Adaptive Query Generation: The knowledge graph is dynamically retrieved through the Adaptive Query Generator (AQG), and the query is automatically generated by inputting user health data. The candidate entities are filtered by combining user taboos to accurately adapt to user needs. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0032] Figure 1 This is a schematic diagram of a personalized recommendation method for food and medicine homology based on knowledge reasoning proposed in this invention;

[0033] Figure 2 This is a schematic diagram of the structure of a personalized recommendation system for food and medicine based on knowledge reasoning proposed in this invention. Detailed Implementation

[0034] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0035] like Figure 1 In a first aspect, embodiments of the present invention disclose a method for recommending food-medicine homology schemes based on knowledge graph reasoning and LLM reasoning, the method comprising the following steps:

[0036] S1. Acquire knowledge about the homology of food and medicine. Specifically, collect knowledge about the homology of food and medicine from traditional Chinese medicine theory and modern nutrition, including information on properties, effects, and applicable populations. Sources cover traditional Chinese medicine classics, modern literature, clinical research, and expert experience. At the same time, integrate multi-source evidence into multi-form structured data and label the source types. Use hybrid knowledge storage to align structured and unstructured knowledge through GNN embedding.

[0037] S2. Preprocessing. The collected data is cleaned, segmented, and entities and relationships are labeled. A unified structured data is output, and taboo rules are embedded in the data cleaning process. The source type of the "food efficacy" type relationship is labeled for subsequent rule confidence calculation.

[0038] S3. Construct a knowledge graph. Write scripts to import structured data on food and medicine homology into a graph database to construct a knowledge graph. Furthermore, embed taboo rules during graph construction to ensure that the generated recommendations conform to traditional theories and modern science.

[0039] S4. Knowledge Mining. Utilizing the rule mining principle in the CHAIN-OF-KNOWLEDGE (CoK) inference framework, based on the knowledge graph of food and medicine homology, the BFS algorithm is used to mine 2-4 hop path rules. Reliable rules with a confidence level > 0.6 are selected. A progressive strategy is adopted to first mine single 2-hop rules and then combine them into long chain rules, and rule weights are introduced to dynamically adjust the priority.

[0040] S5. Combine the two-hop rules into long rules to support complex reasoning. Introduce a trial-and-error mechanism to retrieve supporting facts in the knowledge graph (F2 score is used as one of the rule weight evaluation indicators). If the evidence is insufficient, mark it as a "rule to be verified" and record the error path for subsequent optimization.

[0041] S6. Collect user health data, dynamically retrieve knowledge graphs through an adaptive query generator to generate a personalized suggestion framework, combine user taboos to filter candidate entities, and dynamically adjust rule priorities to accurately adapt to user needs.

[0042] The generation process and structure of the personalized suggestion framework in S6 are as follows:

[0043] a. Data input layer:

[0044] Enter the user's health data (such as age, medical history, physical examination indicators) and a list of contraindications.

[0045] b. Adaptive query generation:

[0046] Knowledge graph query statements are dynamically constructed based on user data (such as SPARQL template population).

[0047] c. Frame structure:

[0048] The output is a triplet structure framework.

[0049] S7, based on the personalized suggestion framework of S6, generates detailed medicine and food solutions through a large language model and verifies intermediate reasoning steps in real time by calling the knowledge graph. It automatically switches solutions when taboo rules are triggered, and ensures the credibility of suggestions through the F2-verification strategy (fact verification + fidelity verification) of the CHAIN-OF-KNOWLEDGE (Cok) reasoning framework, while also providing a complete reasoning path to enhance user trust.

[0050] The reasoning steps in S7 are as follows:

[0051] a. Framework connection:

[0052] Input the framework generated by S6 and extract high-priority rules (such as weight > 0.8) as inference constraints for the Large Language Model (LLM).

[0053] b. Intermediate reasoning steps:

[0054] LLM generates drafts: Natural language suggestions (such as "Consume 50g of oats daily because they contain β-glucan (rule R1)") based on entities and rules in the framework.

[0055] Real-time knowledge graph validation: Checks if entity relationships in the LLM output exist (e.g., queries the knowledge graph to confirm if the path "oats → β-glucan → blood sugar reduction" is supported by literature). When a contraindication is triggered, the entity is automatically replaced (e.g., if a user is allergic to oats, it is switched to "bitter melon" and revalidated).

[0056] c.F2-Verification Strategy:

[0057] Fact verification: Check whether the biological mechanism of LLM generation is consistent with the knowledge graph (such as the molecular action pathway of β-glucan).

[0058] Fidelity verification: Ensure that the final recommendations fully comply with the priorities and taboos of the S6 framework (e.g., disabling rules with a weight < 0.6).

[0059] S1 specifically includes:

[0060] S11. Data Collection: Collect knowledge about food and medicine sharing the same origin from traditional Chinese medicine classics, modern nutrition literature, clinical research and expert experience, including information on the properties, effects and applicable populations of food and medicine.

[0061] S12. Data Fusion: Employ a multi-source data collection strategy and combine data fusion technology to integrate data from different sources into a unified framework, ensuring the accuracy and diversity of the data.

[0062] S13. Evidence Labeling: Integrate multi-source evidence into structured data, label the source type (such as classical records, clinical research, and nutritional literature) of "food efficacy" relationships, and quantify the level of evidence to provide a basis for subsequent rule confidence calculation.

[0063] S14. Hybrid Knowledge Storage: Graph Neural Networks (GNNs) are used to embed structured knowledge (such as triples) and unstructured knowledge (such as literature descriptions) into a representation. Semantic fusion is achieved through node vector alignment, ensuring that the construction of the knowledge graph conforms to both traditional theories and modern science.

[0064] Structured knowledge consists of data with predefined formats and organizational structures, such as database tables, triples, and XML rule bases. It is characterized by being machine-readable and directly computable, accounting for about 40% of the data in this system and forming the core relational data. Unstructured knowledge consists of free text or multimedia data without fixed formats, such as TCM classics, clinical medical records, and full-text research papers. It is characterized by being semantically rich and requiring parsing to extract information. It accounts for about 60% of the data in this system and forms the original source of knowledge.

[0065] S15. Knowledge Alignment: Utilizing the message passing mechanism of GNN, the descriptions of traditional Chinese medicine properties (such as "nourishing yin and moistening dryness") are mapped to the same vector space with modern nutritional component data (such as polysaccharide content), eliminating semantic barriers between heterogeneous data and ensuring the accuracy and consistency of the knowledge graph.

[0066] S2 specifically includes:

[0067] S21. Data Cleaning: Use adaptive cleaning algorithms to remove duplicate, contradictory, and low-quality information to ensure data accuracy and consistency.

[0068] S22. Word segmentation: Perform word segmentation on the text data to prepare for subsequent entity and relation annotation.

[0069] S23. Entity and Relation Labeling: The Transformer model is used for Named Entity Recognition (NER) and relation extraction to label entities and relations, and output structured triple data.

[0070] S24. Taboo Rule Embedding: During the cleaning phase, the dynamic rule engine loads an XML-formatted taboo rule library and executes a real-time interception mechanism during the ETL preprocessing phase. For example, when it detects "constitution is Yin deficiency with excessive fire" and "food is extremely cold in nature," the system will automatically intercept and mark high-risk data, which will be automatically blocked in subsequent processes. Compared with traditional rule injection, this system's taboo rules have higher execution speed and response accuracy, and are suitable for data cleaning preprocessing and real-time data stream processing, mainly handling syntax-level rules and medical semantic rules.

[0071] S25. Source Reliability Identification: A multi-dimensional feature engineering model is established, including source authority (journal impact factor / institutional level, weight 35%), evidence strength (research type, RCT=1.0, retrospective=0.6, weight 30%), timeliness (exponential decay, e^(-0.05*annual difference), weight 15%), and academic influence (citation count (log10 transformation), weight 20%). The model architecture includes a 7-dimensional feature vector input layer, a 128-node fully connected + Dropout(0.3) hidden layer, and a Sigmoid activation output layer, outputting a 0-1 reliability score.

[0072] S3 specifically includes:

[0073] S31. Data Import: A script was written to convert the raw data into RDF triple format using the Apache Jena framework, and automatic type inference was implemented, automatically recognizing numeric attributes as xsd:float and text attributes as xsd:string. Furthermore, an ontology mapping table was established to map traditional Chinese medicine concepts to modern nutritional terms (e.g., "warm nature" maps to "ThermalProperty_Warm"). For Neo4j batch import optimization, the Neo4j-import tool was used to directly load CSV files, handling millions of triples. A partitioned parallel loading strategy was adopted, processing data by food category (e.g., grains, herbs, fruits, etc.), and a BTREE index was created synchronously during import to accelerate queries.

[0074] S32. Taboo Rule Embedding: A dynamic taboo rule library (XML format) is embedded in the graph construction. XML rules are converted into executable code, for example, using RuleCompiler to compile rules such as "If the food's TCM_property is 'Hot' and the user's constitution is 'YinDeficiency', then the risk level is 0.95, and the action is block." Secondly, real-time binding is implemented. At runtime, rules are injected into the Neo4j extension module, and a trigger mechanism automatically activates rule checks when creating food or user associations.

[0075] S33. Graph Neural Network Embedding: Graph neural networks (GNNs) are used to embed knowledge graphs to enhance the representation of nodes and edges in the knowledge graph.

[0076] S34. Graph Attention Network Enhancement: Enhance the representation of nodes and edges in the knowledge graph through Graph Attention Network (GAT) to improve the accuracy of subsequent reasoning.

[0077] S35. Knowledge Graph Verification: Verify the accuracy and consistency of the knowledge graph, ensuring all embedded rules and relationships are correct. A multi-dimensional verification system is constructed for knowledge graph verification. The conflict detection engine includes logical conflict scanning (detecting contradictory attributes, such as a food ingredient being simultaneously labeled "glycemic" and "lowering blood sugar"), circular dependency detection (finding invalid reasoning chains A→B→C→A), and isolated node identification (marking unrelated redundant nodes). The verification pipeline sequentially performs structural verification, logical verification, and medical rule verification, finally outputting a report. Medical rule verification calls a Traditional Chinese Medicine expert system to verify the relationships between properties, flavors, and meridians. An automatic repair mechanism triggers the knowledge fusion module when a conflict is detected.

[0078] S4 specifically includes:

[0079] S41. Rule Mining: Based on the knowledge graph of food and medicine homology, set BFS search parameters (maximum hop count = 4, node degree threshold = 50) and traverse the knowledge graph to generate candidate paths. Example: Goji berry → [contains] → Goji berry polysaccharide → [activates] → AMPK pathway → [improves] → insulin resistance. Mine 2-4 hop path rules and filter reliable rules with confidence > 0.6.

[0080] The following is a detailed process and example of calculating confidence:

[0081] Confidence level calculation formula:

[0082] Confidence=α×Evidence_Score+β×Source_Weight+γ×Consistenc y_Check

[0083] The meanings of each term in the formula are as follows:

[0084] α = 0.5 (weighting coefficient for the strength of evidence);

[0085] β = 0.3 (Source authority weighting coefficient);

[0086] γ = 0.2 (consistency verification weight coefficient);

[0087] Evidence_Score: Strength of experimental evidence;

[0088] Source_Weight: Weighting based on the authority of the source;

[0089] Consistency_Check: Cross-source consistency verification score;

[0090] 1) Evidence_Score: Example of experimental evidence strength:

[0091] Evidence Strength Scoring Criteria:

[0092] Types of evidence score Judgment criteria Randomized controlled trials (RCTs) 1.0 Sample size ≥ 100, double-blind design Cohort Study 0.8 Follow-up period ≥ 2 years Case Report 0.6 ≥3 independent cases animal experiments 0.4 Two or more models Ancient records / expert experience 0.2 ≥2 authoritative classics

[0093] Calculation formula:

[0094]

[0095] Calculation example:

[0096] The rule "Goji berries → improve insulin resistance" is supported by one randomized controlled trial (RCT) and two classical texts:

[0097]

[0098] 2) Source_Weight: Example of source authority weight:

[0099] Calculation formula:

[0100] Source_Weight = 0.7 × IF norm +0.3×log 10 (Citations +1)

[0101] Among them, IF norm The impact factor is normalized; Citations represents the number of times a document has been cited.

[0102] Calculation example:

[0103] Supporting literature published in journals with an impact factor of 15.0 and cited 200 times:

[0104] IF norm =15 / 100=0.15; log 10 (201)≈2.303;

[0105] Source_Weight=0.7×0.15+0.3×2.303=0.105+0.6909=0.7959

[0106] 3) Consistency_Check: Example of cross-source consistency verification score:

[0107] Calculation formula:

[0108]

[0109] Where: ΔYear is the difference between the current year and the year of the latest evidence; e -0.1×ΔYear This is the time-degradation factor;

[0110] Calculation example:

[0111] A certain rule has 5 supporting sources (4 of which are consistent), and the year the most recent evidence was published is 2023.

[0112] Consistency_Ratio=4 / 5=0.8; ΔYear=2025-2023=2;

[0113] DecayFactor=e -0.1×2 =e -0.2 ≈0.8187;

[0114] Consistency_Check=0.8×0.8187=0.655

[0115] After calculating the three parameters, input them into the confidence calculation formula above to calculate the corresponding rule confidence.

[0116] S42, Single 2-hop rule mining: First, mine single 2-hop rules to ensure the accuracy of the basic rules.

[0117] S43. Rule Combination: Based on confidence level and F2 verification results, single 2-hop rules are gradually combined into long chain rules.

[0118] S44. Rule weight calculation: The priority of rules is dynamically adjusted based on the number of supporting facts. If the weight is increased, the rule is recommended first; otherwise, it is downgraded. The rule with the highest confidence is found to achieve personalized adaptation.

[0119] The following provides a detailed process and calculation example for calculating rule weights:

[0120] Comprehensive weight W calculation model:

[0121] W = α × Confidence + β × log 10 (1+SupportCount)+γ×F2Score

[0122] in:

[0123] α = 0.5 (confidence weight);

[0124] β = 0.3 (weight of supporting evidence);

[0125] γ = 0.2 (F2 validation weight);

[0126] SupportCount: Number of supporting documents;

[0127] F2Score: Rule validation score;

[0128] Calculation example:

[0129] Rule R1: Confidence level 0.85, 8 supporting references, F2 score 0.92.

[0130] W = 0.5 × 0.85 + 0.3 × log 10 (9) + 0.2 × 0.92 = 0.895

[0131] S45. Rule Verification: Verify the accuracy and reliability of the combined long-chain rules through a conflict detection algorithm to ensure the effectiveness of the rules.

[0132] S5 specifically includes:

[0133] S51. Introduction of Trial and Error Mechanism: The trial and error mechanism is implemented through an automated verification-feedback loop system, encompassing three substantive technical means: First, the candidate rule generator outputs an initial rule set based on the BFS algorithm and automatically classifies rule types, such as attributes, efficacy, and compatibility, then arranges them in descending order of confidence to form a queue to be verified. Second, the reverse verification engine automatically traverses the knowledge graph's literature index (PMID index) by constructing SPARQL query templates and sets a timeout mechanism to ensure that the longest verification time for a single rule does not exceed 200ms. Finally, the dynamic verification strategy adopts different verification methods based on the rule's confidence level. High-confidence rules use sampling verification and cross-document verification, while low-confidence rules undergo full verification and cross-source evidence comparison.

[0134] S52. Support for Fact Retrieval: The automated technology process supporting fact retrieval includes multimodal retrieval technology and evidence chain construction algorithms. Multimodal retrieval technology combines structured retrieval (SPARQL querying knowledge graph triples), unstructured retrieval (ElasticSearch full-text retrieval of document content), and semantic retrieval (BERT model matching semantic similarity descriptions). The evidence chain construction algorithm automatically generates an evidence relationship graph and calculates the evidence support rate, i.e., the ratio of the number of supporting evidence to (the number of supporting + conflicting evidence). In addition, a real-time feedback mechanism ensures that rules that pass verification are marked as "verified," rules that fail verification trigger an error handling pipeline, and rules with insufficient evidence are transferred to a waiting verification pool.

[0135] S53. Error path recording: Record rules with insufficient evidence as "rules to be verified" for subsequent optimization.

[0136] S54. Rule Removal or Deweighting: The quantitative decision-making model for rule removal / deweighting is based on a deweighting algorithm and an automated processing procedure. The deweighting algorithm is defined as W... new =W old ×e -0.5×N Where N is the number of consecutive failures, with the weight multiplied by 0.606 for one failure, 0.367 for two failures, and removed from the rule base after three failures. The automated handling process determines whether to adjust the weight or remove a rule from the rule base based on the number of failures after verification failure, and generates an error report to optimize the quality and efficiency of the rule base.

[0137] S55. Reinforcement Learning Optimization: Use reinforcement learning algorithms to dynamically adjust rule mining strategies, thereby improving the efficiency and accuracy of rule mining.

[0138] S6 specifically includes:

[0139] S61. User Data Collection: Collect user health data, including information on physical condition, symptoms, allergens, etc.

[0140] S62. Adaptive Query Generation: Dynamically retrieve knowledge graphs using an Adaptive Query Generator (AQG) to generate personalized suggestions.

[0141] S63. Query Generation: Input user health data, and AQG will automatically generate a query.

[0142] S64. Taboo Filtering: Combines user taboo filtering to filter candidate entities, ensuring the safety of recommended content.

[0143] S65. Rule Priority Adjustment: The dynamic weight calculation model is as follows:

[0144] W new =W old ×(1+α×I disease +β×I habit ), where I disease Factors indicating the urgency of the disease, I habit W represents the behavioral habit coefficient. old This represents the rule weight value calculated in S44, which is now being updated to achieve accurate adaptation for different users. α and β are empirical coefficients, with default values ​​of 0.6 and 0.4, respectively. The priority adjustment strategy adjusts weights based on user characteristics (e.g., +50% weight for low-GI foods for diabetic patients, +40% weight for high-protein foods for postoperative recovery, and +30% weight for energy supplementation for athletes), and implements this through technology (e.g., activating the "low-GI" rule subgraph, improving protein-related rules, and expanding the range of calorie calculation). A real-time feedback loop monitors user adoption rates and automatically adjusts rule weights, while simultaneously establishing a rule effectiveness evaluation matrix E to optimize the rule base. The rule optimization process is triggered when E < 0.8.

[0145] Specifically, S7 includes:

[0146] S71. Suggestion Generation: Generates food and medicine suggestions from user data using a Large Language Model (LLM), and verifies intermediate reasoning steps in real time by calling the knowledge graph.

[0147] S72. Taboo rule check: If the generated suggestion triggers a taboo rule, the system will automatically switch to the alternative solution.

[0148] S73. Fact Verification: Verify the accuracy of the recommendations by retrieving entity relationships from the knowledge graph, ensuring that the recommendations are based on reliable facts.

[0149] S74. Fidelity Verification: The semantic similarity between the user's health description and the recommendation reason is calculated through a sentence encoder to ensure the fidelity of the recommendation.

[0150] S75. Reasoning Path Included: Each suggestion is accompanied by a reasoning path to enhance user trust.

[0151] This invention achieves high accuracy, safety, and interpretability in the recommendation of food and medicine homology through multi-source data fusion, dynamic rule optimization, and multimodal verification mechanisms, combining the synergistic advantages of traditional theory and modern artificial intelligence technology.

[0152] like Figure 2 In a second aspect, embodiments of the present invention disclose a recommendation system for food and medicine homology based on knowledge graph reasoning and LLM reasoning, comprising: a multi-source data integration and knowledge graph construction module, a rule mining and dynamic optimization module, a personalized query generation and adaptation module, and a credible suggestion generation and multi-dimensional verification module.

[0153] The multi-source data integration and knowledge graph construction module is responsible for the full lifecycle management of knowledge about food and medicine homology. It covers the collection, cleaning and storage of multi-source data, cleans redundant and contradictory data through adaptive algorithms, embeds taboo rules and labels entity relationships. Then, it aligns structured and unstructured knowledge and uses graph neural networks (GNN) to build a knowledge graph that integrates traditional theories and modern science, ensuring high-quality data storage and logical consistency.

[0154] The rule mining and dynamic optimization module focuses on knowledge graph-driven end-to-end rule management. It mines multi-hop association rules through breadth-first search (BFS) algorithm and dynamically adjusts rule weights by combining confidence and the number of supporting documents. It introduces a trial-and-error mechanism to verify the reliability of rules and optimizes error paths through reinforcement learning, thereby achieving dynamic updates and precise iterations of the rule base.

[0155] The personalized query generation and adaptation module connects user needs with knowledge graphs. Based on user health data, it dynamically generates search instructions through an adaptive query generator (AQG), filters high-risk options using a taboo library, adjusts rule priorities based on user characteristics, and optimizes query logic using deep reinforcement learning to ensure that the recommended results are highly adapted to individual needs.

[0156] The credible suggestion generation and multi-dimensional verification module generates food and drug suggestions through a large language model (LLM), calls the knowledge graph in real time to verify contraindications and logical chains, and triggers alternative solutions; it simultaneously performs fact verification and semantic similarity calculation to ensure that the scientific nature of the suggestions is consistent with user needs; and finally, it adds a traceable reasoning path to each suggestion to improve transparency and credibility.

[0157] In summary, each module is centered around a functional closed loop, covering data management, rule optimization, personalized adaptation, reliable output, and conflict resolution, forming a complete link of "data → knowledge → reasoning → verification → output", taking into account both the rigor of traditional theories and the dynamism of modern technologies.

[0158] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0159] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A personalized recommendation method for food and medicine homology based on knowledge reasoning, characterized in that, Includes the following steps: Acquire knowledge about the homology of food and medicine and construct a knowledge graph of the homology of food and medicine; Based on the knowledge graph of food and medicine homology, the BFS algorithm is used to mine multi-hop association rules; during the mining process, the reliability of the rules is verified according to the number of supports, and the rules that meet the reliability threshold are selected to obtain the basic knowledge graph. Acquire user data, adjust the basic knowledge graph based on the user data, and generate a triplet structure framework that conforms to the user data; Based on the aforementioned triplet structure framework, personalized suggestions for food and medicine homology corresponding to the current user are generated using a large language model.

2. The personalized recommendation method for food and medicine homology based on knowledge reasoning according to claim 1, characterized in that, The steps for acquiring knowledge about the homology of food and medicine include: Extracting information about the homology between food and medicine yields structured and unstructured knowledge; Graph neural networks are used to embed structured and unstructured knowledge, and semantic fusion is performed through node vector alignment.

3. The personalized recommendation method for food and medicine homology based on knowledge reasoning according to claim 2, characterized in that, The information on food and medicine homology comes from multiple fields, and the steps for obtaining knowledge on food and medicine homology also include: using the message passing mechanism of GNN to map data from different fields to the same vector space.

4. The personalized recommendation method for food and medicine homology based on knowledge reasoning according to claim 1, characterized in that, Before constructing the aforementioned knowledge graph of food and medicine homology, data preprocessing is performed, specifically including: Clean the data and segment the retained information into words; Each keyword obtained from word segmentation is labeled with corresponding tags for entity or relation annotation, generating triplet structured data.

5. The personalized recommendation method for food and medicine homology based on knowledge reasoning according to claim 4, characterized in that, The construction of the knowledge graph of food and medicine homology includes: writing the structured data into a graph database according to its labels, and converting it into a structured triple form to obtain the knowledge graph of food and medicine homology.

6. The personalized recommendation method for food and medicine homology based on knowledge reasoning according to claim 5, characterized in that, In the preprocessing stage, taboo rule data is introduced based on a pre-built emergency rule base; in the knowledge graph construction, the taboo rule data is converted into executable code for rule checking.

7. A personalized recommendation method for food and medicine homology based on knowledge reasoning according to claim 1 or 6, characterized in that, The steps for mining multi-hop association rules include: Before constructing the knowledge graph of food and medicine homology, multi-source evidence data is integrated into each piece of knowledge; the evidence data includes: evidence type and authority data and evidence consistency data; Calculate the confidence level based on the evidence data, and filter out rules that meet the preset confidence level threshold.

8. The personalized recommendation method for food and medicine homology based on knowledge reasoning according to claim 7, characterized in that, The step of adjusting the basic knowledge graph based on the user data specifically includes: The recommendation weights of each rule in the basic knowledge graph are adjusted based on the user data, and personalized suggestions are generated.

9. A personalized recommendation system for food and medicine homology based on knowledge reasoning, characterized in that, include The multi-source data integration and knowledge graph construction module is used to collect, clean, and store data from traditional Chinese medicine classics, modern nutrition literature, and clinical research. It eliminates redundant and contradictory data through adaptive algorithms, embeds taboo rules, labels entity relationships, and uses graph neural networks to align structured and unstructured knowledge to construct a multimodal knowledge graph that integrates traditional theories and modern science. The rule mining and dynamic optimization module is used to mine multi-hop association rules based on the knowledge graph using a breadth-first search algorithm, dynamically adjust the rule weights by combining confidence and the number of supporting documents, introduce a trial-and-error mechanism to back-verify the reliability of the rules, and optimize error paths through reinforcement learning to achieve dynamic updates and precise iterations of the rule base. The personalized query generation and adaptation module is used to dynamically generate search instructions based on user health data through an adaptive query generator, filter high-risk options by combining a taboo library, adjust rule priority according to user characteristics, and optimize query logic using deep reinforcement learning. The credible suggestion generation and multi-dimensional verification module is used to generate drug and food suggestions through a large language model, call the knowledge graph in real time to verify the contraindications and logical chains, trigger alternative solutions, and output suggestions with traceable reasoning paths through dual verification of fact verification and semantic similarity calculation.

Citation Information

Cited By

  • Test feedback power grid equipment operation and maintenance knowledge graph construction and optimization method and system

    CN122452719A