Traditional Chinese medicine data analysis method, system and equipment and storage medium

By establishing a traditional Chinese medicine knowledge base and structuring prescription data, and combining the matching results of related prescription texts, a multi-dimensional evaluation of traditional Chinese medicine prescriptions is conducted, which solves the problem of inaccurate evaluation results of traditional Chinese medicine prescriptions and improves accuracy and reliability.

CN121237304APending Publication Date: 2025-12-30BEIJING ZHIYI NET PHARM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511345664.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-19
Publication Date
2025-12-30

AI Technical Summary

Technical Problem

Existing technologies for evaluating TCM prescriptions have the problem that the same prescription may have different rational medication plans due to different syndromes, constitutions or conditions, leading to inaccurate evaluation results.

Method used

A traditional Chinese medicine knowledge base is established, including a database of rules on the incompatibilities of traditional Chinese medicine combinations, a database of dosage safety thresholds, and a database of efficacy conflict features. By processing prescription data in a structured manner and combining the matching results of related prescription texts, prescriptions are evaluated in multiple dimensions, and scores are generated through weighting and dynamic adjustment.

Benefits of technology

It enables a comprehensive and objective evaluation of TCM prescriptions, improves the accuracy and reliability of the evaluation, and provides targeted optimization suggestions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121237304A_ABST
    Figure CN121237304A_ABST
Patent Text Reader

Abstract

The invention provides a traditional Chinese medicine data analysis method, system and device and a storage medium, and relates to the technical field of artificial intelligence. Obtaining target traditional Chinese medicines in the to-be-detected prescription text and a target dose of each traditional Chinese medicine in the target traditional Chinese medicines, and generating structured prescription data; matching the structured prescription data with a traditional Chinese medicine knowledge base to generate a matching coefficient, and generating an initial score of the to-be-detected prescription according to the matching coefficient; obtaining an associated prescription text associated with the to-be-detected prescription text, obtaining a matching result of the associated prescription text and the traditional Chinese medicine knowledge base, and determining a standard score of the associated prescription text according to the matching result; and adjusting the initial score according to the standard score, generating a target score of the to-be-detected prescription, and when the target score is lower than a preset score, generating an adjustment strategy of the to-be-detected prescription. The technical effect of the invention is that the accuracy of the traditional Chinese medicine prescription evaluation result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, specifically to a method, system, device, and storage medium for traditional Chinese medicine data analysis. Background Technology

[0002] With the modernization of traditional Chinese medicine (TCM), the standardization and normalization of TCM prescriptions have become increasingly important. In clinical practice, a comprehensive evaluation of the drug combinations, dosage settings, and efficacy compatibility of prescriptions is necessary to ensure their safety and effectiveness. However, due to the flexible and highly personalized nature of TCM prescriptions, establishing a scientific and reasonable evaluation system to achieve objective and quantitative evaluation of prescription quality has become a pressing technical problem.

[0003] Existing technologies typically employ the establishment of a traditional Chinese medicine knowledge base and rule-based evaluation of prescriptions. This method uses pre-defined evaluation rules to examine each element in the prescription, such as drug combinations and dosages, to determine whether the prescription meets regulatory requirements. While this method can initially identify obvious irrational factors in prescriptions, in reality, the same prescription may require different rational medication regimens due to different syndromes, constitutions, or conditions. Relying solely on a single fixed rule for evaluation leads to inaccurate results. Summary of the Invention

[0004] This application provides a method, system, device, and storage medium for analyzing traditional Chinese medicine data, which can improve the accuracy of TCM prescription evaluation results.

[0005] Firstly, this application provides a method for analyzing traditional Chinese medicine (TCM) data. The method includes: establishing a TCM knowledge base, which includes a TCM compatibility contraindication rule base, a dosage safety threshold base, and an efficacy conflict feature base; acquiring target TCM herbs contained in a prescription text to be tested, and the target dosage of each of the target TCM herbs; structuring the target TCM herbs and each target dosage according to a predetermined format to generate structured prescription data; matching the structured prescription data with the TCM knowledge base to generate a matching coefficient; and generating an initial value for the prescription to be tested based on the matching coefficient. Scoring; obtaining associated prescription texts related to the prescription text to be tested, and obtaining the matching results between the associated prescription texts and the traditional Chinese medicine knowledge base; determining the standard score of the associated prescription texts based on the matching results; the associated prescription texts include: prescription texts with the same therapeutic effects as the prescription to be tested and / or prescription texts with the same main medicinal materials as the prescription to be tested; adjusting the initial score based on the standard score to generate a target score for the prescription to be tested; when the target score is lower than the preset score, generating an adjustment strategy for the prescription to be tested.

[0006] By adopting the above technical solution, and by establishing a traditional Chinese medicine knowledge base that includes a database of rules on incompatibilities between Chinese medicines, a database of dosage safety thresholds, and a database of efficacy conflict features, combined with the structured processing of the prescription text to be tested, a standardized evaluation of prescription medication can be achieved. Furthermore, by obtaining the matching results and standard scores of related prescription texts with the same therapeutic effects or the same main medicinal materials, the initial score of the prescription to be tested can be dynamically adjusted. This not only generates specific adjustment strategies when the target score is lower than the preset score, providing effective guidance for prescription optimization, but also improves the accuracy of prescription evaluation.

[0007] Optionally, matching the structured prescription data with the traditional Chinese medicine knowledge base to generate a matching coefficient includes: combining the traditional Chinese medicines in the structured prescription data in pairs to obtain multiple traditional Chinese medicine combinations; comparing the multiple traditional Chinese medicine combinations with the prohibited combinations in the traditional Chinese medicine compatibility rule base; when there are identical combinations, they are recorded as prohibited combinations; calculating the ratio of the number of prohibited combinations to the total number of multiple traditional Chinese medicine combinations to obtain the first sub-matching coefficient; and comparing the target dose of each traditional Chinese medicine in the structured prescription data with the corresponding safety threshold in the dose safety threshold base. The process involves comparing the target dose with the corresponding safety threshold, identifying dose abnormalities, and calculating the ratio of the number of Chinese herbal medicines with dose abnormalities to the total number of target Chinese herbal medicines to obtain the second sub-matching coefficient. The efficacy of Chinese herbal medicines in the structured prescription data is then matched with the efficacy conflict feature library to identify combinations of Chinese herbal medicines with efficacy conflicts. The ratio of the number of combinations of Chinese herbal medicines with efficacy conflicts to the total number of such combinations is calculated to obtain the third sub-matching coefficient. Finally, the first, second, and third sub-matching coefficients are combined to generate a matching coefficient.

[0008] By adopting the above technical solution, the system compares the pairwise combinations of Chinese herbs in the structured prescription data with the rules of incompatible combinations, compares the dosage of Chinese herbs with the safety threshold, and matches the efficacy of Chinese herbs with the efficacy conflict characteristics. The system calculates the ratio of incompatible combinations, the ratio of abnormal dosage, and the ratio of efficacy conflict, and obtains the first sub-matching coefficient, the second sub-matching coefficient, and the third sub-matching coefficient. This enables a quantitative evaluation of the prescription in three dimensions: compatibility, dosage setting, and efficacy combination, making the prescription evaluation results more comprehensive and objective.

[0009] Optionally, generating a matching coefficient by combining the first sub-matching coefficient, the second sub-matching coefficient, and the third sub-matching coefficient includes: substituting the first sub-matching coefficient, the second sub-matching coefficient, and the third sub-matching coefficient into a preset formula to generate a matching coefficient; wherein the preset formula is: MC=α(1-P1)W1+β(1-P2)W2 +γ(1-P3)W3; wherein MC is the matching coefficient; P1 is the first sub-matching coefficient; P2 is the second sub-matching coefficient; P3 is the third sub-matching coefficient; W1, W2, and W3 are weighting coefficients, and W1+W2+W3=1; α, β, and γ are preset adjustment coefficients.

