Traditional Chinese medicine constitution identification method and device based on dynamic converging dialogue model, medium

By dynamically updating the constitution probability and information entropy-driven question selection through a dynamic convergent dialogue model, the problems of low inquiry efficiency and insufficient accuracy in TCM constitution identification are solved, and a highly efficient and accurate constitution identification process is achieved.

CN122245704APending Publication Date: 2026-06-19GUANGDONG HOSPITAL OF TRADITIONAL CHINESE MEDICINE

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG HOSPITAL OF TRADITIONAL CHINESE MEDICINE
Filing Date
2026-03-06
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing TCM constitution identification techniques suffer from low inquiry efficiency, severe information redundancy, inability to dynamically adjust according to individual differences, and inability to simulate the adaptive mechanism in the TCM consultation process, resulting in low identification accuracy and efficiency.

Method used

A dynamic convergence-based dialogue model is adopted. By initializing the physical constitution probability and dynamically updating the physical constitution probability using user response data, the optimal question is selected by combining Shannon information entropy and information gain, and the range of physical constitution judgment is gradually narrowed until the convergence condition is met.

Benefits of technology

It achieves adaptive convergence of the inquiry path, improves the efficiency and accuracy of physical constitution identification, makes the physical constitution judgment results more consistent with the user's long-term characteristics, reduces the number of inquiry rounds, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122245704A_ABST
    Figure CN122245704A_ABST
Patent Text Reader

Abstract

This invention discloses a method, device, and medium for identifying TCM constitutions based on a dynamic convergent dialogue model. The method includes: initializing constitution probabilities, with each constitution having an equal initial probability; acquiring user response data for each round of questioning based on the dynamic convergent dialogue model, and updating the constitution probabilities based on the response data; calculating the Shannon information entropy of the constitution probabilities, updating the optimal constitution question sequence based on the Shannon information entropy, and acquiring user response data for the optimal constitution question sequence; acquiring response data multiple times until a preset convergence condition is met, and determining the user's constitution type. This invention automatically selects the optimal question based on real-time user responses, shortening the consultation path and improving the accuracy of constitution identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent traditional Chinese medicine technology, and in particular to a method, device, and medium for identifying traditional Chinese medicine constitution based on a dynamic convergent dialogue model. Background Technology

[0002] Existing TCM constitution identification technologies mainly fall into two categories: one is based on scale-based digital assessment systems (such as "Classification and Determination of TCM Constitution" ZYYXH / T157-2009), whose core is a fixed list of questions, requiring users to answer dozens of questions one by one. These systems rely on users' subjective understanding of vague terms such as "sometimes" and "frequently," and are highly susceptible to recency effects due to the requirement to recall the past year's state. Furthermore, the fixed questionnaire model uses the exact same question order and content for all users, failing to dynamically adjust according to individual differences. This results in low inquiry efficiency, significant information redundancy, and an inability to deeply extract the most crucial identification information for a specific user, leading to a poor user experience. Another type is classification methods based on traditional machine learning or data mining, which use static feature input models to predict body constitution categories. These methods rely on a predetermined feature set and a fixed model structure, and cannot dynamically generate follow-up questions based on user responses during the interaction process, nor do they possess the logical chain of grasping the chief complaint, asking about concurrent symptoms, and distinguishing between true and false symptoms in the process of traditional Chinese medicine consultation.

[0003] The two methods described above involve all users answering the same list of questions, resulting in a large number of redundant inquiries, low efficiency, and an inability to adjust the next round of questions based on the user's previous answers. They also lack dialectical logic or adaptive mechanisms and cannot quickly determine which questions are most helpful in differentiating different constitutions. There is an urgent need for a constitution identification method that can automatically select the optimal questions based on the user's real-time answers, shortening the consultation path and improving identification accuracy. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides a method, device, and medium for identifying TCM constitution based on a dynamic convergent dialogue model. This method automatically selects the optimal question based on the user's real-time response, thereby shortening the consultation path and improving identification accuracy.

[0005] To address the aforementioned technical problems, the first aspect of this invention discloses a method for identifying traditional Chinese medicine constitution based on a dynamic convergent dialogue model, the method comprising: Initialize the constitution probability, with each constitution having an equal initial probability; The user's answer data for each round of questioning is obtained based on a dynamic convergent dialogue model, and the physical constitution probability is updated based on the answer data. Calculate the Shannon information entropy of the physical condition probability, update the optimal physical condition question sequence based on the Shannon information entropy, and obtain the user's answer data for the optimal physical condition question sequence; The system retrieves response data multiple times until the preset convergence condition is met, thereby determining the user's physical type.

[0006] In some implementations, updating the optimal physical fitness problem sequence based on the Shannon information entropy includes: Generate a candidate question set, calculate the posterior information entropy for each question in the candidate question set, and perform a weighted average of the posterior information entropy to obtain the expected posterior information entropy; The information gain is calculated based on the current information entropy and the expected posterior information entropy. The query question with the largest information gain is selected from the candidate questions, and the optimal physical fitness question sequence is updated.

