An atlas semantic enhanced intelligent drug recommendation method, system and medium

CN122930477APending Publication Date: 2026-10-16QINGDAO UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611195710.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-07
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

第一,自然语言输入适配能力不足

Benefits of technology

本发明利用图谱词汇表约束大语言模型与本地语义引擎的输出,确保所有匹配均在标准医学实体范围内,从而有效降低模型幻觉与误匹配,提升召回率和推荐可控性。通过隐性关联挖掘机制,以区分高可信图谱主通路与低权重LLM辅助通路,发现常规关键词检索难以覆盖的隐性药物与病症,弥补表层匹配的预警缺失。针对多源结果冲突,采用候选合并去重与动态评分排序,将语义来源、召回路径和排序位置统一纳入评分框架,并结合兜底模糊召回保障无效场景下的有效输出。通过相似病症风险分层,利用直接相似、交叉症状及共享用药路径构建候选病症集合,将单点推荐扩展为可解释的关联疾病辅助筛查;同时,基于JWT用户身份与订阅状态实现分层建议与权限控制,区分大众与专家建议,兼顾安全性与可运营性。最终,通过图谱可视化联动闭环,支持节点点击触发推荐、行为记录及后台数据运维。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122930477A_ABST
    Figure CN122930477A_ABST
Patent Text Reader

Abstract

The application relates to the field of drug recommendation, and discloses an intelligent drug recommendation method and system based on atlas semantic enhancement and a medium, and the specific method comprises the following steps: based on a user natural language query, a system constructs a reconstructable cache atlas vocabulary table, a five-path candidate recall is performed by using a graph database, and after merging and deduplication, a dynamic sorting is performed on a comprehensive basic score and an enhanced score, a recommendation result is output, and an explanation is attached. Meanwhile, the main diagnosis is analyzed, similar diseases are searched, a risk level and a hierarchical screening suggestion are output. The system also performs implicit mining on the search result in the case feature layer, and according to the user role and the member state, popular suggestions or expert-level guidance are output in layers. The application effectively improves the accuracy, explainability and system scalability of drug recommendation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent medical information processing and computer-aided drug recommendation technology, and specifically relates to an intelligent drug recommendation method, system and medium with graph semantic enhancement. Background Technology

[0002] With the development of internet-based healthcare, family health management, and medical knowledge services, users are increasingly searching for drug information by symptoms, disease names, drug names, or surgery names. Existing systems typically employ keyword search, inverted indexes, static drug instruction manual displays, or simple rule-based recommendations, which can return basic information such as drug name, indications, and dosage. However, they struggle to form a complete technological loop in areas such as complex, conversational input, tracing medical entity relationships, interpreting the ranking of recommendation results, screening for similar symptoms, and controlling service access.

[0003] Specifically, the existing technology mainly has the following problems: First, the natural language input adaptation capability is insufficient. Users frequently input colloquial, synonymous, misspelled, or compound symptom expressions such as "headache," "stomachache," "sore throat," and "high blood pressure." Ordinary string matching cannot reliably map these expressions to standard medical entities, leading to missed or false positives.

[0004] Second, the search results lack support from medical relationships. Traditional list searches typically return drug descriptions containing keywords directly, failing to explicitly model the path relationships between drugs, diagnostic symptoms, treatment plans, surgery, and postoperative medication, making the source of recommendations difficult to interpret.

[0005] Third, multi-channel candidates lack a fusion and ranking mechanism. Channels such as exact matching, diagnostic association, indication inclusion, drug name inclusion, and large language model are usually isolated from each other, lacking a unified scoring and deduplication mechanism based on semantic source, candidate ranking position, and graph path.

[0006] Fourth, there is insufficient analysis of similar symptoms. Most drug retrieval systems only answer "what medicine to use for a certain symptom," lacking the ability to mine similar symptoms, overlapping symptoms, and shared drug pathways. They cannot provide users with relevance, risk levels, and screening suggestions. Existing retrieval solutions rely solely on text keywords for surface-level literal matching, failing to extract multi-dimensional case features based on user queries. They cannot uncover deep, implicit relationships between symptoms, diseases, and drugs through feature layering and multi-hop graph reasoning, making it difficult to output medical association results with clinical reference value.

[0007] Fifth, decouple the graph display from the recommendation interface. Existing knowledge graph visualizations mostly remain at the display layer, and clicking on nodes cannot create interaction with recommendations, suggestions, browsing history, and backend operations.

[0008] Sixth, the system operation and maintenance and permission closed loop are insufficient. Teaching or prototype systems often lack engineering closed loops such as user behavior recording, administrator map maintenance, subscription status refresh, order ledger, and expert suggestion unlocking, making it difficult to support subsequent expansion into real-world scenarios.

[0009] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0010] To address the above issues, this invention provides an intelligent drug recommendation method and system with graph semantic enhancement. This system maps colloquial user queries to standard medical entities constrained by a graph. Through multi-path graph recall, dynamic scoring and ranking, and risk stratification of similar diseases, it improves the accuracy, interpretability, and scalability of drug recommendations. Furthermore, this invention adds a multi-round sampling association analysis and a dual-path implicit reasoning coupling chain to simultaneously uncover implicit drugs and diseases that conventional retrieval methods cannot cover, aiming to find the truly needed results to improve diagnostic accuracy.

[0011] To achieve the above objectives, according to a first aspect of the present invention, a graph semantic enhancement intelligent drug recommendation method is provided, comprising the following steps: S1. Obtain the query text input by the user; S2. Query the names of medical entity nodes from the graph database and construct a medical retrieval vocabulary to constrain the range of semantic parsing output; S3. A cascaded semantic parsing architecture with strong constraints based on a medical retrieval vocabulary is adopted. This includes first calling a large language model to perform semantic parsing on the query text, comparing the parsing results with the medical retrieval vocabulary one by one, and retaining the medical entities that exist in the medical retrieval vocabulary. If the parsing content is empty or there are no medical entities matching the medical retrieval vocabulary in the parsing results, the local semantic engine is switched to perform text normalization processing on the query text and then map it to standard search terms in the medical retrieval vocabulary, and simultaneously outputs standardized multidimensional case features. S4. Based on standard search terms, perform multi-path candidate recall in the graph database to obtain explicit drug candidates; simultaneously, perform multi-round sampling association analysis on standardized multidimensional case features to screen for strong and weak association features, and mine implicit association candidates through two parallel inference pathways. The main inference pathway outputs high-confidence implicit candidates based on graph multi-hop evidence-based inference, while the auxiliary inference pathway outputs implicit candidates with indirect association labels based on large-model weak association causal inference; the results of the two inference paths are independent of each other and stored separately. S5. Merge and remove duplicates of explicit drug candidates and implicit association candidates. Calculate the comprehensive score of each candidate according to the preset multi-factor weighted scoring rules. Retain the candidate with the highest comprehensive score among the same drugs and output the recommendation results and matching basis in descending order of comprehensive score.

[0012] Furthermore, the query text is first parsed using a large language model. The parsing results are then compared one by one with the medical retrieval vocabulary, and medical entities existing in the medical retrieval vocabulary are retained, including: Send system prompts, query text, and medical retrieval vocabulary samples to the dialogue interface of the large language model, and constrain the large language model to output structured data without markers. The structured data includes at least a query intent field, a normalized query text field, a list of standard search terms mapped to the medical retrieval vocabulary field, a list of ambiguities, and a confidence level field. Analyze the structured data returned by the large language model and extract a list of standard search terms; The standard search term list is compared and filtered with the medical search term list, and only the standard terms that exist in the medical search term list are retained; The filtered standard words are encapsulated into semantic query results carrying the source identifier of the large language model.

[0013] Furthermore, switching to the local semantic engine, the query text is normalized and mapped to standard search terms within the medical retrieval terminology, including: The query text is processed by punctuation normalization and word segmentation; Call the pre-set medical colloquialisms synonym mapping table to map colloquial expressions to standard medical terms; The system calls a pre-defined regular expression rule base to identify complex symptom expression patterns and maps them to standard words in the medical retrieval vocabulary. The edit distance between the input word and the vocabulary candidates is calculated and the character overlap is scored. Based on the preset minimum threshold, candidate words from the vocabulary list whose scores reach the threshold are selected as standard search terms, and ambiguity prompts are output.