[0010] By adopting the above technical solution, and by substituting the first sub-matching coefficient, the second sub-matching coefficient, and the third sub-matching coefficient into a preset formula that includes weighting coefficients and adjustment coefficients, not only is the weighted integration of the three evaluation dimensions of incompatible combinations, abnormal dosage, and efficacy conflict realized, but the evaluation intensity of each dimension can also be flexibly adjusted by setting the adjustment coefficients, so that the final generated matching coefficients can more accurately reflect the overall rationality of the prescription.

[0011] Optionally, generating an initial score for the prescription to be tested based on the matching coefficient includes: substituting the matching coefficient into a preset scoring conversion function to generate an initial score for the prescription to be tested; wherein the scoring conversion function is: IS=A×e^(MC)+B; where IS is the initial score; MC is the matching coefficient; A is a proportional coefficient; and B is the base score.

[0012] By adopting the above technical solution, the matching coefficient can be non-linearly mapped to the scoring interval by substituting the matching coefficient into an exponential scoring transformation function that includes a proportional coefficient and a base score. This not only ensures a reasonable distribution of the initial scores, but also allows the exponential function to more sensitively reflect subtle differences in prescription quality, making the scoring results more discriminative.

[0013] Optionally, adjusting the initial score based on the standard score to generate a target score for the prescription to be tested includes: calculating the average of multiple standard scores to generate a reference score; calculating the difference between the initial score and the reference score; when the absolute value of the difference is greater than a preset threshold, obtaining the similarity between the prescription to be tested and the associated prescription text, and determining an adjustment factor based on the similarity; substituting the adjustment factor, the initial score, and the reference score into an adjustment formula to generate a target score for the prescription to be monitored; the adjustment formula is: TS=IS+λ(RS-IS); where TS is the target score; IS is the initial score; RS is the reference score; λ is the adjustment factor; when the absolute value of the difference is not greater than the preset threshold, the initial score is used as the target score.

[0014] By adopting the above technical solution, the average standard score of the associated prescription text is calculated as a reference score. When the difference between the initial score and the reference score exceeds a preset threshold, an adjustment factor is determined based on the similarity between the prescription to be detected and the associated prescription text. This factor is then substituted into the adjustment formula to dynamically adjust the initial score. As a result, the target score maintains the evaluation result of the prescription's own characteristics while also referencing the evaluation standards of similar prescriptions in clinical practice, thus improving the accuracy and reliability of the scoring results.

[0015] Optionally, obtaining the similarity between the prescription text to be detected and the associated prescription text, and determining an adjustment factor based on the similarity, includes: calculating a similarity score between the prescription text to be detected and each of the associated prescription texts, wherein the similarity score increases as the number of common medicinal materials in the prescription text to be detected and each of the associated prescription texts increases; calculating the average of multiple similarity scores to obtain the similarity between the prescription text to be detected and the associated prescription texts; setting the adjustment factor to a first preset value when the similarity is greater than a first threshold; setting the adjustment factor to a second preset value when the similarity is less than a second threshold; and when the similarity is between the first threshold and the second threshold, the adjustment factor has a linear relationship with the similarity.

[0016] By adopting the above technical solution, a similarity score is calculated based on the number of common medicinal materials between the prescription to be tested and the related prescriptions. Different adjustment factor settings are adopted according to the average similarity in different threshold ranges. That is, a fixed first preset value is used for high similarity, a fixed second preset value is used for low similarity, and a linear relationship is used for the intermediate range. This achieves accurate quantification of prescription similarity and reasonable allocation of adjustment factors, so that the strength of score adjustment is adapted to the similarity between prescriptions.

[0017] Optionally, when the target score is lower than a preset score, generating an adjustment strategy for the prescription to be tested includes: identifying key factors that cause the target score to be lower than the preset score, the key factors including at least one of the following: incompatible Chinese herbal combinations, abnormal dosage of Chinese herbal medicines, and conflicting efficacy of Chinese herbal combinations; for the incompatible Chinese herbal combinations, querying a list of recommended alternative herbs from the Chinese herbal medicine knowledge base to generate a first adjustment strategy; for the abnormal dosage of Chinese herbal medicines, adjusting the dosage to a compliant range according to the safety threshold range in the dosage safety threshold library to generate a second adjustment strategy; for the conflicting efficacy of Chinese herbal combinations, deleting conflicting herbs or replacing them with efficacy-compatible herbs based on the conflict type provided by the efficacy conflict feature library to generate a third adjustment strategy; and combining and outputting the first, second, and third adjustment strategies as the adjustment strategy for the prescription to be tested.

[0018] By adopting the above technical solution, key factors leading to low target scores are identified, and alternative medicinal materials are queried from the Chinese medicine knowledge base for three types of problems: incompatible combinations, abnormal dosage, and efficacy conflicts. Dosage is adjusted based on safety thresholds, and efficacy conflicts are addressed. This generates a combined adjustment scheme that includes the first, second, and third adjustment strategies. This not only achieves accurate positioning of prescription problems but also provides targeted optimization suggestions, effectively guiding prescription improvement.

[0019] Secondly, this application provides a traditional Chinese medicine data analysis system, the system comprising: an establishment module, a first acquisition module, a matching module, a second acquisition module, and an adjustment module; wherein, The establishment module is used to establish a traditional Chinese medicine (TCM) knowledge base, which includes: a TCM compatibility contraindication rule base, a dosage safety threshold base, and an efficacy conflict feature base; the first acquisition module is used to acquire the target TCMs contained in the prescription text to be tested, and the target dosage of each TCM in the target TCMs, and to structure the target TCMs and each target dosage according to a predetermined format to generate structured prescription data; the matching module is used to match the structured prescription data with the TCM knowledge base to generate a matching coefficient, and to generate an initial score for the prescription to be tested based on the matching coefficient; the second acquisition module... The module is used to acquire associated prescription texts related to the prescription text to be tested, and to acquire the matching results between the associated prescription texts and the traditional Chinese medicine knowledge base. Based on the matching results, a standard score is determined for the associated prescription texts. The associated prescription texts include: prescription texts with the same therapeutic effects as the prescription to be tested and / or prescription texts with the same medicinal materials as the prescription to be tested. The adjustment module is used to adjust the initial score according to the standard score, generate a target score for the prescription to be tested, and generate an adjustment strategy for the prescription to be tested when the target score is lower than a preset score.

[0020] Thirdly, this application provides an electronic device that adopts the following technical solution: it includes a processor, a memory, a user interface, and a network interface. The memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes a computer program of any of the above-mentioned traditional Chinese medicine data analysis methods.

[0021] Fourthly, this application provides a computer-readable storage medium, which adopts the following technical solution: storing a computer program that can be loaded by a processor and executed by any of the above-mentioned traditional Chinese medicine data analysis methods.

[0022] In summary, this application includes at least one of the following beneficial technical effects: By establishing a traditional Chinese medicine (TCM) knowledge base that includes a TCM compatibility contraindication rule library, a dosage safety threshold library, and an efficacy conflict feature library, and combining this with structured processing of the prescription text to be tested, a standardized assessment of prescription medication can be achieved. Furthermore, by obtaining the matching results and standard scores of related prescription texts with the same therapeutic effects or the same main medicinal materials, the initial score of the prescription to be tested can be dynamically adjusted. This not only generates specific adjustment strategies when the target score is lower than the preset score, providing effective guidance for prescription optimization, but also improves the accuracy of prescription assessment. Attached Figure Description

[0023] Figure 1 This is a flowchart illustrating a traditional Chinese medicine data analysis method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a traditional Chinese medicine data analysis system provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0024] Explanation of reference numerals in the attached figures: 1000, electronic device; 1001, processor; 1002, communication bus; 1003, user interface; 1004, network interface; 1005, memory. Detailed Implementation

[0025] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0026] In the description of the embodiments in this application, words such as "illustrative," "for example," or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "illustrative," "for example," or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Rather, the use of words such as "illustrative," "for example," or "for example" is intended to present the relevant concepts in a specific manner.

[0027] Figure 1 This is a flowchart illustrating a traditional Chinese medicine data analysis method provided in an embodiment of this application. Figure 1 As shown, the method includes S101-S105: S101, Establish a traditional Chinese medicine knowledge base, which includes: a traditional Chinese medicine compatibility contraindication rule base, a dosage safety threshold base, and an efficacy conflict feature base.

