A traditional Chinese medicine prescription decoction time identification method, electronic device, and program product

By constructing feature vectors of Chinese herbal medicines and prescriptions, and using graph neural networks to identify the optimal decoction time, the problem of the lack of standards for the decoction time of Chinese herbal medicine prescriptions has been solved, realizing the scientific and accurate decoction time, and improving the efficacy and safety of the medicine.

CN120744626BActive Publication Date: 2026-01-02JIANGXI UNIVERSITY OF TRADITIONAL CHINESE MEDICINE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511141742.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-15
Publication Date
2026-01-02
Estimated Expiration
2045-08-15

AI Technical Summary

Technical Problem

The lack of unified and scientific quantitative standards for the decoction time of traditional Chinese medicine prescriptions leads to decoction times that are too short or too long, affecting efficacy or causing adverse reactions. Furthermore, the time required is difficult to accurately control due to reliance on the doctor's personal experience and the patient's subjective operation.

Method used

We construct feature vectors for traditional Chinese medicine and formulas, use graph neural networks for feature learning, and combine information such as medicinal properties, meridian tropism, efficacy and medicinal parts to identify the optimal decoction time through graph neural networks and classifiers.

Benefits of technology

This improves the scientific rigor and accuracy of decoction time identification, reduces reliance on doctors' personal experience and patients' subjective actions, and ensures the stability and safety of the drug's efficacy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120744626B_ABST
    Figure CN120744626B_ABST
Patent Text Reader

Abstract

The application provides a traditional Chinese medicine prescription decoction time recognition method, an electronic device and a program product, the traditional Chinese medicine name text and the medicinal material attribute text are comprehensively used when a traditional Chinese medicine feature vector is constructed, a prescription node initial feature vector is constructed based on a prescription text, and an edge weight of a type edge between a traditional Chinese medicine node and a prescription node is also constructed, so that various information of traditional Chinese medicines and prescriptions is comprehensively considered, and feature extraction is more comprehensive and accurate. The graph neural network is used for feature learning of the prescription node to obtain a prescription feature vector, and then a trained classifier is used for classification to obtain a decoction time length category, so that the scientificity and accuracy of decoction time recognition are improved, and the dependence on the personal experience of doctors and the subjective operation of patients is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of traditional Chinese medicine decoction, in particular to a traditional Chinese medicine prescription decoction time identification method, an electronic device and a program product. BACKGROUND

[0002] Traditional Chinese medicine prescriptions are the core component of the traditional Chinese medicine treatment system, and condense the practical experience and theoretical achievements of generations of Chinese medicine experts. The decoction process of the prescription largely determines the efficacy and safety of the decoction, and the decoction time as a key variable plays a crucial role in the dissolution and transformation of the effective components in the prescription. On the one hand, too short decoction time may not fully release the effective components in the medicinal materials, affecting the therapeutic effect; on the other hand, too long decoction time may destroy the structure of some components, reduce the efficacy, and even produce adverse reactions. Therefore, reasonable control of the decoction time is a key factor to ensure the efficacy of the prescription.

[0003] At present, there is still a lack of unified and scientific quantitative standard for the decoction time of traditional Chinese medicine prescriptions, and in clinical practice, doctors often rely on their personal experience. However, many doctors may be proficient in prescribing, but lack control over the decoction process. In addition, due to the lack of knowledge of traditional Chinese medicine, ordinary patients are difficult to accurately grasp the decoction points, and deviations often occur in actual operation. In addition, some traditional Chinese medicine decoction service institutions have the phenomenon of "one decoction for thousands of prescriptions", ignoring the individual differences between different prescriptions. SUMMARY

[0004] The purpose of the embodiments of the present application is to provide a traditional Chinese medicine prescription decoction time identification method, an electronic device and a program product, to solve the problem of lack of unified and scientific quantitative standard for the decoction time of traditional Chinese medicine prescriptions.

[0005] The traditional Chinese medicine prescription decoction time identification method provided by the embodiments of the present application comprises:

[0006] According to the traditional Chinese medicine name text and the medicinal material attribute text, a traditional Chinese medicine feature vector of the traditional Chinese medicine node is constructed;

[0007] According to the prescription text, an initial feature vector of the prescription node is constructed;

[0008] The traditional Chinese medicine node and the prescription node are taken as two types of heterogeneous nodes in the graph, and the edge weight of the type edge between the traditional Chinese medicine node and the prescription node is constructed;

[0009] The prescription node is subjected to feature learning by using a graph neural network, and a prescription feature vector is obtained;

[0010] The prescription feature vector is classified by using the trained classifier, and a corresponding decoction time category is obtained.

[0011] In the technical solution, the Chinese medicine feature vector is constructed by comprehensively considering the Chinese medicine name text and the medicinal material attribute text, the initial feature vector of the prescription node is constructed based on the prescription text, and the edge weight of the type edge between the Chinese medicine node and the prescription node is also constructed. Various information of Chinese medicine and prescription is comprehensively considered, so that the feature extraction is more comprehensive and accurate. The prescription feature vector is obtained by using the graph neural network to learn the features of the prescription node, and then the trained classifier is used for classification to obtain the decoction time length category, thereby improving the scientificity and accuracy of the decoction time recognition and reducing the dependence on the personal experience of doctors and the subjective operation of patients.