[0014] Furthermore, based on standard search terms, multi-path candidate recall is performed in the graph database to obtain dominant drug candidates, including: Drug name exact match path: The standard search terms are precisely compared with the name field of the drug node in the graph database. If they match, the drug node is returned directly. Diagnostic association path matching path: Match the standard search terms with the names of diagnostic nodes in the graph database. If the match is successful, return the candidate drugs for treating the diagnosis through the association path from the drug node to the treatment plan node. Indications include matching paths: Search for candidate drugs containing the standard search terms in the indication field of the drug node in the graph database; Drug name contains matching path: Search for candidate drugs that contain the standard search terms in the name field of the drug node in the graph database; Full-field fuzzy matching path: Calculate fuzzy matching scores for the fields of drug name, indication, dosage description and associated diagnosis name, and retain candidate drugs whose scores reach the preset threshold.

[0015] Furthermore, multiple rounds of sampling association analysis were performed on the standardized multidimensional case features to screen for strongly and weakly associated features, including: The standardized multidimensional features output by semantic parsing are collected and a feature queue is constructed. Each feature in the feature queue carries a confidence score, semantic weight, source identifier, and modality type label. Multiple rounds of random sampling with replacement are performed on the feature queue, and each round generates an independent feature subset. For all features within the same feature subset, the co-occurrence correlation, graph path connectivity, and semantic vector similarity between any two features are calculated to generate a feature correlation matrix. Multiple rounds of sampling are iteratively performed until convergence, outputting a globally stable combination of highly correlated features, and removing isolated and low-correlation noise features. The highly correlated feature combination is input into a pre-trained feature matcher and matched with target entities in the knowledge base. The comprehensive correlation coefficient between the feature group and each target entity is calculated. Feature groups with a comprehensive correlation coefficient higher than a preset threshold coefficient are marked as strongly correlated feature groups and output. Feature groups with a comprehensive correlation coefficient lower than the preset threshold coefficient are marked as undetermined feature groups. For the undetermined feature groups, a probabilistic generation model is invoked to calculate the weak association confidence and semantic matching degree between each undetermined feature and the target object; a comprehensive fit value for each undetermined feature group is calculated based on a weighted fusion formula, wherein the input parameters of the weighted fusion formula include at least semantic similarity, knowledge graph association hop count, object attribute constraint matching degree, and multimodal feature overlap; undetermined feature groups with comprehensive fit values ​​higher than a preset output threshold are marked as weakly associated feature groups and included in the candidate pool, while undetermined feature groups with comprehensive fit values ​​lower than the preset output threshold are directly discarded; The strongly correlated feature group and the weakly correlated feature group are output as two types of effective features and sent to dual-path inference respectively.

[0016] Furthermore, implicit association candidates are mined through two parallel inference pathways. The main inference pathway outputs high-confidence implicit candidates based on graph multi-hop evidence-based inference, while the auxiliary inference pathway outputs implicit candidates with indirect association labels based on large-model weak association causal inference. The results of the two inference pathways are independent and stored separately, including: Feature Bagging Association Reasoning: Based on feature subsets generated by multiple rounds of sampling with replacement, an undirected feature association graph is constructed. Stable high-association feature clusters are selected by multi-round voting fusion, and distinguished into strong association features and discrete weak association features. The strong association features are assigned to the main reasoning path, and the discrete weak association features are assigned to the auxiliary association reasoning path. The feature clusters simultaneously include symptom features and population constraint features, and unconstrained isolated noise features are removed during the execution process. Multi-hop Evidence-Based Reasoning in the Graph: The main reasoning pathway performs clinical treatment path reasoning, pharmacological target multi-hop reasoning, and clinical syndrome reasoning in parallel for the strongly correlated features; the number of hops in the reasoning path is limited, and the higher the number of hops, the lower the evidence-based weight; a drug candidate set carrying path depth information and evidence-based level information is output as a high-credibility professional recommendation data source; Large-scale weak-association causal reasoning: The auxiliary associative reasoning pathway, for the discrete weak-association features, calls the large language model to output a complete three-segment causal reasoning chain: input entity derivation, implicit symptom causal derivation, and mapping graph standard diagnosis; it verifies whether the diagnostic entity corresponding to the reasoning chain exists in the medical retrieval vocabulary, and directly discards the entity if there is no matching entity; the reasoning results that pass the verification are uniformly marked with indirect association identifiers, which are used to reduce their ranking weight in subsequent ranking steps; The main reasoning path and the auxiliary associative reasoning path adopt a dual-path physical isolation reasoning mechanism, and the reasoning results of the two paths are stored separately. The main reasoning path does not call open large language model association, and the auxiliary associative reasoning path executes three-level hierarchical logic in series: feature Bagging association reasoning, graph multi-hop evidence-based reasoning, and large model weak association causal reasoning. The reasoning results of the two paths are processed with differentiated weighting in subsequent processing.

[0017] Furthermore, explicit drug candidates and implicit association candidates are merged and deduplicated. A comprehensive score for each candidate is calculated according to a pre-defined multi-factor weighted scoring rule. The candidate with the highest comprehensive score for the same drug is retained. Recommendations and matching criteria are output in descending order of comprehensive score, including: Construct a candidate drug mapping table using the drug node identifier or drug name hash value as the candidate key; For multiple candidates for the same drug appearing under different search terms or different recall paths, only the candidate with the highest matching score is retained; A base score is calculated based on the candidate's ranking position in the current search term results; the higher the ranking, the higher the base score. If the user input is parsed as standard words, then set the weight of the search terms; If the semantic source is a large language model, then set the large language model semantic enhancement score; If the semantic source is a local semantic engine, then a local semantic enhancement score is set, where the semantic enhancement score of the large language model is higher than the local semantic enhancement score; Multiple rounds of sampling association analysis were performed on the standardized multidimensional case features output by semantic parsing to distinguish between strongly associated feature groups and weakly associated feature groups. Implicitly associated drug candidates were then mined through the main reasoning pathway and the auxiliary associative reasoning pathway, respectively. Perform large model feature matching verification on the candidate drugs obtained by implicit inference, and retain only implicit candidates with a comprehensive fit value higher than the preset parameter threshold; The overall score is determined by the product of the base score and the weight of the search term, plus the enhancement score.

[0018] To achieve the above objectives, according to a second aspect of the present invention, a graph semantic enhancement intelligent drug recommendation system is provided, comprising: The acquisition module is used to acquire the query text input by the user; The vocabulary building module queries the names of medical entity nodes from the graph database to build a medical retrieval vocabulary to constrain the range of semantic parsing output. The semantic parsing module adopts a cascaded semantic parsing architecture with strong constraints from the medical retrieval vocabulary. This includes first calling a large language model to perform semantic parsing on the query text, comparing the parsing results with the medical retrieval vocabulary one by one, and retaining the medical entities that exist in the medical retrieval vocabulary; if the parsed content is empty or there are no medical entities matching the medical retrieval vocabulary in the parsing results, the module switches to the local semantic engine, performs text normalization processing on the query text, maps it to standard search terms in the medical retrieval vocabulary, and simultaneously outputs standardized multidimensional case features. The multi-path recall module and the dual-path inference module are used to perform multi-path candidate recall based on standard search terms in the graph database to obtain explicit drug candidates. At the same time, multi-round sampling association analysis is performed on standardized multidimensional case features to screen for strong and weak association features. Implicit association candidates are mined through two parallel inference pathways. The main inference pathway outputs high-confidence implicit candidates based on graph multi-hop evidence-based inference, while the auxiliary inference pathway outputs implicit candidates with indirect association labels based on large-model weak association causal inference. The results of the two inference paths are independent of each other and stored separately. The recommendation results output module merges and removes duplicates from explicit drug candidates and implicit association candidates. It calculates the comprehensive score of each candidate according to the preset multi-factor weighted scoring rules, retains the candidate with the highest comprehensive score for the same drug, and outputs the recommendation results and matching basis in descending order of comprehensive score.

[0019] To achieve the above objectives, according to a third aspect of the present invention, a computer-readable storage medium is provided storing a computer program, which, when executed by a processor, is used to implement the intelligent drug recommendation method with enhanced graph semantics as described above.