[0007] In some implementations, the candidate questions include identification questions generated based on a knowledge graph of TCM syndrome associations, and the generation of the candidate question set includes: Select a set of target body types whose probabilities fall within a preset range based on the body type probability ranking; Search the syndrome association knowledge graph for identifying the distinguishing symptoms used to differentiate the target constitution set; Based on the identification questions corresponding to the identification symptoms, the identification questions are added to the candidate question set.

[0008] In some implementations, updating the physical constitution probability based on the response data includes: Perform text parsing on user response data to identify symptom entities, severity modifiers, and frequency modifiers; Based on the correlation strength matrix of symptom entities in the preset symptoms and constitution, the correlation strength between the symptoms and each constitution is obtained; Symptom weights are calculated based on severity modifiers and frequency modifiers; The correlation strength is weighted according to the symptom weight to obtain the score update of each constitution. The score update is accumulated to form a new score vector. The Softmax function is used to convert the score vectors of each constitution into constitution probabilities that sum to 1.

[0009] In some implementations, obtaining response data multiple times until a preset convergence condition is met to determine the user's body type further includes: Based on the current probability distribution of body constitution, select the two body constitutions with the highest probability and determine the body constitution with the highest probability as the main body constitution; When the probability of the second highest probability is greater than the preset threshold for mixed constitution, and the ratio of the probability of the primary constitution to the probability of the second highest constitution is less than the preset ratio threshold, the constitution corresponding to the second highest probability is determined to be a mixed constitution.

[0010] In some implementations, the convergence conditions include: the maximum probability value of the physical probability exceeds a set threshold, the current information entropy is lower than a set threshold, or the number of dialogue turns reaches the maximum limit.

[0011] In some implementations, after the constitution identification is completed, the symptoms with the highest contribution to the change in constitution probability in each round are selected to generate an explanatory report.

[0012] In some implementations, based on the contribution of each symptom to the change in physical fitness probability, the symptoms with the highest contribution are selected to generate an explanatory report, including: Record the contribution of each symptom to the change in the probability of physical condition in each round of user responses; Symptoms were ranked according to their contribution, and the symptoms with the highest contribution were selected as key symptoms and criteria. The key symptoms and corresponding fragments of original user responses are used as explanatory content to generate an explanatory report.

[0013] In a second aspect, a computer device is disclosed, characterized in that it comprises: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and executed by the processor the steps of the TCM constitution identification method based on a dynamic convergence dialogue model as described above.

[0014] Thirdly, a computer storage medium is disclosed, on which a computer program is stored, which, when executed by a processor, implements the TCM constitution identification method based on a dynamic convergent dialogue model as described in any of the above.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention provides a method, device, and medium for TCM constitution identification based on a dynamic convergence dialogue model. Through dynamic updating of constitution probabilities and an information entropy-driven question selection mechanism, it achieves adaptive convergence of the inquiry path. Compared to fixed questionnaires, this invention gradually narrows the scope of constitution judgment based on the user's actual answers, improving identification efficiency and accuracy. By setting multiple convergence conditions, the constitution determination process can converge promptly while maintaining the stability of the results, thereby obtaining identification results that better reflect the user's long-term constitution characteristics. Attached Figure Description

[0016] Figure 1 This is a schematic diagram of the TCM constitution identification method based on a dynamic convergent dialogue model provided by the present invention. Figure 2 This is a flowchart illustrating step S2 in the TCM constitution identification method based on a dynamic convergent dialogue model provided by the present invention. Figure 3 This is a flowchart illustrating step S3 in the TCM constitution identification method based on a dynamic convergent dialogue model provided by the present invention. Figure 4This is a flowchart illustrating step S31 of the TCM constitution identification method based on a dynamic convergent dialogue model provided by the present invention.

[0017] Figure 5 This is a flowchart of step S5 in the TCM constitution identification method based on a dynamic convergent dialogue model provided by the present invention. Detailed Implementation

[0018] To better understand and implement this invention, the technical solutions in the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0019] The terms “comprising” and “having” and any variations thereof in this invention are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or modules is not necessarily limited to those steps or modules that are explicitly listed, but may include other steps or modules that are not explicitly listed or that are inherent to such processes, methods, products or devices.

[0020] The embodiments of the present invention disclose a method for identifying TCM constitution based on a dynamic convergent dialogue model. By performing structured analysis on user response data, dynamic constitution probability updates, optimal question selection driven by information entropy, and multi-dimensional convergence judgment, the method can identify nine types of TCM constitution.

[0021] like Figure 1 As shown, this method includes: Step S1: Initialize the constitution probability. The initial probability of each constitution is equal.