[0012] In some optional embodiments, the medicinal material attribute text includes at least one of medicinal property, meridian tropism, efficacy and medicinal part.

[0013] The medicinal property includes the cold, hot, warm and cool characteristics of the Chinese medicine. The tolerance of medicinal materials with different medicinal properties to temperature and time is different during decoction. For example, the effective components of cold-natured medicinal materials such as Coptis chinensis may be more easily dissolved out under long-time high-temperature decoction, but excessive decoction may also cause the destruction of some components; and hot-natured medicinal materials such as Aconitum carmichaeli need to be decocted for a long time to reduce toxicity. The medicinal property is included in the feature vector, which can more accurately consider the influence of these differences on the decoction time.

[0014] The meridian tropism reflects the selectivity of Chinese medicine acting on the human body. The absorption, distribution and metabolism of the effective components of medicinal materials with different meridian tropisms in the body are different, which also indirectly affects the determination of the decoction time. For example, the effective components of medicinal materials with liver meridian tropism may need specific decoction conditions to be better absorbed and utilized by the human body, and the inclusion of meridian tropism information helps to optimize the decoction time recognition from this perspective.

[0015] The efficacy is the specific manifestation of the therapeutic effect of Chinese medicine. The effective components of medicinal materials with different efficacies are different, and the requirements for decoction are also different. For example, medicinal materials with the function of relieving the exterior, such as Ephedra sinica, have volatile oil as the effective component, and long-time decoction will cause a large amount of volatile oil to be lost, affecting the efficacy; and medicinal materials with the function of tonifying, such as Panax ginseng, need to be decocted for a long time to make the effective components fully dissolved out. Clearing the efficacy information can more specifically determine the decoction time.

[0016] The medicinal part: the tissue structure and component composition of medicinal materials with different medicinal parts are different, and the dissolution speed and degree of effective components during decoction are also different. For example, flower medicinal materials such as Chrysanthemum morifolium have loose texture, and the effective components are easily dissolved out, so the decoction time is relatively short; and root and stem medicinal materials such as Astragalus membranaceus have solid texture, and need to be decocted for a long time to fully release the effective components. The inclusion of the medicinal part in the feature vector can more carefully consider the influence of these factors on the decoction time.

[0017] The embodiment integrates multiple information such as medicinal properties, meridians, effects and medicinal parts to construct a traditional Chinese medicine feature vector, providing a more comprehensive and detailed input feature for the model. These rich features can help the model better learn the complex relationship between traditional Chinese medicine and decoction time, thereby improving the accuracy of decoction time recognition. By incorporating various attribute information, the model can mine potential correlation rules between different attributes and between attributes and decoction time. For example, the model may find that a certain combination of medicinal properties and meridians has a certain effect, and under certain medicinal parts, the optimal decoction time has certain rules. Capturing these potential rules helps further improve the reliability of the recognition results.

[0018] In some optional embodiments, a traditional Chinese medicine feature vector of a traditional Chinese medicine node is constructed according to a traditional Chinese medicine name text and a medicinal material attribute text, including:

[0019] The traditional Chinese medicine name text is input into a pre-trained word vector embedding model to obtain a first word vector;

[0020] The medicinal material attribute text is input into the pre-trained word vector embedding model to obtain a second word vector;

[0021] The first word vector and the second word vector are spliced to obtain the traditional Chinese medicine feature vector of the traditional Chinese medicine node.

[0022] In the above technical solution, the pre-trained word vector embedding model (such as Word2Vec, GloVe, etc.) is pre-trained on a large-scale corpus and can capture the rich representation of words in the semantic space. Inputting the traditional Chinese medicine name text and the medicinal material attribute text into these models can effectively convert the words in the text into vector form with semantic information. The traditional Chinese medicine name text and the medicinal material attribute text may differ in semantics and expression. Separately processing them can better preserve the unique semantic features of their respective texts. For example, the traditional Chinese medicine name may contain some specific appellations, historical evolution, etc. information, while the medicinal material attribute text focuses on describing the medicinal properties, effects, etc. of the medicinal material. Separate processing helps more accurately extract the semantic connotations of different types of text.

[0023] Splicing the first word vector obtained through the traditional Chinese medicine name text and the second word vector obtained through the medicinal material attribute text realizes the organic integration of multiple feature information. The traditional Chinese medicine name often contains certain historical and cultural information, traditional cognition, etc. These information may have potential correlation with decoction time; while the medicinal material attribute text directly reflects the intrinsic characteristics of the medicinal material, which has a direct impact on the decoction time. The spliced feature vector not only contains the semantic information of the traditional Chinese medicine name, but also covers the specific characteristics of the medicinal material attribute, providing a more comprehensive and rich input for subsequent graph neural network feature learning and classifier classification.

[0024] In some optional embodiments, according to the prescription text, the initial feature vector of the prescription node is constructed, including:

[0025] For each prescription text, all traditional Chinese medicine feature vectors in the prescription text are weighted and averaged according to the corresponding dose to obtain the initial feature vector of the prescription node.

[0026] In the above technical solution, in the actual decoction process, the component content and interaction of different doses of medicinal materials in the decoction will be different. The effective components released by the medicinal materials with large dose in the decoction process are relatively more, and the influence on the decoction time and the final efficacy is more significant. By constructing the initial feature vector through weighted averaging, the actual decoction effect can be simulated, and the obtained feature vector can better represent the real situation of the prescription in the decoction process. The compatibility of traditional Chinese medicine prescriptions is one of the core contents of traditional Chinese medicine theory. The compatibility between different medicinal materials will produce complex effects such as synergy and antagonism. By constructing the initial feature vector through weighted averaging, the compatibility relationship can be reflected to some extent. Because the size of the dose will affect the degree of interaction between medicinal materials, the weighted averaging operation can reflect the relative position and mutual influence of different medicinal materials in the compatibility, so as to more comprehensively describe the characteristics of the prescription.

[0027] In some optional embodiments, the edge weight of the type edge between the traditional Chinese medicine node and the prescription node is constructed, including:

[0028] According to the word frequency of the traditional Chinese medicine node in the prescription node and the inverse document frequency of the frequency of the traditional Chinese medicine node appearing in the whole data set, the edge weight of the type edge between the traditional Chinese medicine node and the prescription node is obtained.

[0029] Wherein, the word frequency of the traditional Chinese medicine node in the prescription node refers to the relative dose (dose weight) of the traditional Chinese medicine in the prescription.

[0030] In the above technical solution, the word frequency of the traditional Chinese medicine node in the prescription node is measured by the relative dose of the traditional Chinese medicine in the prescription, which fully considers the importance of the traditional Chinese medicine in a specific prescription. The traditional Chinese medicine with a large relative dose has a more significant impact on the overall efficacy and decoction time during the decoction process of the prescription. For example, in a prescription, if a certain medicine has a high relative dose, it indicates that it plays a key role in treatment, and the association strength between it and the prescription node should also be larger. In this way, the edge weight can accurately reflect the unique position and role of the traditional Chinese medicine in the local prescription. The inverse document frequency of the traditional Chinese medicine node in the whole data set measures the universality and importance of the traditional Chinese medicine in the whole data set from a global perspective. If a traditional Chinese medicine frequently appears in many prescriptions, it may be a common medicinal material, and its association strength with a specific prescription node may need to be adjusted appropriately. The calculation of the inverse document frequency can reduce the weight of common traditional Chinese medicines, highlighting those traditional Chinese medicines that have a special role in a specific prescription but have a low overall frequency, thereby more accurately depicting the association between traditional Chinese medicines and prescription nodes and improving the ability to identify decoction times for different types of prescriptions.

[0031] In some optional embodiments, a graph neural network is used to learn the features of the prescription node to obtain a prescription feature vector, including:

[0032] The initial feature vector of the prescription node and the heterogeneous neighbor information and edge weight are iteratively updated by a multi-layer weighted heterogeneous SAGEConv graph neural network to obtain the prescription feature vector.

[0033] In the above technical solution, the initial feature vector of the prescription node contains information about the prescription itself, while the heterogeneous neighbor information represents the features of other related nodes such as traditional Chinese medicine nodes connected to the prescription node. The multi-layer weighted heterogeneous SAGEConv graph neural network can deeply integrate the initial feature vector of the prescription node and the heterogeneous neighbor information through multiple iterations of weighted aggregation. This makes the prescription feature vector not only contain information about the medicinal ingredients, dosage, etc. of the prescription itself, but also incorporate the characteristics of related traditional Chinese medicines such as medicinal properties, meridians, and efficacy, greatly enriching the information content of the feature vector and providing more comprehensive and accurate inputs for subsequent classification tasks. The edge weight reflects the strength of the association between the traditional Chinese medicine node and the prescription node, and in the feature learning process, the network will weight the neighbor information according to the edge weight. In this way, the information of traditional Chinese medicine nodes that are more closely associated with the prescription node will have a greater weight and a greater impact on the prescription feature vector during the aggregation process. This weighting mechanism can more accurately capture the complex relationships between traditional Chinese medicines and prescriptions, making the prescription feature vector better reflect the actual characteristics of the prescription.

[0034] In some optional embodiments, the decoction time category includes:

[0035] Label I: 3-20 min; Label II: 20-35 min; Label III: 35-60 min.

[0036] In the technical solution, the data set has only several discrete standard time points (such as 10, 15, 20, 25, 30, 35 minutes, etc.) for decocting time, and is not continuous. Therefore, the discretization processing is more in line with the distribution characteristics of the actual label. The classification basis is the relevant provisions of the Management Standard for Traditional Chinese Medicine Decoction Room of Medical Institutions. For different categories of traditional Chinese medicines, there are certain standards for decocting time. The drugs for relieving exterior, clearing heat and aromatic drugs should not be decocted for a long time, and should be boiled and then decocted for 15-20 minutes. The general drugs should be boiled and then decocted for 20-30 minutes. The tonifying drugs should be boiled and then decocted for 40-60 minutes. In actual decoction, the decocting time may have slight differences from the decocting standards due to various factors. In order to better understand the decocting time distribution in the actual situation, according to the processed traditional Chinese medicine prescription data and the guidance of experts in the field of traditional Chinese medicine, the decocting time contained in the data is divided into three labels. Label I: 3-20 min; Label II: 20-35 min; Label III: 35-60 min.