[0020] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art: This invention utilizes a graph vocabulary to constrain the output of a large language model and a local semantic engine, ensuring that all matches fall within the scope of standard medical entities. This effectively reduces model illusions and false matches, improving recall and recommendation controllability. Through a latent association mining mechanism, it distinguishes between high-confidence graph main pathways and low-weight LLM auxiliary pathways, discovering latent drugs and diseases that are difficult to cover by conventional keyword retrieval, thus compensating for the lack of early warning in surface matching. For conflicts in multi-source results, it employs candidate merging and deduplication, along with dynamic scoring and ranking, unifying semantic source, recall path, and ranking position into a unified scoring framework, and combining fallback fuzzy recall to ensure effective output in ineffective scenarios. Through risk stratification of similar diseases, it constructs a candidate disease set using direct similarity, cross-symptoms, and shared medication paths, extending single-point recommendations to interpretable, associated disease-assisted screening. Simultaneously, it implements tiered suggestions and access control based on JWT user identity and subscription status, distinguishing between public and expert suggestions, balancing security and operability. Finally, through a graph visualization and linkage closed loop, it supports node click-triggered recommendations, behavior recording, and backend data maintenance.

[0021] Specifically, this invention constrains semantic parsing through a graph vocabulary, limiting the output of large language models and local semantic engines to the range of standard medical entities in the graph database. This reduces model illusions and mismatches with non-graph entities, thereby improving the recall rate and recommendation controllability of natural language input.

[0022] Specifically, this invention features a unique feature extraction and latent drug-related case search, distinguishing between high-confidence main pathways and low-weight LLM auxiliary pathways, and uncovering latent drugs and diseases that cannot be covered by conventional keyword retrieval, thus overcoming the shortcomings of existing technologies that only perform surface matching and lack potential risk warnings.

[0023] Specifically, this invention incorporates semantic source, graph recall path, and candidate ranking position into the scoring framework through candidate merging and deduplication and dynamic scoring and ranking mechanisms, which solves the problems of multi-channel result conflict and ranking instability. At the same time, it ensures that valid results can still be returned when the standard word candidates are empty through fallback fuzzy recall.

[0024] Specifically, this invention constructs a candidate disease set by using a risk stratification mechanism based on similar diseases, direct similarity relationships, cross-symptom relationships, and shared medication pathways. This expands single-point drug recommendations into interpretable, associated disease-assisted screening, thereby enhancing risk warning capabilities.

[0025] Specifically, this invention uses a hierarchical suggestion and access control mechanism to control access in the backend based on JWT user identity and member subscription status, thereby enabling controllable output of public and expert suggestions and enhancing system security and operability.

[0026] Specifically, this invention uses a graph visualization linkage closed-loop mechanism to enable node clicks to trigger recommendations and suggestions and record user behavior. At the same time, it works with the administrator backend to maintain graph data and perform operational statistics, forming a complete engineering system closed loop.

[0027] The specific embodiments of the present invention will now be described in further detail with reference to the accompanying drawings. Attached Figure Description

[0028] The accompanying drawings, as part of this invention, are provided to further illustrate the invention. The illustrative embodiments and descriptions of the invention are used to explain the invention, but do not constitute an undue limitation thereof. Clearly, the drawings described below are merely some embodiments; those skilled in the art can obtain other drawings based on these drawings without any creative effort.

[0029] In the attached diagram: Figure 1 This is a flowchart illustrating the intelligent drug recommendation method with graph semantic enhancement in this specific embodiment; Figure 2 This is a flowchart illustrating the similarity disease analysis and risk stratification process in this specific implementation method; Figure 3 This is a flowchart illustrating the semantic parsing, multi-path recall, and recommendation scoring fusion mechanism in this specific implementation. Figure 4 This is a schematic diagram of the structure of an intelligent drug recommendation system with graph semantic enhancement in this specific embodiment. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer and more accurate, the technical solutions in the embodiments will be clearly and completely described one by one below with reference to the accompanying drawings. The following embodiments are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0031] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of the present invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0032] Please see Figure 1 This invention provides a graph semantic enhancement-based intelligent drug recommendation method, comprising the following steps: S1. Obtain the query text input by the user; S2. Query the names of medical entity nodes from the graph database and construct a medical retrieval vocabulary to constrain the range of semantic parsing output; S3. A cascaded semantic parsing architecture with strong constraints based on a medical retrieval vocabulary is adopted. This includes first calling a large language model to perform semantic parsing on the query text, comparing the parsing results with the medical retrieval vocabulary one by one, and retaining the medical entities that exist in the medical retrieval vocabulary. If the parsing content is empty or there are no medical entities matching the medical retrieval vocabulary in the parsing results, the local semantic engine is switched to perform text normalization processing on the query text and then map it to standard search terms in the medical retrieval vocabulary, and simultaneously outputs standardized multidimensional case features. S4. Based on standard search terms, perform multi-path candidate recall in the graph database to obtain explicit drug candidates; simultaneously, perform multi-round sampling association analysis on standardized multidimensional case features to screen for strong and weak association features, and mine implicit association candidates through two parallel inference pathways. The main inference pathway outputs high-confidence implicit candidates based on graph multi-hop evidence-based inference, while the auxiliary inference pathway outputs implicit candidates with indirect association labels based on large-model weak association causal inference; the results of the two inference paths are independent of each other and stored separately. S5. Merge and remove duplicates of explicit drug candidates and implicit association candidates. Calculate the comprehensive score of each candidate according to the preset multi-factor weighted scoring rules. Retain the candidate with the highest comprehensive score among the same drugs and output the recommendation results and matching basis in descending order of comprehensive score.

[0033] In some embodiments, a cascaded semantic parsing architecture, prioritizing a large language model and using a local semantic engine as a fallback, is employed to map query text to standard search terms within a graph vocabulary, including: Send system prompt words, query text, and graph vocabulary samples to the dialogue interface of the large language model, and constrain the large language model to output structured data without tags. The structured data must include at least the query intent field, the normalized query text field, the standard search term list field mapped to the vocabulary, the ambiguity explanation list field, and the confidence field. Analyze the structured data returned by the large language model and extract a list of standard search terms; The standard search term list is compared and filtered with the graph vocabulary, and only standard terms that exist in the graph vocabulary are retained; The filtered standard words are encapsulated into semantic query results carrying the source identifier of the large language model.

[0034] Specifically, upon system startup or the arrival of the first recommendation request, the backend queries the Neo4j graph database for the node names of Drug, Diagnosis, and Surgery to form a medical retrieval vocabulary. This vocabulary serves as a boundary condition for semantic parsing, limiting the range of standard word output and preventing the semantic model from generating entities that do not exist in the graph. The vocabulary is stored using a caching mechanism; it can be cleared and rebuilt by the administrator after maintaining the graph data.

[0035] When a user enters a query term, the semantic parsing module first determines if the large language model interface is available. If available, it initiates a dialogue request to the large language model dialogue interface via a standardized HTTP client, inputting the system prompts along with the user's query and a sample of the graph vocabulary. The large language model is constrained to output a strict JSON structure without Markdown markup. This structure must contain at least five fields: query intent, normalized query text, resolved terms (mapped to the vocabulary), ambiguity notes, and confidence. After the server performs structured parsing on the returned JSON, it performs vocabulary whitelist filtering on the resolved terms, retaining only the standard terms present in the current graph vocabulary. If the filtered list of standard terms is not empty, it encapsulates the result into a semantic query with the source identifier "LLM" and returns it.

[0036] Unlike existing drug recommendation systems, this system can extract implicit relationships from user-input information by mining data features, and use the knowledge graph's ability to link entities and relationships to output results related to drugs, diseases, and other medical fields that best match the user's search content.

[0037] Furthermore, the Large Language Model (LLM) does not directly determine the recommendation results, but must output standard words within the scope of the graph vocabulary; the local engine, as a deterministic fallback mechanism, ensures that semantic normalization can still be achieved when there is no external model.

