Method for processing electronic drug instructions based on knowledge graph and its management system
Through the method based on the knowledge graph, data cleaning, standardization and structure processing of electronic drug instructions, combined with NLP for semantic understanding, and building a knowledge graph, it solves the problem that existing systems cannot perform semantic analysis and knowledge correlation, realizes intelligent query and recommendation of drug information, and improves the efficiency and convenience of information services.
Patent Information
- Application Number
- CN202510462320.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-04-14
AI Technical Summary
The existing electronic drug manual system cannot effectively perform semantic analysis and knowledge correlation, resulting in low accuracy of information query and inability to achieve intelligent content generation.
The knowledge graph-based method is adopted to carry out semantic understanding and keyword extraction through data cleaning, standardization and structured processing, combined with natural language processing (NLP), build a knowledge graph, and carry out authoritative weighting and trustworthiness factor processing of multi-source data, supporting voice interaction and QR code scanning access.
It improves the accuracy and consistency of drug information, realizes intelligent correlation and recommendation of drug information, and improves user query efficiency and convenience of information acquisition.
Smart Images

Figure CN119993373B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of information technology, and particularly relates to a method for processing electronic drug instructions based on a knowledge graph and its management system. Background Art
[0002] With the rapid development of information technology, electronic drug instructions have gradually replaced traditional paper instructions and become an important part of the pharmaceutical industry. Electronic drug instructions can not only improve the efficiency of information dissemination, but also achieve personalized recommendations and automatic parsing through intelligent processing. In recent years, the progress of natural language processing (NLP), knowledge graphs, and artificial intelligence technologies has made it possible to intelligently process drug instructions. Through data extraction, structured processing, semantic understanding, and knowledge association, electronic drug instructions can provide more accurate information services for the medical industry and improve the safety and convenience of patients' medication. Currently, the existing electronic drug instructions on the market mainly rely on OCR technology for text recognition, combined with database storage and retrieval technologies, to achieve information query and display. Most of these systems have basic data extraction and display functions, and some high-end systems introduce natural language processing technology to improve the accuracy of user queries. However, the existing technologies mainly focus on traditional text storage and retrieval and cannot effectively perform semantic parsing, knowledge association, and intelligent content generation.
[0003] In order to solve the deficiencies of the existing technologies, people have conducted long-term explorations and proposed various solutions. For example, a Chinese patent document discloses a method for constructing a knowledge graph of rational drug use based on drug instructions [201910593831.7], which includes the following steps: S10, extracting drug instructions, and summarizing the entities and relationships therein through the expert annotation method to form an entity and relationship indexing rule library; S20, training a machine learning model based on the expert-annotated data and machine learning rules through a semi-supervised learning method; S30, using the trained machine learning model to predict and annotate the unannotated drug instructions to form a knowledge graph of drug relationships.
[0004] The above solution solves the problem of drug instruction digitization to a certain extent, but there are still many deficiencies in this solution, such as the problem of inability to perform semantic parsing. Summary of the Invention
[0005] The object of the present invention is to provide a method for processing electronic drug instructions based on a knowledge graph with reasonable design and capable of realizing semantic parsing of drug instructions for the above problems.
[0006] Another object of the present invention is to provide a management system for electronic drug instructions based on a knowledge graph capable of realizing knowledge association for the above problems.
[0007] To achieve the above object, the present invention adopts the following technical solutions: An electronic drug instruction manual processing method based on a knowledge graph, comprising the following steps:
[0008] S1: Data extraction and data cleaning. The user submits drug instruction manual data, and the system extracts the text content of the drug instruction manual and preprocesses and cleans the data;
[0009] S2: Standardize and structure the data, perform intelligent association on the data, use natural language processing (NLP) for semantic understanding and keyword extraction, and construct a knowledge graph;
[0010] S3: Store the data in a database and establish a back-end service.
[0011] In the above-mentioned electronic drug instruction manual processing method based on a knowledge graph, the step S1 includes the following steps:
[0012] S11: The user submits a drug instruction manual for format conversion;
[0013] S12: Perform data cleaning and noise reduction;
[0014] S13: Perform separation processing according to the text part of speech;
[0015] S14: Filter out meaningless text;
[0016] S15: Perform feature engineering and topic word extraction;
[0017] S16: Set a text retrieval strategy.
[0018] In the above-mentioned electronic drug instruction manual processing method based on a knowledge graph, the step S2 includes the following steps:
[0019] S21: Perform data integration, clean unstructured data, perform SQL mode mapping and parse JSON / XML semi-structured data;
[0020] S22: Perform data standardization, unify naming and establish a synonym library, discretize the data and perform clustering analysis using the k-means algorithm to obtain a classified data set;
[0021] S23: Set association rules and confidence thresholds, and perform data association using the Apriori algorithm;
[0022] S24: Perform in-depth NLP semantic processing, use an RNN model to perform semantic understanding on the drug instruction manual and capture core semantic units;
[0023] S25: Construct a knowledge graph and perform visualization processing.
[0024] In the above method for processing electronic drug instructions based on a knowledge graph, step S25 includes the following steps:
[0025] S251: Perform document triage, imitate the dynamic routing mechanism of the MoE architecture, construct an expert module selector, synthesize drug instructions according to templates, and use GAN to generate complex cases;
[0026] S252: Perform knowledge extraction, capture structured information, use lightweight BiLSTM-CRF to identify complex entities, and route low-confidence results dynamically for manual review according to the extraction relationship path;
[0027] S253: Align multi-source data and implement automatic decision-making based on authority weighting;
[0028] S254: Imitate the on-demand activation strategy of the MoE architecture to perform user profile analysis and assemble knowledge units.
[0029] In the above method for processing electronic drug instructions based on a knowledge graph, step S252 includes the following steps:
[0030] S2521: Input the text into the BiLSTM model to obtain vectors corresponding to the fusion context semantics of each unit word , and this vector is divided into a word vector , a position vector and a segment vector as follows:
[0031] ;
[0032] S2521: Extract information features from the vector , input the result of the BiLSTM model into the CRF model for annotation, as follows:
[0033] ;
[0034] ;
[0035] Among them, is the normalization factor, refers to the drug instruction text sequence variable, is the entity annotation variable, is the conditional probability distribution of the output sequence under the condition of a given , is the state feature function and the entity category is associated with the drug instruction text, It is a local feature function and the entity category is associated with external features.
[0036] In the above method for processing electronic drug instructions based on a knowledge graph, in step S253, the multi-source data includes drug administration data, pharmaceutical company data, and literature data. The regulatory level priority is that drug administration data is greater than pharmaceutical company data, and pharmaceutical company data is greater than literature data. The authority weighted automatic decision-making used is as follows:
[0037] ;
[0038] Among them, is the number of data sources, is data sources, is the discrete value of data source , is the authority value weight of data source and 0 ≤ ≤ 1, is the amplification factor.
[0039] In the above method for processing electronic drug instructions based on a knowledge graph, in steps S251 and S254, a credibility factor is used to handle the uncertainty of entity relationships. The generation of the credibility factor is as follows:
[0040] ;
[0041] Among them, is the upper entity of the entity relationship, is the lower entity of the entity relationship, is the credibility factor of the entity relationship. The calculation of the entity relationship credibility is as follows:
[0042] ;
[0043] Among them, is the uncertain entity relationship, is the credibility factor of this entity relationship.
[0044] In the above method for processing electronic drug instructions based on a knowledge graph, after the knowledge graph is constructed in step S2, redundant nodes are merged and invalid information is deleted.
[0045] In the above method for processing electronic drug instructions based on a knowledge graph, step S3 includes the following steps:
[0046] S31: Convert the content of the drug instruction into speech and perform segmented optimization;
[0047] S32: Call the WeChat mini-program port to generate a WeChat mini-program code.
[0048] An electronic drug instruction management system based on a knowledge graph adopts the above-mentioned electronic drug instruction processing method based on a knowledge graph.
[0049] Compared with the existing technologies, the advantages of the present invention are as follows: By means of multi-level data cleaning and standardization, the accuracy and consistency of drug instruction data are improved; semantic analysis and knowledge graph technologies are introduced to realize intelligent association and recommendation of drug information, thereby improving the user query efficiency; QR code scanning access, voice broadcast and voice interaction are supported to make information acquisition more convenient; through structured storage and intelligent retrieval, the reusability of drug instruction data is improved, providing a more efficient information service for the medical industry. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 is the flowchart of the drug instruction processing of the present invention;
[0051] Figure 2 is the data processing flowchart of the present invention;
[0052] Figure 3 is the knowledge graph construction flowchart of the present invention;
[0053] Figure 4 is the schematic diagram of the management system of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0054] The present invention will be further described in detail below with reference to the drawings and specific embodiments.
[0055] As Figures 1-4 shown, an electronic drug instruction processing method based on a knowledge graph includes the following steps:
[0056] S1: Data extraction and data cleaning. The user submits drug instruction data, and the system extracts the text content of the drug instruction and preprocesses and cleans the data; the drug instruction is the core data source. After obtaining the drug instruction text by crawling medical websites, entity recognition and relationship extraction need to be performed. For example, entities include drug names, ingredients, indications, contraindications, etc., and relationships cover drug interactions, dosage limitations, etc. During the construction process, the expert annotation method is usually combined with semi-supervised learning to form a rule base and train a machine learning model, and finally it is structured and stored in the database;
[0057] S2: Standardize and structure the data, perform intelligent association on the data, use natural language processing NLP for semantic understanding and keyword extraction to construct a knowledge graph; use a deep learning model to extract entities and relationships from unstructured text, improving the data annotation accuracy;
[0058] S3: Store the data in the database, establish a back-end service, and users can enable the back-end service and obtain the electronic medicine instructions by scanning the code.
[0059] Specifically, step S1 includes the following steps:
[0060] S11: Users scan the existing document, submit the medicine instructions, judge the document type and perform format conversion;
[0061] S12: Perform data cleaning and denoising, and focus on cleaning traditional Chinese medicine data;
[0062] S13: Perform separation processing according to text part-of-speech, and use NLTK / Spacy for part-of-speech tagging;
[0063] S14: Filter out meaningless text, and remove stop words and low-frequency words;
[0064] S15: Use the TF-IDF algorithm for feature engineering and topic word extraction;
[0065] S16: Set the text retrieval strategy.
[0066] In-depth, step S2 includes the following steps:
[0067] S21: Perform data integration, clean unstructured data, perform SQL mode mapping and parse JSON / XML semi-structured data;
[0068] S22: Perform data standardization, unify naming and establish a thesaurus. For example, map paracetamol to acetaminophen. Using semi-supervised annotation can effectively reduce the amount of manual annotation. Discretize the data and use the k-means algorithm for clustering analysis to obtain the classified data set;
[0069] S23: Set association rules and confidence thresholds, and use the Apriori algorithm for data association;
[0070] S24: Perform in-depth NLP semantic processing, use the RNN model to perform semantic understanding of the medicine instructions and capture the core semantic units, input the medicine instruction text and output the core semantic units;
[0071] S25: Construct a knowledge graph and perform visualization processing.
[0072] Furthermore, step S25 includes the following steps:
[0073] S251: Perform document triage, imitate the dynamic routing mechanism of the MoE architecture, construct an expert module selector, synthesize the medicine instructions according to the template, use GAN to generate complex cases, simulate rare side effect descriptions, and expand the training data;
[0074] S252: Perform knowledge extraction to capture structured information, use lightweight BiLSTM-CRF to identify complex entities, dynamically route low-confidence results for manual review, and extract entity relationships based on the dynamically routed extraction path; the extracted entities include drug names, dosages, etc.
[0075] S253: Perform multi-source data alignment and achieve automatic decision-making based on authority weighting.
[0076] S254: Conduct user profile analysis by imitating the on-demand activation strategy of the MoE architecture, assemble knowledge units, and adapt to different scenario requirements using deep semantic understanding.
[0077] Furthermore, in step S252, the rule layer captures structured information such as dosages and frequencies, the model layer uses lightweight BiLSTM-CRF to identify complex entities such as contraindications and interactions, and finally the verification layer submits low-confidence results for manual review. It specifically includes the following steps:
[0078] S2521: Input the text into the BiLSTM model for processing to obtain vectors corresponding to the fused context semantics of each unit word , and this vector is divided into word vectors , position vectors and segment vectors as follows:
[0079] ;
[0080] S2521: Extract information features from the vector , input the results of the BiLSTM model into the CRF model for annotation, as follows:
[0081] ;
[0082] ;
[0083] Among them, is the normalization factor, refers to the text sequence variable of the drug instruction, is the entity annotation variable, is the conditional probability distribution of the output sequence under the given , is the state feature function and the entity category is associated with the drug instruction text, is the local feature function and the entity category is associated with external features.
[0084] In addition, the multi-source data in step S253 includes drug administration data, pharmaceutical company data, and literature data. The regulatory level priority is that drug administration data is greater than pharmaceutical company data, and pharmaceutical company data is greater than literature data. The authoritative weighted automatic decision-making used is as follows:
[0085] ;
[0086] Among them, is the number of data sources, is data sources, is the discrete value of the data source , is the authoritative value weight of the data source and 0 ≤ ≤ 1, is the amplification factor. By introducing multiple data sources and taking into account their authority, the mapping of traditional Chinese and Western medicine knowledge can be achieved, which is suitable for the pharmaceutical field scenarios that need to balance compliance requirements and knowledge diversity. In actual applications, the K value and the weight allocation strategy need to be adjusted according to the characteristics of the data source, and the decision-making quality can be optimized by supplementing rules (such as timeliness, randomization).
[0087] At the same time, step S251 and step S254 use credibility factors to handle the uncertainty of entity relationships. The generation of credibility factors is as follows:
[0088] ;
[0089] Among them, is the upper entity of the entity relationship, is the lower entity of the entity relationship, is the credibility factor of the entity relationship. The calculation of the entity relationship credibility is as follows:
[0090] ;
[0091] Among them, is the uncertain entity relationship, is the credibility factor of this entity relationship.
[0092] Step S251 and step S254 imitate the MoE architecture to construct expert modules to analyze the drug ingredients and identify indications, contraindications, etc., and hand them over to the routing network to process the entity relationships. Finally, the output results of each expert module are integrated to give medication advice.
[0093] Among them, step S254 assembles knowledge units according to different user portraits such as doctors, patients, or pharmacists, identifies the user device, and adjusts the output format, which is applicable to various service ports such as mobile terminals and PC terminals.
[0094] Visibly, after the construction of the knowledge graph in step S2, redundant nodes are merged and invalid information is deleted. At the same time, it is also necessary to monitor the announcements of the drug regulatory agency in real time and update the knowledge graph through differential comparison.
[0095] Obviously, step S3 includes the following steps:
[0096] S31: Convert the content of the drug instruction manual into voice and optimize it by segmentation;
[0097] S32: Call the WeChat mini-program port to generate a WeChat mini-program code.
[0098] An electronic drug instruction manual management system based on a knowledge graph adopts the above-mentioned electronic drug instruction manual processing method based on a knowledge graph.
[0099] In summary, the principle of this embodiment is as follows: The user submits drug instruction manual data, and the system automatically extracts the text content of the drug instruction manual and preprocesses the extracted data using algorithms, including format conversion, removal of redundant information, error correction, etc., and performs secondary and tertiary cleaning to improve the data quality, perform data standardization and structuring processing to improve the data consistency, use natural language processing (NLP) for semantic understanding and keyword extraction, construct a knowledge graph, establish the association relationship between drugs, support intelligent query and recommendation, store the cleaned data in the database, and provide an efficient retrieval function.
[0100] The specific embodiments described herein are merely illustrative of the spirit of the present invention. Those skilled in the art to which the present invention pertains can make various modifications or supplements to the described specific embodiments or use similar methods to replace them, but will not deviate from the spirit of the present invention or exceed the scope defined by the appended claims.
[0101] Although terms such as knowledge graph are used more frequently in this article, the possibility of using other terms is not excluded. Using these terms is only to more conveniently describe and explain the essence of the present invention; interpreting them as any additional limitation is contrary to the spirit of the present invention.
Claims
1. An electronic medicine instruction processing method based on a knowledge graph, characterized in that It includes the following steps: S1: Data extraction and data cleaning. The user submits the drug instruction data, and the system extracts the text content of the drug instruction and preprocesses and cleans the data; S2: Standardize and structure the data, perform intelligent association on the data, use natural language processing (NLP) for semantic understanding and keyword extraction, and construct a knowledge graph; S21: Perform data integration, clean unstructured data, perform SQL schema mapping and parse JSON / XML semi-structured data; S22: Standardize the data, unify the naming and establish a thesaurus, discretize the data and perform clustering analysis using the k-means algorithm to obtain a classified data set; S23: Set association rules and confidence thresholds, and perform data association using the Apriori algorithm; S24: Perform in-depth NLP semantic processing, use an RNN model to perform semantic understanding on the drug instruction and capture core semantic units; S25: Construct a knowledge graph and perform visualization processing; S251: Perform document triage, imitate the dynamic routing mechanism of the MoE architecture, construct an expert module selector, synthesize drug instructions according to templates, and use GAN to generate complex cases; S252: Perform knowledge extraction, capture structured information, use lightweight BiLSTM-CRF to identify complex entities, dynamically route low-confidence results for manual review, and according to the extraction relationship path of dynamic routing; S253: Perform multi-source data alignment and achieve automatic decision-making based on authority weighting; in the step S253, the multi-source data includes drug administration data, pharmaceutical company data, and literature data, and their regulatory level priority is drug administration data > pharmaceutical company data, pharmaceutical company data > literature data. The authority-weighted automatic decision-making used is as follows: ; Among them, is the number of data sources, is data sources, is the discrete value of the data source ; is the authoritative value weight of the data source and 0 ≤ ≤ 1, is the amplification factor; S254: Perform user portrait analysis by imitating the on-demand activation strategy of the MoE architecture and assemble knowledge units; In the steps S251 and S254, the credibility factor is used to handle the uncertainty of entity relationships, and the generation of the credibility factor is as follows: ; Among them, is the upper entity of the entity relationship, is the lower entity of the entity relationship, is the credibility factor of the entity relationship. The calculation of the entity relationship credibility is as follows: ; Among them, is an uncertain entity relationship, is the credibility factor of this entity relationship; S3: Store the data in a database and establish a backend service.
2. The method for processing electronic drug instructions based on a knowledge graph according to claim 1, wherein The step S1 includes the following steps: S11: The user submits the drug instruction and performs format conversion; S12: Perform data cleaning and denoising; S13: Perform separation processing according to the text part of speech; S14: Filter meaningless text; S15: Perform feature engineering and subject word extraction; S16: Set a text retrieval strategy.
3. The method for processing electronic drug instructions based on a knowledge graph according to claim 1, wherein The step S252 includes the following steps: S2521: Input the text into the BiLSTM model for processing to obtain vectors corresponding to the fused context semantics of each unit word , the vector is divided into a word vector , a position vector and a segment vector as follows: ; S2521: Extract information features from the vector and input the results of the BiLSTM model into the CRF model for annotation as follows: ; ; Among them, is a normalization factor, denotes the text sequence variable of the drug instruction manual, is an entity annotation variable, is the conditional probability distribution of the output sequence under the given condition, is a state feature function and the entity category is associated with the drug instruction manual text, is a local feature function and the entity category is associated with the external features.
4. The method for processing electronic drug instructions based on a knowledge graph according to claim 1, wherein After the knowledge graph is constructed in the step S2, redundant nodes are merged and invalid information is deleted.
5. The method for processing electronic drug instructions based on a knowledge graph according to claim 1, characterized in that The step S3 includes the following steps: S31: Convert the drug instruction content into speech and perform segment optimization; S32: Call the WeChat mini-program port to generate a WeChat mini-program code.
6. An electronic drug instruction manual management system based on a knowledge graph, characterized in that, The electronic drug instruction processing method based on a knowledge graph according to any one of claims 1-5 above is adopted.
Citation Information
Patent Citations
Drug specification-based reasonable medication knowledge graph construction method
CN110377755A
Clinical research medical inspection method and system based on artificial intelligence
CN119480044A