[0022] When a user begins a new inquiry session, a constitution probability P is created for that session, named ConstitutionProbabilityVector, to represent the user's constitution state. The constitution probability P is an array of length 9, corresponding to: balanced constitution, qi deficiency constitution, yang deficiency constitution, yin deficiency constitution, phlegm-dampness constitution, damp-heat constitution, blood stasis constitution, qi stagnation constitution, and special constitution.

[0023] For example, during the initialization phase, the data structure is defined as follows: Name: Physical Probability P Type: One-dimensional array Length: 9. Each index i (from 0 to 8) of the array is fixedly mapped to a TCM constitution. This mapping is predefined, for example: P[0] -> Peaceful P[1] -> Qi-Deficiency P[2] -> Yang-Deficiency P[3] -> Yin-Deficiency P[4] -> Phlegm-Dampness constitution P[5] -> Damp-Heat P[6] -> Blood-Stasis P[7] -> Qi-Stagnation P[8] ->Special-Constitution Element type: Floating-point number, with a value range of [0, 1].

[0024] Constraint: At any given time, the sum of all elements of vector P must be equal to 1, i.e., ΣP[i] = 1, so that it conforms to the definition of a probability distribution.

[0025] At the start of the session, an initialization operation is performed, setting all elements of the physical probability P to equal values, i.e., a uniform distribution. That is: P[i] = 1 / N for all i in [0, N-1], that is, P[i] = 1 / 9 ≈ 0.111... Step S2: Obtain user answer data for each round of questioning based on the dynamic convergent dialogue model, and update the physical constitution probability based on the answer data.

[0026] By generating an open-ended initial question, users are guided into a conversation. This question is presented in a natural and friendly manner, allowing users to describe their physical condition in a relaxed context. During the generation of the initial question, a specific timeframe is defined for the response, guiding user attention to long-term experiences such as the past year, six months, or recent months. This avoids information bias caused by users focusing on recent, occasional changes, ensuring the stability and representativeness of the collected health status information.

[0027] To encourage users to express their most prominent, noticeable, longest-lasting, or most troubling physical symptoms, the subsequent constitution identification should revolve around the core complaint. Therefore, a natural language generation approach based on a large-scale pre-trained language model (Qwen3-MAX) was employed to generate questions. Prompts were provided to the language model to generate an opening statement and the first question according to predetermined goals. The prompts included a role setting, posing as an experienced and approachable TCM practitioner communicating with the user; and a description of the generation task to ensure that the questions guided the user to describe their most profound physical condition over the past year. Furthermore, the prompts included language constraints, requiring them to include a time frame and adopt an open-ended question format to guide the user to focus on their most significant physical problem.

[0028] For example, role-playing: You are an experienced and approachable Traditional Chinese Medicine (TCM) practitioner. Your task is to help users understand their TCM constitution over the past year through conversation.

[0029] Task Description: You now need to generate the opening remarks and the first question for this conversation. The goal of this question is to guide the user to describe the major health issues they have experienced most significantly over the past year. Please avoid using any medical jargon and use plain, easy-to-understand language.

[0030] Constraints and Instructions: Your questions must include the following: 1. Clearly state the timeframe as 'the past year' or 'the entire last year'. 2. Use open-ended questions, avoiding yes / no questions. 3. Encourage users to state their 'most important' or 'most troubling' problem, guiding them to focus on the key issues. Initial questions generated in this way will encourage users to naturally recall their physical experiences over the past year and express key symptoms in their own words.

[0031] like Figure 2 As shown, updating the physical constitution probability based on the answer data includes: Step S21: Perform text parsing on the user's answer data to identify symptom entities, severity modifiers, and frequency modifiers; Step S22: Based on the symptom entity in the preset symptom-constitution correlation strength matrix, obtain the correlation strength between the symptom and each constitution; Step S23: Calculate symptom weights based on severity modifiers and frequency modifiers; Step S24: Weight the correlation strength according to the symptom weight to obtain the score update of each constitution, and sum the score update to form a new score vector; Step S25: Convert the score vectors of each constitution into constitution probabilities that satisfy the condition that the sum of probabilities is 1 using the Softmax function.

[0032] After posing the initial question and receiving the user's input response data, the system parses and processes the user's response data. Generally, the user's response is input in the form of natural language text. This text is first fed into a language understanding process to identify any information related to TCM constitution. The response data, denoted as U_text, is then used to call a Large Language Model (LLM) to perform a specific natural language processing task—Named Entity Recognition (NER) and Relation Extraction (RE). Entity types may include: Symptoms or signs (e.g., fatigue, chills, dry mouth, thick tongue coating) severity: Modifiers indicating the degree of severity (e.g., particularly, slightly, somewhat). frequency: a modifier of frequency (e.g., always, frequently, occasionally). body_part: Body parts (e.g., hands and feet, waist and knees, head) In this application, text parsing is performed by calling a pre-trained large-scale language model. During the parsing process, symptom words, severity modifiers, frequency modifiers, and potentially related body parts are identified in the response data, extracting structured semantic information from the user's free expression. For example, when a user answers "I've always felt a bit weak for the past year, and I get tired after a short period of activity," the symptom can be identified as weakness, the severity as "a bit," and the frequency as "always." The content "gets tired after a short period of activity" can also be incorporated into subsequent calculations as a supplementary description of the same symptom.