[0038] In some embodiments, switching to a local semantic engine for normalization processing includes: Perform punctuation normalization and word segmentation on the query text; Call the pre-set medical colloquialisms synonym mapping table to map colloquial expressions to standard medical terms; The system calls a pre-defined regular expression rule library to identify complex symptom expression patterns and maps them to standard words in the graph vocabulary. The edit distance between the input word and the vocabulary candidates is calculated and the character overlap is scored. Based on the preset minimum threshold, candidate words from the vocabulary list whose scores reach the threshold are selected as standard search terms, and ambiguity prompts are output.

[0039] Specifically, if the large language model is unavailable, disabled, or returns results that cannot be parsed, the local semantic engine is invoked. The local semantic engine includes three types of rules: The first type is synonym mapping, for example, mapping "headache" to "headache", "diarrhea" to "diarrhea", and "fever", "high body temperature" to "fever"; the second type is regular expression pattern rules, for example, recognizing expressions containing "throat" and "pain / ache / dry / itch" and mapping them to pharyngitis or cough; the third type is fuzzy scoring rules, which score the input word and vocabulary candidates by word segmentation, Levenshtein edit distance, and character overlap. Candidates that reach the minimum threshold are adopted as standard search terms, and ambiguity prompts are output for front-end display.

[0040] Next, a keyword feature-based hierarchical retrieval process with multiple rounds of random sampling with replacement is executed. The specific sub-steps are as follows: Feature collection: Collect all standardized multidimensional features output by semantic parsing, construct a unified and complete feature queue, and each feature carries confidence, semantic weight, source identifier, and modality type label.

[0041] Multi-round sampling and co-cohort feature association analysis: Perform multiple rounds of random sampling with replacement on the feature cohort, with each round generating an independent feature subset; quantify and calculate the co-occurrence correlation degree, graph path connectivity, and semantic vector similarity for all features within the same subset to generate a feature association matrix; multi-round sampling iteration eliminates single sampling bias, converges and outputs globally stable high-correlation feature combinations, and removes isolated, low-correlation noise features.

[0042] Pre-trained feature matcher filters strongly correlated features: The converged highly correlated feature combination is input into the offline trained feature matcher, which traverses the drug and diagnostic entities in the graph database to complete the matching; the comprehensive correlation coefficient between the feature combination and the medical entity is calculated, and only strongly correlated feature groups with a comprehensive correlation coefficient higher than the preset critical coefficient are retained. Feature groups that do not meet the standard are directly blocked and do not enter the subsequent multi-path candidate recall.

[0043] Large Language Model Weak Association Feature Validation and Custom Mathematical Formula Threshold Determination: For the remaining set of weak association features that failed the strong association screening, the large language model is invoked to detect the weak association features in the knowledge graph for the drug or case, as well as the deep semantic matching degree with the search target; a weighted fusion formula is used to comprehensively calculate the comprehensive fit value of the weak association features, which integrates semantic similarity, graph indirect jump steps, population constraint fit score, and multimodal feature overlap multiple indicators for weighted calculation; only when the comprehensive fit value is higher than the preset output threshold can the drug candidate corresponding to the group of weak association features be included in the candidate pool, and weak association features that do not reach the threshold are directly discarded.

[0044] The system distinguishes between two types of effective features: a group of strongly associated features with multiple rounds of random sampling with replacement, and a group of weakly associated features that have been validated by a large model and meet mathematical criteria. The two types of features are then sent to the multi-path recall module.

[0045] Specifically, after completing semantic parsing to obtain standardized multidimensional case features, the system executes a keyword feature hierarchical retrieval process based on multi-round sampling association analysis. The specific sub-steps are as follows:

[0046] Feature collection: Collect all standardized multidimensional features output by semantic parsing, construct a unified and complete feature queue, and each feature carries confidence, semantic weight, source identifier, and modality type label.

[0047] Multi-round sampling and co-cohort feature association analysis: 20 rounds of random sampling with replacement are performed, with a sampling ratio of 70% in each round, and an independent feature subset is generated in each round; co-occurrence correlation, graph path connectivity, and semantic vector similarity are quantitatively calculated for all features in the same subset to generate a feature association matrix; multi-round sampling is iterated until convergence with variance < 0.02, and isolated and low-association noise features are removed.

[0048] The pre-trained feature matcher filters strongly correlated features: The converged highly correlated feature combination is input into the offline trained feature matcher, which traverses the drug and diagnostic entities in the graph database to complete the matching; the comprehensive correlation coefficient between the feature combination and the medical entity is calculated, and the preset critical coefficient is 0.5. Only strongly correlated feature groups with a preset critical coefficient are retained, and feature groups that do not meet the standard are directly blocked and do not enter the subsequent multi-path candidate recall.

[0049] Weak association feature verification and composite threshold determination for large language models: The overall fit value S is: S = W1 × Semantic similarity + W2 × Negative score of graph indirect jump count + W3 × Crowd constraint fit score + W4 × Multimodal feature overlap; Fixed weights: W1=0.4, W2=-0.05, W3=0.3, W4=0.25, preset output threshold is 0.65; For the remaining weakly related feature set that failed the strong correlation screening, a large language model is called to detect the deep semantic matching degree. The comprehensive fit value is calculated by substituting it into the above weighted fusion formula. Only drug candidates corresponding to weakly related features that are higher than the preset output threshold can be included in the candidate pool.

[0050] The system distinguishes between two types of effective features: a group of strongly correlated features output from the multi-round sampling association analysis results and a group of weakly correlated features that meet the criteria after formula verification. The two types of features are then sent to the multi-path candidate recall.

[0051] In some embodiments, implicit association candidates are mined through two parallel inference paths. The main inference path outputs high-confidence implicit candidates based on graph multi-hop evidence-based inference, while the auxiliary inference path outputs implicit candidates with indirect association labels based on large-model weak association causal inference. The results of the two inference paths are independent and stored separately, including: Feature Bagging Association Reasoning: Based on feature subsets generated by multiple rounds of sampling with replacement, an undirected feature association graph is constructed. Stable high-association feature clusters are selected by multi-round voting fusion, and distinguished into strong association features and discrete weak association features. The strong association features are assigned to the main reasoning path, and the discrete weak association features are assigned to the auxiliary association reasoning path. The feature clusters simultaneously include symptom features and population constraint features, and unconstrained isolated noise features are removed during the execution process. Multi-hop Evidence-Based Reasoning in the Graph: The main reasoning pathway performs clinical treatment path reasoning, pharmacological target multi-hop reasoning, and clinical syndrome reasoning in parallel for the strongly correlated features; the number of hops in the reasoning path is limited, and the higher the number of hops, the lower the evidence-based weight; a drug candidate set carrying path depth information and evidence-based level information is output as a high-credibility professional recommendation data source; Large-scale weak-association causal reasoning: The auxiliary associative reasoning pathway, for the discrete weak-association features, calls the large language model to output a complete three-segment causal reasoning chain: input entity derivation, implicit symptom causal derivation, and mapping graph standard diagnosis; it verifies whether the diagnostic entity corresponding to the reasoning chain exists in the medical retrieval vocabulary, and directly discards the entity if there is no matching entity; the reasoning results that pass the verification are uniformly marked with indirect association identifiers, which are used to reduce their ranking weight in subsequent ranking steps; The main reasoning path and the auxiliary associative reasoning path adopt a dual-path physical isolation reasoning mechanism, and the reasoning results of the two paths are stored separately. The main reasoning path does not call open-ended large language model association, and the auxiliary associative reasoning path executes three-level hierarchical logic in series: feature association reasoning, graph multi-hop evidence-based reasoning, and large model weak association causal reasoning. The reasoning results of the two paths are processed with differentiated weighting in subsequent processing.

[0052] Specifically, after completing the feature stratification and screening, the system employs a three-layer progressive reasoning paradigm to conduct multi-dimensional deduction of the feature groups, which consists of three layers: feature association reasoning, graph multi-hop evidence-based reasoning, and large model weak association causal reasoning. Simultaneously, a dual-pathway isolated reasoning architecture is adopted.

[0053] The first layer is feature-based Bagging association reasoning: an undirected feature association graph is constructed based on feature subsets generated by multiple rounds of sampling with replacement. Stable and highly associated feature clusters are selected through multi-round voting fusion to distinguish between strongly associated features and discrete weakly associated features. Strongly associated features directly enter the main reasoning path, while weakly associated features enter the auxiliary associative reasoning path. The reasoning process constrains feature clusters to simultaneously include symptom and population-constrained features, and unconstrained isolated noise features are removed during execution.