[0028] In its implementation, the first step is to establish a Traditional Chinese Medicine (TCM) knowledge base. This base is a systematic compilation and digital storage of traditional Chinese medicine theories and clinical experience. The purpose of establishing this knowledge base is to provide comprehensive reference for subsequent prescription analysis, ensuring the safety and rationality of prescriptions. The TCM knowledge base includes three sub-bases: a TCM compatibility contraindication rules database, a dosage safety threshold database, and an efficacy conflict characteristic database.

[0029] Specifically, the Traditional Chinese Medicine (TCM) Combination Incompatibilities Rule Database stores information on TCM combinations that may cause adverse reactions or reduce efficacy when combined. For example, the combination of licorice and seaweed may cause adverse reactions, while the combination of aconite and fritillaria may lead to reduced efficacy. Each rule in the database includes the contraindicated TCM combination, the reason for the contraindication, and the possible adverse consequences. By querying this database, inappropriate combinations in prescriptions can be identified promptly, thereby avoiding medication risks.

[0030] The dosage safety threshold database records the safe dosage ranges for various traditional Chinese medicines (TCMs). For different TCMs, based on their medicinal properties and clinical experience, corresponding minimum effective doses and maximum safe doses are set. For example, the dosage of certain highly toxic TCMs, such as Aconitum carmichaelii (Fuzi), must be strictly controlled within the safe range. The establishment of the dosage safety threshold database helps identify TCMs with abnormal dosages in prescriptions, preventing problems caused by overdose or underdose.

[0031] The efficacy conflict feature database primarily stores the characteristics of traditional Chinese medicine combinations that may cause efficacy conflicts. For example, the simultaneous use of dispersing and astringent drugs may reduce therapeutic efficacy. This database records the specific manifestations, severity, and management suggestions for various efficacy conflicts. By querying the efficacy conflict feature database, one can identify situations where prescriptions contain conflicting efficacy.

[0032] The data sources for the three sub-databases include: authoritative records in traditional Chinese medicine classics, summaries of clinical practice, expert experience, and modern pharmacological research findings. Data collection and organization follow standardized processes to ensure accuracy and reliability. Furthermore, interrelationships are established between the sub-databases to form a complete knowledge network, facilitating rapid retrieval and comprehensive analysis.

[0033] S102, obtain the target Chinese medicine contained in the prescription text to be detected, and the target dosage of each Chinese medicine in the target Chinese medicine, and organize the target Chinese medicine and each target dosage in a predetermined format to generate structured prescription data.

[0034] In practical applications, traditional Chinese medicine prescriptions are usually recorded in natural language text format. This unstructured data format is difficult to use directly for computer analysis. To achieve intelligent analysis of prescriptions, it is necessary to first convert the prescription text to be analyzed into a standardized data format. Therefore, the purpose of this step is to convert unstructured prescription text into a structured data format, facilitating subsequent data processing and analysis.

[0035] In practice, the first step is to use text parsing technology to obtain the target Chinese herbal medicine information contained in the prescription text to be tested. The prescription text to be tested refers to the original text of the Chinese herbal medicine prescription that needs to be analyzed and evaluated, such as "Astragalus membranaceus 30g, Angelica sinensis 15g, Ligusticum chuanxiong 10g". The target Chinese herbal medicine refers to all the Chinese herbal medicines contained in the prescription, which in the example are "Astragalus membranaceus", "Angelica sinensis" and "Ligusticum chuanxiong". At the same time, the target dosage of each Chinese herbal medicine in the target Chinese herbal medicine is obtained, that is, the specific dosage of each Chinese herbal medicine specified in the prescription, such as "30g", "15g" and "10g" in the example.

[0036] After obtaining the above information, it needs to be structured according to a predetermined format. The predetermined format refers to a standardized data structure template that includes fields such as the name of the Chinese medicine, dosage, and unit. For example, it can be stored in key-value pairs, with the name of the Chinese medicine as the key and the dosage and unit as the corresponding values. This standardized data organization method generates structured prescription data. Structured prescription data is a standard data format that is easy for computers to process; it organizes and stores the information in the original prescription text in a standardized way.

[0037] To ensure the accuracy of data conversion, the system verifies and standardizes the acquired information. For example, it standardizes the names of Chinese medicines, unifying synonyms and alternative names into standardized names; it also standardizes dosage units to ensure that all data uses the same unit of measurement. Simultaneously, the system checks the integrity of the data to ensure that each Chinese medicine has corresponding dosage information.

[0038] After structuring, the data can be stored in various formats, such as JSON. This structuring process standardizes and normalizes prescription data, laying the foundation for subsequent data analysis. Structured prescription data facilitates data matching with traditional Chinese medicine knowledge bases, improving the efficiency and accuracy of data processing. Simultaneously, the standardized data format facilitates data storage, retrieval, and management, enhancing the overall performance of the system.

[0039] S103: Match the structured prescription data with the traditional Chinese medicine knowledge base to generate a matching coefficient. Based on the matching coefficient, generate an initial score for the prescription to be tested.

[0040] To quantitatively assess the rationality of the prescriptions under test, it is necessary to conduct a systematic matching analysis between structured prescription data and a traditional Chinese medicine knowledge base. This step calculates matching coefficients through multi-dimensional data matching and generates an initial score based on these coefficients, thereby achieving an objective evaluation of prescription quality.

[0041] In the specific implementation process, the traditional Chinese medicines in the structured prescription data are first paired to form multiple herb combinations. For example, a prescription containing Astragalus membranaceus, Angelica sinensis, and Ligusticum chuanxiong will form three herb combinations: Astragalus membranaceus-Angelica sinensis, Astragalus membranaceus-Ligusticum chuanxiong, and Angelica sinensis-Ligusticum chuanxiong. The system compares these combinations with the prohibited combinations in the herb compatibility rule base. When a matching combination is found, it is recorded as a prohibited combination. The first sub-matching coefficient P1 is obtained by calculating the ratio of the number of prohibited combinations to the total number of herb combinations. For example, if one prohibited combination is found among the three combinations, then P1 = 1 / 3.

[0042] Simultaneously, the system compares the dosage of each traditional Chinese medicine (TCM) in the structured prescription data with the corresponding safety threshold in the dosage safety threshold database. When the dosage of a TCM exceeds or falls below the safety threshold range, it is recorded as a dosage anomaly. The second sub-matching coefficient P2 is obtained by calculating the ratio of the number of TCMs with dosage anomalies to the total number of TCMs in the prescription. For example, if one of the three TCMs has a dosage anomaly, then P2 = 1 / 3.

[0043] In addition, the system matches the efficacy of traditional Chinese medicine (TCM) in the structured prescription data with a feature library of efficacy conflicts to identify TCM combinations with conflicting efficacy. The third sub-matching coefficient P3 is obtained by calculating the ratio of the number of TCM combinations with conflicting efficacy to the total number of TCM combinations.

[0044] After obtaining the three sub-matching coefficients, the system substitutes them into a preset formula to calculate the final matching coefficient MC: MC = α(1-P1)W1 + β(1-P2)W2 + γ(1-P3)W3; where W1, W2, and W3 are weighting coefficients used to reflect the severity of different types of problems, and satisfy W1 + W2 + W3 = 1. α, β, and γ are preset adjustment coefficients used to adjust the degree of influence of different types of problems on the overall score. Through this weighted calculation method, the system can comprehensively consider three aspects: incompatibility, dosage safety, and efficacy conflict, to obtain a comprehensive matching coefficient.

[0045] The adjustment coefficients α, β, and γ are set based on TCM clinical practice experience and authoritative literature standards, and are used to quantify the impact of different types of problems on the safety and efficacy of prescriptions. α primarily reflects the severity of incompatibilities, with a value of 1.5, because incompatibilities may lead to severe toxic reactions or a significant reduction in therapeutic effect. β measures the risk of dosage abnormalities, with a value of 1.2, which references the prescribed dosage range while considering the flexibility required in clinical medication. γ characterizes the impact of efficacy conflicts, with a value of 1.0, based on the requirements for efficacy compatibility and the actual need for complementary efficacy in clinical practice.