[0033] After obtaining structured semantic information, the constitution probability is updated based on the symptom content of the response data. Before execution, a correlation strength matrix between symptoms and constitutions is pre-constructed. This matrix uses standardized symptoms as indexed rows and nine constitutions as indexed columns. Each matrix value represents the symptom contribution calculated from sample data analysis and point mutual information. During the development phase, this matrix was created using NLP techniques, drawing upon knowledge from the Chinese Association of Traditional Chinese Medicine's standards for TCM constitution identification, papers on TCM constitution characteristics, and TCM constitution identification examination data from health check centers. The frequency and correlation index (PMI) of each symptom co-occurring with each constitution were statistically analyzed, and the statistical results were quantified into values ​​in the matrix.

[0034] The matrix structure is as follows: Rows: Correspond to each standard symptom entity (symptom_id) in the knowledge base.

[0035] Columns: Corresponding to the nine constitutions (constitution_id).

[0036] The value M[j][i] represents the strength of the association between the j-th symptom and the i-th constitution, and is a floating-point number in the range [-1, 1]. A positive value indicates a positive correlation, a negative value indicates a negative correlation (i.e., the symptom is evidence of exclusion for this constitution), and 0 indicates no correlation.

[0037] For example, in the association strength matrix, the row corresponding to the symptom "fatigue" may contain several different association values. The association strength between this symptom and Qi deficiency constitution might be 0.85, with Yang deficiency constitution 0.30, with Yin deficiency constitution 0.25, while the association strength with damp-heat constitution might be 0. The matrix values ​​are used to reflect the positive, negative, or irrelevant influence of different symptoms on constitution assessment.

[0038] Before updating the constitution probability, the contribution weight of symptoms is calculated based on the modifiers in the user's response. In this example, the severity "somewhat" can be mapped to a weight of 0.8, and the frequency "always" can be mapped to a weight of 1.2. Therefore, the final contribution weight of the symptom "fatigue" is 0.8 × 1.2 = 0.96. If the user's expression contains multiple symptoms, each symptom will be assigned a corresponding weight according to this process. For example: severity: "Extremely", "Severe" -> w_severity = 1.5 severity: "slight", "somewhat" -> w_severity = 0.8 frequency: "always", "frequently" -> w_frequency = 1.2 frequency: "occasionally" ->w_frequency = 0.7 The final weight w_e = w_severity * w_frequency (if the modifier is not present, the weight is 1.0).

[0039] Subsequently, based on the correlation strength and weight between symptoms and constitution, the score update amount for each constitution is calculated, and the row M[e] of the standard symptom corresponding to entity e in matrix M is found. Taking the symptom "fatigue" as an example, its update amount can be calculated using the formula Score_update[i] = 0.96 × M[fatigue][i]. If M[fatigue][Qi deficiency constitution] = 0.85, the calculation result is 0.96 × 0.85 = 0.816; if M[fatigue][Yang deficiency constitution] = 0.30, the calculation result is 0.288; if M[fatigue][damp-heat constitution] = 0, its score update amount is 0. For cases where the user's answer contains multiple symptoms, the above process will be performed sequentially for each symptom, and the score update amounts of all symptoms will be accumulated into the score vector of the current round, so that the constitution score vector gradually accumulates and corrects as the dialogue progresses.

[0040] After updating the scores, the score vector is converted into new constitution probabilities using the Softmax function. The Softmax function exponentializes each score, normalizes it to obtain a probability, and sums the probabilities to 1. For example, if the score vector is [0.816, 0.288, 0.25, …], the Softmax function converts these values ​​into significantly different probability values, resulting in a significant increase in the probability of constitution most relevant to the symptoms. The transformed probability vector directly overwrites the previous round's probabilities and serves as the basis for the next round of questioning strategies and constitution identification reasoning.

[0041] Through the above steps, from natural language responses to automatic updates of physical fitness probabilities, physical fitness assessment no longer relies on a fixed questionnaire but changes in real time based on user expression. Symptom analysis, evidence weight allocation, correlation matrix mapping, and Softmax probability make the physical fitness assessment process progressively convergent and expression-driven.

[0042] Step S3: Calculate the Shannon information entropy of the physical condition probability, update the optimal physical condition question sequence based on the Shannon information entropy, and obtain the user's answer data for the optimal physical condition question sequence.