[0054] The second layer is graph-based multi-hop evidence-based reasoning (exclusive to the main reasoning pathway): it executes three types of rule-based reasoning in parallel for strongly correlated features, namely clinical treatment pathway reasoning, pharmacological target multi-hop reasoning, and clinical syndrome reasoning; the number of hops in the reasoning path is limited to 1-4 hops, with higher hop counts resulting in lower evidence-based weights, and outputs a drug candidate set carrying path depth and evidence-based level as a high-reliability professional recommendation data source.

[0055] Specifically, the second layer is graph multi-hop evidence-based reasoning (exclusive to the main reasoning pathway): It executes three types of rule-based reasoning in parallel for strongly correlated features: clinical treatment pathway reasoning, pharmacological target multi-hop reasoning, and clinical syndrome matching reasoning. Each type follows a standardized process of "feature entity binding → graph database multi-hop query → path weight assignment → candidate drug aggregation." The hop count of the reasoning path is defined as the total number of relational edges in the graph link. The system enforces a valid path range of 1 to 4 hops: only reasoning links with 1, 2, 3, or 4 relational edges are retained; any link with 5 or more relational edges is directly discarded and not included in the candidate drug set. A higher hop count indicates a lower degree of indirect correlation between the disease and the drug, resulting in decreased evidence-based reliability. A hop count decay formula is uniformly adopted. Calculate the single-path evidence-based score; where The evidence-based score after decay of a single reasoning path; To fix the base weights for the corresponding inference branches, the values ​​for clinical treatment pathway, pharmacological target pathway, and clinical syndrome pathway are 0.55, 0.30, and 0.15, respectively; hopCount represents the total number of relational edges within the graph path, taking only integers from 1 to 4; the constant 0.15 is the unit hop decay coefficient, representing that for each additional layer of relational edges, the score of the path is reduced by 15% of the baseline score; the larger the hop count, the lower the final evidence-based score, thus distinguishing between directly connected high-confidence drugs and indirectly selected alternative drugs.

[0056] The three inference branches are searched in parallel. After the search is completed, the output is merged and deduplicated to generate a drug candidate set carrying path hop count, evidence level, and source rule label, which serves as a high-credibility professional recommendation data source.

[0057] The standardization execution steps for each branch are as follows: Clinical treatment pathway reasoning (branch base weight 0.55):

[0058] The query starts by binding the standard diagnostic entity within the feature cluster and executes the map link Diagnosis-[TREATS]->TreatmentPlan-[USES_DRUG]->Drug; it traverses the first-line treatment plan with 1 hop, the standard medication pathway with 2 hops, and the alternative pathways for complications with 3-4 hops, and performs score reduction; it distinguishes Level 1 first-line, Level 2 second-line, and Level 3 alternative third-level evidence-based levels according to clinical guidelines, and outputs the drug, the number of hops in the pathway, and the source of the guideline.

[0059] Pharmacological target multi-hop inference (branch base weight 0.30): The query starts with diseases, targets, and pathological entities within the bound feature clusters, and executes the graph link: Disease-[TARGETS]->Gene / Protein-[BIND_WITH]->Drug; only 1-3 hop target association paths are retained, the indirect association score of 4 hop targets is significantly reduced, and 5 hops are directly filtered; the drug is classified into three levels of evidence-based status: Level A approved targeted drugs, Level B clinical investigation drugs, and Level C laboratory candidate drugs.

[0060] Clinical syndrome matching reasoning (branch base weight 0.15): The query starts from the disease and clinical syndrome entities within the bound feature cluster, and executes the graph link Diagnosis-[CORRESPOND_SYNDROME]->ClinicalSyndrome-[MATCH_DRUG]->Drug; only the 1st and 2nd hop direct syndrome matching paths are retained, the indirect syndrome association scores of the 3rd and 4th hops are reduced, and the links of 5 hops and above are directly discarded; distinguish between the two levels of evidence-based treatment: S1 standard symptomatic treatment plan and S2 auxiliary symptomatic treatment plan.

[0061] The three types of inference branches are retrieved synchronously and in parallel, and a unified hop count decay formula is used to calculate the evidence-based score of a single path. After the retrieval is completed, the candidates are merged by drug ID, and only the path with the highest evidence-based score is retained for the same drug. All candidates are uniformly bound to three types of metadata: inference branch, path hop count, and evidence-based level, which are used for subsequent hierarchical composite scoring and front-end attribution display.

[0062] The third layer is the large language model's weak association causal reasoning (exclusively for the auxiliary associative reasoning pathway): it is only activated for discrete weak association features, constraining the large model to output a complete three-segment causal reasoning chain: input entity → inferring the causal relationship of the hidden disease → mapping the standard diagnosis of the atlas; it verifies whether the diagnostic entity corresponding to the reasoning chain exists in the medical retrieval vocabulary, and directly discards the entity if there is no matching entity; all reasoning results are uniformly marked with indirect association identifiers to reduce the subsequent ranking weight.

[0063] The system adopts a dual-path physical isolation reasoning mechanism. The main reasoning path only performs feature Bagging association reasoning and graph multi-hop evidence-based reasoning, without calling open-ended large language model association, to ensure the rigor of clinical retrieval. The auxiliary association path connects three layers of complete reasoning for scenarios with no matching input and cross-domain entity retrieval. The results of the two reasoning paths are stored separately, and the subsequent scoring mechanism performs differentiated weighted processing.

[0064] In some embodiments, multi-path candidate recall is performed for each standard search term based on a graph database, including: Drug name exact match path: The standard search terms are precisely compared with the name field of the drug node in the graph database. If they match, the drug node is returned directly. Diagnostic association path matching path: Match the standard search terms with the names of diagnostic nodes in the graph database. If the match is successful, return the candidate drugs for treating the diagnosis through the association path from the drug node to the treatment plan node. Indications include matching paths: Search for candidate drugs that contain standard search terms in the indication field of the drug node in the graph database; Drug name contains matching path: Search for candidate drugs that contain standard search terms in the name field of drug nodes in the graph database; Full-field fuzzy matching path: Calculate fuzzy matching scores for the fields of drug name, indication, dosage description and associated diagnosis name, and retain candidate drugs whose scores reach the preset threshold.

[0065] Specifically, the system constructs a medical knowledge graph in the Neo4j graph database, with nodes including at least Drug, Diagnosis, Treatment Plan, and Surgery. The Drug node stores attributes such as drug name, indication, dosage, side effect, contraindication, drug interactions, and applicable population. The Treatment Plan node stores attributes such as plan name, dosage, applicable population, drug name, and diagnosis name. The Diagnosis node stores the name of the standard symptom or disease. The Surgery node stores the relevant names and descriptions of the surgery.

[0066] The attribution graph includes at least the following relationships: Drug (USES_DRUG) links to Treatment Plans; Treatment Plans (TREATS) links to Diagnosis; Surgery (SURGERY_FOR) links to Diagnosis; and postoperative medication relationships. The system can also extend to include disease associations such as similar symptoms (SIMILAR_SYMPTOM) and cross-symptoms (CROSS_SYMPTOM).

[0067] During candidate recall, the system sequentially executes the five paths mentioned above for standard search terms. This multi-path recall mechanism solves the problem that a single keyword channel cannot cover drug names, symptom names, indication descriptions, and compound inputs.

[0068] In some embodiments, dominant candidate drugs obtained from multi-path recall are merged and deduplicated, a base score is determined based on the candidate's ranking position in each recall path, an enhancement score is determined based on semantic source type and search term weight, and a comprehensive score is calculated based on the base score and the enhancement score, including: Construct a candidate drug mapping table using the drug node identifier or drug name hash value as the candidate key; For multiple candidates for the same drug appearing under different search terms or different recall paths, only the candidate with the highest matching score is retained; A base score is calculated based on the candidate's ranking position in the current search term results; the higher the ranking, the higher the base score. If the user input is parsed as standard words, then set the weight of the search terms; If the semantic source is a large language model, then set the semantic enhancement score for the large language model; if the semantic source is a local semantic engine, then set the semantic enhancement score for the local engine, where the semantic enhancement score for the large language model is higher than the semantic enhancement score for the local engine. The overall score is determined by the product of the base score and the weight of the search term, plus the semantic enhancement score of the large language model or the local semantic enhancement score.