[0046] In practical applications, the system will adjust these adjustment coefficients appropriately based on the specific circumstances of the prescription, such as the acuteness or chronicity of the disease and the complexity of the syndrome. By analyzing a large amount of clinical prescription data and treatment effects, the system will continuously optimize these parameter values ​​to ensure the scientific validity and practicality of the scoring results.

[0047] After obtaining the matching coefficient, the system substitutes it into a preset scoring transformation function to generate the initial score IS of the prescription to be tested: IS = A × e^(MC) + B; where A is the proportional coefficient used to adjust the range of the score; B is the base score to ensure the lower limit of the score; and e is the base of the natural logarithm. The purpose of using an exponential function is to make the score more sensitive to changes in the matching coefficient and to better reflect the differences in prescription quality.

[0048] In this way, the system achieves a quantitative assessment of the rationality of prescriptions. A higher initial score indicates that the prescription is reasonable in terms of compatibility, dosage, and efficacy, while a lower score suggests that the prescription may need improvement. This objective scoring mechanism provides a clear basis for subsequent prescription optimization.

[0049] Based on the above embodiments, as an optional implementation method, in S103, matching the structured prescription data with the traditional Chinese medicine knowledge base to generate matching coefficients specifically includes S31-S34: S31. Pair the Chinese herbs in the structured prescription data to obtain multiple Chinese herb combinations. Compare the multiple Chinese herb combinations with the prohibited combinations in the Chinese herb compatibility rule library. When there are identical combinations, they are recorded as prohibited combinations. Calculate the ratio of the number of prohibited combinations to the total number of multiple Chinese herb combinations to obtain the first sub-matching coefficient.

[0050] The system first performs pairwise combination analysis on the traditional Chinese medicine (TCM) herbs in the structured prescription data. For example, for a prescription containing Astragalus membranaceus, Angelica sinensis, Ligusticum chuanxiong, and Paeonia lactiflora, the system generates six TCM combinations: Astragalus membranaceus-Angelica sinensis, Astragalus membranaceus-Ligusticum chuanxiong, Astragalus membranaceus-Paeonia lactiflora, Angelica sinensis-Ligusticum chuanxiong, Angelica sinensis-Paeonia lactiflora, and Ligusticum chuanxiong-Paeonia lactiflora. Then, the system compares these combinations with the prohibited combinations stored in the TCM compatibility rule base. When a combination is found to have a match in the rule base, the system marks it as a prohibited combination. The first sub-matching coefficient P1 is obtained by calculating the ratio of the number of prohibited combinations to the total number of TCM combinations. For example, if two prohibited combinations are found in the six combinations, then P1 = 2 / 6 ≈ 0.333. This coefficient reflects the proportion of unreasonable combinations in the prescription; a higher coefficient indicates a more serious compatibility problem.

[0051] S32, compare the target dose of each Chinese medicine in the structured prescription data with the corresponding safety threshold in the dose safety threshold library. When the target dose is not at the corresponding safety threshold, it is recorded as a dose abnormality. Calculate the ratio of the number of Chinese medicines with dose abnormalities to the total number of target Chinese medicines to obtain the second sub-matching coefficient.

[0052] The system monitors the appropriateness of the dosage of each Chinese herbal medicine (TCM). The first dosage in the structured prescription data refers to the specific amount of each TCM herb used. The system compares these dosages with the safe ranges recorded in the dosage safety threshold database. When the dosage of a TCM herb exceeds the safe threshold (including excessive or insufficient dosage), the system records it as a dosage anomaly. The second sub-matching coefficient, P2, is obtained by calculating the ratio of the number of TCM herbs with dosage anomalies to the total number of first-level TCM herbs in the prescription. For example, if one of the four TCM herbs has a dosage anomaly, then P2 = 1 / 4 = 0.25. This coefficient reflects the appropriateness of the dosage used in the prescription; a higher coefficient indicates a more prominent dosage problem.

[0053] S33, match the efficacy of Chinese medicines in the structured prescription data with the efficacy conflict feature library, identify Chinese medicine combinations with efficacy conflicts, calculate the ratio of the number of Chinese medicine combinations with efficacy conflicts to the total number of multiple Chinese medicine combinations, and obtain the third sub-matching coefficient.

[0054] The system analyzes potential efficacy conflicts in prescriptions. First, it extracts the efficacy information of each Chinese herbal medicine (TCM) from structured prescription data. This information is then matched against an efficacy conflict feature database to identify potentially conflicting TCM combinations. Examples include the simultaneous use of warming and cooling herbs, or dispersing and astringent herbs. The third sub-matching coefficient, P3, is obtained by calculating the ratio of conflicting TCM combinations to the total number of combinations. For example, if one conflicting combination is found among six combinations, then P3 = 1 / 6 ≈ 0.167. This coefficient reflects the rationality of the efficacy compatibility in the prescription.

[0055] S34, combine the first sub-matching coefficient, the second sub-matching coefficient, and the third sub-matching coefficient to generate a matching coefficient.

[0056] The system integrates the three sub-matching coefficients into a final matching coefficient MC. The integration process uses a weighted calculation method: MC = (1-P1)×W1 + (1-P2)×W2 + (1-P3)×W3; where W1, W2, and W3 are weighting coefficients used to reflect the importance of different types of problems, and satisfy W1 + W2 + W3 = 1. The weights are set based on clinical experience and expert opinions, typically with the highest weight for incompatibilities (e.g., W1 = 0.4), followed by dosage safety (e.g., W2 = 0.35), and relatively lower weight for efficacy conflicts (e.g., W3 = 0.25). The formula uses the form (1-P1), so that a larger final matching coefficient MC value indicates better prescription quality.

[0057] Based on the above embodiments, as an optional implementation method, in S103, generating the initial score of the prescription to be tested according to the matching coefficient specifically includes: Substitute the matching coefficient into the preset scoring conversion function to generate the initial score of the prescription to be tested; where the scoring conversion function is: IS=A×e^(MC)+B; where IS is the initial score; MC is the matching coefficient; A is the proportional coefficient; and B is the base score.

[0058] After obtaining the matching coefficients, they need to be converted into more intuitive scoring results. This conversion requires consideration of the non-linear characteristics of the scoring and practical application needs. Therefore, an exponential function is used as the scoring conversion function, and by appropriately setting parameters, a scientific conversion from matching coefficients to initial scores is achieved.

[0059] In practice, the system uses IS=A×e^(MC)+B as the scoring conversion function, where IS represents the initial score of the prescription to be tested, MC is the matching coefficient calculated in the previous steps, A is the proportional coefficient, B is the base score, and e is the base of the natural logarithm (approximately 2.718). The reason for choosing an exponential function as the conversion function is that when the prescription quality is good (higher MC value), the score will show an accelerated upward trend, which is consistent with the importance attached to high-quality prescriptions in clinical practice; when the prescription quality is poor (lower MC value), the score will decrease relatively slowly, avoiding excessively low scores due to individual problems.

[0060] In practical applications, the proportionality coefficient A is used to adjust the range and gradient of the score. For example, if the expected score range is between 0 and 100, and the matching coefficient MC ranges from 0 to 1, A can be set to 40. With this setting, when MC=1, e^(MC)≈2.718, and the score variation is approximately 108.72 points. The base score B is used to ensure the lower limit of the score and is usually set to a positive value, such as B=20. This ensures that even when MC=0, the score will not fall below the base score, reflecting recognition of the basic value of the prescription.

[0061] For example, assuming a prescription has a matching coefficient MC=0.8, and A=40 and B=20, the initial score calculation process is: IS=40×e^(0.8)+20=40×2.226+20=89.04+20=109.04.

[0062] To ensure a more standardized final score, the system normalizes the calculation results, setting scores exceeding 100 to 100. Therefore, the initial score for the above prescription is 100. This scoring mechanism ensures that the results are both highly discriminative and easy to understand and use.