[0043] To minimize the uncertainty in physical constitution assessment during subsequent questioning, the physical constitution probabilities obtained from the current round of questioning are read, and the Shannon information entropy is used to measure this probability distribution. Let the current probability vector be P = {p0, p1, …, p8}, and according to the Shannon information entropy H(P) = ... Σ(p i log2p i The formula is used to calculate the magnitude of uncertainty. If the probability of a certain constitution is close to 1 while the probabilities of others are close to 0, the entropy value will approach 0, indicating that the determination of the constitution type is highly clear; conversely, in the initial stage of the conversation, the probability of each constitution is 1 / 9, and the calculated entropy value is close to log29 ≈ 3.17, indicating that there is almost no distinguishing ability, and further questioning is needed to reduce uncertainty.

[0044] After obtaining the current information entropy, it is necessary to determine the set of possible questions for the next round to effectively distinguish the constitution types with higher current probabilities. The optimal constitution question sequence is then updated based on the Shannon information entropy, as follows: Figure 3 , 4 include: Step S31: Generate a candidate question set; the candidate questions include identification questions generated based on the TCM syndrome association knowledge graph, and the generated candidate question set includes: Step S311: Select a set of target physiques with probabilities within a preset range based on the physique probability ranking; Step S312: Search for the identification symptoms used to distinguish the target constitution set in the syndrome association knowledge graph; Step S313: Add the identification questions to the candidate question set according to the identification questions corresponding to the identification symptoms.

[0045] First, the current constitution probabilities are sorted in descending order, and the two constitutions with the highest probabilities, or a predetermined number, are selected as the key identification targets. For example, if the probability of Yang deficiency is 0.45 and the probability of Qi deficiency is 0.35, and both are significantly higher than other constitutions, then these two constitutions are selected as the target constitution set. After determining the target constitutions, typical distinguishing symptoms are found using pre-organized constitution identification knowledge. For example, common distinguishing points between Yang deficiency and Qi deficiency include "cold limbs" which is more likely to be Yang deficiency, while "sweating easily upon exertion" is more likely to be Qi deficiency. Based on these distinguishing symptoms, corresponding question formats are further matched, such as whether one sweats easily after activity, whether one still feels cold when wearing thick clothing, etc., and these questions are added to the candidate question set for this round.

[0046] Step S32: Calculate the posterior information entropy for each question in the candidate question set, and then perform a weighted average of the posterior information entropy to obtain the expected posterior information entropy. After generating candidate questions, the question that best reduces physical uncertainty is selected. The posterior information entropy of each question in the candidate question set is calculated. For any candidate question q, a predefined set of possible answers, such as "yes" and "no," is used. The probability P(a) of the user for different answers is estimated based on the current physical probability. j |P), this estimate can be combined with the correlation strength matrix between symptoms and constitution: P(is|P)≈Σ i (p i *P(q_yes|constitution i )) P(q_yes | constitution i The value represents "the probability that a person with constitution i will answer 'yes' to question q". This value is obtained from the symptom-constitution correlation strength matrix M in step S2. For example, if "sweating upon exertion" is highly correlated with Qi deficiency constitution, then given a high probability of Qi deficiency constitution, the user is also more likely to give an affirmative answer to the question.

[0047] After obtaining the probability estimates for each answer, the system further simulates how the probability of physical constitution would change if a user gave a certain answer, and calculates the corresponding new information entropy. The probability update method is the same as in step S2, i.e., the score vector and probability vector are updated based on the correlation strength matrix between the identified symptoms and physical constitution, and the corresponding values ​​of the answers. For each answer a...j Each of these can yield a new physical probability P_new|a j And the information entropy H(P_new|a) calculated based on this distribution. j Using the probability of the given answer as the weight, a weighted average of the entropy values ​​corresponding to all answers is taken to obtain the expected posterior entropy H_expected(P|q) for the question: H_expected(P|q)=Σ j (P(a j |P)*H(P_new|a j )) Step S33: Calculate the information gain based on the current information entropy and the expected posterior information entropy, select the query question with the largest information gain from the candidate questions, and update the optimal physical fitness question sequence.

[0048] Information gain is defined as the uncertainty before asking the question minus the expected uncertainty after asking the question: IG(q) = H(P) - H_expected(P|q) The information gain is calculated based on the current entropy and the expected posterior entropy. The larger the information gain IG(q), the more likely the question is to reduce the uncertainty of the physical condition judgment in this round. For example, if the current entropy is 1.8 and the expected posterior entropy of a certain question is 1.1, then the information gain is 0.7; if the expected posterior entropy of another question is 1.5, then its information gain is 0.3. Obviously, the former is more suitable as the question for the next round. All candidate questions are iterated and the information gain IG(q) is calculated. Finally, the one with the largest information gain is selected as the optimal question.

[0049] After determining the optimal questions, the optimal sequence of physical fitness questions is updated. Based on the historical content of the dialogue and the context of the user's previous response, natural language questions are generated through a language model to make the questioning method coherent and human-like.

[0050] For example: Prompt input: (1) Dialogue history: Provides the context of previous dialogues.

[0051] (2) Generating instructions: "You are a friendly TCM doctor. Based on the user's previous answer, please transition naturally and ask the user a question focusing on the core point of 'Do you sweat easily after slight activity?' You can add guiding words such as 'Think back' to the question to emphasize the situation over the past year." LLM execution: LLM synthesizes all inputs and generates a question that is both diagnostically accurate and humane.

[0052] In each round of dialogue, the most effective questions are dynamically selected, so that the constitution assessment gradually converges in the direction of the lowest uncertainty, and the thinking path from chief complaint to syndrome differentiation is simulated in the real TCM consultation process.

[0053] Step S4: Obtain response data multiple times until the preset convergence condition is met to determine the user's physical type.

[0054] To avoid unnecessary lengthy conversations and ensure the stability and reliability of the physical constitution identification results, at the end of each round of questioning, it is determined whether the response data meets the preset convergence criteria. If any one of these criteria is met, it indicates that the current physical constitution assessment has sufficient certainty, and further follow-up questions are unnecessary.

[0055] The convergence conditions include: the maximum probability value of a constitution exceeds a set threshold, the current information entropy is lower than a set threshold, or the number of dialogue turns reaches the maximum limit. Whether probability-dominant convergence has been achieved is determined based on the concentration of constitution probabilities. The current constitution probability P is read, and the maximum probability value is checked to see if it exceeds the set confidence threshold T_prob. For example, when T_prob is set to 0.85, if the probability of a certain constitution reaches or exceeds 0.85, it indicates that this constitution has formed an absolute advantage over other constitutions. In this case, convergence can be directly determined based on max(P)≥T_prob. This usually occurs after the user clearly expresses certain typical symptoms, and the probability rapidly converges to a specific constitution.

[0056] Simultaneously, changes in information entropy can be used to determine whether uncertainty convergence has been achieved. When the probability of physical constitution is highly concentrated, even if the maximum probability has not reached 0.85, it may mean that convergence has been completed. Calculate the information entropy H(P) of the current round and compare it with the set absolute information entropy threshold T_entropy. When the absolute information entropy threshold T_entropy is set to 0.5, if H(P) is not greater than 0.5, it indicates that the probability of physical constitution has shown a clear unimodal distribution, with almost no difficulty in differentiation, and further questioning is of little value. Based on this, to assess whether the downward trend of uncertainty has stopped, the difference between the current and previous round information entropy is also calculated. When |H(P_current)| When H(P_previous) is less than the set threshold T_delta_entropy, and the change in entropy in two consecutive rounds does not exceed this threshold, the entropy is considered to have entered a stable plateau, and further questions are no longer asked to obtain more information. In this embodiment, T_delta_entropy is set to 0.01. If the entropy decreases by no more than 0.01 in two consecutive rounds, the reduction in bits is negligible, and continuing to ask questions will hardly improve the recognition effect. Therefore, the dialogue can be considered to have converged.

[0057] In some implementations, to prevent the dialogue from becoming excessively long due to ambiguous user expressions, repetitive information, or other abnormal situations, a maximum number of dialogue rounds is set as a mandatory convergence condition. At the end of each round, the total number of rounds executed (turn_count) is counted. When turn_count reaches or exceeds the maximum number of rounds (N_max, e.g., N_max=20), further questioning stops and the body constitution assessment phase begins. This upper limit on the number of dialogue rounds effectively prevents user fatigue caused by excessively long dialogues, while ensuring that body constitution identification is completed within a limited number of rounds.

[0058] The system reads the final constitution probabilities and identifies the constitution with the highest probability value as the user's primary constitution. This primary constitution is obtained by finding the index corresponding to the maximum probability value; this constitution has formed the most obvious tendency after all rounds of information accumulation and updates. To simulate the concept of "complementary constitution" in traditional Chinese medicine clinical practice, it also checks whether the second-highest probability constitution contributes sufficiently. If the second-highest probability value exceeds a set threshold for inclusion / exclusion judgment, such as 0.25, and the ratio between the maximum probability value and the second-highest probability value does not exceed a preset difference limit (e.g., the maximum probability divided by the second-highest probability is less than 3.0), then this second-highest constitution will also be recorded as the user's complementary / exclusionary constitution. This system can not only identify single constitutions but also capture complex situations involving multiple constitution characteristics.

[0059] Step S5: Based on the contribution of each symptom to the change in the probability of physical condition, select the symptom with the highest contribution and generate an explanatory report.

[0060] like Figure 5 As shown, it includes: Step S51: Record the contribution of each symptom to the change in the probability of physical condition in the user's answer data in each round of inquiry; Step S52: Sort the symptoms according to their contribution and select the symptoms with the highest contribution as the key symptoms and criteria. Step S53: Use the key symptoms and corresponding fragments of the user's original response as explanatory content to generate an explanatory report.

[0061] Simulating the concept of "combined constitution" in traditional Chinese medicine clinical practice, this method also checks whether the second-highest probability constitution contributes sufficiently. If the second-highest probability value exceeds a set threshold for determining combined constitution, such as 0.25, and the ratio between the highest and second-highest probability values ​​does not exceed a preset upper limit for difference (e.g., the maximum probability divided by the second-highest probability is less than 3.0), then the second-highest constitution will also be recorded as the user's combined constitution. This method can not only identify single constitutions but also capture complex situations involving multiple constitution characteristics.

[0062] The system traces and processes the symptom information provided by users throughout the dialogue process to generate interpretable diagnostic criteria. To this end, the incremental change of each symptom's contribution to the probability of the primary constitution is recorded during each round of constitution probability updates. For example, if in a certain round, the symptom "fatigue" expressed by the user increases the probability of the primary constitution from 0.40 to 0.48, then the contribution of this symptom in that round is recorded as 0.08. The system collects the contribution values ​​of all rounds and all symptoms, and filters out symptoms with positive contributions, i.e., those that support the constitution assessment. For each symptom, not only is its contribution value retained, but the specific statements the user made about the symptom in the original response are also recorded to ensure the traceability of subsequent reports. Symptoms are sorted in descending order of contribution, and several symptoms with a preset contribution ranking are selected as key diagnostic criteria. For example, the top three symptoms with the highest contribution values ​​can be selected, and subsequent reports can explain why these symptoms are important for the final constitution determination. By extracting key evidence from the perspective of probability changes, the results of constitution identification are made transparent and interpretable, clearly showing users the main reasons for the constitution judgment obtained by this method.

[0063] To facilitate user understanding and use of the constitution results, the primary constitution, secondary constitutions, key symptom evidence, and conditioning suggestions based on Traditional Chinese Medicine (TCM) theory can be integrated into a structured natural language report. The report content will be presented in a coherent, professional, and easy-to-understand manner, including explanations for each key symptom. For example, if a user's primary constitution is Qi deficiency, the report might state, "Because you repeatedly mentioned fatigue and excessive sweating after activity, these symptoms contribute significantly to Qi deficiency in the probability model; therefore, your constitution tends to be Qi deficiency." The report can also include conditioning suggestions regarding diet and exercise to support the user's daily health management. The conversation record, the process of constitution probability changes, the final results, and the report are stored anonymously for continuous model optimization and iteration.

[0064] This invention provides a method for TCM constitution identification based on a dynamic convergent dialogue model. Without relying on a fixed questionnaire, it dynamically adjusts the constitution judgment results based on the user's responses in each round. By initializing the constitution probabilities to ensure all constitutions start at the same level, the method then progressively updates the probability distribution using the user's actual responses, making the constitution identification process cumulative and correctable. By quantifying the current uncertainty using Shannon information entropy, this method selects the optimal question that minimizes uncertainty in each round, guiding the inquiry path towards the fastest convergence of constitution judgment. It effectively controls the number of inquiry rounds while ensuring accuracy, thus completing constitution identification with fewer interaction steps. Compared to traditional methods relying on fixed scales or static questionnaires, this method improves inquiry efficiency, makes the identification results more closely reflect the user's actual long-term condition, and is more intelligent, flexible, and closer to the step-by-step confirmation logic of TCM diagnosis, thereby improving the accuracy of constitution identification and the user experience.

[0065] This invention, in the physical fitness identification process, dynamically updates the physical fitness probability and uses an information entropy-based question selection method, enabling the inquiry process to adjust according to the user's specific answers. Compared to the method of answering questions sequentially using a fixed scale, it reduces unnecessary questions and fewer rounds of inquiry, making it suitable for scenarios where physical fitness assessments need to be completed within a limited time.

[0066] This invention, through time-range prompts, detailed expressions of symptom frequency and severity, and free text parsing, makes the content provided by users more closely reflect their long-term condition, reducing information bias caused by recent fluctuations. Based on the correlation between symptoms and the method of questioning to identify symptoms, the probability update process of this invention conforms to the logic of "gradually confirming the chief complaint" in traditional diagnostic inquiry, making the constitution assessment more accurate.

[0067] The inquiry process is a continuous dialogue, allowing users to describe their condition in a natural way, which is easier to respond to than the fixed-option format of traditional scales. After the constitution identification is completed, this invention traces the source of key symptoms based on their contribution and presents the user's original description fragments along with the probability change process, making the constitution assessment results traceable and easy for users to understand.

[0068] The original text, structured symptoms, and records of changes in physical condition probability during the dialogue process can all be retained. This information can reflect the dynamic process of physical condition assessment and contains more content than traditional scales that only have a final score. It is suitable for subsequent statistical analysis, model training, or health management research.

[0069] This invention, through the above-mentioned technical process, expresses the characteristics of gradual convergence and dynamic identification in TCM constitution identification in an algorithmic way. It can be used in constitution assessment scenarios that require standardization and verifiability, and can also serve as an auxiliary tool for primary healthcare institutions and health management systems, improving the operability of constitution identification, alleviating the problem of insufficient high-quality TCM resources, and has high promotional value and social significance.

[0070] Based on the same inventive concept, the present invention also provides a computer device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and executed as described above for the TCM constitution identification method based on a dynamic convergence dialogue model.

[0071] The processing methods for computer devices can be referred to the description of the methods above, and will not be repeated here.

[0072] This application also provides a non-transitory machine-readable storage medium storing an executable program, which, when run by a microprocessor, causes the processor to execute the method provided in the above embodiments.

[0073] This invention discloses a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform the described methods.

[0074] This invention discloses a computer program product including a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform the described method.

[0075] The embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0076] Through the detailed description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0077] Finally, it should be noted that the embodiments disclosed in this invention are merely preferred embodiments of this invention and are only used to illustrate the technical solutions of this invention, not to limit it. Although this invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this invention.