[0069] S5. Candidate merging, deduplication, and dynamic scoring: Specifically, after obtaining explicit candidate drugs through multi-path recall, the system constructs a candidate drug mapping table, using the drug node ID as the primary key; if the drug node ID does not exist, the drug name hash value is used as the candidate key. For the same drug appearing under different search terms or different recall paths, the system only retains the candidate with the highest matching score.

[0070] In one example implementation, the system calculates a base score based on the candidate's ranking position in the current search term results, using the following formula: base = 100 - i × 4.5; Where i is the position number of the candidate in the current search term results (starting from 0), and 4.5 is the position decay coefficient, which is used to ensure that the candidates ranked higher receive significantly higher base scores (e.g., the base score is 100 when the first candidate i=0, and drops to about 59.5 when the 10th candidate i=9). The position decay coefficient can be adjusted according to the business scenario.

[0071] If the user input is parsed as standard words, then a term weight is set; if the semantic source is a large language model, then a higher large language model semantic enhancement score (semantic Boost_LLM) is set; if the semantic source is a local semantic engine, then a lower but stable local semantic enhancement score (semantic Boost_Local) is set. The value ranges are: term weight: 1.2~1.5; large language model semantic enhancement score (semantic Boost_LLM): 15~18; local semantic enhancement score (semantic Boost_Local): 6~9; number of outputs (Top N): N=7. The final score can be expressed as: score = base × term Weight + semantic Boost_LLM; score = base × term Weight + semantic Boost_ Local.

[0072] Candidate drugs obtained from multi-path recall are merged and deduplicated using drug node ID or drug name hash value as the unique key, retaining only the highest matching candidate for a single drug. A three-layer hierarchical composite scoring mechanism is used to calculate the global comprehensive score, distinguishing between two sets of calculation formulas for the main inference path and the auxiliary association path. Multi-dimensional quantitative indicators are introduced, including scenario dynamic weights, medical record matching corrections, safety constraint corrections, and weak association decay coefficients. Step 1: Calculate the basic feature association score in a hierarchical manner: ; Where P is the normalized baseline score for the recall path location. To determine the correlation and matching degree between the recalled medical records and the original baseline medical records, The feature association Bagging algorithm outputs feature association coefficients. Step 2: Differentiate pathways and calculate mid-level scores: If the primary reasoning pathway is a candidate, the graph-based evidence foundation is divided into graph multi-hop reasoning evidence score: ; in, For the mid-level score of the graph-based evidence-based approach, only the main inference path candidate is enabled. The evidence-based score for multi-hop reasoning in the atlas, calculated using the aforementioned hop count decay formula, represents the credibility of the atlas's clinical links. The graph semantic dynamic weights are adaptively assigned based on the scenario, representing the percentage of scores for the graph's evidence-based dimensions. Dynamic weights are assigned to string literal matching, with adaptive allocation based on the scenario, representing the score percentage for drug or diagnostic literal matching dimensions; If it is a weakly associated LLM auxiliary pathway candidate, the weak association correction is divided into the comprehensive fit value output by the large language model: ; in, For weak association mid-level scores, only auxiliary pathway implicit association candidates are enabled. The overall matching score of weakly correlated features output by the third-layer causal inference is set as a comprehensive adaptation value for the large language model. The permanent penalty decay coefficient for weak associations. The dynamic weighting for cross-domain association is adaptively allocated based on the scenario, representing the scoring proportion of the LLM cross-domain inference dimension. , and The sum of the three is 1; Step 3: Subtract the safety constraint correction score to obtain the final total score: Total score of strongly correlated candidates: ; Total score of weakly associated candidates: ; Among them, Safe is the safety constraint correction score. It is negative when there are drug incompatibilities or liver and kidney contraindications during pregnancy, and positive when it is appropriate for first-line drugs in guidelines or for matching user populations. When Safe is lower than the critical negative threshold, the candidate drug is directly eliminated regardless of the total score.

[0073] The system automatically assigns tasks based on the user's search scenario. , , Dynamic weighting enhances the semantic weight of the atlas in clinical practice scenarios; only when weakly associated features... Only results exceeding the preset output threshold can be included in the ranking output; all candidates are displayed in descending order of their total score, with strong correlation graph matching results uniformly arranged in front of weak correlation association results, and each recommendation result is accompanied by a detailed breakdown of the hierarchical score, fully displaying the values ​​of feature association score, graph inference score, LLM adaptation score, and security correction score, thus achieving full-link interpretability of the matching logic.

[0074] The innovation of this embodiment lies in unifying semantic source, graph recall path, and candidate ranking position into the same scoring framework, thereby solving the problems of multi-channel result conflict and ranking instability.

[0075] In some embodiments, when the candidate recall results corresponding to the standard search term are empty, a fuzzy fallback recall is performed on the original query text, and the basic score of the candidate term is lower than that of the standard term to participate in the comprehensive score ranking. A preset number of recommended drugs are output in descending order of the comprehensive score, and the corresponding matching reason is returned. The matching reason includes at least the original input of large language model semantic mapping, local semantic normalization, graph association matching or fuzzy matching.

[0076] Vague fallback recall: Specifically, when no valid candidate drugs are found for all standard search terms in the multi-path recall, the system automatically triggers a fuzzy fallback recall mechanism. The system performs full-field fuzzy matching on the original query text in fields such as drug name, indication, dosage instructions, and associated diagnostic names, and participates in the subsequent comprehensive scoring and ranking with a lower initial base score. The final results output a preset number of recommended drugs (e.g., N=5) in descending order of comprehensive score, and annotates the corresponding matching reason for each recommendation result, so that users can clearly understand the source basis of the recommendation result.

[0077] In some embodiments, performing a similarity analysis includes: Standard search terms at the surface level: Standardized disease, drug, and surgical entity terms that exist in the medical atlas after being parsed by the LLM / local engine and filtered by the atlas vocabulary whitelist; Standardized multidimensional case features: all symptoms, population, medication, and dimensional features output by semantic parsing, each carrying confidence level, semantic weight, and source identifier; Strongly correlated feature group: After multiple rounds of random sampling with replacement convergence, the feature set with a comprehensive correlation coefficient ≥ 0.5 is sent only to the main pathway of the map; Weakly correlated feature group: The feature set with a comprehensive correlation coefficient < 0.5, which is sent to the LLM auxiliary pathway after passing the composite formula verification; Implicit association candidates: drugs or symptoms not directly recalled through five standard terms; Overall fit value: The composite calculation result for determining the effectiveness of weakly correlated features, with a preset threshold of 0.65; Evidence-based weighting: The credibility score of graph multi-hop inference is reduced by 4 points for each additional hop.

[0078] In some embodiments, performing similarity analysis includes: The semantic parsing module is called to parse the query text into the main diagnosis name. If it cannot be parsed, the original query text is used as the main diagnosis. Retrieve diseases from the graph database that have direct similarity or overlap in symptoms with the primary diagnosis, and use them as the first category of candidate diseases; By identifying shared medication pathways from the primary diagnosis through treatment plans and drugs to other diagnoses, diseases sharing drugs with the primary diagnosis are identified as second-category candidate diseases. Multi-round sampling association analysis and dual-pathway inference are performed on standardized multidimensional case features to validate latent diseases that meet the criteria, identifying them as third-category supplementary candidates. When there are insufficient direct relationships in the graph database, candidate symptoms are supplemented by fuzzy matching of diagnostic names as a third category of candidate symptoms. The relevance score for each candidate disease is calculated based on the relationship type, the number of shared drugs, and the name similarity. Based on the threshold range of the relevance score, candidate diseases are classified into high-risk, medium-risk, or low-risk levels, and corresponding association reasoning is output for each risk level, including direct matching of the association graph, matching of shared medications, implicit inference matching, and screening suggestions. The association reasoning includes an explanation of implicit feature inference matching.

[0079] S6. Similarity Disease Analysis and Risk Stratification: Specifically, this is performed through the similar disease analysis module. When a user requests similar disease analysis, the system first calls the semantic parsing module to obtain the primary diagnosis name. If parsing fails, the system uses the original input as the primary diagnosis to attempt a graph search.