[0063] This non-linear scoring method enables the system to accurately quantify prescription quality. A high score (above 90 points) indicates that the prescription is reasonable in terms of compatibility, dosage, and efficacy; a medium score (70-90 points) indicates that the prescription is basically usable but has room for improvement; and a low score (below 70 points) suggests that the prescription may have serious problems and requires adjustment. This scoring result is intuitive and has practical reference value, allowing doctors to quickly assess the quality level of prescriptions.

[0064] The design of the scoring conversion function IS=A×e^(MC)+B incorporates multiple professional considerations. Its core calculation uses the exponential function e^(MC) based on the actual needs of prescription quality assessment. In the prescription quality assessment process, there is a non-linear relationship between quality and score. When prescription quality gradually improves from poor, the score increase should be relatively gradual, reflecting the process of the prescription reaching a basic acceptable level. However, when prescription quality reaches a good level, the score should show a more significant increase to encourage high-quality prescriptions. The exponential function e^(MC) possesses this characteristic: it increases slowly when the MC value is small and increases rapidly when the MC value is large. Furthermore, as an exponential function with the natural logarithm e as its base, when MC is in the range of 0-1, the value range of e^(MC) is 1-2.718. This range is suitable for subsequent score conversion without causing score loss of control due to excessively rapid growth or reducing discrimination due to excessively slow growth.

[0065] The main function of the proportionality coefficient A is to transform the range of e^(MC) to a suitable scoring range. By adjusting the value of A, the upper limit and variation range of the score can be controlled. When A=40, the range of e^(MC) from 1 to 2.718 will be mapped to the range of 40 to 108.72. Even in the most ideal case (MC=1), the score will not exceed the normal range by much, facilitating subsequent normalization. The base score B ensures the lower limit of the score, reflecting the basic acceptance of all prescriptions. Even if a prescription has many problems (MC close to 0), its score will not be lower than the B value. This is consistent with the concept in TCM clinical practice that "prescriptions may be biased, but they can still be adjusted and used." By setting an appropriate B value (such as 20), sufficient error margin can be provided for the scoring system to avoid the complete rejection of a prescription due to individual problems.

[0066] In practical applications, setting A=40 and B=20 yields a well-suited scoring range: when MC=0, IS=60, representing the basic passing grade; when MC=0.5, IS is approximately 86, indicating a good level; and when MC=0.8, IS is approximately 109, which, after normalization, becomes 100, representing an excellent level. This parameter configuration means that a score of 60-70 indicates a prescription that is basically usable but requires significant adjustment; 70-85 indicates a prescription of moderate quality requiring appropriate optimization; 85-95 indicates a prescription of good quality requiring only minor adjustments; and 95-100 indicates a prescription of excellent quality that can be used directly.

[0067] S104, obtain the associated prescription texts related to the prescription text to be tested, and obtain the matching results between the associated prescription texts and the traditional Chinese medicine knowledge base. Based on the matching results, determine the standard score of the associated prescription texts. The associated prescription texts include: prescription texts with the same therapeutic effects as the prescription to be tested and / or prescription texts with the same medicinal materials as the prescription to be tested.

[0068] In traditional Chinese medicine clinical practice, the experience of using similar prescriptions is of significant reference value. To improve the accuracy and reliability of prescription evaluation, the system needs to introduce related prescriptions as evaluation reference standards. By analyzing prescriptions with similar characteristics, a more objective scoring benchmark can be established, making the evaluation results more clinically relevant.

[0069] In practice, the first step is to obtain related prescription texts associated with the prescription text to be tested. Related prescription texts mainly fall into two categories: one is prescription texts with the same therapeutic effects as the prescription to be tested. For example, if the prescription to be tested treats liver qi stagnation, the system will search for classic prescriptions or clinically proven formulas with the same therapeutic effects. The other category is prescription texts with the same main medicinal materials as the prescription to be tested, i.e., prescriptions with similar core medicinal materials, such as prescriptions that both use one or more Chinese herbs as the main ingredients.

[0070] When retrieving related prescription texts, the system searches the standard prescription database. This database contains a large amount of structured data on classic prescriptions and clinically proven formulas, which have been verified by experts and are widely used. The search process employs semantic matching technology, considering not only direct matching of drug components but also the similarity of efficacy descriptions to ensure that the retrieved related prescriptions are highly relevant.

[0071] After obtaining the text of the associated prescriptions, the system performs a matching analysis between these prescriptions and the traditional Chinese medicine knowledge base. The matching process is similar to step S103, evaluating the prescriptions from three dimensions: incompatibilities, dosage safety, and efficacy conflicts. For each associated prescription, the system calculates its matching coefficient and generates a corresponding score using a scoring transformation function. These scores, derived from clinically validated prescriptions, have high reference value and are therefore referred to as standard scores.

[0072] For example, for a prescription to be tested that treats liver qi stagnation, the system may retrieve classic formulas such as Chaihu Shugan San and Xiaoyao San as related prescriptions. These related prescriptions all have the effect of soothing the liver and regulating qi, and their composition and compatibility rules can serve as important references. The system will score these related prescriptions and obtain a set of standard score values.

[0073] In calculating the standard score, the system pays special attention to the clinical application history and efficacy of the associated prescriptions. For classic prescriptions with a long history of use and proven clinical efficacy, the score results have high reference value. While some newer clinically proven prescriptions can also be used as a reference, their weight may be appropriately reduced.

[0074] By analyzing the scoring results of multiple related prescriptions, the system can establish a reasonable scoring reference range. This range reflects the reasonable range of medication use for similar prescriptions in practical applications, providing a reliable benchmark for scoring the prescription under test. Simultaneously, the medication characteristics of related prescriptions also provide useful references for subsequent prescription optimization.

[0075] S105, adjust the initial score according to the standard score to generate the target score of the prescription to be tested. When the target score is lower than the preset score, generate the adjustment strategy of the prescription to be tested.

[0076] In the implementation process, the average of the standard scores of multiple related prescription texts is first calculated to generate a reference score RS. The reference score represents the general level of similar prescriptions in practice and can be used as an evaluation benchmark. Subsequently, the system calculates the difference between the initial score IS of the prescription to be tested and the reference score RS. When the absolute value of this difference is greater than a preset threshold, it indicates that the prescription to be tested deviates significantly from conventional medication practices, requiring score adjustment. The preset threshold is set based on clinical experience and expert consensus and is used to determine whether score deviations need to be corrected.

[0077] When score adjustments are needed, the system first obtains the similarity between the prescription to be tested and related prescription texts. The similarity calculation is based on the commonality of medicinal materials in the prescriptions. Specifically, for each related prescription text, the number of medicinal materials used in common with the prescription to be tested is calculated, and a similarity score is calculated based on the number of common medicinal materials. The average of multiple similarity scores is the final similarity score. A higher similarity score indicates that the prescription to be tested is closer to the medication characteristics of a typical prescription, and the higher the reliability of the score adjustment.

[0078] Based on the calculated similarity, the system determines the adjustment factor λ. When the similarity is greater than the first threshold (e.g., 0.8), the adjustment factor is set to a larger first preset value (e.g., 0.8), indicating a stronger adjustment force; when the similarity is less than the second threshold (e.g., 0.3), the adjustment factor is set to a smaller second preset value (e.g., 0.2), indicating a weaker adjustment force; when the similarity is between the two thresholds, the adjustment factor has a linear relationship with the similarity and can be calculated through linear interpolation.

[0079] After obtaining the adjustment factor, the system substitutes the adjustment factor λ, the initial score IS, and the reference score RS into the adjustment formula: TS = IS + λ(RS - IS); where TS is the target score. This formula dynamically adjusts the initial score. When the initial score differs significantly from the reference score, the adjustment factor helps the final target score converge towards the reference score while maintaining a certain degree of uniqueness. If the absolute value of the difference is not greater than a preset threshold, the initial score is directly used as the target score without adjustment.