Claims

1. A Chinese constitution identification method based on a dynamic converging dialogue model, characterized in that, The method includes: Initialize the constitution probability, with each constitution having an equal initial probability; The user's answer data for each round of questioning is obtained based on a dynamic convergent dialogue model, and the physical constitution probability is updated based on the answer data. Calculate the Shannon information entropy of the physical condition probability, update the optimal physical condition question sequence based on the Shannon information entropy, and obtain the user's answer data for the optimal physical condition question sequence; The system retrieves response data multiple times until the preset convergence condition is met, thereby determining the user's physical type.

2. The method for TCM constitution identification based on a dynamic convergent dialogue model according to claim 1, characterized in that, Updating the optimal physical fitness problem sequence based on the Shannon information entropy includes: Generate a candidate question set, calculate the posterior information entropy for each question in the candidate question set, and perform a weighted average of the posterior information entropy to obtain the expected posterior information entropy; The information gain is calculated based on the current information entropy and the expected posterior information entropy. The query question with the largest information gain is selected from the candidate questions, and the optimal physical fitness question sequence is updated.

3. The method for TCM constitution identification based on a dynamic convergent dialogue model according to claim 2, characterized in that, The candidate question set includes identification questions generated based on a knowledge graph of TCM syndrome associations. The generated candidate question set includes: Select a set of target body types whose probabilities fall within a preset range based on the body type probability ranking; Search the syndrome association knowledge graph for identifying the distinguishing symptoms used to differentiate the target constitution set; Based on the identification questions corresponding to the identification symptoms, the identification questions are added to the candidate question set.