[0080] The system constructs candidate disease sets in the following ways: First, it obtains similar diseases through direct relationships such as similar symptoms (SIMILAR_SYMPTOM) or cross symptoms (CROSS_SYMPTOM); Second, it finds other diagnoses that share drugs with the main diagnosis through the shared medication path of "main diagnosis - treatment plan - drug - treatment plan - other diagnoses", as well as latent diseases discovered through reasoning; Third, when there are insufficient direct relationships in the graph, it supplements candidates through fuzzy matching of diagnosis names.

[0081] After obtaining candidate symptoms, the system calculates a relatedness score based on relationship type, number of shared drugs, and name similarity. If a large language model is available, the main diagnosis and candidate symptom list can be input into the large language model, requiring it to output a strict JSON array with fields including diagnosis name, relatedness score, risk level, reason, and screening advice. If the large language model is unavailable, local risk rules are used; for example, a high-risk condition is defined as a relatedness score reaching a high threshold or a large number of shared drugs, a medium-risk condition is defined as a medium-risk condition, and all others are defined as low-risk.

[0082] S7. Recommendations for tiered medication use: Specifically, this is done through the tiered recommendation module. Tiered medication recommendations are generated based on user roles and membership subscription status, including: The system categorizes recommendations into general advice and expert advice. General advice includes common medication reminders, explanations of indications, basic safety tips, and relevant examples; expert advice includes more in-depth disease analysis, surgical-related atlas content, risk screening tips, and value-added expert interpretations.

[0083] When a user requests suggested content, the backend reads the user's identity from the JWT and queries the member's subscription status in the relational database. If the user is not logged in or the subscription has expired, the expert suggestion returns to a locked state; if the user's subscription is valid, the full text of the expert suggestion is returned. The subscription module provides updates for monthly, yearly, new user discounts, automatic renewal, order status, and expiration time. The suggested content is not simply hidden on the frontend, but access is controlled on the backend based on user identity and subscription status.

[0084] The technical features of this embodiment can be replaced by the following alternatives: the graph database can be Neo4j, or JanusGraph, NebulaGraph, ArangoDB, or other databases that support attribute graph queries; the graph query language can be Cypher, Gremlin, or equivalent query statements. Local semantic parsing can use thesaurus, regular rules, n-gram segmentation, edit distance, Jaccard similarity, BM25, vector retrieval, or any combination thereof; the large language model interface can be replaced by any model with structured output capabilities. The relational database can be replaced by MySQL, PostgreSQL, SQLite, DM database, etc.; JPA can be replaced by MyBatis, JDBC, or other ORM / data access frameworks. The front-end graph display library can be replaced by ECharts Graph, D3.js, Cytoscape.js, etc., which still belongs to the implementation of converting back-end node / edge data into interactive graphs and triggering recommendation linkage. Member permissions can be expanded to multi-level expert permissions, doctor review permissions, institutional account permissions, or temporary authorization codes, which are essentially access controls for different levels of suggested content based on user status.

[0085] Please see Figure 4 Based on the same inventive concept, this invention also provides a graph semantic enhancement intelligent drug recommendation system, comprising: The acquisition module is used to acquire the query text input by the user; The vocabulary building module queries the names of medical entity nodes from the graph database to build a medical retrieval vocabulary to constrain the range of semantic parsing output. The semantic parsing module adopts a cascaded semantic parsing architecture with strong constraints from the medical retrieval vocabulary. This includes first calling a large language model to perform semantic parsing on the query text, comparing the parsing results with the medical retrieval vocabulary one by one, and retaining the medical entities that exist in the medical retrieval vocabulary; if the parsed content is empty or there are no medical entities matching the medical retrieval vocabulary in the parsing results, the module switches to the local semantic engine, performs text normalization processing on the query text, maps it to standard search terms in the medical retrieval vocabulary, and simultaneously outputs standardized multidimensional case features. The multi-path recall module and the dual-path inference module are used to perform multi-path candidate recall based on standard search terms in the graph database to obtain explicit drug candidates. At the same time, multi-round sampling association analysis is performed on standardized multidimensional case features to screen for strong and weak association features. Implicit association candidates are mined through two parallel inference pathways. The main inference pathway outputs high-confidence implicit candidates based on graph multi-hop evidence-based inference, while the auxiliary inference pathway outputs implicit candidates with indirect association labels based on large-model weak association causal inference. The results of the two inference paths are independent of each other and stored separately. The recommendation results output module merges and removes duplicates from explicit drug candidates and implicit association candidates. It calculates the comprehensive score of each candidate according to the preset multi-factor weighted scoring rules, retains the candidate with the highest comprehensive score for the same drug, and outputs the recommendation results and matching basis in descending order of comprehensive score.

[0086] In some embodiments, the system also includes a hierarchical suggestion module and a similar disease analysis module. For the specific execution steps of each module, please refer to the previous description, which will not be repeated here.

[0087] Based on the same inventive concept, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the intelligent drug recommendation method with enhanced graph semantics as described above.

[0088] The program product of the present invention for implementing the above-described method may employ a portable compact disk read-only memory and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In the present invention, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0089] It should be noted that a computer-readable storage medium may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable storage medium may also be any readable medium other than a readable storage medium, capable of transmitting, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0090] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-described technical content to create equivalent embodiments without departing from the scope of the present invention. The implementation schemes in the above embodiments can also be further combined or replaced. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A graph-based semantic enhancement method for intelligent drug recommendation, characterized in that, Includes the following steps: S1. Obtain the query text input by the user; S2. Query the names of medical entity nodes from the graph database and construct a medical retrieval vocabulary to constrain the range of semantic parsing output; S3. A cascaded semantic parsing architecture with strong constraints based on a medical retrieval vocabulary is adopted. This includes first calling a large language model to perform semantic parsing on the query text, comparing the parsing results with the medical retrieval vocabulary one by one, and retaining the medical entities that exist in the medical retrieval vocabulary. If the parsing content is empty or there are no medical entities matching the medical retrieval vocabulary in the parsing results, the local semantic engine is switched to perform text normalization processing on the query text and then map it to standard search terms in the medical retrieval vocabulary, and simultaneously outputs standardized multidimensional case features. S4. Based on standard search terms, perform multi-path candidate recall in the graph database to obtain explicit drug candidates; at the same time, perform multi-round sampling association analysis on standardized multidimensional case features to screen strong and weak association features, and mine implicit association candidates through two parallel inference pathways. The main inference pathway outputs high-confidence implicit candidates based on graph multi-hop evidence-based inference, while the auxiliary inference pathway outputs implicit candidates with indirect association labels based on large model weak association causal inference. The results of the two inference paths are independent and stored separately. S5. Merge and remove duplicates of explicit drug candidates and implicit association candidates. Calculate the comprehensive score of each candidate according to the preset multi-factor weighted scoring rules. Retain the candidate with the highest comprehensive score among the same drugs and output the recommendation results and matching basis in descending order of comprehensive score.

2. The method according to claim 1, characterized in that, First, the large language model is called to parse the query text. The parsing results are then compared one by one with the medical retrieval vocabulary, and medical entities existing in the medical retrieval vocabulary are retained, including: Send system prompts, query text, and medical retrieval vocabulary samples to the dialogue interface of the large language model, and constrain the large language model to output structured data without markers. The structured data includes at least a query intent field, a normalized query text field, a list of standard search terms mapped to the medical retrieval vocabulary field, a list of ambiguities, and a confidence level field. Analyze the structured data returned by the large language model and extract a list of standard search terms; The standard search term list is compared and filtered with the medical search term list, and only the standard terms that exist in the medical search term list are retained; The filtered standard words are encapsulated into semantic query results carrying the source identifier of the large language model.

3. The method according to claim 2, characterized in that, Switching to the local semantic engine, the query text is normalized and mapped to standard search terms within the medical retrieval terminology, including: The query text is processed by punctuation normalization and word segmentation; Call the pre-set medical colloquialisms synonym mapping table to map colloquial expressions to standard medical terms; The system calls a pre-defined regular expression rule base to identify complex symptom expression patterns and maps them to standard words in the medical retrieval vocabulary. The edit distance between the input word and the vocabulary candidates is calculated and the character overlap is scored. Based on the preset minimum threshold, candidate words that have reached the threshold in the vocabulary list are selected as standard search terms, and ambiguity prompts are output.