[0037] In some optional embodiments, before the decocting time of the prescription feature vector is classified by using the trained classifier, the method further includes:

[0038] A training set is constructed. The training set includes the prescription feature vector and the corresponding decocting time category label.

[0039] The training set is input into the classifier to obtain the trained classifier.

[0040] The electronic device provided by the embodiment of the present application includes a processor and a memory. The memory stores machine readable instructions executable by the processor. When the machine readable instructions are executed by the processor, the method described in any of the above embodiments is performed.

[0041] The computer program product provided by the embodiment of the present application includes a computer program / instruction. When the computer program / instruction is executed by a processor, the steps of the method described in any of the above embodiments are implemented. BRIEF DESCRIPTION OF DRAWINGS

[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.

[0043] Figure 1A traditional Chinese medicine prescription decoction time recognition method step flow chart provided by the embodiment of the application;

[0044] Figure 2 A model structure schematic diagram used in the embodiment;

[0045] Figure 3 A possible structure schematic diagram of an electronic device provided by the embodiment of the application. DETAILED DESCRIPTION

[0046] The technical solutions in the embodiments of the application will be described below with reference to the drawings in the embodiments of the application.

[0047] Please refer to Figure 1 , Figure 1 A traditional Chinese medicine prescription decoction time recognition method step flow chart provided by the embodiment of the application, comprising:

[0048] Step S1, constructing a traditional Chinese medicine feature vector of a traditional Chinese medicine node according to a traditional Chinese medicine name text and a medicinal material attribute text;

[0049] Among them, the traditional Chinese medicine feature vector, for example: the traditional Chinese medicine name (100 dimensions), the traditional Chinese medicine attribute (including the medicinal property, the medicinal effect, the medicinal part, the medicinal taste and the meridian tropism, a total of 100 dimensions) are spliced, and the final traditional Chinese medicine feature vector is 200 dimensions.

[0050] Step S2, constructing an initial feature vector of a prescription node according to a prescription text;

[0051] Among them, the initial feature vector: is obtained by weighted average of the traditional Chinese medicine feature vectors according to the dosages of the traditional Chinese medicines for composing the prescription. For example: the 100-dimensional word vector of the traditional Chinese medicine node feature vector of Huangqi is generated by the name "Huangqi", and the 100-dimensional word vector of the attribute "cold, bitter, lung meridian, heat-clearing and dampness" is generated. Splice the two to get a 200-dimensional traditional Chinese medicine feature vector. Prescription A contains "Huangqi (6g), Chaihu (10g), Banxia (9g)", then the 200-dimensional feature vectors of the three traditional Chinese medicines are obtained, and the 200-dimensional feature vector of the prescription is obtained by weighted average according to the dosages (6:10:9).

[0052] Step S3, taking the traditional Chinese medicine node and the prescription node as two types of heterogeneous nodes in the graph, constructing the edge weight of the type edge between the traditional Chinese medicine node and the prescription node;

[0053] Among them, the edge weight not only considers the dosage weight of the traditional Chinese medicine in a single prescription, but also introduces the inverse document frequency (IDF) of the frequency of the traditional Chinese medicine in the whole data set. The importance and difference of the medicinal material are calculated by the proposed TCM-TFIDF method to enhance the semantic expression ability of the edges in the graph.

[0054] Step S4, using a graph neural network to learn the characteristics of the prescription node to obtain a prescription feature vector;

[0055] The graph neural network can use a SAGEConv graph neural network to learn the characteristics of the prescription node, and use heterogeneous neighbor information and edge weight to perform weighted information aggregation, so as to fully learn the influence of medicinal material compatibility structure and dosage weight on the expression of the prescription.

[0056] Step S5, using the trained classifier to classify the prescription feature vector to obtain the corresponding decoction time length category.

[0057] The classifier can use a two-layer perception machine (MLP).

[0058] In the embodiments of the present application, the Chinese medicine feature vector is constructed by comprehensively considering the Chinese medicine name text and the medicinal material attribute text, the initial feature vector of the prescription node is constructed based on the prescription text, and the edge weight of the type edge between the Chinese medicine node and the prescription node is also constructed. Various information of Chinese medicine and prescription is comprehensively considered, so that the feature extraction is more comprehensive and accurate. The graph neural network is used to learn the characteristics of the prescription node to obtain the prescription feature vector, and then the trained classifier is used for classification to obtain the decoction time length category, which improves the scientificity and accuracy of the decoction time recognition and reduces the dependence on the personal experience of the doctor and the subjective operation of the patient.

[0059] In some optional embodiments, the medicinal material attribute text includes at least one of medicinal property, meridian tropism, efficacy and medicinal part.

[0060] The medicinal property includes the characteristics of cold, heat, warm and cool of Chinese medicine. The medicinal materials with different medicinal properties have different tolerances to temperature and time during the decoction process. For example, the effective components of cold medicinal materials such as Coptis chinensis may be more easily dissolved out under long-time high-temperature decoction, but excessive decoction may also cause the destruction of some components; while hot medicinal materials such as Aconitum carmichaeli need to be decocted for a long time to reduce toxicity. By including the medicinal property in the feature vector, the influence of these differences on the decoction time can be more accurately considered.

[0061] The meridian tropism reflects the selectivity of Chinese medicine acting on the viscera and meridians of the human body. The absorption, distribution and metabolism of the effective components of medicinal materials with different meridian tropisms in the body are different, which also indirectly affects the determination of decoction time. For example, the effective components of medicinal materials with liver meridian tropism may need specific decoction conditions to be better absorbed and utilized by the human body, and the inclusion of meridian tropism information helps to optimize the decoction time recognition from this perspective.

[0062] Efficacy: Efficacy is the specific manifestation of the therapeutic effect of traditional Chinese medicine. Different effective components are contained in medicinal materials with different efficacy, and the requirements for decoction are also different. For example, medicinal materials with the function of relieving the exterior, such as Ephedra, contain volatile oil as the effective component, and long decoction time will cause a large amount of volatile oil to be lost, affecting the efficacy. Medicinal materials with the function of tonifying, such as ginseng, need a long decoction time to fully dissolve the effective components. Clearing the efficacy information can more targetedly determine the decoction time.

[0063] Medicinal parts: Different medicinal parts of medicinal materials have different tissue structures and component compositions, and the dissolution speed and degree of effective components are also different during decoction. For example, flower medicinal materials such as chrysanthemum have loose texture and effective components are easily dissolved, so the decoction time is relatively short. Root and stem medicinal materials such as Huangqi have solid texture and need a long decoction time to fully release the effective components. Including the medicinal parts in the feature vector can more carefully consider the influence of these factors on the decoction time.

[0064] This embodiment constructs the traditional Chinese medicine feature vector by comprehensively considering multiple information such as medicinal properties, meridians, efficacy and medicinal parts, and provides more comprehensive and detailed input features for the model. These rich features can help the model better learn the complex relationship between traditional Chinese medicine and decoction time, thereby improving the accuracy of decoction time recognition. By including multiple attribute information, the model can mine the potential correlation between different attributes and between attributes and decoction time. For example, the model may find that a certain combination of medicinal properties and meridians and a certain efficacy of medicinal materials have a certain regularity in the best decoction time under the condition of a certain medicinal part. The capture of this potential law helps to further improve the reliability of the recognition result.

[0065] In some optional embodiments, in step S1, the traditional Chinese medicine feature vector of the traditional Chinese medicine node is constructed according to the traditional Chinese medicine name text and the medicinal material attribute text, including:

[0066] The traditional Chinese medicine name text is input into a pre-trained word vector embedding model to obtain a first word vector;

[0067] The medicinal material attribute text is input into a pre-trained word vector embedding model to obtain a second word vector;

[0068] The first word vector and the second word vector are spliced to obtain the traditional Chinese medicine feature vector of the traditional Chinese medicine node.

[0069] In the embodiments of the present application, the pre-trained word vector embedding model (such as Word2Vec, GloVe, etc.) is pre-trained on a large corpus and can capture the rich representation of words in the semantic space. By inputting the traditional Chinese medicine name text and the medicinal material attribute text into these models, the words in the text can be effectively converted into vector form with semantic information. The traditional Chinese medicine name text and the medicinal material attribute text may differ in semantics and expression. Separate word vector embedding processing of them can better preserve the unique semantic features of their respective texts. For example, the traditional Chinese medicine name may contain some specific titles, historical evolution, etc. information, while the medicinal material attribute text focuses on describing the medicinal properties, efficacy, etc. objective attributes of medicinal materials, and separate processing helps to more accurately extract the semantic connotations of different types of text.

[0070] The first word vector obtained by the traditional Chinese medicine name text and the second word vector obtained by the medicinal material attribute text are spliced, realizing the organic integration of multi-aspect feature information. The traditional Chinese medicine name often contains certain historical and cultural information, traditional cognition, etc. These information may have a potential correlation with the decoction time; while the medicinal material attribute text directly reflects the inherent characteristics of the medicinal materials, which has a direct impact on the decoction time. The spliced feature vector contains not only the semantic information of the traditional Chinese medicine name, but also the specific features of the medicinal material attribute, providing more comprehensive and rich inputs for subsequent graph neural network feature learning and classifier classification.

[0071] In some optional embodiments, in step S2, according to the prescription text, an initial feature vector of the prescription node is constructed, including:

[0072] For each prescription text, all traditional Chinese medicine feature vectors in the prescription text are weighted and averaged according to the corresponding dose to obtain the initial feature vector of the prescription node.

[0073] In the embodiments of the present application, in the actual decoction process, the component content and interaction of medicinal materials of different doses in the decoction will be different. The effective components released by medicinal materials with large doses in the decoction process are relatively more, and have more significant influence on the decoction time and the final efficacy. By constructing the initial feature vector through weighted averaging, the actual decoction effect can be simulated, and the obtained feature vector can better represent the real situation of the prescription in the decoction process. The compatibility of traditional Chinese medicine prescriptions is one of the core contents of traditional Chinese medicine theory, and the compatibility between different medicinal materials will produce complex effects such as synergy and antagonism. By constructing the initial feature vector through weighted averaging, the compatibility relationship can be reflected to some extent. Because the size of the dose will affect the degree of interaction between medicinal materials, the weighted averaging operation can reflect the relative position and mutual influence of different medicinal materials in the compatibility, thereby more comprehensively describing the features of the prescription.

[0074] In some optional embodiments, in step S3, the edge weight of the type edge between the TCM node and the prescription node is constructed, including:

[0075] According to the word frequency of the TCM node in the prescription node and the inverse document frequency of the TCM node in the whole data set, the edge weight of the type edge between the TCM node and the prescription node is obtained.

[0076] The word frequency of the TCM node in the prescription node refers to the relative dosage of the TCM in the prescription.

[0077] In this embodiment, the TCM-TFIDF weight is used as the edge weight. Specifically, the TCM-TFIDF maps the “word-document” relationship in the text statistical method (TF-IDF) to the “medicine- prescription” relationship and performs essential reconstruction:

[0078] The TF (word frequency) is redefined as the relative dosage: TF = dosage of single medicine in the prescription / total dosage of the prescription, which quantifies the local importance of the medicine in the current prescription (for example, the dosage of angelica in a certain prescription accounts for 30%).

[0079] The IDF (inverse document frequency) is redefined as global rarity: IDF = log (total number of prescriptions / number of prescriptions containing the medicine), which quantifies the scarcity of the medicine in the whole data set (for example, the fewer the number of musk, the higher the IDF).

[0080] Dynamic weighted fusion: edge weight TCM-TFIDF = TF × IDF, which realizes the synergistic regulation of dosage and frequency. This embodiment converts the text statistical method (TF-IDF) into a quantitative tool for TCM dosage-frequency, dynamically adjusts the semantic expression of the heterogeneous graph through the edge weight, and enables the model to simultaneously learn the local compatibility structure (dosage weight) and the global medicine distribution (frequency weight) for the first time, which significantly improves the accuracy and interpretability of the decoction time classification.

[0081] In the embodiments of the present application, the word frequency of the traditional Chinese medicine node in the prescription node is measured by the relative dose of the traditional Chinese medicine in the prescription, which fully considers the importance of the traditional Chinese medicine in a specific prescription. The traditional Chinese medicine with a large relative dose has a more significant impact on the overall efficacy and decoction time during the decoction process of the prescription. For example, in a prescription, if a certain medicine has a high relative dose, it indicates that it plays a key role in treatment, and the association strength between it and the prescription node should also be larger. In this way, the edge weight can accurately reflect the unique position and role of the traditional Chinese medicine in the local prescription. The inverse document frequency of the frequency of the traditional Chinese medicine node in the whole data set measures the universality and importance of the traditional Chinese medicine in the whole data set from a global perspective. If a traditional Chinese medicine frequently appears in many prescriptions, it may be a common and general medicinal material, and the association strength between it and a specific prescription node may need to be adjusted appropriately. The calculation of the inverse document frequency can reduce the weight of common traditional Chinese medicines, highlight those traditional Chinese medicines that have a special role in a specific prescription but have a low overall frequency, and thus more accurately depict the association between the traditional Chinese medicine and the prescription node and improve the ability to identify the decoction time of different types of prescriptions.

[0082] Specifically, the traditional Chinese medicine has a word frequency TF in the prescription . , wherein is the actual dose of the traditional Chinese medicine in the prescription . TF reflects the relative dose of the traditional Chinese medicine in the prescription and reflects the local importance of the traditional Chinese medicine. Among them, k is the kth medicinal material of the prescription, d k refers to the dose of the kth medicinal material.

[0083] The inverse document frequency IDF is: , wherein represents the number of prescriptions in which the traditional Chinese medicine appears (for example, there are 100 pieces of prescription data, and the traditional Chinese medicine A appears 20 times in the 100 pieces of prescription data, so the value of is 20), and the total number of prescriptions. A larger IDF indicates that the medicinal material is rarer and thus obtains a higher weight in the model.

[0084] The final weight of the edge TCM-TFIDF is .

[0085] In some optional embodiments, in step S4, a graph neural network is used to learn the features of the prescription node to obtain a prescription feature vector, including:

[0086] A multi-layer weighted heterogeneous SAGEConv graph neural network is used to perform multiple weighted aggregation iterations on the initial feature vector of the prescription node, the heterogeneous neighbor information, and the edge weight to update and obtain the prescription feature vector.

[0087] In the embodiments of the present application, the initial feature vector of the prescription node contains the information of the prescription itself, and the heterogeneous neighbor information represents the features of other related nodes such as traditional Chinese medicine nodes connected to the prescription node. The multi-layer weighted heterogeneous SAGEConv graph neural network can deeply integrate the initial feature vector of the prescription node and the heterogeneous neighbor information through multiple weighted aggregation iterations. This makes the prescription feature vector not only contain the information of the medicinal materials composition, dosage, etc. of the prescription itself, but also integrate the characteristics such as medicinal properties, meridians, and efficacy of the related traditional Chinese medicines, greatly enriching the information amount of the feature vector and providing more comprehensive and accurate input for subsequent classification tasks. The edge weight reflects the strength of the association between the traditional Chinese medicine node and the prescription node. In the feature learning process, the network will weight the neighbor information according to the edge weight. In this way, the information of the traditional Chinese medicine nodes associated more closely with the prescription node will get a greater weight and have a greater impact on the prescription feature vector in the aggregation process. This weighting mechanism can more accurately capture the complex relationship between traditional Chinese medicines and prescriptions, and make the prescription feature vector better reflect the actual characteristics of the prescription.

[0088] Specifically, please refer to Figure 2 , Figure 2 the model structure diagram used in the embodiments of the present application. In the embodiments of the present application, three-layer heterogeneous SAGEConv is used, P represents the prescription node, and H represents the traditional Chinese medicine node. In each layer, the prescription node receives weighted information from adjacent traditional Chinese medicine nodes, splices its own feature, aggregates neighbor features, and updates node representation. After three-layer update, the prescription node finally contains: its own feature (dose-weighted traditional Chinese medicine information), directly related traditional Chinese medicine information, and indirect relationship combination information, reflecting the compatibility relationship and combination dosage information. Three times of feature propagation and update enable the prescription node to gradually integrate richer medicinal properties, medicinal tastes, and compatibility relationships, and capture complex dependency relationships from directly compatible drugs to indirectly associated drugs.

[0089] In some optional embodiments, the decoction duration category includes:

[0090] Label I: 3-20 min; Label II: 20-35 min; Label III: 35-60 min.

[0091] In the embodiments of the present application, since the values of decoction time in the data set are only several discrete standard time points (such as 10, 15, 20, 25, 30, 35 minutes, etc.), not continuous time. Therefore, the discretization processing is more in line with the distribution characteristics of the actual label, and according to the relevant provisions of the “Management Standard for Traditional Chinese Medicine Decoction Room in Medical Institutions”, the decoction time contained in the data is divided into three labels, label I: 3-20 min; label II: 20-35 min; label III: 35-60 min. For different categories of traditional Chinese medicines, there is a certain standard for decoction time, and the decoction time category label of the embodiments can perfectly adapt to the following situations: drugs for relieving superficies, clearing heat and aromatic drugs should not be decocted for a long time, and after boiling, they should be decocted for 15-20 min; after boiling, general drugs should be decocted for 20-30 min; after boiling, tonifying drugs should be decocted for 40-60 min. Therefore, the decoction time category setting of the embodiments strictly follows the TCM standard, accurately covers the clinical common decoction time distribution (such as label I corresponding to 15-20 min of superficies relieving drugs), adapts to the actual discrete data characteristics, and significantly improves the model classification accuracy and clinical practicability.

[0092] In some optional embodiments, before the step S5 of classifying the prescription feature vector by using the trained classifier to obtain the corresponding decoction time category, the method further comprises the following steps:

[0093] constructing a training set; the training set comprises the prescription feature vector and the corresponding decoction time category label;

[0094] inputting the training set into the classifier to obtain the trained classifier.

[0095] In the process of constructing the graph neural network, the edge weight is constructed in the above embodiments. In order to further explore the role of the edge weight mechanism in the graph neural network model, the present embodiment carries out comparative experiments under the conditions of using and not using the edge weight, and the results are shown in Table 1. The experimental data shows that the edge weight mechanism significantly improves the model performance. After introducing the edge weight, the ACC (accuracy) is improved from 85.71% to 87.90%, the Precision (precision) is improved from 86.15% to 88.06%, the Recall (recall) is improved from 85.91% to 88.07%, and the F1 (harmonic mean of precision and recall) value is also increased from 86.01% to 88.03%. Each index is improved by about 2.1 percentage points, indicating that the edge weight plays a positive role in promoting the more reasonable propagation of graph structure information.

[0096] Table 1, experimental results of whether to use weight

[0097]

[0098] Overall, edge weights can provide more detailed graph structure semantic expression for the model, especially in the context of traditional Chinese medicine prescriptions with naturally existing dosage information, which is particularly crucial. The experimental results verify the feasibility and effectiveness of using traditional Chinese medicine dosage and inverse literature frequency as edge weights in graph neural networks, providing an important design basis for traditional Chinese medicine prescription modeling.

[0099] Figure 3 A possible structure of an electronic device provided by an embodiment of the present application is shown. Referring to Figure 3 , the electronic device includes a processor, a memory, and a communication interface, which are interconnected and communicate with each other through a communication bus and / or other forms of connection mechanism (not shown).

[0100] The memory includes one or more (only one is shown in the figure), which can be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The processor and other possible components can access the memory to read and / or write data therein.

[0101] The processor comprises one or more (only one is shown in the figure), which can be an integrated circuit chip with signal processing capabilities. The aforementioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Microcontroller Unit (MCU), a Network Processor (NP), or other conventional processors; it can also be a special-purpose processor, including a Neural-network Processing Unit (NPU), a Graphics Processing Unit (GPU), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. Furthermore, when there are multiple processors, some can be general-purpose processors, and others can be special-purpose processors.

[0102] The communication interface includes one or more (only one is shown in the figure), which can be used to communicate directly or indirectly with other devices to exchange data. The communication interface may include interfaces for wired and / or wireless communication.

[0103] One or more computer program instructions may be stored in the memory, and the processor may read and execute these computer program instructions to implement the methods provided in the embodiments of this application.

[0104] Understandable. Figure 3 The structure shown is for illustrative purposes only; the electronic device may also include structures that are more complex than those shown. Figure 3 The more or fewer components shown, or having the same Figure 3 The different structures shown. Figure 3 The components shown can be implemented using hardware, software, or a combination thereof. Electronic devices may be physical devices, such as PCs, laptops, tablets, mobile phones, servers, embedded devices, etc., or they may be virtual devices, such as virtual machines, virtualized containers, etc. Furthermore, electronic devices are not limited to a single device; they can also be a combination of multiple devices or a cluster of a large number of devices.

[0105] The embodiment of the present application provides a computer program product, including computer programs / instructions, which are executed by a processor to realize the steps of the method described above.

[0106] In the embodiments of the present application, it should be understood that the disclosed device and method can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There can be another division during actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some communication interfaces, devices or units, and can be electrical, mechanical or in other forms.

[0107] In addition, the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, that is, can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment of the present application.

[0108] In addition, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0109] In this paper, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations.