[0080] When the calculated target score is lower than the preset score, the system will activate the prescription optimization module to generate adjustment strategies for the prescription under test. First, the system identifies key factors leading to the low score, including incompatible herbal combinations, abnormal dosages of herbal medicines, and combinations with conflicting effects. For different types of problems, the system generates corresponding adjustment suggestions: for incompatible combinations, it queries the herbal medicine knowledge base for a list of recommended alternative herbs; for abnormal dosages, it provides dosage adjustment suggestions based on a dosage safety threshold database; and for conflicting effects, it provides suggestions for drug replacement or deletion based on a conflicting effect feature database.

[0081] For example, if the system detects that licorice and seaweed in the prescription are incompatible, it will suggest replacing licorice with other harmonizing drugs; if it finds that the dosage of aconite is too high, it will suggest adjusting the dosage to a safe range; if it finds that dispersing drugs and astringent drugs are used at the same time, it will suggest adjusting the combination of drugs to avoid mutual conflict of effects.

[0082] Based on the above embodiments, as an optional implementation method, in S105, adjusting the initial score according to the standard score to generate the target score of the prescription to be tested specifically includes S51-S56: S51 calculates the average of multiple standard scores to generate a reference score.

[0083] To make prescription scoring more accurate and reliable, the system needs to dynamically adjust the initial score based on the standard score. This adjustment mechanism optimizes the score through a series of steps, so that the final score reflects both the characteristics of the prescription itself and the rules of clinical practice.

[0084] In its implementation, the system first calculates the average of multiple standard scores related to the prescription being tested, generating a reference score (RS). These standard scores are derived from high-quality prescriptions validated in clinical practice, and their average value can effectively reflect the general scoring level of similar prescriptions. For example, for a prescription that tonifies Qi and nourishes blood, the system will select the scores of multiple classic prescriptions of the same type and average them to obtain a reference standard for this type of prescription.

[0085] S52, calculate the difference between the initial score and the reference score.

[0086] The system then calculates the difference between the initial score (IS) and the reference score (RS) of the prescription being tested. This difference reflects the degree of deviation of the prescription from the standard level. A preset threshold (e.g., 10 points) is set as the trigger condition for score adjustment. When the absolute value of the difference exceeds this threshold, it indicates that the prescription score differs significantly from the standard level and adjustment is required. The preset threshold is set based on clinical experience, aiming to identify significant scoring deviations while avoiding overly frequent adjustments.

[0087] S53, when the absolute value of the difference is greater than the preset threshold, obtain the similarity between the prescription to be detected and the associated prescription text, and determine the adjustment factor based on the similarity.

[0088] When score adjustments are needed, the system first calculates the similarity between the prescription to be tested and related prescriptions. The similarity calculation is based on multiple dimensions, including the overlap of drug composition, consistency of main efficacy, and similarity of usage scenarios. For example, if the prescription to be tested and a related prescription have 70% overlap in main drug composition and essentially the same efficacy positioning, a high similarity score is likely to be obtained. A higher similarity score indicates a stronger similarity between the prescription to be tested and the standard prescription, and a higher credibility of the adjustment.

[0089] S54. Substitute the adjustment factor, initial score, and reference score into the adjustment formula to generate the target score for the prescription to be monitored.

[0090] Based on the calculated similarity, the system determines the adjustment factor λ. The adjustment factor typically ranges from 0 to 1, and its value is positively correlated with the similarity. Specifically, two threshold points can be set: when the similarity is higher than 0.8, λ is set to 0.8, indicating a stronger adjustment; when the similarity is lower than 0.3, λ is set to 0.2, indicating a weaker adjustment; when the similarity is between 0.3 and 0.8, λ is calculated through linear interpolation to ensure a smooth transition in the adjustment intensity.

[0091] Based on the above embodiments, as an optional implementation, in S54, obtaining the similarity between the prescription text to be detected and the associated prescription text, and determining the adjustment factor based on the similarity specifically includes S541-S543: S541, calculate the similarity score between the prescription text to be detected and each of the associated prescription texts, wherein the similarity score increases as the number of common medicinal materials in the prescription text to be detected and each of the associated prescription texts increases.

[0092] The system first needs to calculate the similarity score between the prescription text to be detected and each associated prescription text. This similarity score is mainly based on the degree of overlap in the composition of the prescriptions, and the calculation method adopts a weighted scoring mechanism based on the number of common medicinal materials. For example, for a prescription to be detected containing four medicinal materials: Astragalus membranaceus, Angelica sinensis, Ligusticum chuanxiong, and Paeonia lactiflora, if an associated prescription contains three of the same medicinal materials (Astragalus membranaceus, Angelica sinensis, and Paeonia lactiflora), then the similarity score between the two prescriptions can be expressed as: Score = (Number of common medicinal materials / Total number of medicinal materials in the prescription to be detected) × 100, which is (3 / 4) × 100 = 75 points in this example. This calculation method reflects the basic principle that "the more common medicinal materials, the higher the similarity," and at the same time, by using the total number of medicinal materials in the prescription to be detected as the denominator, it avoids scoring bias caused by differences in the size of associated prescriptions.

[0093] S542, calculate the average of multiple similarity scores to obtain the similarity between the prescription text to be detected and the associated prescription text.

[0094] After obtaining the similarity scores between the prescription to be tested and all associated prescriptions, the system calculates the average of these scores to obtain the final similarity index. This averaging calculation can comprehensively reflect the degree of similarity between the prescription to be tested and multiple standard prescriptions, reducing the random influence of a single associated prescription. For example, if the similarity scores between the prescription to be tested and five associated prescriptions are 75, 80, 70, 85, and 78, the final similarity is (75+80+70+85+78) / 5=77.6.

[0095] S543, when the similarity is greater than the first threshold, the adjustment factor is set to the first preset value; when the similarity is less than the second threshold, the adjustment factor is set to the second preset value; when the similarity is between the first threshold and the second threshold, the adjustment factor is linearly related to the similarity.

[0096] Based on the calculated similarity, the system uses a piecewise function to determine the adjustment factor λ. Specifically, three intervals are set: when the similarity is higher than the first threshold (e.g., 0.8 or 80 points), the adjustment factor is set to the first preset value (e.g., 0.8), indicating a stronger adjustment; when the similarity is lower than the second threshold (e.g., 0.3 or 30 points), the adjustment factor is set to the second preset value (e.g., 0.2), indicating a weaker adjustment; when the similarity is between the two thresholds, the adjustment factor is calculated through linear interpolation. This piecewise setting can be expressed as: when similarity > 0.8, λ = 0.8; when similarity < 0.3, λ = 0.2; when 0.3 ≤ similarity ≤ 0.8, λ = 0.2 + (similarity - 0.3) × (0.8 - 0.2) / (0.8 - 0.3). For example, if the calculated similarity score is 0.6 (or 60 points), then the adjustment factor λ = 0.2 + (0.6 - 0.3) × 0.6 / 0.5 = 0.56. This calculation method ensures a smooth transition of the adjustment factor and avoids abrupt changes caused by threshold settings.

[0097] S55, the adjustment formula is: TS=IS+λ(RS-IS); where TS is the target score; IS is the initial score; RS is the reference score; and λ is the adjustment factor.

[0098] S56, when the absolute value of the difference is not greater than the preset threshold, the initial score is used as the target score.

[0099] After obtaining the adjustment factor, the system substitutes the adjustment factor λ, the initial score IS, and the reference score RS into the adjustment formula: TS = IS + λ(RS - IS), to calculate the target score TS. This formula achieves dynamic adjustment of the initial score: when λ is close to 1, the target score will move closer to the reference score; when λ is close to 0, the target score retains more characteristics of the initial score. For example, if the initial score of a prescription is 85 points, the reference score is 95 points, and the λ corresponding to a similarity of 0.7 is 0.6, then the target score is 85 + 0.6 × (95 - 85) = 91 points, achieving a moderate approach to the standard of a high-quality prescription.

[0100] When the absolute value of the difference between the initial score and the reference score does not exceed a preset threshold, the system directly uses the initial score as the target score without adjustment. This approach reflects the system's trust in the scoring system, assuming that score fluctuations within a reasonable range are acceptable and do not require mandatory adjustments.

