Knowledge graph construction method and system for traditional Chinese medicine production quality risk management and control
By constructing a knowledge map and using multi-source heterogeneous data and intelligent technology, the intelligent and dynamic problems of quality risk management in traditional Chinese medicine production are solved, scientific risk identification and evaluation of the traditional Chinese medicine production process is realized, and the standardization and efficiency of quality control are improved.
Patent Information
- Application Number
- CN202510443029.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-08-15
AI Technical Summary
There is a lack of intelligent and dynamic quality risk management in the production process of traditional Chinese medicine. The existing expert system has a separation of data and rules and a single semantic relationship, making it difficult to achieve dynamic updates and multi-level semantic networks, resulting in risk management relying on experience and lacking scientific quantitative basis.
Construct a knowledge graph, by obtaining multi-source heterogeneous data, using natural language processing (NLP) and deep learning technology to extract entities, relationships and attributes, generate triple data, build a knowledge graph for risk identification and evaluation, and combine it with graph database for storage and query, and realize dynamic risk prediction and causal reasoning.
It realizes the accurate identification and evaluation of quality risks in the production process of traditional Chinese medicine, supports scientific decision-making, reduces risks caused by human factors, and improves the standardization and efficiency of quality control.
Smart Images

Figure CN120492880A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traditional Chinese medicine production, and in particular to a method and system for constructing a knowledge graph for traditional Chinese medicine production quality risk management. Background Art
[0002] Quality and safety risks can exist throughout the entire process of TCM production, from planting and harvesting medicinal materials to processing and preparation. Risks primarily arise from differences in raw materials, complex processes, and incomplete standards. Due to the diverse variety of TCM materials, their quality varies significantly from origin to origin and season to season, and raw material quality is susceptible to contamination from heavy metals, pesticide residues, mycotoxins, and other factors. Processing, extraction, concentration, and drying in TCM production place stringent demands on parameters such as temperature and humidity; even the slightest deviation can affect the efficacy or safety of the product. Some TCM production processes lack unified standards, and risk management relies primarily on experience, lacking a scientific, quantitative basis. This demonstrates the need for more intelligent, dynamic, and standardized solutions for TCM production quality control. Summary of the Invention
[0003] Based on this, it is necessary to provide a knowledge graph construction method and system for traditional Chinese medicine production quality risk management and control in response to the problems existing in the existing traditional Chinese medicine production quality control.
[0004] A method for constructing a knowledge graph for quality risk management of traditional Chinese medicine production, comprising obtaining multi-source heterogeneous traditional Chinese medicine production data; extracting entities, relationships, and attributes of quality risks in the traditional Chinese medicine production process from the traditional Chinese medicine production data to generate triple data; and generating a knowledge graph of quality risks in the traditional Chinese medicine production process based on the triple data.
[0005] In one embodiment, the traditional Chinese medicine production data includes structured data and unstructured data, and obtaining multi-source heterogeneous traditional Chinese medicine production data includes using a crawler tool to capture unstructured data; using an API (Application Programming Interface) interface to connect to a traditional Chinese medicine production system and / or traditional Chinese medicine experimental equipment to collect structured data; and preprocessing the structured data and the unstructured data to convert them into the traditional Chinese medicine production data in a unified format.
[0006] In one embodiment, when the traditional Chinese medicine production data is the unstructured data, extracting entities, relationships and attributes of quality risks in the traditional Chinese medicine production process from the traditional Chinese medicine production data to generate triple data includes using NLP (Natural Language Processing) technology to extract entities from the unstructured data; identifying the relationship between the entities through a deep learning method; and extracting attributes related to the entities from the unstructured data.
[0007] In one embodiment, when the traditional Chinese medicine production data is the structured data, the entities, relationships and attributes of the quality risks in the traditional Chinese medicine production process are extracted from the traditional Chinese medicine production data to generate triple data, including mapping the data strips in the structured data into entities; mapping the numerical values corresponding to each field in the structured data into attributes related to the entity; and converting the hierarchical structure or business correlation between fields in the structured data into relationships between the entities.
[0008] In one embodiment, the extracting entities, relationships and attributes of quality risks in the traditional Chinese medicine production process from the traditional Chinese medicine production data and generating triple data also includes unifying nodes expressing the same entity in different data sources through entity linking technology; performing entity disambiguation on the entity based on context information and attribute features; and performing reference resolution on the entity in combination with text context.
[0009] In one embodiment, the generation of a knowledge graph of quality risks in the production process of traditional Chinese medicine based on the triple data includes constructing a semantic framework of the knowledge graph; classifying the entities in the triple data according to predefined entity types; classifying the relationships in the triple data according to predefined relationship types; mapping the extracted triple data into nodes and edges in the knowledge graph to generate the knowledge graph with a graph structure; and storing the knowledge graph using a graph database.
[0010] In one embodiment, after generating a knowledge graph of quality risks in the traditional Chinese medicine production process based on the triple data, the method further includes performing causal reasoning, risk propagation path analysis, and dynamic risk prediction based on the knowledge graph.
[0011] A knowledge graph construction system for quality risk management and control of traditional Chinese medicine production, comprising a data acquisition module for acquiring multi-source heterogeneous traditional Chinese medicine production data; a knowledge extraction module, connected to the data acquisition module, for extracting entities, relationships and attributes of quality risks in the traditional Chinese medicine production process from the traditional Chinese medicine production data to generate triple data; and a knowledge graph construction module, connected to the knowledge extraction module, for generating a knowledge graph of quality risks in the traditional Chinese medicine production process based on the triple data.
[0012] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the steps of the knowledge graph construction method for traditional Chinese medicine production quality risk management described in any one of the above embodiments.
[0013] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for constructing a knowledge graph for quality risk management of traditional Chinese medicine production as described in any of the above embodiments.
[0014] A computer program product includes a computer program, which, when executed by a processor, implements the steps of the knowledge graph construction method for traditional Chinese medicine production quality risk management described in any one of the above embodiments.
[0015] The above-mentioned knowledge graph construction method for TCM production quality risk management collects TCM production data from various sources, extracts entities, relationships, and attributes related to TCM production quality risks from this data, and represents them as triples. Based on the generated triples, a knowledge graph is constructed that comprehensively reflects the potential quality risks in the TCM production process. This knowledge graph, based on information related to TCM production quality risks extracted from TCM production data, can more accurately identify and assess quality risks in the production process, assisting managers in making scientific and rational decisions. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the implementation methods of this specification or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the implementation methods or the description of the prior art. Obviously, the drawings described below are only some implementation methods recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0017] Figure 1 This is a flowchart of a method for constructing a knowledge graph for quality risk management of traditional Chinese medicine production in one of the embodiments of this application;
[0018] Figure 2 This is a flow chart of a method for obtaining traditional Chinese medicine production data in one embodiment of the present application;
[0019] Figure 3 This is a flow chart of a method for generating triplet data in one embodiment of the present application;
[0020] Figure 4 This is a flow chart of a method for generating a knowledge graph based on triple data in one embodiment of the present application;
[0021] Figure 5 This is a schematic diagram of the knowledge architecture for risk management and control of traditional Chinese medicine production quality in one of the embodiments of this application;
[0022] Figure 6This is a schematic diagram of the structure of the knowledge graph of traditional Chinese medicine production risks in one of the embodiments of this application;
[0023] Figure 7 This is a flowchart of a method for constructing a knowledge graph for quality risk management of traditional Chinese medicine production in another embodiment of the present application;
[0024] Figure 8 This is a schematic diagram of the structure of a knowledge graph construction system for traditional Chinese medicine production quality risk management in one of the embodiments of this application;
[0025] Figure 9 This is a schematic diagram of the structure of a device for implementing a method for constructing a knowledge graph for quality risk management of traditional Chinese medicine production in one of the embodiments of the present application;
[0026] Figure 10 This is a diagram of the internal structure of a computer device in one of the embodiments of the present application. DETAILED DESCRIPTION
[0027] To facilitate understanding of the present invention, the present invention will be described more fully below with reference to the accompanying drawings. Preferred embodiments of the present invention are shown in the accompanying drawings. However, the present invention may be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and comprehensive understanding of the present disclosure.
[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this invention pertains. The terms used in this specification of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0029] Existing Traditional Chinese Medicine (TCM) production processes primarily utilize knowledge-based expert systems to incorporate domain knowledge and improve decision-making accuracy. By encoding expert experience into a rule base, risk prediction and decision support are implemented. For example, rule-based logic can be used to determine whether the risk of mold exceeds the specified limit. However, existing expert systems suffer from limitations such as a disconnect between data and rules, limited semantic associations, and a lack of intelligent reasoning capabilities. Specifically, the rule base within the expert system is separated from production data, making dynamic updates impossible. Furthermore, the rule base within the expert system struggles to construct a multi-level semantic network, and cannot leverage modern intelligent technologies such as deep learning for dynamic prediction and reasoning.
[0030] Figure 1This is a method flow chart of a method for constructing a knowledge graph for quality risk management of traditional Chinese medicine production in one of the embodiments of the present application. In one embodiment, the method for constructing a knowledge graph for quality risk management of traditional Chinese medicine production may include the following steps S100 to S300.
[0031] Step S100: Acquire multi-source heterogeneous traditional Chinese medicine production data.
[0032] In the embodiments of this application, Chinese medicine production data may refer to various types of data related to the Chinese medicine production process, such as production process formulas, equipment data, expert research literature, etc. Chinese medicine production data covering the entire process of medicinal material planting, harvesting, processing, and preparation production is obtained from different sources (such as medicinal material suppliers, production equipment sensors, laboratory analysis reports, historical production records, etc.) to ensure that all aspects of Chinese medicine production are covered.
[0033] Step S200: extracting entities, relationships and attributes of quality risks in the traditional Chinese medicine production process from traditional Chinese medicine production data to generate triple data.
[0034] From traditional Chinese medicine production data, natural language processing (NLP), machine learning and other technologies are used to extract entities, relationships and attributes related to the quality risks of traditional Chinese medicine production, and express them in the form of triples. Structured triple data is used to describe information related to quality risks in the traditional Chinese medicine production process.
[0035] Step S300: Generate a knowledge graph of quality risks in the traditional Chinese medicine production process based on triple data.
[0036] Based on the triple data generated in step S200, a knowledge graph is constructed using graph databases, semantic web standards, and other technologies to comprehensively reflect potential quality risks in the traditional Chinese medicine production process. This generated knowledge graph can more accurately identify and assess quality risks in the production process, assisting managers in making scientific and reasonable decisions.
[0037] The knowledge graph construction method for the quality risk management of traditional Chinese medicine production provided in this application collects traditional Chinese medicine production data from different sources, extracts entities, relationships and attributes related to the quality risks of traditional Chinese medicine production from the traditional Chinese medicine production data, and represents them as triple data in the form of triples. Based on the generated triple data, a knowledge graph that comprehensively reflects the potential quality risks in the traditional Chinese medicine production process is constructed based on the triple data. Using knowledge graphs for risk prediction and decision support will help to formulate and implement more standardized quality control standards and reduce risks caused by human factors.
[0038] In one of the embodiments, when obtaining multi-source heterogeneous traditional Chinese medicine production data, a dynamic data access mechanism can also be used to update the traditional Chinese medicine production data in real time or regularly. Furthermore, as new data related to the traditional Chinese medicine production process is continuously updated, the knowledge graph can also be dynamically adjusted synchronously based on step S200 and step S300. The existing expert system relies on manual input rules, so the rule update efficiency is low. This application can ensure that the knowledge graph can reflect the latest production status and changing trends in a timely manner by setting a real-time or regular data import mechanism, so as to use the latest knowledge graph to provide the latest risk insights and support enterprises to continuously optimize production and quality management processes.
[0039] In one embodiment, Chinese medicine production data may include structured data and unstructured data. Among them, structured data refers to data with fixed formats and rules, which are usually stored in relational databases, such as SQL (Structured Query Language) databases. It exists in the form of rows and columns and is easy to retrieve and manage through query languages such as SQL; unstructured data refers to data without a fixed format or organizational structure, including text, pictures, audio and video, etc. It is usually stored in non-relational databases, such as NoSQL databases (NotOnly SQL, non-relational databases), in various forms and difficult to manage using traditional database methods. In an embodiment of the present application, structured data may include but is not limited to production records, test reports, medicinal material quality standards, sensor monitoring data (such as temperature, humidity, pressure), etc.; unstructured data may include but is not limited to literature, laws and regulations, expert reports, etc. related to the production process and quality control of Chinese medicine.
[0040] Figure 2 This is a flowchart of a method for obtaining traditional Chinese medicine production data in one of the embodiments of the present application. In one of the embodiments, determining the inspection time corresponding to the inspection item according to the inspection item may include the following steps S110 to S130.
[0041] Step S110: using a crawler tool to crawl unstructured data.
[0042] Use crawler tools to capture unstructured data from web pages, literature databases, and other sources. In practical applications, you can first determine the data sources to be crawled. These data sources can include, but are not limited to, medicinal material markets, academic literature, industry reports, and social media discussions. Select or develop crawler tools tailored to specific needs, and customize crawling strategies based on the structure and content of the target data source, ensuring compliance with the protocols, laws, and regulations of each data source. For different types of web content, you can develop detailed HTML (Hypertext Markup Language) parsing rules to accurately extract the required information fragments.
[0043] Step S120: Use the API interface to connect to the traditional Chinese medicine production system and / or traditional Chinese medicine experimental equipment to collect structured data.
[0044] For structured data, it is possible to collaborate with TCM production systems and / or TCM laboratory equipment, as well as other relevant systems and equipment throughout the entire TCM production process, to develop or integrate API interfaces to achieve automated data collection and ensure the security and stability of the API. Appropriate transmission modes can be selected based on different application scenarios, such as real-time streaming or scheduled batch uploads, to ensure data consistency and integrity. Furthermore, relevant metadata, such as timestamps, operator IDs (identity documents), and device status, can be synchronized with each data exchange to assist with subsequent data verification and audit tracking.
[0045] Step S130: pre-processing the structured data and unstructured data, and converting them into traditional Chinese medicine production data in a unified format.
[0046] Preprocessing operations for both structured and unstructured data can include, but are not limited to, deduplication, missing value filling, and outlier detection and correction to ensure the cleanliness of the collected dataset. After obtaining preprocessed TCM production data, data from different sources can be converted into a unified file format (e.g., text, spreadsheet, CSV, JSON, XML) to facilitate subsequent processing. A unified data dictionary should be created using standard encoding, defining the meaning and allowable value range of each field to avoid character set conflicts.
[0047] This application uses a combination of crawlers and APIs to obtain multi-source heterogeneous data, enabling the acquisition of rich information from a wide range of channels, including publicly available market standards and social experience, as well as precise operational data from internal systems. By efficiently integrating multi-source heterogeneous data, seamless connections between different types of data are achieved, reducing decision-making barriers caused by data silos and promoting cross-departmental collaboration and information sharing. Furthermore, meticulous preprocessing steps can improve the quality of data analysis, making the data entering the analysis model more standardized and reliable, thereby improving the accuracy and practicality of the final output results.
[0048] Figure 3 This is a flow chart of a method for generating triplet data in one of the embodiments of the present application. In one embodiment, when the traditional Chinese medicine production data is unstructured data, entities, relationships and attributes of quality risks in the traditional Chinese medicine production process are extracted from the traditional Chinese medicine production data, and generating triplet data may include the following steps S210 to S230.
[0049] Step S210: Utilize NLP technology to extract entities from unstructured data.
[0050] For captured unstructured data, NLP techniques can be used to extract key entities from unstructured data (such as literature, laws and regulations) for preliminary processing. Key entities may include, but are not limited to, medicinal material names, risk types, and process parameters. Applying NLP techniques such as word segmentation, named entity recognition, and sentiment analysis allows for a deeper understanding and utilization of this information in subsequent applications.
[0051] Step S220: Identify the relationship between entities through deep learning methods.
[0052] Identify the relationship between entities through deep learning methods. For example, "Material Risk - Inclusion - Extract Index Abnormality", where "Material Risk" and "Extract Index Abnormality" belong to two entities, "Inclusion" belongs to the relationship between the two entities "Material Risk" and "Extract Index Abnormality". Use BERT (Bidirectional Encoder Representations from Transformers, pre-trained language model) or other pre-trained language models to generate a contextual embedding representation of each entity to capture its contextual information in the sentence. Add a position code relative to the beginning of the sentence to each entity to help the model understand the relative distance between entities. Parse the sentence structure, obtain the dependency path between entities, and input it into the model as an additional feature to help capture deeper semantic relationships.
[0053] Step S230: extracting attributes related to the entity from the unstructured data.
[0054] Extract attribute information related to entities (such as batches of medicinal materials, upper and lower limits, etc.). Use pre-trained language models such as BERT and RoBERTa (Robustly Optimized BERT Approach, natural language processing model) as a basis, and use their powerful semantic understanding capabilities to capture attribute information in complex text. Add position information relative to the entity for each attribute to help the model better understand the relationship between attributes and entities. Introduce dependency syntax analysis to obtain the grammatical relationship between entities and attributes, and enhance the model's understanding of attributes. Combine with domain knowledge bases (such as pharmacopoeias and standard operating procedures) to assist the model in identifying and classifying specific attributes.
[0055] This application uses NLP technology and deep learning methods to efficiently extract entities from unstructured data, identify relationships between entities, and extract related attributes, thereby realizing the automated transformation from unstructured data to structured knowledge. NLP technology and deep learning methods can accurately identify various types of Chinese medicine-related entities, significantly reducing false positive and false negative rates. They can not only identify explicit entity relationships, but also infer implicit associations, thereby enhancing the understanding of the Chinese medicine production process. Combining template matching and deep learning, entity attributes can be effectively extracted from complex text environments, providing detailed information support for subsequent risk assessments.
[0056] In one embodiment, see Figure 3 When the TCM production data is unstructured data, extracting entities, relationships, and attributes of quality risks in the TCM production process from the TCM production data and generating triple data may include the following steps S240 to S260.
[0057] Step S240: Map data strips in the structured data into entities.
[0058] Perform a detailed analysis of the data structure of structured data to identify which fields can be used as entities. For structured data in tabular form, the data items in the data table can be mapped to entity nodes. For example, in the medicinal material procurement record table, the fields corresponding to data items such as "Medicinal Material Name" and "Supplier ID" can be considered entities. Ensure that each entity has a unique identifier in the system to uniformly manage the same entities from different sources to avoid duplication or conflict. Based on business logic and domain knowledge, classify entities and assign corresponding labels to facilitate subsequent queries and applications. For example, medicinal material category, equipment category, operation category, etc.
[0059] Step S250: Map the values corresponding to the fields in the structured data into attributes related to the entity.
[0060] Perform a detailed analysis of the data structure of structured data to identify which data can be used as entities. For example, for structured data in tabular form, the numerical values corresponding to each field can be mapped to attribute values. In a feasible implementation, a set of standard attribute lists can be defined for each entity to clarify which fields should be mapped to the attributes of the entity. For example, the batch number of medicinal materials, the production date, the content of active ingredients, etc. Ensure that the units of the same attribute in different records remain consistent, and the attribute values can be converted when necessary. In addition, reasonable upper and lower limits can be set for numerical attributes to prevent abnormal values from entering the knowledge graph; perform format verification on text attributes to ensure that they conform to the expected pattern.
[0061] Step S260: converting the hierarchical structure or business relevance between fields in the structured data into relationships between entities.
[0062] Establish relationships between entities based on the hierarchical structure in structured data (such as organizational structure and process flow). Identify the business relevance between fields and convert it into relationships between entities. In a feasible implementation, the hierarchical structure in structured data can be directly mapped to relationships in the graph, and the business relevance between fields can also be directly converted into relationships in the graph. Furthermore, for complex relationships involving multiple steps or conditions, a multi-step reasoning model can be used to gradually analyze the relationships and their evolution at each stage.
[0063] By conducting in-depth analysis of structured data, this application can accurately map each record to the corresponding entity, attribute, and relationship, ensuring the basic accuracy of the knowledge graph, achieving comprehensive coverage and standardized processing of entities, attributes, and relationships, and facilitating a deep understanding of the status and characteristics of each entity.
[0064] In one embodiment, see Figure 3 Extracting entities, relationships, and attributes of quality risks in the traditional Chinese medicine production process from traditional Chinese medicine production data and generating triple data may also include the following steps S270 to S290.
[0065] Step S270: unify the nodes expressing the same entity in different data sources through entity linking technology.
[0066] Through entity linking technology, nodes expressing the same entity in different data sources can be unified. For different expressions of the same entity, a synonym list or clustering algorithm can be applied to normalize them. For example, "ginseng" and "red ginseng" (two different expressions) are unified as the "ginseng" entity. In some other implementations, an authoritative database can be introduced to enrich the content of the knowledge base, improve the accuracy of entity links, generate embedding vectors of entity descriptions using a pre-trained language model, and calculate the degree of semantic matching through metrics such as cosine similarity. The entity recognition results are verified in combination with the sentence or paragraph context to verify whether the candidate entity conforms to the current context logic and filter out illogical misidentifications. The consistency of entities is evaluated throughout the document or even across documents to avoid multiple different link results for the same entity in the same scenario.
[0067] Step S280: performing entity disambiguation on the entity based on context information and attribute features.
[0068] Construct contextual features based on text content, including previous and next sentences, paragraph topics, co-occurring word frequencies, etc., to assist in determining the identity of specific entities. Eliminate ambiguity based on contextual information and attribute features, such as disambiguating the different situations of "Chuanxiong" (medicinal material) and "Chuanxiong" as origin labels. Use supervised learning algorithms (such as support vector machines, random forests) or deep learning models to train classifiers to predict the correct entity identity based on the above features. Combining the advantages of multiple models, the final disambiguation result is obtained through voting or weighted averaging, thereby improving the robustness and accuracy of decision-making. For some entities that are easily confused, clear rules can also be formulated to assist the model in making the right choice. For example, different origins of medicinal materials with the same name can be distinguished based on geographical information.
[0069] Step S290: performing reference resolution on the entity in combination with the text context.
[0070] By integrating the textual context, the system analyzes sentence structure, identifying subject-verb-object relationships, and modifier relationships, helping to understand the specific reference of pronouns or noun phrases and resolve ambiguity. It also tracks dependency paths within sentences, capturing indirect connections between entities and providing clues for reference resolution. For example, in the sentence "This medicinal herb easily deteriorates at high temperatures," the context clearly indicates that "this medicinal herb" refers to ginseng.
[0071] In a preferred embodiment, BERT or other pre-trained language models can be used as a foundation to capture the interactions of all words in a sentence through bidirectional encoding, thereby identifying referential relationships. An end-to-end neural network architecture specifically designed for the task of referential resolution can be designed to directly process the raw text and output referential relationships. Furthermore, a user feedback channel can be established to allow for manual correction of erroneous referential resolution results, thereby continuously improving model performance.
[0072] This application can accurately link data from different sources to the same entity by combining string matching, semantic similarity, and contextual verification, significantly reducing the false positive rate. With the help of rich feature engineering and advanced machine learning models, it can make relatively accurate choices even when faced with highly ambiguous or ambiguous entities, thereby improving the quality of the knowledge graph. Combining the advantages of dependency parsing and deep learning models, it can effectively parse reference relationships in complex text environments and enhance the ability to understand long texts.
[0073] Figure 4 This is a flow chart of a method for generating a knowledge graph based on triple data in one of the embodiments of the present application. In one embodiment, generating a knowledge graph of quality risks in the production process of traditional Chinese medicine based on triple data may include the following steps S310 to S350.
[0074] Step S310: Construct the semantic framework of the knowledge graph.
[0075] Based on laws, regulations, and expert knowledge, combined with the data of triple data, a semantic framework for the knowledge graph is constructed. The semantic framework can be used to define concepts, entities, relationships, and attributes in the field of traditional Chinese medicine production, providing a unified understanding and interpretation of the data in the knowledge graph.
[0076] Step S320: Classify the entities in the triple data according to predefined entity types.
[0077] In the embodiment of the present application, six entity types can be defined in advance based on domain knowledge, regulatory requirements, data characteristics and other information. Specifically, Figure 5 This is a schematic diagram of the knowledge architecture of risk management and control of traditional Chinese medicine production quality in one of the embodiments of this application. The six entity types are: drug name (such as "Guanxinning Tablets"), risk type (such as "equipment risk"), risk name (such as "abnormal finished product indicators-abnormal disintegration time"), risk identification method (such as "model-based"), key process step name (such as "adding solvent once"), and parameter limit (such as "upper limit 4160").
[0078] In step S200, when entities are extracted from the traditional Chinese medicine production data, the entities can be preliminarily classified. When entities are identified from the original data, classification labels are attached to the entities. In this step S320, further confirmation and optimization of the classification results in step S200 can be achieved. Unclassified entities are supplemented to ensure that the entities in the triple data meet the requirements of the semantic framework and fill in the missing classification information. In a preferred embodiment, an automated tool can be developed or selected to use a machine learning model (such as a classifier) to quickly classify the newly extracted entities. At the same time, a rule engine can be combined to handle special cases.
[0079] Step S330: Classify the relations in the triple data according to predefined relation types.
[0080] In the present embodiment, six types of relationships can also be pre-defined based on domain knowledge, regulatory requirements, data characteristics, and other information. For example, a specific entity relationship can be "Based on inspection results (entity: risk identification method): identification (relationship): abnormal finished product indicators - abnormal disintegration time limit (entity: risk name)."
[0081] In a preferred embodiment, a deep learning model can be trained to identify and classify relationship types in triple data, and the model performance can be optimized by using a large amount of annotated data. A rule engine is then applied to verify the classification results and correct potential errors, especially for ambiguous or complex relationship types.
[0082] Step S340: Map the extracted triple data into nodes and edges in the knowledge graph to generate a knowledge graph with a graph structure.
[0083] Entities in the triple data are mapped as nodes, and relationships in the triple data are mapped as edges to generate a graph structure, thereby outputting a complete knowledge graph of quality risks in the traditional Chinese medicine production process. The extracted triple data is decomposed into a subject (entity), a predicate (relationship), and an object (another entity or attribute value), which is then mapped into the graph structure. Duplicate triples are removed, and triplets with the same subject and predicate but different objects are merged to simplify the graph structure. Figure 6 This is a schematic diagram of the structure of the knowledge graph of traditional Chinese medicine production risks in one of the embodiments of this application.
[0084] Specifically, a node is created for each entity and assigned corresponding labels and attributes. Based on the relationship type in the triple data, edges are created between related nodes and the attributes of the edges (such as weight, timestamp, etc.) are set. Figure 6 In the structural diagram of the knowledge graph shown, there are 6 different entity types and 6 different relationship types between the 6 different entity types.
[0085] Step S350: Use a graph database to store the knowledge graph.
[0086] A graph database can refer to a database system that can be used to store and query knowledge graphs. A graph database can support data storage and efficient query for graph structures and is the basic platform for knowledge graph implementation. A graph database (such as Neo4j) is used to store knowledge graphs generated based on triple data and to achieve efficient storage and query of knowledge graphs. In addition, the knowledge graph generated in step S340 can be efficiently imported into the database using the import tool or API interface provided by the graph database. At the same time, indexes can be created for frequently queried fields (such as entity names and relationship types) to improve the query efficiency of the graph database.
[0087] The knowledge graph construction method for the risk control of Chinese medicine production quality provided in this application adopts natural language processing (NLP) technology and semantic modeling method, integrates structured and unstructured data, performs entity recognition and relationship extraction on unstructured data, and builds a unified knowledge graph in combination with structured data. It can realize the efficient integration and structured expression of multi-source heterogeneous data, break the data island, realize the automatic fusion of multi-source heterogeneous data such as laws and regulations, production data, and test result data, and build a unified semantic framework. Based on the knowledge graph constructed with triple data with "entity-relationship-attribute" as the core, the risk points and their causal relationships in the Chinese medicine production process are systematically represented, the semantic expression ability of risk data is enhanced, and the foundation is laid for the reasoning analysis of complex associations. The use of knowledge graphs can realize multi-level risk association expression and describe complex semantic relationships.
[0088] Figure 7 This is a method flow chart of a method for constructing a knowledge graph for quality risk management of traditional Chinese medicine production in another embodiment of the present application. After generating a knowledge graph of quality risks in the traditional Chinese medicine production process based on triple data, the method for constructing a knowledge graph for quality risk management of traditional Chinese medicine production can also include the following step S400.
[0089] Step S400: Perform causal reasoning, risk propagation path analysis, and dynamic risk prediction based on the knowledge graph.
[0090] Causal reasoning, risk propagation path analysis, and dynamic risk prediction of raw data based on knowledge graphs can achieve more automated and intelligent quality risk control in the production process of traditional Chinese medicine.
[0091] In a specific embodiment, the Bayesian network is combined to perform probabilistic reasoning on the causal relationship in the knowledge graph to analyze the possibility of risk occurrence. Based on the known entities and their relationships in the knowledge graph, a Bayesian network is constructed, in which nodes represent entities or events, edges represent causal relationships, and the probability distribution of each node is determined by its parent node. The parameters of the Bayesian network are estimated using historical data. Methods such as maximum likelihood estimation (MLE) or Bayesian estimation can be used to determine the conditional probability table (CPT) between each node. The probability of a risk event occurring under given evidence conditions is calculated using a Bayesian inference algorithm (such as variable elimination method and Gibbs sampling). For example, the probability of a finished drug being unqualified after a batch of medicinal materials is contaminated is evaluated.
[0092] Using causal reasoning based on knowledge graphs to determine quality risks in the traditional Chinese medicine production process can quantify the impact of different factors on the final risk, providing a scientific basis to support decision-making. Furthermore, as new data is added, the Bayesian network can be continuously updated to maintain the latest risk assessment capabilities.
[0093] In a specific embodiment, graph algorithms (such as shortest path algorithms, random walks, etc.) can also be used to identify the risk propagation chain from raw materials to finished products. For example, using the classic shortest path algorithm to find the risk propagation chain from raw materials to finished products can help identify the main path of risk diffusion; by simulating the behavior of random walks on the graph, the importance of each node can be evaluated. Preferably, when processing knowledge graphs with large-scale graph structures, heuristic functions can also be introduced to optimize search efficiency. For risk propagation path analysis, it can help identify which nodes are more likely to become key points for risk propagation. Alternatively, based on the Markov property assumption, the process of risk propagation in the graph is simulated to evaluate the possibility of different paths. After identifying the main risk propagation path, targeted measures can be taken for the propagation path, for example, strengthening the monitoring of a certain link or improving the process to block the risk propagation.
[0094] In a specific embodiment, the key nodes (such as a key process parameter) that affect the spread of risks can be determined through node importance analysis. By calculating the number of connections of each node, its activity level in the network is reflected, among which nodes with a high number of connections may be key nodes. The frequency of the node as the shortest path intermediary between other nodes is measured to identify bridge-type nodes. Once a problem occurs at a bridge-type node, it may seriously affect the stability of the entire system. The average shortest path length from the node to all other nodes is evaluated. Nodes close to the center often have a higher influence. Using node importance analysis to accurately identify key nodes that affect risk propagation can provide clear goals for formulating effective prevention and control measures, avoid unnecessary waste of resources, and improve overall risk management efficiency.
[0095] This application enables the monitoring, prediction, and traceability of risks throughout the entire TCM production process through the integration of multi-source heterogeneous data, knowledge graph construction, intelligent reasoning, and dynamic visualization. Leveraging high-quality data, it builds a more intelligent and dynamic risk warning system, providing strong support for TCM production quality risk management. This helps companies identify potential problems early on, take timely and effective countermeasures, and ensure product quality and safety.
[0096] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times. The order of execution of these steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.
[0097] Based on the description of the embodiment of the knowledge graph construction method for the quality risk management of traditional Chinese medicine production, the present disclosure also provides a knowledge graph construction system for the quality risk management of traditional Chinese medicine production. The system may include a device (including a distributed system), software (application), module, component, server, client, etc. using the method described in the embodiment of this specification and combined with a device for implementing the necessary hardware. Based on the same innovative concept, the system in one or more embodiments provided by the embodiment of the present disclosure is as described in the following embodiments. Since the implementation scheme and method for solving the problem of the system are similar, the implementation of the specific device of the embodiment of this specification can refer to the implementation of the aforementioned method, and the repetitions will not be repeated. As used below, the term "unit" or "module" can implement a combination of software and / or hardware for predetermined functions. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0098] Figure 8 This is a structural diagram of a knowledge graph construction system for quality risk management of traditional Chinese medicine production in one of the embodiments of the present application. In one of the embodiments, the knowledge graph construction system for quality risk management of traditional Chinese medicine production may include a data acquisition module 100, a knowledge extraction module 200 and a knowledge graph construction module 300.
[0099] The data acquisition module 100 can be used to obtain multi-source heterogeneous traditional Chinese medicine production data. The data acquisition module 100 can obtain relevant traditional Chinese medicine production data of the entire process of traditional Chinese medicine production from different sources, ensuring that all links of traditional Chinese medicine production are covered.
[0100] The knowledge extraction module 200 can be connected to the data acquisition module 100. The knowledge extraction module 200 can be used to extract entities, relationships and attributes of quality risks in the traditional Chinese medicine production process from the traditional Chinese medicine production data to generate triple data.
[0101] The knowledge graph construction module 300 can be connected to the knowledge extraction module 200, and the knowledge graph construction module 300 can be used to generate a knowledge graph of quality risks in the production process of traditional Chinese medicine based on triple data.
[0102] The knowledge graph construction system for the risk control of traditional Chinese medicine production quality provided by this application can automatically process multiple data types and integrate structured and unstructured data compared to expert systems that rely on fixed rule bases. The risk knowledge graph is constructed using data in the form of triples, which can express complex semantic relationships rather than just supporting simple rule expressions. Furthermore, the system can also obtain the latest data in real time through a dynamic data access mechanism, thereby updating the knowledge graph in real time based on the latest data, with high update efficiency.
[0103] In one embodiment, the knowledge graph construction system for traditional Chinese medicine production quality risk management and control may also include a risk prediction module.
[0104] This application utilizes the knowledge graph generated by the risk prediction module based on the knowledge graph construction module 300 to dynamically predict quality risks that may exist during the production of traditional Chinese medicine. This application demonstrates that the present invention utilizes advanced knowledge graphs and intelligent reasoning technology, significantly outperforming existing technologies in data integration, risk analysis, and dynamic display, providing a novel solution for risk management and control in the production of traditional Chinese medicine.
[0105] It should be understood that the various embodiments of the above-mentioned methods, devices, etc. in this specification are described in a progressive manner. The same / similar parts between the various embodiments can be referred to in detail. Each embodiment focuses on the differences from other embodiments. For related parts, refer to the descriptions of other method embodiments.
[0106] Figure 9 This is a schematic diagram of the device structure for implementing a method for constructing a knowledge graph for quality risk management of traditional Chinese medicine production in one of the embodiments of this application. Figure 9 The knowledge graph construction system S00 for the quality risk management and control of traditional Chinese medicine production may include a processing component S20, which further includes one or more processors, and a memory resource represented by a memory S22 for storing instructions that can be executed by the processing component S20, such as an application. The application stored in the memory S22 may include one or more modules, each of which corresponds to a set of instructions. In addition, the processing component S20 is configured to execute instructions to perform the above-mentioned knowledge graph construction method for the quality risk management and control of traditional Chinese medicine production.
[0107] The knowledge graph construction system S00 for the quality risk management of traditional Chinese medicine production may further include: a power supply component S24 configured to perform power management of the knowledge graph construction system S00 for the quality risk management of traditional Chinese medicine production, a wired or wireless network interface S26 configured to connect the knowledge graph construction system S00 for the quality risk management of traditional Chinese medicine production to a network, and an input / output (I / O) interface S28. The knowledge graph construction system S00 for the quality risk management of traditional Chinese medicine production may operate based on an operating system stored in the memory S22, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, or the like.
[0108] In an exemplary embodiment, a computer-readable storage medium including instructions is further provided, such as a memory S22 including instructions, and the instructions can be executed by a processor of the knowledge graph construction system S00 for traditional Chinese medicine production quality risk management to complete the above method. The storage medium can be a computer-readable storage medium, for example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0109] In an exemplary embodiment, a computer program product is also provided, which includes instructions. The above instructions can be executed by a processor of the knowledge graph construction system S00 for traditional Chinese medicine production quality risk management to complete the above method.
[0110] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 10 As shown, Figure 10 This is an internal structural diagram of a computer device in one of the embodiments of the present application. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store user- and task-related data used in the above-mentioned knowledge graph construction method for the quality risk management of traditional Chinese medicine production. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a knowledge graph construction method for the quality risk management of traditional Chinese medicine production can be implemented.
[0111] Those skilled in the art will understand that Figure 10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0112] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0113] The various embodiments in this specification are described in a progressive manner. Similar portions between the various embodiments can be referenced to each other. Each embodiment focuses on the differences between the other embodiments. In particular, the hardware + program embodiments are described briefly because they are generally similar to the method embodiments. For relevant portions, refer to the description of the method embodiments.
[0114] It should be noted that the aforementioned devices, electronic devices, servers, etc., according to the description of the method embodiments, may also include other implementation methods. For specific implementation methods, reference can be made to the description of the relevant method embodiments. At the same time, new embodiments formed by combining the features of various method, device, equipment, and server embodiments still fall within the scope of implementation covered by this disclosure and are not described in detail here.
[0115] Throughout this specification, references to terms such as "some embodiments," "other embodiments," and "desired embodiments" indicate that a particular feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. Although these terms are used interchangeably throughout this specification, they do not necessarily refer to the same embodiment or example.
[0116] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0117] The above-described embodiments merely represent several implementations of the present invention. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent. It should be noted that a person skilled in the art would be able to make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the patent for this invention shall be determined by the appended claims.
Claims
1. A knowledge graph construction method for traditional Chinese medicine production quality risk management, characterized in that: include: Obtain multi-source heterogeneous traditional Chinese medicine production data; Extracting entities, relationships, and attributes of quality risks in the traditional Chinese medicine production process from the traditional Chinese medicine production data to generate triple data; A knowledge graph of quality risks in the traditional Chinese medicine production process is generated based on the triple data.
2. The method for constructing a knowledge graph for traditional Chinese medicine production quality risk management according to claim 1, characterized in that: The traditional Chinese medicine production data includes structured data and unstructured data, and the acquisition of multi-source heterogeneous traditional Chinese medicine production data includes: Use crawler tools to crawl unstructured data; Use API interfaces to connect to traditional Chinese medicine production systems and / or traditional Chinese medicine experimental equipment to collect structured data; The structured data and the unstructured data are preprocessed and converted into the traditional Chinese medicine production data in a unified format.
3. The method for constructing a knowledge graph for traditional Chinese medicine production quality risk management according to claim 2, characterized in that: When the traditional Chinese medicine production data is the unstructured data, extracting entities, relationships, and attributes of quality risks in the traditional Chinese medicine production process from the traditional Chinese medicine production data to generate triple data includes: Extracting entities from the unstructured data using NLP technology; identifying relationships between the entities through deep learning methods; Attributes related to the entity are extracted from the unstructured data.
4. The method for constructing a knowledge graph for traditional Chinese medicine production quality risk management according to claim 2, characterized in that: When the traditional Chinese medicine production data is the structured data, extracting entities, relationships, and attributes of quality risks in the traditional Chinese medicine production process from the traditional Chinese medicine production data to generate triple data includes: Mapping data strips in the structured data into entities; Mapping the values corresponding to the fields in the structured data to attributes related to the entity; The hierarchical structure or business correlation between fields in the structured data is converted into relationships between the entities.
5. The method for constructing a knowledge graph for traditional Chinese medicine production quality risk management according to claim 3 or 4, characterized in that: The extracting entities, relationships and attributes of quality risks in the traditional Chinese medicine production process from the traditional Chinese medicine production data to generate triple data further includes: Unify the nodes representing the same entity in different data sources through entity linking technology; Performing entity disambiguation on the entity based on context information and attribute features; The entity is resolved based on the text context.
6. The method for constructing a knowledge graph for traditional Chinese medicine production quality risk management according to claim 1, characterized in that: The generating of the knowledge graph of quality risks in the traditional Chinese medicine production process based on the triple data includes: Constructing a semantic framework for knowledge graphs; Classifying the entities in the triple data according to predefined entity types; classifying the relations in the triple data according to predefined relation types; Mapping the extracted triple data into nodes and edges in the knowledge graph to generate the knowledge graph with a graph structure; A graph database is used to store the knowledge graph.
7. The method for constructing a knowledge graph for traditional Chinese medicine production quality risk management according to claim 1, characterized in that: After generating a knowledge graph of quality risks in the traditional Chinese medicine production process based on the triple data, the method further includes: Causal reasoning, risk propagation path analysis and dynamic risk prediction are performed based on the knowledge graph.
8. A knowledge graph construction system for traditional Chinese medicine production quality risk management, characterized by: include: Data acquisition module, used to obtain multi-source heterogeneous traditional Chinese medicine production data; A knowledge extraction module, connected to the data acquisition module, is used to extract entities, relationships and attributes of quality risks in the traditional Chinese medicine production process from the traditional Chinese medicine production data to generate triple data; A knowledge graph construction module is connected to the knowledge extraction module and is used to generate a knowledge graph of quality risks in the production process of traditional Chinese medicine based on the triple data.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for constructing a knowledge graph for traditional Chinese medicine production quality risk management as described in any one of claims 1 to 7 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method for constructing a knowledge graph for quality risk management of traditional Chinese medicine production as described in any one of claims 1 to 7 are implemented.