4. The method for TCM constitution identification based on a dynamic convergent dialogue model according to claim 3, characterized in that, Update the physical condition probability based on the answer data, including: Perform text parsing on user response data to identify symptom entities, severity modifiers, and frequency modifiers; Based on the correlation strength matrix of symptom entities in the preset symptoms and constitution, the correlation strength between the symptoms and each constitution is obtained; Symptom weights are calculated based on severity modifiers and frequency modifiers; The correlation strength is weighted according to the symptom weight to obtain the score update of each constitution. The score update is accumulated to form a new score vector. The Softmax function is used to convert the score vectors of each constitution into constitution probabilities that sum to 1.

5. The method for identifying TCM constitution based on a dynamic convergent dialogue model according to claim 2, characterized in that, The process of repeatedly retrieving response data until a preset convergence condition is met to determine the user's constitution type also includes: Based on the current probability distribution of body constitution, select the two body constitutions with the highest probability and determine the body constitution with the highest probability as the main body constitution; When the probability of the second highest probability is greater than the preset threshold for mixed constitution, and the ratio of the probability of the primary constitution to the probability of the second highest constitution is less than the preset ratio threshold, the constitution corresponding to the second highest probability is determined to be a mixed constitution.

6. The method for TCM constitution identification based on a dynamic convergent dialogue model according to claim 3, characterized in that, The convergence conditions include: the maximum probability value of the physical probability exceeds a set threshold, the current information entropy is lower than a set threshold, or the number of dialogue turns reaches the maximum limit.

7. The method for TCM constitution identification based on a dynamic convergent dialogue model according to claim 6, characterized in that, After the constitution identification is completed, the symptoms with the highest contribution to the change in constitution probability in each round are selected to generate an explanatory report.

8. The method for identifying TCM constitution based on a dynamic convergent dialogue model according to claim 7, characterized in that, Based on the contribution of each symptom to the change in physical condition probability, the symptoms with the highest contribution are selected, and an explanatory report is generated, including: Record the contribution of each symptom to the change in the probability of physical condition in each round of user responses; Symptoms were ranked according to their contribution, and the symptoms with the highest contribution were selected as key symptoms and criteria. The key symptoms and corresponding fragments of original user responses are used as explanatory content to generate an explanatory report.

9. A computer device, characterized in that, include: A processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and execute the steps of the method for identifying TCM constitution based on a dynamic convergence dialogue model as claimed in any one of claims 1-8.

10. A computer storage medium, characterized in that, It stores a computer program, which, when executed by a processor, implements the steps of the TCM constitution identification method based on a dynamic convergent dialogue model as described in any one of claims 1-8.