[0101] Based on the above embodiments, as an optional implementation, in S105, when the target score is lower than the preset score, the adjustment strategy for generating the prescription to be tested specifically includes S57-S511: S57, Identify the key factors that cause the target score to be lower than the preset score. The key factors include at least one of the following: incompatible Chinese medicine combinations, abnormal dosage of Chinese medicine, and conflicting efficacy of Chinese medicine combinations.

[0102] In a traditional Chinese medicine prescription quality control system, when the target score of a prescription is lower than the preset score (e.g., 75 points), the system needs to provide specific optimization suggestions to help doctors improve prescription quality. This optimization mechanism first requires accurately identifying the key factors that lead to the low score, then providing corresponding adjustment strategies for different types of problems, and finally forming a systematic prescription improvement plan.

[0103] The system first identifies key factors leading to low scores through multi-dimensional analysis. These factors mainly include three aspects: incompatible combinations of Chinese herbal medicines, abnormal dosages of Chinese herbal medicines, and combinations of Chinese herbal medicines with conflicting effects. Incompatible combinations refer to the possibility that certain Chinese herbal medicines, when used together, may produce toxic side effects or reduce therapeutic efficacy, such as the traditional incompatibilities of "Eighteen Incompatibilities" and "Nineteen Antagonisms." Abnormal dosages refer to the use of certain drugs at dosages exceeding or significantly below the safe range. Conflicting effects refer to the presence of drug combinations in the prescription that have mutually antagonistic effects or affect efficacy. For example, the system may find that the prescription uses licorice and seaweed simultaneously (an incompatible combination), or that the dosage of ephedra exceeds the safe upper limit (abnormal dosage), or that it detects the simultaneous use of dispersing and astringent drugs (conflicting effects).

[0104] S58: For incompatible combinations of Chinese herbal medicines, query the Chinese herbal medicine knowledge base for a list of recommended alternative herbs and generate the first adjustment strategy.

[0105] To address incompatible drug combinations, the system accesses a traditional Chinese medicine (TCM) knowledge base to search for possible alternative herbs. This knowledge base contains a large number of clinically validated alternative regimens, compiled based on the similarity of drug efficacy and clinical experience. For example, when a prescription is found to contain the incompatible combination of licorice and seaweed, the system will suggest replacing seaweed with kelp or licorice with codonopsis, while keeping other herbs unchanged, thus generating the first adjustment strategy. This substitution recommendation fully considers the efficacy characteristics and compatibility rules of the herbs, ensuring that the overall therapeutic effect of the adjusted prescription is not significantly affected.

[0106] S59: For traditional Chinese medicines with abnormal dosage, adjust the dosage to the compliant range according to the safety threshold range in the dosage safety threshold library, and generate a second adjustment strategy.

[0107] For dosage anomalies, the system analyzes and adjusts based on a dosage safety threshold database. This database stores the safe dosage ranges for various traditional Chinese medicines, determined according to the properties of the medicine, the usage scenario, and the results of modern pharmacological research. When the system detects a dosage anomaly, it automatically calculates a reasonable adjustment to bring the dosage back within the safe threshold range. For example, if the dosage of ephedra in a prescription is 10 grams, exceeding the safe upper limit of 6 grams, the system will suggest adjusting the dosage to the range of 4-6 grams, forming a second adjustment strategy. This adjustment ensures both medication safety and maintains the therapeutic effect of the medicine.

[0108] S510, for combinations of Chinese medicines with conflicting effects, based on the conflict types provided by the conflict feature library, deletes conflicting medicinal materials or replaces them with medicinal materials with compatible effects, and generates a third adjustment strategy.

[0109] Regarding efficacy conflicts, the system relies on an efficacy conflict feature database for analysis and processing. This database contains specific manifestations and handling methods for various efficacy conflicts, such as divergent and convergent effects, and contradictory ascending and descending effects. When an efficacy conflict is detected, the system provides two solutions based on the nature of the conflict: first, delete the relatively weaker of the conflicting herbs; second, replace it with a herb with similar but non-conflicting efficacy. For example, when a prescription uses both the divergent Schizonepeta and the astringent Schisandra chinensis, the system will suggest retaining one of them based on the primary symptoms, or using a substitute with similar but non-conflicting efficacy, thus generating a third adjustment strategy.

[0110] S511 combines the first adjustment strategy, the second adjustment strategy, and the third adjustment strategy to output the adjustment strategy of the prescription to be tested.

[0111] Finally, the system integrates and optimizes these three adjustment strategies to form a complete prescription adjustment plan. This plan is sorted according to the priority and implementation difficulty of the adjustments, and includes detailed reasons for the adjustments and explanations of expected effects. For example, a complete adjustment strategy might include: "It is recommended to replace seaweed with kelp (to avoid incompatible combinations); reduce the dosage of ephedra from 10 grams to 6 grams (to ensure medication safety); consider removing schisandra or replacing it with glehnia littoralis (to resolve efficacy conflicts)." Through this systematic adjustment suggestion, doctors can choose the appropriate optimization plan according to the specific situation to improve the safety and effectiveness of prescriptions.

[0112] Based on the above method, this application also discloses a traditional Chinese medicine data analysis system, such as... Figure 2 As shown, Figure 2 This is a schematic diagram of the structure of a traditional Chinese medicine data analysis system provided in an embodiment of this application. The system includes: an establishment module, a first acquisition module, a matching module, a second acquisition module, and an adjustment module; wherein, The system comprises the following modules: a first acquisition module for establishing a traditional Chinese medicine (TCM) knowledge base, which includes a TCM compatibility and incompatibilities rule base, a dosage safety threshold base, and an efficacy conflict feature base; a second acquisition module for acquiring the target TCMs and their target dosages from the text of the prescription to be tested, and for structuring the target TCMs and their dosages according to a predetermined format to generate structured prescription data; a third acquisition module for matching the structured prescription data with the TCM knowledge base to generate a matching coefficient, and for generating an initial score for the prescription to be tested based on the matching coefficient; a fourth acquisition module for acquiring related prescription texts associated with the text of the prescription to be tested, and for acquiring the matching results between the related prescription texts and the TCM knowledge base, and for determining a standard score for the related prescription texts based on the matching results; the related prescription texts include prescription texts with the same therapeutic effects as the prescription to be tested and / or prescription texts with the same main medicinal materials as the prescription to be tested; and an adjustment module for adjusting the initial score based on the standard score to generate a target score for the prescription to be tested, and for generating an adjustment strategy for the prescription to be tested when the target score is lower than the preset score.

[0113] It should be noted that the system provided in the above embodiments is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0114] Please see Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 3 As shown, the electronic device 1000 may include: at least one processor 1001, at least one network interface 1004, a user interface 1003, a memory 1005, and at least one communication bus 1002.

[0115] The communication bus 1002 is used to realize the connection and communication between these components.

[0116] The user interface 1003 may include a display screen and a camera. Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface.

[0117] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0118] The processor 1001 may include one or more processing cores. The processor 1001 connects to various parts of the server using various interfaces and lines, and performs various server functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 1005, and by calling data stored in the memory 1005. Optionally, the processor 1001 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 1001 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content to be displayed on the screen; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 1001 and may be implemented as a separate chip.

[0119] The memory 1005 may include random access memory (RAM) or read-only memory. Optionally, the memory 1005 may include a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 1005 may also be at least one storage device located remotely from the aforementioned processor 1001. Figure 3 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an application program for a traditional Chinese medicine data analysis method.

[0120] exist Figure 3In the electronic device 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user and to obtain the user input data; while the processor 1001 can be used to call an application program stored in the memory 1005 for a traditional Chinese medicine data analysis method. When executed by one or more processors, the electronic device performs one or more of the methods described in the above embodiments.

[0121] An electronic device readable storage medium stores instructions that, when executed by one or more processors, cause the electronic device to perform one or more of the methods described in the above embodiments.

[0122] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0123] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0124] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some service interfaces; indirect couplings or communication connections between devices or units may be electrical or other forms.

[0125] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0126] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0127] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, portable hard drives, magnetic disks, or optical disks.

[0128] The foregoing description is merely an exemplary embodiment of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Other embodiments of this disclosure will be readily apparent to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described herein. The specification and embodiments are to be considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.