[0110] The above only describes the embodiments of the present application and does not limit the protection scope of the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for identifying the decoction time of a traditional Chinese medicine prescription, characterized in that, include: Based on the text of the Chinese medicine name and the text of the medicinal material attributes, construct the Chinese medicine feature vector of the Chinese medicine node; Based on the prescription text, construct the initial feature vector of the prescription node; Treating the Chinese medicine nodes and prescription nodes as two types of heterogeneous nodes in the graph, the edge weights of the type edges between the Chinese medicine nodes and the prescription nodes are constructed. Using a graph neural network, feature learning is performed on the prescription nodes to obtain the prescription feature vector; The trained classifier is used to classify the feature vector of the prescription to obtain the corresponding decoction time category; The step of constructing the initial feature vector of the prescription node based on the prescription text includes: For each of the above prescription texts, the feature vectors of all Chinese medicines in the prescription text are weighted and averaged according to the corresponding dosage to obtain the initial feature vector of the prescription node; The construction of the edge weights for the type edges between the traditional Chinese medicine nodes and the prescription nodes includes: Based on the word frequency of the Chinese herbal medicine node in the prescription node, and the inverse literature frequency of the frequency of the Chinese herbal medicine node in the entire dataset, the edge weight of the type edge between the Chinese herbal medicine node and the prescription node is obtained; where the word frequency is the dosage weight of the Chinese herbal medicine in the prescription. The method of using a graph neural network to learn features from the prescription nodes to obtain prescription feature vectors includes: Using a multi-layer weighted heterogeneous SAGEConv graph neural network, the initial feature vector of the prescription node is iteratively updated by multiple weighted aggregations with heterogeneous neighbor information and edge weights to obtain the prescription feature vector.