4. The method according to claim 2, characterized in that, Multi-path candidate recall is performed in the graph database based on standard search terms to obtain dominant drug candidates, including: Drug name exact match path: The standard search terms are precisely compared with the name field of the drug node in the graph database. If they match, the drug node is returned directly. Diagnostic association path matching path: Match the standard search terms with the names of diagnostic nodes in the graph database. If the match is successful, return the candidate drugs for treating the diagnosis through the association path from the drug node to the treatment plan node. Indications include matching paths: Search for candidate drugs containing the standard search terms in the indication field of the drug node in the graph database; Drug name contains matching path: Search for candidate drugs that contain the standard search terms in the name field of the drug node in the graph database; Full-field fuzzy matching path: Calculate fuzzy matching scores for the fields of drug name, indication, dosage description and associated diagnosis name, and retain candidate drugs whose scores reach the preset threshold.

5. The method according to claim 1, characterized in that, Perform multi-round sampling association analysis on standardized multidimensional case features to screen for strongly and weakly associated features, including: The standardized multidimensional features output by semantic parsing are collected and a feature queue is constructed. Each feature in the feature queue carries a confidence score, semantic weight, source identifier, and modality type label. Multiple rounds of random sampling with replacement are performed on the feature queue, and each round generates an independent feature subset. For all features within the same feature subset, the co-occurrence correlation, graph path connectivity, and semantic vector similarity between any two features are calculated to generate a feature correlation matrix. Multiple rounds of sampling are iteratively performed until convergence, outputting a globally stable combination of highly correlated features, and removing isolated and low-correlation noise features. The highly correlated feature combination is input into a pre-trained feature matcher and matched with target entities in the knowledge base. The comprehensive correlation coefficient between the feature group and each target entity is calculated. Feature groups with a comprehensive correlation coefficient higher than a preset threshold coefficient are marked as strongly correlated feature groups and output. Feature groups with a comprehensive correlation coefficient lower than the preset threshold coefficient are marked as undetermined feature groups. For the undetermined feature groups, a probabilistic generation model is invoked to calculate the weak association confidence and semantic matching degree between each undetermined feature and the target object; a comprehensive fit value for each undetermined feature group is calculated based on a weighted fusion formula, wherein the input parameters of the weighted fusion formula include at least semantic similarity, knowledge graph association hop count, object attribute constraint matching degree, and multimodal feature overlap; undetermined feature groups with comprehensive fit values ​​higher than a preset output threshold are marked as weakly associated feature groups and included in the candidate pool, while undetermined feature groups with comprehensive fit values ​​lower than the preset output threshold are directly discarded; The strongly correlated feature group and the weakly correlated feature group are output as two types of effective features and sent to dual-path inference respectively.

6. The method according to claim 5, characterized in that, Implicit association candidates are mined through two parallel reasoning pathways. The main reasoning pathway outputs high-confidence implicit candidates based on graph multi-hop evidence-based reasoning, while the auxiliary reasoning pathway outputs implicit candidates with indirect association labels based on large model weak association causal reasoning. The results of the two inference paths are independent and stored separately, including: Feature Bagging Association Reasoning: Based on feature subsets generated by multiple rounds of sampling with replacement, an undirected feature association graph is constructed. Stable high-association feature clusters are selected by multi-round voting fusion, and distinguished into strong association features and discrete weak association features. The strong association features are assigned to the main reasoning path, and the discrete weak association features are assigned to the auxiliary association reasoning path. The feature clusters simultaneously include symptom features and population constraint features, and unconstrained isolated noise features are removed during the execution process. Multi-hop Evidence-Based Reasoning in the Graph: The main reasoning pathway performs clinical treatment path reasoning, pharmacological target multi-hop reasoning, and clinical syndrome reasoning in parallel for the strongly correlated features; the number of hops in the reasoning path is limited, and the higher the number of hops, the lower the evidence-based weight; a drug candidate set carrying path depth information and evidence-based level information is output as a high-credibility professional recommendation data source; Large-scale weak-association causal reasoning: The auxiliary associative reasoning pathway, for the discrete weak-association features, calls the large language model to output a complete three-segment causal reasoning chain: input entity derivation, implicit symptom causal derivation, and mapping graph standard diagnosis; it verifies whether the diagnostic entity corresponding to the reasoning chain exists in the medical retrieval vocabulary, and directly discards the entity if there is no matching entity; the reasoning results that pass the verification are uniformly marked with indirect association identifiers, which are used to reduce their ranking weight in subsequent ranking steps; The main reasoning path and the auxiliary associative reasoning path adopt a dual-path physical isolation reasoning mechanism, and the reasoning results of the two paths are stored separately. The main reasoning path does not call open large language model association, and the auxiliary associative reasoning path executes three-level hierarchical logic in series: feature Bagging association reasoning, graph multi-hop evidence-based reasoning, and large model weak association causal reasoning. The reasoning results of the two paths are processed with differentiated weighting in subsequent processing.

7. The method according to claim 4, characterized in that, The explicit drug candidates and implicit association candidates are merged and deduplicated. A comprehensive score for each candidate is calculated according to a pre-defined multi-factor weighted scoring rule. The candidate with the highest comprehensive score for the same drug is retained. Recommendations and matching criteria are output in descending order of comprehensive score, including: Construct a candidate drug mapping table using the drug node identifier or drug name hash value as the candidate key; For multiple candidates for the same drug appearing under different search terms or different recall paths, only the candidate with the highest matching score is retained; A base score is calculated based on the candidate's ranking position in the current search term results; the higher the ranking, the higher the base score. If the user input is parsed as standard words, then set the weight of the search terms; If the semantic source is a large language model, then set the large language model semantic enhancement score; If the semantic source is a local semantic engine, then a local semantic enhancement score is set, where the semantic enhancement score of the large language model is higher than the local semantic enhancement score; Multiple rounds of sampling association analysis were performed on the standardized multidimensional case features output by semantic parsing to distinguish between strongly associated feature groups and weakly associated feature groups. Implicitly associated drug candidates were then mined through the main reasoning pathway and the auxiliary associative reasoning pathway, respectively. Perform large model feature matching verification on the candidate drugs obtained by implicit inference, and retain only implicit candidates with a comprehensive fit value higher than the preset parameter threshold; The overall score is determined by the product of the base score and the weight of the search term, plus the enhancement score.

8. A graph-based semantic enhancement intelligent drug recommendation system, characterized in that, include: The acquisition module is used to acquire the query text input by the user; The vocabulary building module queries the names of medical entity nodes from the graph database to build a medical retrieval vocabulary to constrain the range of semantic parsing output. The semantic parsing module adopts a cascaded semantic parsing architecture with strong constraints from the medical retrieval vocabulary. This includes first calling a large language model to perform semantic parsing on the query text, comparing the parsing results with the medical retrieval vocabulary one by one, and retaining the medical entities that exist in the medical retrieval vocabulary; if the parsed content is empty or there are no medical entities matching the medical retrieval vocabulary in the parsing results, the module switches to the local semantic engine, performs text normalization processing on the query text, maps it to standard search terms in the medical retrieval vocabulary, and simultaneously outputs standardized multidimensional case features. The multi-path recall module and the dual-path inference module are used to perform multi-path candidate recall based on standard search terms in the graph database to obtain explicit drug candidates. At the same time, multi-round sampling association analysis is performed on standardized multidimensional case features to screen strong and weak association features. Implicit association candidates are mined through two parallel inference pathways. The main inference pathway outputs high-confidence implicit candidates based on graph multi-hop evidence-based inference, while the auxiliary inference pathway outputs implicit candidates with indirect association labels based on large-model weak association causal inference. The results of the two inference paths are independent and stored separately. The recommendation results output module merges and removes duplicates from explicit drug candidates and implicit association candidates. It calculates the comprehensive score of each candidate according to the preset multi-factor weighted scoring rules, retains the candidate with the highest comprehensive score for the same drug, and outputs the recommendation results and matching basis in descending order of comprehensive score.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it is used to implement the intelligent drug recommendation method with graph semantic enhancement as described in any one of claims 1 to 7.