Claims

1. A traditional Chinese medicine data analysis method, characterized in that, The method comprises: establishing a traditional Chinese medicine knowledge base, the traditional Chinese medicine knowledge base comprising: a traditional Chinese medicine compatibility contraindication rule base, a dose safety threshold value base, and an efficacy conflict feature base; obtaining target traditional Chinese medicines contained in a to-be-detected prescription text, and target doses of each of the target traditional Chinese medicines, and structurally organizing the target traditional Chinese medicines and the target doses according to a predetermined format to generate structured prescription data; matching the structured prescription data with the traditional Chinese medicine knowledge base to generate a matching coefficient, and generating an initial score of the to-be-detected prescription according to the matching coefficient; obtaining associated prescription texts associated with the to-be-detected prescription text, and obtaining a matching result of the associated prescription texts and the traditional Chinese medicine knowledge base, and determining a standard score of the associated prescription texts according to the matching result; the associated prescription texts comprising: prescription texts having the same therapeutic efficacy as the to-be-detected prescription and / or prescription texts having the same medicinal material composition as the to-be-detected prescription; adjusting the initial score according to the standard score to generate a target score of the to-be-detected prescription, and generating an adjustment strategy of the to-be-detected prescription when the target score is lower than a preset score.

2. The traditional Chinese medicine data analysis method according to claim 1, characterized in that, The matching of the structured prescription data with the traditional Chinese medicine knowledge base to generate a matching coefficient comprises: combining the traditional Chinese medicines in the structured prescription data in pairs to obtain a plurality of traditional Chinese medicine combinations, comparing the plurality of traditional Chinese medicine combinations with incompatible combinations in the traditional Chinese medicine compatibility contraindication rule base, recording as incompatible combinations when there are identical combinations, calculating a ratio of the number of incompatible combinations to the total number of the plurality of traditional Chinese medicine combinations to obtain a first sub-matching coefficient; comparing the target dose of each of the traditional Chinese medicines in the structured prescription data with a corresponding safety threshold value in the dose safety threshold value base, recording as a dose anomaly when the target dose is not within the corresponding safety threshold value, calculating a ratio of the number of dose anomalies to the total number of the target traditional Chinese medicines to obtain a second sub-matching coefficient; matching the efficacy of the traditional Chinese medicines in the structured prescription data with the efficacy conflict feature base to identify traditional Chinese medicine combinations with efficacy conflicts, calculating a ratio of the number of traditional Chinese medicine combinations with efficacy conflicts to the total number of the plurality of traditional Chinese medicine combinations to obtain a third sub-matching coefficient; generating a matching coefficient by combining the first sub-matching coefficient, the second sub-matching coefficient, and the third sub-matching coefficient.

3. The method according to claim 2, wherein, The generation of a matching coefficient by combining the first sub-matching coefficient, the second sub-matching coefficient, and the third sub-matching coefficient comprises: substituting the first sub-matching coefficient, the second sub-matching coefficient, and the third sub-matching coefficient into a preset formula to generate a matching coefficient; wherein, the preset formula is MC=α(1-P1)W1+β(1-P2)W2+γ(1-P3)W3; wherein, MC is the matching coefficient; P1 is the first sub-matching coefficient; P2 is the second sub-matching coefficient; P3 is the third sub-matching coefficient; W1, W2, and W3 are weight coefficients, and W1+W2+W3=1; α, β, and γ are preset adjustment coefficients.

4. The method according to claim 1, wherein, The generating the initial score of the prescription to be detected according to the matching coefficient comprises: substituting the matching coefficient into a preset score conversion function to generate the initial score of the prescription to be detected; wherein, the score conversion function is IS=A×e^(MC)+B; wherein, IS is the initial score; MC is the matching coefficient; A is a proportional coefficient, and B is a basic score.

5. The method of claim 1, wherein, The adjusting the initial score according to the standard score to generate the target score of the prescription to be detected comprises: calculating an average value of the plurality of standard scores to generate a reference score; calculating a difference value between the initial score and the reference score; when the absolute value of the difference value is greater than a preset threshold, obtaining a similarity between the prescription to be detected and the associated prescription text, and determining an adjustment factor according to the similarity; substituting the adjustment factor, the initial score, and the reference score into an adjustment formula to generate the target score of the prescription to be detected; the adjustment formula is TS=IS+λ(RS-IS); wherein, TS is the target score; IS is the initial score; RS is the reference score; and λ is the adjustment factor; when the absolute value of the difference value is not greater than the preset threshold, taking the initial score as the target score.

6. The traditional Chinese medicine data analysis method according to claim 5, characterized in that, The obtaining the similarity between the prescription to be detected and the associated prescription text and determining the adjustment factor according to the similarity comprises: calculating a similarity score between the prescription to be detected and each of the associated prescription texts, the similarity score increasing with an increase in the number of common medicinal materials in the prescription to be detected and each of the associated prescription texts; calculating an average value of the plurality of similarity scores to obtain the similarity between the prescription to be detected and the associated prescription texts; when the similarity is greater than a first threshold, setting the adjustment factor to a first preset value; when the similarity is less than a second threshold, setting the adjustment factor to a second preset value; and when the similarity is between the first threshold and the second threshold, the adjustment factor is in a linear relationship with the similarity.

7. The method of claim 1, wherein, The generating the adjustment strategy for the prescription to be detected when the target score is lower than a preset score comprises: identifying a key factor causing the target score to be lower than the preset score, the key factor comprising at least one of the following: a combination of traditional Chinese medicines with contraindicated compatibility, a traditional Chinese medicine with an abnormal dose, and a combination of traditional Chinese medicines with conflicting efficacy; for the combination of traditional Chinese medicines with contraindicated compatibility, querying a recommended list of alternative medicinal materials from the traditional Chinese medicine knowledge base to generate a first adjustment strategy; for the traditional Chinese medicine with an abnormal dose, adjusting the dose to a compliant range according to a safe threshold range in the dose safety threshold library to generate a second adjustment strategy; for the combination of traditional Chinese medicines with conflicting efficacy, deleting a conflict medicinal material or replacing it with a medicinal material with compatible efficacy based on a conflict type provided by the efficacy conflict feature library to generate a third adjustment strategy; combining the first adjustment strategy, the second adjustment strategy, and the third adjustment strategy to output the adjustment strategy for the prescription to be detected.

8. A traditional Chinese medicine data analysis system, characterized in that, The system comprises an establishing module, a first obtaining module, a matching module, a second obtaining module, and an adjusting module; wherein, The establishing module is configured to establish a traditional Chinese medicine knowledge base, which comprises a traditional Chinese medicine compatibility contraindication rule base, a dose safety threshold value base and an efficacy conflict feature base. The first obtaining module is configured to obtain target traditional Chinese medicines contained in the to-be-detected prescription text and target doses of each of the target traditional Chinese medicines, and to generate structured prescription data by structurally organizing the target traditional Chinese medicines and the target doses in a predetermined format. The matching module is configured to match the structured prescription data with the traditional Chinese medicine knowledge base to generate a matching coefficient, and to generate an initial score of the to-be-detected prescription according to the matching coefficient. The second obtaining module is configured to obtain associated prescription texts associated with the to-be-detected prescription text, to obtain a matching result of the associated prescription texts and the traditional Chinese medicine knowledge base, and to determine a standard score of the associated prescription texts according to the matching result. The associated prescription texts comprise prescription texts having the same therapeutic efficacy as the to-be-detected prescription and / or prescription texts having the same medicinal material composition as the to-be-detected prescription. The adjusting module is configured to adjust the initial score according to the standard score to generate a target score of the to-be-detected prescription, and to generate an adjustment strategy of the to-be-detected prescription when the target score is lower than a preset score.

9. An electronic device, comprising: An electronic device comprising a processor, a memory, a user interface and a network interface, the memory being configured to store instructions, the user interface and the network interface being configured to communicate with other devices, and the processor being configured to execute the instructions stored in the memory to enable the electronic device to perform the method of any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, A computer program stored in a memory and capable of being loaded and executed by a processor to perform the method of any one of claims 1-7.