2. The method as described in claim 1, characterized in that, The medicinal material attribute text includes at least one of the following: medicinal properties, meridian tropism, efficacy, and medicinal part.

3. The method as described in claim 1, characterized in that, The step of constructing the traditional Chinese medicine feature vector of the traditional Chinese medicine node based on the text of the traditional Chinese medicine name and the text of the medicinal material attributes includes: The text of the Chinese medicine name is input into a pre-trained word vector embedding model to obtain the first word vector; The medicinal material attribute text is input into a pre-trained word vector embedding model to obtain a second word vector; The first word vector and the second word vector are concatenated to obtain the traditional Chinese medicine feature vector of the traditional Chinese medicine node.

4. The method as described in claim 1, characterized in that, The categories of simmering time include: Label I: 3-20 min; Label II: 20-35 min; Label III: 35-60 min.

5. The method as described in claim 1, characterized in that, Before classifying the formula feature vector using the trained classifier to obtain the corresponding decoction time category, the method further includes: Construct a training set; the training set includes the formula feature vector and the corresponding decoction time category label; The training set is input into the classifier to obtain the trained classifier.

6. An electronic device, characterized in that, include: A processor and a memory, the memory storing machine-readable instructions executable by the processor, which, when executed by the processor, perform the method as described in any one of claims 1-5.

7. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Decoction decocting parameter decision-making method and decocting parameter decision-making model training method

    CN113509388A

  • Intelligent medicine decocting control method and device based on traditional Chinese medicine e-commerce platform and electronic equipment

    CN120319392A