Intelligent recommendation method for food and medicine homology suggestions oriented by traditional Chinese medicine constitution identification

By standardizing the collection of multi-source health data and fusing deep learning features, combined with intelligent identification of TCM constitution and reinforcement learning optimization, the problems of low personalization and poor dynamic adaptability of existing health management systems have been solved. This has enabled the objective quantitative identification of TCM constitution and the generation of personalized dietary therapy plans, and improved the prediction of health risks and the system's autonomous learning capabilities.

CN122067700APending Publication Date: 2026-05-19NANJING UNIV OF INFORMATION SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING UNIV OF INFORMATION SCI & TECH
Filing Date
2026-02-26
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing health management systems lack personalization and dynamic adaptability, cannot effectively process subjective descriptive information in TCM constitution identification, lack the ability to dynamically allocate personalized health care plans, cannot integrate health data from multiple dimensions, lack objective evaluation mechanisms and system optimization mechanisms, and cannot establish a quantitative correlation between TCM constitution and health risks.

Method used

This paper adopts standardized collection and preprocessing of multi-source health data, multimodal feature extraction and fusion based on deep learning, intelligent identification of TCM constitution, dynamic assessment of health status based on time series analysis, multi-dimensional health risk prediction, generation of personalized dietary therapy plans, collection and effect evaluation of user feedback data, and adaptive optimization of system parameters based on reinforcement learning to construct an online optimization framework for multi-armed slot machines.

Benefits of technology

It has achieved objective and quantitative identification of TCM constitution, improved the accuracy of health data feature extraction, enhanced the ability to detect health risks early, generated personalized dietary therapy plans, enhanced the system's self-learning ability, and achieved a comprehensive quantitative evaluation of the effects of dietary therapy plans.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122067700A_ABST
    Figure CN122067700A_ABST
Patent Text Reader

Abstract

The invention discloses a traditional Chinese medicine constitution identification oriented intelligent recommendation method for food and medicine homology suggestions. The method comprises the steps of standardized collection and preprocessing of multi-source health data, extraction and fusion of multi-modal features, intelligent recognition of traditional Chinese medicine physique, dynamic evaluation of health status, health risk prediction, generation of personalized dietary therapy schemes, effect evaluation and adaptive optimization of system parameters. According to the method, technologies such as random forest, deep learning and reinforcement learning are fused, models such as a multi-mode attention fusion network, a knowledge enhancement support vector machine and an LSTM-Autoencoder anomaly detection network are innovatively adopted, subjective judgment of the traditional Chinese medicine physique is quantified, dietary therapy recommendation is converted into a constraint satisfaction problem, and the traditional Chinese medicine physique subjective judgment method is optimized. A three-in-one effect evaluation system and a dobby machine online optimization framework are constructed, deep fusion of traditional Chinese medicine theories and modern science and technology is realized, intelligence, personalization and scientificity of health management are improved, and a new scheme is provided for the field of health management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information technology in traditional Chinese medicine, and in particular to an intelligent recommendation method for food and medicine homology based on TCM constitution identification. Background Technology

[0002] Traditional health management systems mainly consist of user health records and a standardized nutrition advice database. Due to the lack of individualized analysis and static recommendation mechanisms, the nutrition advice and health care plans in traditional health management systems do not have truly personalized characteristics, making it difficult to adapt to the user's dynamically changing health status and affecting the practical effectiveness of the health management system.

[0003] Currently, research on personalized health management systems largely focuses on improving user data collection efficiency, enriching nutritional knowledge bases, and optimizing user interfaces. There is a lack of discussion and case studies on the deep integration of traditional Chinese medicine constitution theory with modern AI technology in personalized health management. Furthermore, existing static recommendation methods based on questionnaires and simple matching methods based on single indicators are unsuitable for the dynamic personalized health management needs under complex constitution characteristics, as these methods are not ideal for generating personalized plans.

[0004] The main problems with existing technologies are as follows: 1) The problem of quantifying and standardizing TCM constitution characteristics: Existing health management systems cannot effectively process subjective descriptive information in TCM constitution identification and lack standardized methods to convert traditional constitution characteristics into calculable data, resulting in low accuracy of constitution analysis. 2) The problem of dynamically adjusting personalized health care plans: Traditional health management systems adopt a static recommendation model and cannot dynamically adjust health care suggestions according to real-time changes in the user's health status, making it difficult to meet the dynamic needs of individualized health management. 3) The problem of multi-source health data fusion and processing: Existing systems lack effective technical means to integrate user health records, nutritional knowledge, and effect feedback data, and cannot achieve collaborative analysis and intelligent processing of multi-dimensional data. 4) The problem of health care effect evaluation: Traditional health management systems mainly rely on subjective feelings for evaluation and lack a comprehensive evaluation mechanism that combines objective health indicators, resulting in inaccurate and unscientific effect evaluation. 5) The problem of lagging system knowledge updates and optimization: The knowledge base updates of existing systems mainly rely on manual maintenance and lack a mechanism for automatic learning and optimization based on actual usage effects, making it impossible to achieve continuous improvement of system performance. 6) Issues with the correlation analysis between constitution identification and health risk: Traditional methods cannot effectively establish a quantitative correlation between TCM constitution types and modern health risk indicators, which affects the accuracy of preventive health management. Summary of the Invention

[0005] To address the technical problems of low personalization and poor dynamic adaptability in existing health management systems, this invention provides an intelligent recommendation method for food and medicine homology suggestions guided by traditional Chinese medicine constitution identification.

[0006] This invention adopts the following technical solution: a method for intelligent recommendation of food and medicine homology based on traditional Chinese medicine constitution identification, comprising the following steps:

[0007] Step 1: Standardized collection and preprocessing of multi-source health data: Collect and fuse multi-source health data, use the random forest imputation method, and process heterogeneous data sources through the Z-score standardization algorithm and outlier detection mechanism;

[0008] Step 2: Multimodal feature extraction and fusion based on deep learning: Fusing textual, numerical, and temporal features, a multimodal attention fusion network is adopted, and deep semantic representation of heterogeneous health data is performed through BERT text encoder, multilayer perceptron numerical encoder and bidirectional LSTM temporal extractor.

[0009] Step 3, Intelligent Identification of TCM Constitution: Construct a knowledge-enhanced support vector machine model, embed the TCM constitution expert knowledge graph into machine learning, and perform objective quantitative identification of traditional TCM constitution theory through expert constraint terms and constitution tendency calculation;

[0010] Step 4: Dynamic assessment of health status based on time series analysis: Construct a health anomaly detection network based on LSTM-Autoencoder and a Transformer time series prediction model. By reconstructing the error threshold judgment and multi-head attention mechanism, capture the long-term and short-term change patterns of health status and provide early warning of abnormal health status.

[0011] Step 5: Multi-dimensional health risk prediction model: Construct a multi-dimensional risk feature engineering algorithm and Stacking ensemble learning framework, and predict the risk of chronic diseases through constitution-disease correlation calculation and risk grading algorithm;

[0012] Step 6: Personalized Dietary Therapy and Wellness Plan Generation: The personalized dietary therapy recommendations are transformed into a constraint satisfaction problem. A backtracking search algorithm combined with collaborative filtering optimization is used to automatically generate personalized dietary therapy plans based on the user's physical condition and preferences.

[0013] Step 7: User feedback data collection and effect evaluation: Construct a three-in-one effect evaluation system that integrates subjective evaluation, objective indicators, and behavioral data. Through Likert scale scoring, physiological indicator improvement calculation, and compliance scoring algorithm, establish a comprehensive effect scoring model to quantitatively evaluate the effect of the dietary therapy plan.

[0014] Step 8: System parameter adaptive optimization based on reinforcement learning: Design an online optimization framework based on multi-armed slot machine, adopt the Upper Confidence Bound algorithm and a decreasing learning rate mechanism, and continuously optimize the recommendation strategy through the feedback loop of state-action-reward to realize the autonomous learning and evolution of the health management system.

[0015] Compared with the prior art, the present invention, employing the above technical solution, has the following technical effects:

[0016] 1. This invention effectively solves the problems of inconsistent and missing standards in multi-source heterogeneous data by using adaptive data acquisition and intelligent interpolation technology; it adopts a multimodal attention fusion network to achieve deep semantic fusion of text, numerical and temporal features, which significantly improves the feature extraction accuracy of health data and overcomes the limitations of single-modal evaluation.

[0017] 2. This invention, through Knowledge-Enhanced Support Vector Machine (KE-SVM), transforms the subjective judgment of the nine constitution types in traditional Chinese medicine into an objective, quantitative identification process for the first time. By embedding expert knowledge graphs and designing expert constraints, it effectively solves the key problems of existing technologies, such as reliance on subjective judgment, low standardization, and poor consistency, achieving a deep integration of traditional Chinese medicine theory and modern machine learning technology. Compared to traditional subjective judgment methods such as questionnaires, the constitution identification results of this invention have higher stability and repeatability, are not affected by the subjective factors of the assessor, and provide a more reliable theoretical basis for personalized health management.

[0018] 3. This invention's LSTM-Autoencoder-based health anomaly detection network, through reconstruction error analysis, can more sensitively capture subtle changes in health status. Combined with the multi-head attention mechanism of the Transformer time-series prediction model, the system can effectively identify long-term and short-term patterns of health status changes, achieving early warning of health anomalies and significantly improving the early detection capability of health risks. Furthermore, it integrates multi-dimensional risk feature engineering algorithms with the Stacking ensemble learning framework, overcoming the limitations of single algorithms by combining the advantages of multiple base learners such as random forests, gradient boosting trees, and logistic regression. The introduction of constitution-disease correlation calculation and risk grading algorithms makes risk prediction for chronic diseases such as diabetes and hypertension more accurate and reliable.

[0019] 4. This invention innovatively transforms personalized dietary therapy recommendations into a constraint satisfaction problem (CSP). By combining a backtracking search algorithm with collaborative filtering optimization technology, it achieves simultaneous satisfaction of multiple constraints, including nutritional constraints, physical constitution constraints, and seasonal constraints. Compared to existing rule-based simple recommendation methods, this invention can generate more personalized and scientifically sound dietary therapy plans. Furthermore, by comprehensively considering multiple constraints, it ensures the scientific validity of the dietary therapy plans in terms of nutritional balance, seasonal adaptability, and physical constitution matching. This solves the problems of lack of personalization and poor practicality in existing technologies, significantly improving user acceptance and implementation feasibility.

[0020] 5. This invention, based on an online optimization framework for multi-armed slot machines, enables the system to "learn through service." Through a feedback loop of state-action-reward, the system can continuously and adaptively adjust its recommendation strategy based on user feedback, solving the problem of traditional systems having fixed parameters and being unable to cope with individual changes.

[0021] 6. This invention constructs a three-in-one effect evaluation system integrating subjective evaluation, objective indicators, and behavioral data. Through Likert scale scoring, physiological indicator improvement calculation, and compliance scoring algorithms, it achieves a comprehensive quantitative evaluation of the effectiveness of dietary therapy programs. Compared to existing technologies that lack a systematic evaluation mechanism, this provides a scientific basis for continuous system optimization. Simultaneously, it streamlines the entire process from data collection, constitution identification, risk prediction to program generation and optimization, deeply integrating traditional Chinese medicine theory with modern artificial intelligence technology to form a complete closed-loop health management program. Attached Figure Description

[0022] Figure 1 This is a flowchart of the intelligent recommendation method for food and medicine homology proposed in this invention. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the application will be further described in detail below with reference to the accompanying drawings. The described embodiments are only a part of the embodiments involved in this invention. All non-innovative embodiments based on these embodiments by other researchers in the art are within the protection scope of this invention. Furthermore, the step numbers in the embodiments of this invention are only set for ease of explanation and do not limit the order of the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

[0024] In one embodiment of the present invention, a method for intelligent recommendation of food and medicine homology based on traditional Chinese medicine constitution identification is provided, such as... Figure 1 As shown, it includes the following steps:

[0025] Step 1: Standardized Collection and Preprocessing of Multi-Source Health Data: Wearable device data, user subjective evaluations, and third-party health application data are deeply integrated. Adaptive Data Acquisition Protocol (ADCP) and intelligent imputation technology based on random forest are adopted. The Z-score standardization algorithm and outlier detection mechanism are used to achieve unified processing of heterogeneous data sources, which solves the problems of inconsistent standards and uneven quality in traditional health data collection.

[0026] Step 2: Multimodal feature extraction and fusion based on deep learning: Innovatively, three modal features are fused: text (symptom description), numerical (physiological indicators), and time series (continuous monitoring data). A multimodal attention fusion network (MMAFN) is used, and a BERT text encoder, a multilayer perceptron numerical encoder, and a bidirectional LSTM time series extractor are used to achieve deep semantic representation of heterogeneous health data, thus solving the problem of low accuracy in traditional single-modal health assessment.

[0027] Step 3, TCM Constitution Intelligent Recognition Algorithm: Using the Knowledge Enhanced Support Vector Machine (KE-SVM) architecture, the expert knowledge graph of the nine TCM constitutions is embedded into the machine learning model. Through expert constraint terms and constitution tendency calculation algorithms, the objective quantitative recognition of traditional TCM constitution theory is realized for the first time, breaking through the limitations of traditional subjective judgment.

[0028] Step 4: Dynamic assessment of health status based on time series analysis: Design a health anomaly detection network based on LSTM-Autoencoder and a Transformer time series prediction model. By reconstructing the error threshold judgment and multi-head attention mechanism, capture the long-term and short-term change patterns of health status, realize early warning of health anomalies, and effectively improve the ability to detect health risks early.

[0029] Step 5: Multi-dimensional health risk prediction model: Design a multi-dimensional risk feature engineering algorithm and a Stacking ensemble learning framework, integrating multiple base learners such as random forest, gradient boosting tree, and logistic regression. Through constitution-disease correlation calculation and risk grading algorithm, it achieves accurate prediction of the risk of chronic diseases such as diabetes and hypertension, significantly improving the accuracy of disease risk prediction.

[0030] Step 6: Intelligent Generation of Personalized Dietary Therapy and Wellness Plans: Personalized dietary therapy recommendations are transformed into constraint satisfaction problems (CSP). Using a self-developed backtracking search algorithm combined with collaborative filtering optimization technology, personalized dietary therapy plans based on user constitution and preferences are automatically generated through multi-dimensional constraints such as nutritional constraints, constitution constraints, and seasonal constraints, significantly improving the personalization of the plans and user satisfaction.

[0031] Step 7: User Feedback Data Collection and Effect Evaluation: Construct a three-in-one effect evaluation system that integrates subjective evaluation, objective indicators, and behavioral data. Through Likert scale scoring, physiological indicator improvement calculation, and compliance scoring algorithm, establish a comprehensive effect scoring model to achieve quantitative evaluation of the effect of the dietary therapy plan and provide a scientific basis for system optimization.

[0032] Step 8: System parameter adaptive optimization based on reinforcement learning: Design an online optimization framework based on multi-armed slot machine (MAB-OOF), adopt the Upper Confidence Bound algorithm and the decreasing learning rate mechanism, and realize the continuous optimization of the recommendation strategy through the feedback loop of state-action-reward, thereby realizing the autonomous learning and evolution of the health management system and continuously improving the system recommendation effect.

[0033] In this embodiment, step 1 specifically includes:

[0034] (1) Access and classification of multi-source heterogeneous data

[0035] The data interface module can simultaneously access three types of data sources, including:

[0036] Wearable device data, including physiological indicators such as heart rate, steps, sleep duration, and blood oxygen saturation collected by smart bracelets and smartwatches;

[0037] User subjective evaluation data, including subjective feelings such as symptom description text, fatigue level rating, and pain level input through questionnaires or voice input;

[0038] Third-party health application data, including calorie intake from diet tracking apps, exercise types and durations from fitness apps, and laboratory indicators from medical examination reports.

[0039] During data access, a unique source ID is assigned to each data source, and four meta-attributes are monitored and recorded in real time: collection frequency f (unit: times / hour), data precision p (number of significant digits), transmission latency d (time from collection to data entry, unit: seconds), and stability r (successful collection rate in the past 7 days). These meta-attributes are stored in the data source metadata table as the basis for subsequent quality assessment.

[0040] (2) Adaptive Data Acquisition Protocol (ADCP)

[0041] First, calculate the overall quality score S for each data source:

[0042] Calculate the total amount of data from this data source over the past 24 hours. Missing data volume (Number of data points that should have been collected but were not), erroneous data volume (Number of data points collected but with clearly incorrect values), obtain the average transmission delay. (Unit: seconds) and stability (Number of successful data collections / Number of data collections that should have been collected).

[0043] Then, calculate the overall quality score of the data source:

[0044] ;

[0045] Among them, the weighting coefficient =0.3, =0.25, =0.25, =0.2, delay penalty coefficient =0.05, the score S ranges from [0, 1], and the higher the value, the better the quality of the data source.

[0046] when If the data source is identified as high-quality, a high-frequency collection mode is adopted, collecting data once every 5 minutes.

[0047] when When the data source is determined to be of medium quality, a medium-frequency acquisition mode is adopted, and data is collected every 15 minutes.

[0048] when If the data source is deemed to be of low quality, a low-frequency collection mode will be adopted, collecting data once every 30 minutes.

[0049] The system is set to perform a scheduled task to recalculate the quality score S of each data source every 6 hours, and dynamically adjust the collection interval T based on the latest S value to achieve adaptive optimization of the collection strategy.

[0050] (3) Intelligent interpolation based on random forest

[0051] When a missing value is detected in a field X, the intelligent imputation process is initiated. Let the dataset contain n feature fields, denoted as... The field to be interpolated is (No. (Number of fields).

[0052] 1) Feature Filtering:

[0053] Calculate the field to be interpolated Compared with all other fields in the dataset The Pearson correlation coefficient between features is used to filter the feature set whose correlation is greater than a threshold τ. ;

[0054] Establish a mandatory inclusion feature set based on medical domain knowledge This yields the final feature set used for interpolation. :

[0055] .

[0056] 2) Construction of temporal features and construction of temporal weight functions:

[0057] ;

[0058] in, The time lag is in days. The attenuation coefficient is... The distance from the current time The weight of historical data for each time unit, for each time point within a time window T=7 days. Construct a combined feature matrix that includes current time features, sliding window historical features, and time period features.

[0059] 3) Model building and interpolation:

[0060] A random forest model is established, consisting of N decision trees (N=100 in this embodiment). The parameters for each decision tree include maximum depth, minimum number of leaf node samples, feature subset size, and bootstrap sampling ratio. For the _th... Decision Tree The weighted CART algorithm is used, with sample weights being time-series weights. .

[0061] The interpolated values ​​are obtained through ensemble learning:

[0062] ;

[0063] in, For fields The imputed predicted value at time point t, where N is the total number of decision trees in the random forest. Let be the prediction function of the j-th decision tree.

[0064] For combined feature vectors:

[0065] ;

[0066] in, The feature vector at the current time. For the historical feature vector of the sliding window, This is a time-period feature vector.

[0067] The weight of the j-th decision tree is determined based on its prediction accuracy on the validation set:

[0068] ;

[0069] in, Let be the root mean square error of the j-th decision tree on the validation set. For the normalization factor of all decision tree weights, ensure .

[0070] (4) Standardization and quality control

[0071] A robust Z-score method based on median absolute deviation (MAD) was used for data standardization, and outliers were detected and removed using interquartile range (IQR) boxplots combined with a medical rule base. Finally, a comprehensive data quality scoring model (DQ) was established. When the DQ fell below a threshold, re-collection or manual review was triggered, and the final output was standardized JSON data containing quality indicators.

[0072] (5) Data fusion and quality assessment

[0073] Establish a comprehensive data quality scoring model:

[0074] ;

[0075] in, Rate the quality; For completeness, ; For accuracy, ; For consistency; For timeliness, ; The time difference is expressed in hours.

[0076] Quality control: Data quality (DQ) ≥ 75 is processed normally; data quality (DQ) ≤ 60 < DQ < 75 triggers re-collection; data quality (DQ) < 60 requires manual review. The final output is standardized JSON data, including fields such as user ID, timestamp, value, and quality identifier.

[0077] In this embodiment, step 2 specifically includes:

[0078] (1) Multimodal data preprocessing and coding preparation

[0079] The standardized data output from step 1 are classified by modality: text modality T (symptom description, subjective evaluation), numerical modality N (physiological indicators such as heart rate and blood pressure), and time series modality S (time series data of continuous monitoring).

[0080] The text data is segmented and cleaned to construct a vocabulary V. The maximum sequence length is set to 128. The numerical data is normalized to the [0,1] interval. The time series data is segmented according to a fixed time window W=24 hours, and the sampling interval is 5 minutes.

[0081] (2) Independent encoding of single-modal features

[0082] Different deep learning models were used to extract deep features from the three modalities respectively:

[0083] Text semantic feature extraction: A pre-trained BERT model is used to encode the text modality, and the output at the [CLS] position is taken as a 768-dimensional global semantic feature vector. .

[0084] Numerical correlation feature extraction: A three-layer multilayer perceptron (MLP) is constructed to encode numerical modes, extract nonlinear correlation patterns between physiological indicators, and output a 64-dimensional numerical feature vector. .

[0085] Temporal Evolution Feature Extraction: A bidirectional LSTM is used to extract temporal features. By concatenating the forward and backward hidden states of the last time step, a 256-dimensional global temporal feature vector containing past and future contextual information is obtained. .

[0086] (3) Multimodal Attention Fusion Network (MMAFN)

[0087] Based on the three feature vectors already obtained: , , Through adaptive fusion using an attention mechanism, the attention weights between each modality are first calculated:

[0088] ;

[0089] in, For attention weights of the modality, , For the feature vector of the corresponding mode, These are learnable weight parameters. For bias parameters, As an exponential function, the denominator is normalized by summing the three modes to ensure... .

[0090] To address the heterogeneous dimensionality issue and prevent gradient vanishing, , , Aligned to a uniform 256 dimensions via linear projection (denoted as ) , , After that, attention weights are combined. Perform weighted splicing.

[0091] Subsequently, deep nonlinear mapping is performed sequentially through residual connection, layer normalization, and a two-layer feedforward neural network (FFN), ultimately outputting 256-dimensional multimodal fusion features. .

[0092] (4) Output and quality assessment

[0093] The final output multimodal fusion features It contains a comprehensive representation of the user's health characteristics and has the following features:

[0094] Semantic integrity: The textual semantic information of the symptom description (from the BERT encoder) is preserved.

[0095] Numerical correlation: captured the correlation patterns among physiological indicators (from the multilayer perceptron encoder).

[0096] Temporal continuity: Encodes the temporal evolution of health status (from a bidirectional LSTM encoder).

[0097] To assess fusion quality, the modal contribution index is calculated:

[0098] ;

[0099] in, The contribution of mode m, Let L2 be the norm of the eigenvector.

[0100] When the contribution of any mode is below the threshold ( When this occurs, a data quality warning is triggered, indicating that the modal data may have quality issues and requires manual review or re-collection. Ultimately, the system will... The relevant metadata is encapsulated in standard JSON format.

[0101] In this embodiment, step 3 specifically includes:

[0102] (1) Construction of a knowledge graph of TCM constitution

[0103] Based on the "Classification and Judgment Standards of Traditional Chinese Medicine Constitution", a knowledge graph G=(V,E) of nine constitutions is constructed; where V is the set of nodes and E is the set of relation edges.

[0104] As a preferred embodiment, the node includes:

[0105] Constitution type nodes: 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 (9 types in total)

[0106] Key symptom features: such as sallow complexion, aversion to cold and cold limbs, dry mouth and throat, etc. (a total of 156 core symptoms)

[0107] Physiological indicators: such as pale tongue, weak pulse, and overweight body type (68 indicators in total).

[0108] The relationship edges are divided into three categories: strong association (weight w≥0.8), medium association (0.5≤w<0.8), and weak association (0.3≤w<0.5). The weights are derived from the labeled data of multiple TCM experts.

[0109] Next, the TransE algorithm is used to train the triples to obtain low-dimensional vector representations of each body type. .

[0110] (2) Knowledge-enhanced support vector machine (KE-SVM) model construction

[0111] The 256-dimensional multimodal features output from step 2 Symptom embedding vectors matched with users Weighted fusion is performed. During the fusion process, a weight matrix is ​​used... By implementing feature projection, we obtain knowledge-enhanced features that combine data-driven information with traditional Chinese medicine theoretical information. .

[0112] A KE-SVM classifier incorporating constraints from traditional Chinese medicine theory is constructed, and its decision function is expressed as:

[0113] ;

[0114] in, ∈ Let c be the weight vector of class c. For bias terms, For inner product operations, λ=0.3 is the constraint weight coefficient; Based on theoretical constraints defined by expert knowledge, the positive and negative association sets between user symptoms and target physical constitution are calculated. The matching degree is used to objectively guide the logic of physical constitution identification. The model is trained using a soft-margin optimization method to balance classification error and model complexity.

[0115] (3) Calculation and determination of physical tendency

[0116] The decision values ​​for each physical category are converted into probability distributions using the Softmax function. And based on the highest probability Determine the nature of the subject, and in and It was determined to be a mixed constitution at that time. This represents the probability of having a mixed constitution, calculated based on the maximum probability among the remaining constitution types after removing the primary constitution, using a probability distribution. The second largest value after sorting in descending order.

[0117] (4) Calculation of overall confidence level

[0118] Calculate the overall confidence index of the recognition results :

[0119] ;

[0120] in, For the probability of the main body, The probability difference between primary and secondary constitutions (the greater the difference, the clearer the primary constitution). To obtain the input data quality score, the DQ value from step 1 is normalized to the [0,1] interval.

[0121] Confidence level grading criteria:

[0122] HIGH (high confidence level) can be directly used for subsequent analysis;

[0123] MEDIUM (Medium confidence level), manual review is recommended;

[0124] LOW (low confidence level) requires manual verification or data supplementation.

[0125] Quality control mechanism:

[0126] when When this happens, the system automatically triggers a secondary evaluation process;

[0127] Prompt users to provide additional information on key symptoms or to undergo a professional body mass index assessment;

[0128] Record low-confidence identification results to the anomaly log for system optimization.

[0129] The system output includes complete constitution identification results and detailed confidence information. The output includes: a unique user identifier, an identification timestamp (format: YYYY-MM-DD HH:MM:SS), the constitution type name and code cmax, and the constitution tendency probability. Combined constitution type name and code csecond (if present), combined constitution tendency probability The complete probability distributions of the nine constitution types, P(1|x) to P(9|x), a list of matched key symptoms (including symptom name, expert weight ws, and symptom type identifier), confidence levels (HIGH / MEDIUM / LOW), and confidence values. Input data quality score The input for step 4 includes usage suggestions automatically generated based on confidence levels (such as suggestions to supplement data or direct use).

[0130] In this embodiment, step 4 specifically includes:

[0131] (1) Time series construction and preprocessing

[0132] The user's historical health data is constructed into a time series in chronological order. Assuming an observation window of T = 30 days and a sampling frequency of once per day, a time series data matrix is ​​obtained. ,in, For time steps, For feature dimensions.

[0133] Feature Dimension It contains three types of data:

[0134] Physiological indicators (d1 = 15 dimensions): heart rate, blood pressure, blood oxygen, body temperature, sleep duration, steps, etc.

[0135] Physical characteristics (d2 = 9 dimensions): from the nine physical probability distributions P(1|x) to P(9|x) from step 3;

[0136] Subjective evaluation features (d3 = 8 dimensions): fatigue level, pain level, emotional state, appetite score, etc.

[0137] The total feature dimension d = d1 + d2 + d3 = 32 dimensions.

[0138] Data preprocessing uses sliding window normalization:

[0139] ;

[0140] in, The normalized value. Let j be the original value of the j-th feature on day i. Let j be the mean of feature j within the current window. The standard deviation is set to 7 days for the window.

[0141] (2) LSTM-Autoencoder anomaly detection network

[0142] 1) Encoder structure: A dual-layer LSTM is used as the encoder.

[0143] ;

[0144] ;

[0145] in, Let be the input feature vector on day t. Let be the hidden state of the first LSTM layer at time t. This represents the hidden state of the second LSTM layer.

[0146] After T = 30 time steps, the hidden state at the last moment is taken as the encoded representation:

[0147] ;

[0148] in, This represents the hidden state of the second-layer LSTM at the 30th time step (i.e., the last day). This is a compressed health status encoding vector that contains the core information of 30 days of health data.

[0149] 2) Reconstruction error calculation: For the input sequence and reconstructed sequence Calculate the timing reconstruction error:

[0150] ;

[0151] in, It is the L2 norm. This represents the average reconstruction error over the entire time window. , Let t be the input sequence and the reconstructed sequence, respectively.

[0152] Simultaneously calculate the feature-level reconstruction error:

[0153] ;

[0154] in, Let be the average reconstruction error of the j-th feature, where j = 1,2,...,32, used to locate specific anomalous features.

[0155] 3) Model training, with the loss function as:

[0156] ;

[0157] Where N is the number of training samples, θ represents all model parameters, and α = 0.001 is the L2 regularization coefficient. The Adam optimizer is used with a learning rate lr = 0.001 and a training epoch of 200.

[0158] (3) Mechanism for determining health abnormalities

[0159] 1) Dynamic threshold setting: Anomaly detection threshold is set based on the reconstruction error distribution on the training set, and the mean reconstruction error of all normal samples in the training set is calculated. and standard deviation :

[0160] ;

[0161] ;

[0162] Where N is the number of training samples. Let be the reconstruction error of the i-th sample.

[0163] Set three warning thresholds:

[0164] .

[0165] 2) Anomaly Level Determination:

[0166] For a new time window, calculate its reconstruction error REcurrent, and the determination rule is as follows:

[0167] like The status is determined to be "normal health status", and AnomalyLevel = 0;

[0168] like It was determined to be "mildly abnormal", AnomalyLevel = 1;

[0169] like The result was determined to be "moderately abnormal", with AnomalyLevel = 2.

[0170] like It was determined to be "severely abnormal", with AnomalyLevel = 3.

[0171] AnomalyLevel is the anomaly level code.

[0172] 3) Anomaly feature localization:

[0173] When an anomaly is detected, the anomaly contribution of each feature is calculated:

[0174] ;

[0175] in, The anomaly contribution of the j-th feature, .

[0176] according to Sort the features in descending order, select the top 5 features with the highest contribution, and output a list of abnormal features:

[0177] ;

[0178] Where fⱼ is the feature name. As for contribution level, This is the current deviation value.

[0179] (4) Transformer time series prediction model

[0180] 1) Input sequence encoding: Combine historical health data (T = 30 days) with location encoding:

[0181] ;

[0182] in, This is the encoded representation of day t. For the position-coded vector, sine and cosine position coding is used:

[0183] ;

[0184] ;

[0185] Where t is the time position (t = 1,2,...,30), and i = 0,1,...,15 is half of the feature index.

[0186] 2) Multi-head self-attention mechanism: Employing h = 8 attention heads, each head has a dimension of For the k-th attention head (k = 1,2,...,8):

[0187] ;

[0188] ;

[0189] ;

[0190] in, For the input encoding matrix, This is a projection matrix of query, key, and value. This is the projected matrix.

[0191] Calculate attention weights and output:

[0192] ;

[0193] in, For attention score matrix, As a scaling factor, softmax normalizes row by row so that the sum of each row is 1. This is the attention output for the k-th head.

[0194] Scatter all attention points:

[0195] ;

[0196] in, This indicates a column-wise concatenation operation, resulting in a concatenated dimension of [dimensional value]. (8 heads × 4 dimensions per head) To output the projection matrix, This is the final output of multi-head attention.

[0197] 3) Feedforward network and residual connection:

[0198] Further processing via a feedforward network:

[0199] ;

[0200] in, , This is the weight matrix. , This is the bias vector.

[0201] Apply residual connectivity and layer normalization:

[0202] ;

[0203] LayerNorm is a layer normalization operation. This is the final output of the Transformer layer.

[0204] 4) Prediction of future health status:

[0205] Predicting health status in the next τ = 7 days using a linear projection layer:

[0206] ;

[0207] in, To predict the weight matrix (projecting the 30-day encoding onto a 7-day × 32-dimensional matrix). For bias, For the predicted health data for the next 7 days, each row represents the predicted value of 32 health characteristics for a specific future day.

[0208] (5) Analysis of short-term and long-term health trends

[0209] 1) Short-term trend extraction (3 days):

[0210] Calculate the characteristic rate of change over the last 3 days:

[0211] ;

[0212] in, Let be the short-term rate of change (average daily change) of feature j. Let j be the value of feature j on day T (current). Let j be the value of feature j on day T-2.

[0213] Determine the direction of the short-term trend:

[0214] ;

[0215] in, The threshold for trend determination (normalized rate of change).

[0216] 2) Long-term trend extraction (30 days):

[0217] Linear regression is used to fit the long-term trend line. For feature j, the fitted model is as follows:

[0218] ;

[0219] in, For time indexing, The slope (trend strength). This is the intercept.

[0220] Solve using the least squares method:

[0221] ;

[0222] in, The average over time. Let be the mean of feature j.

[0223] Calculate the goodness-of-fit R² to assess the stability of the trend:

[0224] ;

[0225] in, The numerator is the sum of squared residuals, and the denominator is the sum of squared total deviations. A larger value indicates a better fit and a more pronounced long-term trend. If... and If so, then feature j is considered to have a significant long-term trend.

[0226] 3) Trend Consistency Analysis: Comparing the consistency between short-term and long-term trends:

[0227] ;

[0228] Among them, "consistent deterioration" indicates a downward trend in both the short and long term, which requires close attention.

[0229] (6) Comprehensive health status score and early warning level judgment

[0230] 1) Overall health status score:

[0231] A comprehensive health score is calculated by combining reconstruction error, anomaly level, and trend analysis.

[0232] ;

[0233] in, The historical maximum reconstruction error (used for normalization); It is classified as an abnormal level; The proportion of key features in a state of "consistent deterioration" (key features refer to features with higher weights among physiological indicators); The value ranges from [0, 100], with higher scores indicating better health.

[0234] 2) Warning Level Determination:

[0235] The alert level is determined based on HealthScore and AnomalyLevel:

[0236] HealthScore ≥ 80 and AnomalyLevel = 0: Green (Good health status);

[0237] 70 ≤ HealthScore < 80 or AnomalyLevel = 1: Yellow (Requires attention);

[0238] 60 ≤ HealthScore < 70 or AnomalyLevel = 2: Orange (Intervention recommended);

[0239] HealthScore < 60 or AnomalyLevel = 3: Red (Medical attention is needed immediately).

[0240] The system output includes a complete dynamic health assessment result, including: a unique user identifier, an assessment timestamp, a comprehensive health score (HealthScore), a warning level (green / yellow / orange / red), anomaly detection results (normal / mild / moderate / severe and the corresponding AnomalyLevel value), and the reconstruction error (REcurrent) and its relationship to the normal baseline. The degree of deviation, the list of anomaly features (including feature names) Abnormal contribution and deviation value Health status forecast trend for the next 7 days (7×32 dimensional matrix), short-term rate of change of key features and long-term trend coefficient and goodness of fit The system includes a list of characteristics in a "consistently deteriorating" state and their deterioration ratio (DeteriorationRatio); personalized health recommendations automatically generated based on body type and abnormal characteristics; and the recommended next assessment time (14 days for normal state, 3-7 days for abnormal state).

[0241] In this embodiment, step 5 specifically includes:

[0242] (1) Construction of risk characteristic system

[0243] The dynamic health status assessment results output in step 4 are used as the basic input data. Multi-source input data are integrated to form an initial feature pool, which mainly includes the following four categories:

[0244] Dynamic characteristics of health status: derived from step 4, including comprehensive health score (HealthScore), anomaly level (AnomalyLevel), reconstruction error (RE_current), number and contribution of abnormal features, deterioration ratio of short-term deterioration features, and health prediction trend for the next 7 days, reflecting the user's current and recent health fluctuation levels.

[0245] Traditional Chinese Medicine constitution characteristics: derived from step 3, including the probability of nine constitution tendencies P(c|x) (c=1~9), the main constitution tendency Pmax, the constitution identification confidence, and additional constitution information;

[0246] Physiological indicator characteristics: the current measured values, historical mean, coefficient of variation, and degree of deviation from the clinical normal range of the user's core physiological parameters (such as blood glucose, blood pressure, BMI, blood lipids, etc.);

[0247] Behavioral and environmental characteristics: user's exercise, sleep, and dietary regularity scores, seasonal climate codes, age, gender, family history of chronic diseases, etc.

[0248] Continuous features are normalized, and categorical features are transformed by one-hot encoding to form a standardized initial feature matrix.

[0249] (2) Generation of high-order risk interaction features

[0250] To capture the complex impact of multiple factors synergistically on disease risk, this invention further constructs the following four types of higher-order interaction features based on the initial features:

[0251] Physical constitution-physiological indicator interaction features: The probability vectors of nine physical constitutions are multiplied by key physiological indicators such as blood glucose, blood pressure, BMI, and blood lipids to generate combined features that reflect the risk amplification effect of indicator abnormalities under a specific physical constitution background.

[0252] Trend-indicator interaction features: By integrating the long-term slope of physiological indicators with current measured values, features of the following form are constructed:

[0253] ;

[0254] in, Let be the long-term trend slope obtained by fitting the j-th physiological index in step 4. This is the current measured value of the indicator. This represents the short-term rate of change. This feature quantifies the compound risk of an indicator currently being high and showing a continuous deterioration trend.

[0255] Abnormal-Constitution Cross-Feature: The abnormality detection level is multiplied element-wise by the probabilities of the nine constitutions to generate a 9-dimensional feature vector.

[0256] ;

[0257] This feature reflects the differences in the severity of health risks represented by the same abnormality level under different body constitution types.

[0258] The Risk Accumulation Index (RCI) is calculated based on the proportion of abnormal features, the frequency of recent abnormalities, and the overall health score. The formula is as follows:

[0259] ;

[0260] in, This represents the number of abnormal features currently detected. To monitor the total number of features, This refers to the number of days with abnormalities in the past 7 days. The overall health score output in step 4. , , For the preset weighting coefficients, satisfy + + =1. The RCI value ranges from [0,1], and the larger the value, the higher the user's risk load.

[0261] After feature expansion, mutual information and correlation coefficients are used to filter the features, eliminating features that are not highly relevant to the target disease or are highly redundant, thus forming the final feature subset used for modeling.

[0262] (3) Quantification of the correlation between constitution and disease

[0263] This invention, based on traditional Chinese medicine classics, clinical guidelines, and large-scale epidemiological statistics, pre-constructs a constitution-disease association knowledge base, using a correlation matrix. The data is stored in a format where rows correspond to nine TCM constitutions, columns correspond to M target chronic diseases (such as diabetes, hypertension, hyperlipidemia, coronary heart disease, stroke, obesity, etc.), and matrix elements... This indicates the strength of a person's innate susceptibility to disease m.

[0264] For a specific user i, considering its complete physical constitution probability distribution, calculate the individualized physical constitution correlation degree:

[0265] ;

[0266] in, The probability that user i belongs to constitution c is given (output in step 3). This represents the correlation between constitution c and disease m in the knowledge base. This weighted summation method can accurately reflect the combined impact of a single constitution and mixed constitutions on disease risk.

[0267] To further improve the reliability of correlation calculation, a confidence adjustment mechanism is introduced:

[0268] ;

[0269] in, This represents the confidence level for constitution identification output in step 3. When the confidence level is low, the contribution weight of the constitution correlation is automatically reduced to avoid risky misjudgments caused by constitution identification bias.

[0270] In addition, a physiological indicator correction mechanism is introduced for specific diseases: if a user's objective physiological indicator exceeds the preset normal range, the correlation with the corresponding disease is multiplied by a correction factor greater than 1 according to the degree of deviation, so that the correlation reflects both the innate endowment tendency and the current existing pathological state.

[0271] (4) Stacking Integrated Risk Prediction Model

[0272] The Stacking ensemble learning framework employs a two-layer architecture: the first layer trains multiple heterogeneous base learners, and the second layer trains a meta-learner that fuses the prediction results of the base learners.

[0273] The first layer of base learners selects three algorithms with complementary advantages:

[0274] Random forests excel at capturing non-linear relationships and feature interactions, and are insensitive to outliers;

[0275] Gradient Boosting Decision Tree (XGBoost / LightGBM): Strong fitting ability, effectively handling high-dimensional sparse features;

[0276] Logistic regression: The model is simple and highly interpretable, serving as a linear benchmark.

[0277] K-fold cross-validation is used to generate the predicted probabilities of the base learner on the training set to avoid overfitting. Specifically, the training data is divided into K parts, and K-1 parts are used for training and 1 part for prediction, which is repeated K times. The prediction results of all samples are then concatenated to form meta-features. For the test set, the base learner is trained using all the training data and then predicted directly.

[0278] The second-layer meta-learner is based on the predicted probabilities output by the first layer and is concatenated with the corrected constitution-disease correlation output from step 5.3. Step 5.2 constructs the Risk Cumulative Index (RCI) and several high-weighted original features, forming a complete meta-feature vector. The meta-learner uses a logistic regression model, with the training objective of minimizing the regularized log loss function, ultimately outputting the probability of user i having disease m. .

[0279] (5) Risk grading algorithm

[0280] The continuous risk probabilities output by the model are converted into discrete risk levels to facilitate clinical interpretation and intervention decisions. The grading thresholds can be preset or dynamically optimized based on the distribution characteristics of the target disease on the validation set, clinical guideline recommendations, or health economics requirements. Typical classifications include:

[0281] Low risk (Level 0): The probability is below the first threshold; continue routine monitoring.

[0282] Low to medium risk (Level 1): The probability is between the first and second thresholds, and it is recommended to strengthen monitoring;

[0283] Medium to high risk (Level 2): ​​The probability is between the second and third thresholds, and lifestyle intervention is recommended;

[0284] High risk (Level 3): The probability is higher than the third threshold. It is recommended to seek medical attention or specialist treatment immediately.

[0285] To assess a user's overall health risk level, weighting coefficients are assigned to the severity of different diseases and the urgency of intervention. Calculate the comprehensive risk score:

[0286]

[0287] The score is normalized to the range of [0, 100], with a higher score indicating a greater overall health risk.

[0288] (6) Explanation and Attribution Analysis of Risk Factors

[0289] The SHAP (SHapley Additive exPlanations) method is used to interpret the model's prediction results. SHAP values, based on the Shapley value concept in game theory, fairly quantify the contribution of each feature to the prediction result. For user i and disease m, the model predictions can be decomposed as follows:

[0290] ;

[0291] in, The baseline risk of disease m is equal to the average risk of developing the disease in the training set; Let be the SHAP contribution value of feature j to user i's disease m. It can be positive or negative. A positive value indicates that the feature increases the risk, and a negative value indicates that the risk decreases.

[0292] Based on the absolute value of the SHAP score, the top K most significant risk factors for each user are identified. Furthermore, considering the modifiability of each risk factor (e.g., lifestyle factors are highly modifiable, genetic factors are less modifiable), the major risk factors are prioritized.

[0293] Finally, based on high-priority risk factors, the system automatically matches the TCM dietary therapy knowledge base and health management rule base to generate a personalized summary of intervention suggestions, including but not limited to: abnormal indicators requiring special attention, recommended dietary adjustments, suitable TCM dietary therapy ingredients, and exercise and rest recommendations. These intervention suggestions, along with the risk probability and risk level output from step 5, will serve as the core inputs for generating the personalized dietary therapy plan in step 6, guiding the formulation of subsequent recommendation strategies.

[0294] In this embodiment, step 6 specifically includes:

[0295] (1) Input data integration and food knowledge base construction

[0296] Integrating multi-source input data to construct user feature vectors, including: the probability distributions of nine body types output from step 3. The output of step 4 is the comprehensive health score and abnormality level, the output of step 5 is the probability and risk level of each disease, as well as the user's basic physiological indicators (blood sugar, blood pressure, BMI, blood lipids, etc.) and demographic characteristics (age, gender).

[0297] A pre-built food knowledge base is constructed, including common food and medicinal materials. Each food ingredient is associated with a multi-dimensional attribute vector, which includes at least: nutritional characteristics (such as energy, protein, fat, carbohydrates, dietary fiber, vitamins and minerals); physical suitability characteristics: suitability / contraindication scores for nine physical constitutions (continuous values, negative values ​​indicate contraindications, and positive values ​​indicate suitability); disease conditioning characteristics: the strength of auxiliary conditioning for common chronic diseases (diabetes, hypertension, hyperlipidemia, etc.); seasonal adaptability characteristics: suitability scores for spring, summer, autumn and winter; and other attributes (such as food category, properties and meridian tropism, etc.).

[0298] (2) Constraint satisfaction problem modeling and objective function

[0299] The generation of dietary therapy plans is formalized as a constraint satisfaction problem, and the decision variable is defined as the plan. ;in, For the selected ingredients, k is the total quantity of ingredients in the plan, which is dynamically determined based on the user's target calories and dietary guidelines.

[0300] Define the overall fit scoring function:

[0301] ;

[0302] in, Assess physical fitness score. Score for disease treatment To score nutritional balance, Score the seasonal adaptability. The corresponding weight coefficients are configurable parameters that are dynamically adjusted through the adaptive optimization framework in step 8.

[0303] Physical fitness score:

[0304] ;

[0305] in, This represents the total quantity of ingredients in scheme S; Let be the i-th ingredient in scheme S; c is the constitution type index, with a value range of 1 to 9, corresponding to the nine types of TCM constitutions; For users The probability of belonging to constitution c is output from step 3; For ingredients The suitability score for body constitution c is taken from the food knowledge base. The score ranges from -1 to 1. Negative values ​​indicate contraindications, and positive values ​​indicate suitability.

[0306] Disease management score:

[0307] ;

[0308] in, The set of high-risk diseases for users consists of diseases with a risk level ≥ 2 as output in step 5; m represents the number of high-risk diseases; m is the disease type index, which is traversed. Each disease in the text; For ingredients The treatment score for disease m ranges from [0,1] to [0,1], where 0 indicates no effect and 1 indicates a strong treatment effect. The score is taken from the food knowledge base. This represents the maximum value of the treatment score for disease m for all ingredients in scheme S, ensuring that at least one ingredient has an emphasizing effect. Let S be the average conditioning coverage of disease m.

[0309] Nutritional balance score:

[0310] Nutritional balance score The score is calculated based on how closely the total energy and the energy ratio of the three macronutrients (protein, fat, and carbohydrates) in the proposed plan match the target values. The smaller the deviation, the higher the score. The specific calculation method is as follows:

[0311] ;

[0312] in, The ratio of protein energy to the recommended proportion; This is the ratio of the energy derived from fat to the recommended proportion; The ratio of energy derived from carbohydrates to the recommended proportion; This is the ratio of total heat to target heat. The respective schemes The cumulative values ​​of protein, fat, carbohydrates, and total calories of all ingredients in the formula; The target daily calorie intake for users is determined based on basal metabolic rate and activity coefficient; coefficients 4 and 9 are the calorie conversion coefficients (kcal / g) for protein / carbohydrate and fat, respectively; 0.20, 0.25, and 0.55 are the recommended energy ratios for protein, fat, and carbohydrates, respectively, set with reference to the "Dietary Guidelines for Chinese Residents". This represents absolute value operations.

[0313] Seasonal fitness score:

[0314] ;

[0315] in: For the plan Total number of ingredients; For the plan The first in One ingredient; For ingredients Fitness score for the current season, with a range of values. (Taken from the food knowledge base)

[0316] (3) Definition of constraints

[0317] All feasible solutions must simultaneously satisfy the following hard constraints:

[0318] Physical constitution restrictions: ;in, For the user's physical type, Taboo threshold (configurable parameter);

[0319] Nutritional boundary constraints: The total calories and energy ratio of the three macronutrients in the plan are within the preset healthy range, and the specific range is set according to the "Dietary Guidelines for Chinese Residents";

[0320] Disease management coverage constraints: ;in, To effectively adjust the threshold (configurable parameter);

[0321] Diversity constraints: Schemes The number of food categories covered is no less than the preset minimum value. .

[0322] (4) Constraint solution based on improved backtracking search

[0323] The backtracking search algorithm is used to solve the above constraint satisfaction problem, and three key improvements are made for the dietary therapy recommendation scenario:

[0324] 1) Heuristic sorting:

[0325] Scoring candidate ingredients based on their individual value:

[0326] ;

[0327] in, , These represent the weighting coefficients for physical fitness and disease treatment scores, respectively, and are used to balance the contributions of physical fitness and disease treatment needs to the individual value score. The probability of a user belonging to body type c is output from step 3, satisfying the following conditions: ; This represents the suitability score of food ingredient f for body constitution c, taken from the food ingredient knowledge base. Positive values ​​indicate suitability, and negative values ​​indicate contraindications. This represents the therapeutic score of food ingredient f on disease m, with a value range of [0,1], taken from the food ingredient knowledge base. The larger the value, the stronger the therapeutic effect. This represents the user's high-risk disease set, consisting of diseases whose risk level is greater than or equal to a preset threshold (such as medium-high risk or above) as output in step 5. This represents the individual value score of candidate ingredient f. The higher the score, the more worthy of priority consideration for that ingredient given the user's current physical condition and disease background.

[0328] Then, sort the scores in descending order and prioritize exploring branches with high fit.

[0329] 2) Forward vegetative pruning:

[0330] When the number of ingredients in some plans exceeds half of the target number, the nutritional contribution of the selected ingredients is calculated in real time. If the deviation from the target range exceeds the tolerance threshold, the process is directly backtracked.

[0331] 3) Diversity backtracking mechanism:

[0332] If a feasible solution cannot be found after multiple backtracking attempts, actively release food pairs with high similarity in the current solution and forcibly introduce new food categories.

[0333] During the search process, before adding ingredients at each step, it is checked whether the constraints are violated. If a violation is found, the process backtracks to the previous state and tries the next candidate. Finally, a feasible solution that satisfies all constraints and has the optimal (or near-optimal) objective function value is output.

[0334] (5) Collaborative filtering preference fusion

[0335] To improve user acceptance, an item-based collaborative filtering strategy is introduced. This strategy uses historical user ratings of ingredients to calculate the similarity between ingredients, thereby predicting the current user's preference rating for uneaten ingredients.

[0336] For new users (whose historical rating data is sparse), a default preference model based on physical condition is adopted, with physical fitness and seasonal fitness as the main factors to generate initial preferences.

[0337] For existing users, the collaborative filtering predicted score is fused with the default preference model using a confidence-weighted fusion to obtain the final preference score. The preference score is embedded in a heuristic evaluation function to correct the individual value scores of candidate ingredients, so that the recommendation results take into account both nutritional science and individual taste preferences.

[0338] (6) Adaptive generation of multiple schemes

[0339] To adapt to the health management goals of different users, the system automatically matches recommendation strategies based on user characteristics and generates differentiated alternative solutions:

[0340] When the user's subjectivity tendency Higher than the preset threshold and At that time, the weight of physical fitness is automatically increased. Generate a constitution-prioritized plan;

[0341] When users At that time, the weight of disease treatment will be automatically increased. Generate disease treatment plans;

[0342] In other cases, the default balanced weights are used to generate a comprehensive balanced scheme.

[0343] The aforementioned weight adjustments are automatically executed by a preset rule engine or the reinforcement learning strategy in step 8. The system simultaneously ensures that the overlap of ingredients (Jaccard similarity) between different plans does not exceed a preset upper limit, providing truly diverse choices. The generated dietary therapy plans are output as structured data, including: user identifier and plan generation timestamp; a list of recommended ingredients (including ingredient name, recommended intake, frequency of consumption, and detailed nutritional contributions); a summary of the plan's nutritional components and its suitability for individual body types; conditioning instructions and cooking suggestions for high-risk diseases; a comprehensive suitability score and scores for each sub-item. The output results are passed to step 7 for effect evaluation and feedback collection.

[0344] In this embodiment, step 7 specifically includes:

[0345] (1) Collection of feedback data based on dietary therapy plan

[0346] Receive the three dietary therapy plans output from step 6 (including 8-12 recommended ingredients, intake suggestions, nutritional summary, and body type compatibility information). The user selects one plan to implement, and the system collects three types of feedback data to evaluate the plan's effectiveness during the implementation period (suggested period: 14-28 days).

[0347] The first category is subjective evaluation data, which uses standardized questionnaires to collect users' multi-dimensional subjective feelings about the dietary therapy plan before, during, and after the implementation of the plan. Evaluation dimensions include, but are not limited to: overall plan satisfaction, food acceptance, ease of implementation, taste satisfaction, and perceived symptom improvement (such as fatigue and digestion). Each dimension is scored using a Likert scale, with a preset scoring range of 1 to 5 points, where higher scores indicate greater satisfaction or more significant improvement.

[0348] The second category is objective health indicator data. Baseline values ​​are collected before the plan is implemented, and comparison values ​​are collected at preset frequencies during the implementation period. Monitored indicators include, but are not limited to: blood glucose, blood pressure, body mass index (BMI), blood lipids, sleep duration, physical activity level, and other physiological and behavioral indicators strongly correlated with the user's health status. The system records the baseline value B_j before implementation and the measured value A_j after implementation for each indicator.

[0349] The third category is behavioral compliance data, which tracks the actual implementation of the plan through user check-ins, food consumption records, and other methods. Statistical indicators include: total number of days the plan is recommended to be implemented (T_total), actual number of days the user implements the plan (T_actual) (defined as the number of days on which at least a preset proportion of recommended ingredients are consumed); total number of servings of recommended ingredients (F_total) (number of recommended ingredient types × number of recommended days), and actual number of servings of recommended ingredients consumed by the user (F_actual).

[0350] (2) Calculation of performance evaluation indicators

[0351] Calculate the overall subjective evaluation score:

[0352] ;

[0353] in, The subjective evaluation score ranges from [1, 5]. The score for the i-th evaluation dimension; This represents the total number of evaluation dimensions. If multiple evaluations are collected during the execution period, the arithmetic mean or weighted average can be used as the final score.

[0354] To calculate the degree of improvement of objective indicators, for indicator j, the degree of improvement is defined as follows:

[0355] ;

[0356] in, For the degree of improvement of indicator j, These are the measured values ​​after implementation. The baseline value before implementation, The target values ​​for this indicator are: fasting blood glucose 5.6 mmol / L, systolic blood pressure 120 mmHg, diastolic blood pressure 80 mmHg, BMI 22 kg / m², total cholesterol 5.2 mmol / L, and triglycerides 1.7 mmol / L. A positive improvement indicates the indicator is approaching the target value, while a negative value indicates deviation from the target value.

[0357] Overall improvement in objective indicators:

[0358] ;

[0359] in, To assess the overall improvement of objective indicators, This indicates that only indicators of improvement are counted (i.e. If the value is greater than 0, then this value is used; otherwise, 0 is used. This represents the total number of objective indicators included in the evaluation.

[0360] Calculate compliance score:

[0361] ;

[0362] in, For compliance scoring, the value ranges from [0, 1]. This refers to the actual number of days the policy was implemented. Recommended number of days; The cumulative number of recommended ingredients actually consumed; The total number of recommended ingredients multiplied by the number of recommended days ( = |Number of ingredients in the plan| × The coefficients 0.6 and 0.4 represent the weights for time-based compliance and ingredient-based compliance, respectively.

[0363] (3) Overall effect scoring and output

[0364] Overall performance score calculation formula:

[0365] ;

[0366] in, For the overall performance score, the value range is normalized to [0, 1]. The maximum subjective evaluation score (e.g., 5 points) is used to... Normalize to the interval [0, 1]; , , The weighting coefficients are for the three dimensions of subjective, objective, and compliance, respectively, satisfying... + + =1, which can be preset according to the application scenario or adaptively optimized through step 8.

[0367] Based on the overall performance score The effectiveness of the treatment plan is categorized into several preset levels (e.g., excellent, good, average, poor). The grading thresholds can be dynamically set based on historical data distribution, clinical significance, or business needs.

[0368] The system outputs a structured performance evaluation report, which includes at least: user identifier, solution identifier, evaluation period; detailed summaries of the three types of feedback data; and the degree of improvement for each objective indicator. Three-dimensional scoring , , Overall performance score The output includes the corresponding effectiveness level and automatically generated improvement suggestions based on the scoring results (e.g., suggestions for low-scoring dimensions such as "adjust ingredient pairings", "enhance execution reminders", and "recommend review"). The output serves as feedback signals for the adaptive optimization of system parameters in step 8, used to adjust the recommendation strategy and parameter configuration.

[0369] In this embodiment, step 8 specifically includes:

[0370] (1) Optimization framework for multi-armed slot machines online

[0371] The overall performance score (Score_effect) output from step 7 is received as the optimization feedback signal. The system parameter optimization is modeled as a multi-armed slot machine problem. The action space A is defined as an adjustable combination of key parameters, including the objective function weights from step 6. Constraint thresholds (such as the physical contraindication threshold θ_constitution = -0.4), confidence coefficients in collaborative filtering fusion weights (adjusting the denominator 10 in λ = min(|Ru| / 10, 1) to the range [5, 15]), etc. The parameter space is discretized into M=20 actions, each action corresponding to a set of parameter configurations.

[0372] Define a state space S, where state st contains user characteristics (subjective type cmax, subjective tendency Pmax, comprehensive health score HealthScore, maximum risk level max(RiskLevel_i,m)) and historical feedback (the user's recent average performance score and compliance level Score_compliance).

[0373] Define the reward function as the overall performance score output in step 7:

[0374] ;

[0375] in, Let t be the reward value for the t-th recommendation. The overall effect score for the corresponding solution is given, with a value range of [0, 1]. The higher the value, the better the recommendation effect.

[0376] (2) Upper Confidence Bound Algorithm

[0377] The UCB algorithm is used to balance exploration (trying new parameter configurations) and exploitation (using effective parameter configurations). For action a (parameter configuration), the system maintains two statistics: the number of selections N(a) and the cumulative reward Q(a).

[0378] The formula for calculating the UCB value of the selected action in the t-th round of recommendations is as follows:

[0379] ;

[0380] in, For action The UCB value in round t, For action The average reward (utilization item, reflecting historical effects), c is the exploration coefficient, which controls the exploration intensity and is preset according to the application scenario; Let be the natural logarithm of the total number of rounds t; For action The number of times it was selected The upper bound of confidence (exploration item, encouraging actions with fewer attempts).

[0381] The system selects the action with the highest UCB value:

[0382] ;

[0383] in, For the action (parameter configuration) selected in round t, argmax represents the action to be taken. Biggest movement Let A be the set of all actions M=20.

[0384] (3) Parameter update and learning rate reduction mechanism

[0385] Once the feedback collection in step 7 is completed, the system will score the overall results. Update corresponding actions Statistics:

[0386] ;

[0387] in, For action The cumulative number of selections increases by 1. Add current reward to cumulative rewards .

[0388] To accelerate convergence and adapt to dynamic changes in parameter performance, a decreasing learning rate mechanism is introduced, and the average reward is updated using weighted averages.

[0389] ;

[0390] in, The updated average reward, This is the average reward before the update. Let t be the learning rate, defined as the number of times the action is selected. The decreasing function, i.e. And satisfy This is to ensure the consistency of the estimates.

[0391] (4) Continuous system optimization and output

[0392] The system continuously adjusts parameter configurations based on the UCB algorithm. After every 100 recommendation feedbacks, the average reward Q̄(a) for each action is calculated, and the parameter of the action with the highest average reward is set as the current default configuration and applied to subsequent recommendations.

[0393] To avoid getting trapped in local optima, the minimum exploration rate ε=0.05 is maintained, that is, actions are randomly selected from 5% of the recommendations (uniformly selected from M=20 actions), and 95% of the recommendations are selected according to the UCB strategy.

[0394] The system output includes the current optimal parameter configuration (including weights). Numerical value, threshold Numerical values, the number of times each action was selected N(a) and the average reward Q̄(a) (used to monitor the effect of each parameter configuration), and the recent system average performance rating trend (calculated over the past 30 days and the past 90 days). (Monitoring optimization effects), automatically generated system performance reports, such as: the average performance score over the past 30 days is 0.68, an improvement of 12% compared to the previous period, and the current optimal configuration is action 5: .

[0395] Through a feedback loop of state-action-reward, the system enables autonomous learning and continuous optimization of parameters, dynamically adapts to the characteristic distribution and preference changes of different user groups, and continuously improves the recommendation effect of dietary therapy plans and user satisfaction, thus solving the technical problem of fixed parameters and inability to adaptively optimize in traditional health management systems.

[0396] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for intelligent recommendation of food and medicine homology based on TCM constitution identification, characterized in that, Includes the following steps: Step 1: Standardized collection and preprocessing of multi-source health data: Collect and fuse multi-source health data, use the random forest imputation method, and process heterogeneous data sources through the Z-score standardization algorithm and outlier detection mechanism; Step 2: Multimodal feature extraction and fusion based on deep learning: Fusing textual, numerical, and temporal features, a multimodal attention fusion network is adopted, and deep semantic representation of heterogeneous health data is performed through BERT text encoder, multilayer perceptron numerical encoder and bidirectional LSTM temporal extractor. Step 3, Intelligent Identification of TCM Constitution: Construct a knowledge-enhanced support vector machine model, embed the TCM constitution expert knowledge graph into machine learning, and perform objective quantitative identification of traditional TCM constitution theory through expert constraint terms and constitution tendency calculation. Step 4: Dynamic assessment of health status based on time series analysis: Construct a health anomaly detection network based on LSTM-Autoencoder and a Transformer time series prediction model. By reconstructing the error threshold judgment and multi-head attention mechanism, capture the long-term and short-term change patterns of health status and provide early warning of abnormal health status. Step 5: Multi-dimensional health risk prediction model: Construct a multi-dimensional risk feature engineering algorithm and Stacking ensemble learning framework, and predict the risk of chronic diseases through constitution-disease correlation calculation and risk grading algorithm; Step 6: Personalized Dietary Therapy and Wellness Plan Generation: The personalized dietary therapy recommendations are transformed into a constraint satisfaction problem. A backtracking search algorithm combined with collaborative filtering optimization is used to automatically generate personalized dietary therapy plans based on the user's physical condition and preferences. Step 7: User feedback data collection and effect evaluation: Construct a three-in-one effect evaluation system that integrates subjective evaluation, objective indicators, and behavioral data. Through Likert scale scoring, physiological indicator improvement calculation, and compliance scoring algorithm, establish a comprehensive effect scoring model to quantitatively evaluate the effect of the dietary therapy plan. Step 8: System parameter adaptive optimization based on reinforcement learning: Design an online optimization framework based on multi-armed slot machine, adopt the Upper Confidence Bound algorithm and a decreasing learning rate mechanism, and continuously optimize the recommendation strategy through the feedback loop of state-action-reward to realize the autonomous learning and evolution of the health management system.

2. The intelligent recommendation method for food and medicine homology according to claim 1, characterized in that, Step 1 includes: Step 1.1: The multi-source health data includes wearable device data, user subjective evaluation data, and third-party health application data. A unique source identifier is assigned to each data source, and four meta-attributes are monitored and recorded in real time, including collection frequency f, data accuracy p, transmission delay d, and stability r, which are stored in the data source meta-information table. Step 1.2: Calculate the overall quality score S for each data source, and adaptively adjust the collection interval based on the S value: ; In the formula, , , , These are the weighting coefficients. This is the delay penalty coefficient. For the amount of missing data, For the amount of erroneous data, The total data volume represents the total data volume; a higher S score indicates a better data source quality. Step 1.3: Intelligent imputation based on random forest: Step 1.3.1, Feature Filtering, Input dataset is n is the number of feature fields, and the number of fields to be interpolated is... Calculate in sequence Use Pearson correlation coefficients with other n-1 fields to filter feature sets whose correlation is greater than a threshold τ. Establish a mandatory inclusion feature set based on medical domain knowledge. This yields the final feature set used for interpolation. ; Step 1.3.2: Constructing temporal features and the temporal weight function: ; in, The time lag is in days. The attenuation coefficient is... The distance from the current time Historical data weights for each time unit; Step 1.3.3: Model Construction and Imputation. A random forest model containing N decision trees is built using the weighted CART algorithm, with sample weights being time-series weights. The interpolated values ​​are obtained through ensemble learning: ; in, For fields The imputed predicted value at time point t, where N is the total number of decision trees in the random forest. Let j be the prediction function of the j-th decision tree. Let J be the weight of the j-th decision tree. For combined feature vectors; Step 1.4: The robust Z-score method based on the absolute deviation of the median is used to standardize the data, and outliers are detected and removed using the interquartile range box plot method combined with a medical rule base. Step 1.5: Establish a comprehensive data quality scoring model and output standardized JSON data, including user ID, timestamp, numerical value, and quality identifier fields.

3. The intelligent recommendation method for food and medicine homology according to claim 2, characterized in that, Step 2 includes: Step 2.1: Classify the standardized JSON data output in Step 1 according to modality, including text modality, numerical modality, and time series modality; Step 2.2: Perform deep feature extraction on the three modalities respectively: The text modality is encoded using a pre-trained BERT model, and the output at the [CLS] position is taken as a 768-dimensional global semantic feature vector. ; A three-layer multilayer perceptron is constructed to encode numerical modes, extract nonlinear correlation patterns among physiological indicators, and output a 64-dimensional numerical feature vector. ; A bidirectional LSTM is used to extract temporal features. By concatenating the forward and backward hidden states of the last time step, a 256-dimensional global temporal feature vector containing past and future contextual information is obtained. ; Step 2.3: Construct a multimodal attention fusion network to adaptively fuse 768-dimensional text semantic feature vectors through an attention mechanism. 64-dimensional numerical eigenvectors and 256-dimensional global temporal feature vector Calculate the attention weights between each modality: ; In the formula, For modality Attention weights , For modality eigenvectors, These are learnable weight parameters. For bias parameters, It is an exponential function; Will , , Aligned to 256 dimensions via linear projection, combined with attention weights. Weighted concatenation is performed; deep nonlinear mapping is then applied sequentially through residual connection mechanism, layer normalization, and two layers of feedforward neural network to output 256-dimensional multimodal fusion features. .

4. The intelligent recommendation method for food and medicine homology according to claim 1, characterized in that, Step 3 includes: Step 3.1: Construct a TCM constitution knowledge graph, represented as G=(V,E), where V is the set of nodes and E is the set of relation edges; the nodes include constitution type nodes, core symptom feature nodes, and physiological indicator nodes; the relation edges include three types: strong correlation, medium correlation, and weak correlation. Step 3.2: Use the TransE algorithm to convert the knowledge graph into a low-dimensional vector representation, and train it to obtain the embedding vector for each constitution type. 'c' represents the constitution type index; Step 3.3: Construct a knowledge-enhanced support vector machine model: Step 3.3.1: The 256-dimensional multimodal fusion features output from Step 2 are... It integrates with knowledge graph embeddings, calculates the user's symptom embedding vector, and performs feature fusion using a weight matrix. By implementing feature projection, we obtain knowledge-enhanced features that combine data-driven information with traditional Chinese medicine theoretical information. ; A KE-SVM classifier incorporating constraints from Traditional Chinese Medicine theory is constructed. For the c-th constitution type, its decision function is: ; In the formula, Let c be the weight vector of class c. For bias terms, This is an inner product operation, where λ is the constraint weight coefficient. These are theoretical constraints defined based on expert knowledge. Step 3.4: Convert the decision values ​​for each physical fitness category into a probability distribution. To determine physical fitness; Step 3.5: Calculate the comprehensive confidence index of the physical fitness assessment results, and output the physical fitness identification results and confidence information.

5. The intelligent recommendation method for food and medicine homology according to claim 1, characterized in that, Step 4 includes: Step 4.1: Construct a time-series sequence from the user's historical health data in chronological order to obtain a time-series data matrix. Where T is the number of time steps and d is the feature dimension, which includes physiological indicators, physical characteristics, and subjective evaluation features; a sliding window is used for normalization. Step 4.2: Construct the LSTM-Autoencoder anomaly detection network: Step 4.2.1: Use a dual-layer LSTM as the encoder: ; ; in, Let be the input feature vector on day t. Let be the hidden state of the first LSTM layer at time t. This represents the hidden state of the second LSTM layer; After T time steps, the hidden state at the last moment is taken as the encoded representation: ; in, This represents the hidden state of the second LSTM layer at time step 30. The compressed health status encoding vector contains the core information of 30 days of health data; Step 4.2.2: For the input sequence and reconstructed sequence Calculate the timing reconstruction error: ; in, It is the L2 norm. This represents the average reconstruction error over the entire time window. , Let t be the t-th input sequence and the reconstructed sequence, respectively; Calculate feature-level reconstruction error: ; in, The average reconstruction error of the j-th feature is used to locate specific anomalous features; Step 4.2.3: Train the model using the following loss function: ; Where N is the number of training samples. For all parameters of the model, The L2 regularization coefficient; Step 4.3: Perform health anomaly determination. Based on the reconstruction error distribution on the training set, set the anomaly detection threshold, calculate the mean and standard deviation of the reconstruction error of all normal samples in the training set, and determine and locate the anomaly level. Step 4.4: Construct the Transformer time series prediction model: Step 4.4.1: Combine historical health data with location coding: ; in, This is the encoded representation of day t. The position encoding vector uses sine and cosine position encoding. Step 4.4.2: Construct a multi-head self-attention mechanism, calculate attention weights and outputs, and concatenate all attention heads: ; in, The attention output for the k-th head. This indicates a column-wise concatenation operation. To output the projection matrix, For multi-headed attention output; Step 4.4.3: Process via feedforward network: ; in, , This is the weight matrix. , For bias vectors, The input feature matrix of the feedforward network, This is the output of the feedforward network; Apply residual connectivity and layer normalization: ; LayerNorm is a layer normalization operation. This is the final output of the Transformer layer; The input encoding matrix; Step 4.4.4: Predicting future health status using a linear projection layer: ; in, To predict the weight matrix, For bias, For predicted future health data, each row represents the predicted value of 32 health characteristics for a future day; Step 4.5: Short-term and long-term health trend analysis, including: short-term trend extraction, long-term trend extraction, and trend consistency analysis; Step 4.6: Combine reconstruction error, anomaly level and trend analysis to calculate comprehensive health score, determine warning level based on comprehensive health score and anomaly level, and output dynamic health assessment results.

6. The intelligent recommendation method for food and medicine homology according to claim 5, characterized in that, Step 5 includes: Step 5.1: Construct a risk feature system: Use the dynamic health assessment results output in Step 4 as the basic input data, integrate multi-source input data to form an initial feature pool, including: dynamic health status features, TCM constitution features, physiological indicator features, and behavioral and environmental features. Normalize continuous features and encode categorical features to form a standardized initial feature matrix. Step 5.2: Generate higher-order risk interaction features, including: Body constitution-physiological indicator interaction features: Calculate the cross product of the probability of various body constitutions with four key physiological indicators: blood glucose, blood pressure, BMI, and blood lipids, and generate several interaction features; Trend-indicator interaction characteristics: This integrates the long-term slope of physiological indicators with current measured values, and is expressed as... : ; in, Let be the long-term trend slope obtained by fitting the j-th physiological index. Let j be the current measured value of the j-th physiological indicator. For short-term rates of change; Abnormal-Constitution Cross-Characteristics: The abnormality level determined in step 4.6 Probability of different body types Element-wise multiplication generates feature vectors. : ; The risk accumulation index is calculated by combining the proportion of abnormal features, the frequency of recent abnormalities, and the overall health score. : ; in, This represents the number of abnormal features currently detected. To monitor the total number of features, This refers to the number of days with abnormalities in the past 7 days. For comprehensive health scoring, , , Preset weighting coefficients; Features were screened using mutual information and correlation coefficients, and features with low relevance to the target disease or high redundancy were removed to form a feature subset for modeling. Step 5.3: Quantify the constitution-disease association and construct a constitution-disease association knowledge base, using an association degree matrix. The data is stored in a format where rows correspond to nine types of TCM constitutions, columns correspond to M types of target chronic diseases, and matrix elements... This indicates the strength of a person's innate susceptibility to disease m (body constitution c). For user i, considering the complete body constitution probability distribution, calculate the individualized body constitution correlation degree. : ; in, Let be the probability that user i has a tendency to belong to body type c. The degree of association between constitution c and disease m in the knowledge base; Introducing a confidence adjustment mechanism: ; in, The confidence level for physical constitution identification output in step 3; Step 5.4: Introduce a physiological indicator correction mechanism for specific diseases. If a user's objective physiological indicator exceeds the preset normal range, the correlation degree of the corresponding disease is multiplied by a correction factor greater than 1 according to the degree of deviation, so that the correlation degree reflects both the innate endowment tendency and the current existing pathological state. Step 5.5: Construct a Stacking integrated risk prediction model, which adopts a two-layer architecture. The first layer trains multiple heterogeneous base learners, and the second layer trains a meta-learner and integrates the prediction results of the base learners. Step 5.6: Perform risk stratification. For user i and disease m, convert the continuous risk probability output by the Stacking integrated risk prediction model into discrete risk levels to obtain the final disease risk probability. Weighting coefficients are assigned to different diseases based on their severity and the urgency of intervention. Calculate the comprehensive risk score ; Step 5.7: Use the SHAP method to quantify the contribution of each feature to the prediction result and interpret the model prediction result; for user i and disease m, the model prediction value is decomposed as follows: ; in, Baseline risk of disease m; Let be the SHAP contribution value of feature j to user i suffering from disease m.

7. The intelligent recommendation method for food and medicine homology according to claim 6, characterized in that, Step 6 includes: Step 6.1: Integrate multi-source input data to construct user feature vectors. Inputs include the probability distributions of various physical constitutions output in Step 3. The output of step 4 is the comprehensive health score and abnormality level; the output of step 5 is the disease risk probability and risk level; and the user's current physiological indicators, including blood sugar, blood pressure, BMI, blood lipids, age, and gender. Construct a food knowledge base containing N kinds of food, each of which contains a 36-dimensional attribute vector, including: nutritional composition characteristics, physical suitability characteristics, disease treatment characteristics, and seasonal adaptation characteristics. Step 6.2: Formalize the dietary therapy plan into a constraint satisfaction problem, and define the decision variable as the plan. ,in, Indicates the first There are 1 recommended ingredients, where k is the total number of ingredients in the plan; Define the overall fit scoring function: ; in, Assess physical fitness score. Score for disease treatment To score nutritional balance, Score the seasonal adaptability. , , , These are the corresponding weighting coefficients; Step 6.3: Define constraints, including: physical constitution contraindications, nutritional boundaries, disease treatment coverage constraints, and diversity constraints; Step 6.4: Use backtracking search algorithm to solve the constraint satisfaction problem. For the dietary therapy recommendation scenario, perform heuristic sorting, forward nutrient pruning and diversity backtracking. During the search process, check whether the constraints are violated before adding ingredients at each step. If they are violated, backtrack to the previous state and try the next candidate. Output the feasible solution that satisfies all constraints and has the optimal objective function value. Step 6.5: Perform collaborative filtering preference fusion. For new users, a default preference model based on physical constitution is adopted, using physical fitness and seasonal adaptability as factors to generate initial preferences; For existing users, the collaborative filtering predicted score is fused with the default preference model using a confidence-weighted fusion to obtain the final preference score. The individual value scores of candidate ingredients are corrected by embedding them into the heuristic evaluation function. Step 6.6: Generate differentiated alternative plans by adjusting the weights of the objective function, including: a balanced plan, a constitution-prioritized plan, and a disease conditioning plan. Each plan includes a list of recommended ingredients, intake suggestions, a nutritional summary, and a constitution matching degree.

8. The intelligent recommendation method for food and medicine homology according to claim 7, characterized in that, In step 6.4, the heuristic sorting scores the candidate ingredients based on their individual value: ; in, , These represent the weighting coefficients for physical fitness and disease management scores, respectively. This represents the suitability score of food ingredient f for body constitution c. This indicates the therapeutic score of food ingredient f on disease m. This represents a set of high-risk diseases for the user; This represents the individual value score of candidate ingredient f; Sort by score in descending order and prioritize exploring branches with high fit. The forward nutrient pruning method calculates the nutrient contribution of selected ingredients in real time when the number of ingredients in some schemes exceeds half of the target number. If the deviation from the target range exceeds the tolerance threshold, it directly backtracks. When the diversity backtracking fails to find a feasible solution after multiple backtracking attempts, it actively releases food pairs with excessively high category similarity in the current solution and forcibly introduces new food categories.

9. The intelligent recommendation method for food and medicine homology according to claim 7, characterized in that, Step 7 includes: Step 7.1: Receive multiple dietary therapy plans output from Step 6, select one plan to implement, and collect feedback data during implementation, including: subjective evaluation data, objective health indicator data, and behavioral compliance data, to evaluate the effectiveness of the plan; Step 7.2, Calculation of effect evaluation indicators, including: Calculate the overall subjective evaluation score: ; in, For the score of the i-th evaluation dimension, This is the subjective evaluation score, with a value range of [1, 5]. The total number of evaluation dimensions; To calculate the degree of improvement of objective indicators, for indicator j, the degree of improvement is defined as follows: ; in, For the degree of improvement of indicator j, These are the measured values ​​after implementation. The baseline value before implementation, This is the ideal target value for the indicator; Calculate the overall improvement of objective indicators: ; in, To assess the overall improvement of objective indicators, This indicates that only indicators showing improvement are counted. Calculate compliance score: ; in, [For compliance scoring], This refers to the actual number of days the campaign was conducted. Recommended number of days, This refers to the recommended number of ingredients for actual consumption. The coefficient is calculated by multiplying the total number of recommended ingredients by the number of recommended days. Weighting based on time compliance; Step 7.3: Calculate the overall effect score: ; in, For the overall performance score, the value range is normalized to [0, 1]. The maximum value of the subjective evaluation score is used to... Normalize to the interval [0, 1]; , , The weighting coefficients are for the three dimensions of subjective, objective, and compliance, respectively, satisfying... + + =1; Step 7.4: Based on the comprehensive effect score, classify the effect level and output the following: unique user identifier, solution identifier, evaluation timestamp, evaluation period, details of three types of feedback data, improvement of each objective indicator, and comprehensive effect score. The system assigns a rating and automatically generates improvement suggestions based on the rating.

10. The intelligent recommendation method for food and medicine homology according to claim 9, characterized in that, Step 8 includes: Step 8.1: Receive the overall performance score output from Step 7. As an optimization feedback signal, the system parameter optimization is modeled as a multi-armed slot machine problem; Define the action space A as an adjustable combination of key parameters, including the objective function weights, constraint thresholds, and confidence coefficients in the collaborative filtering fusion weights from step 6. Discretize the parameter space into M actions, with each action corresponding to a set of parameter configurations. Define the state space S and the state s. t Includes user characteristics: body type, body tendency, overall health score, highest risk level, and historical feedback; Define the reward function as the overall performance score output in step 7: ; in, Let t be the reward value for the t-th recommendation. The overall effectiveness of the corresponding solutions is scored; Step 8.2: Use the UCB algorithm to balance exploration and exploitation. For action a, maintain two statistics: the number of selections N(a) and the cumulative reward Q(a); at the t-th round of recommendation, calculate the UCB value of the selected action: ; in, Let UCB be the value of action a in round t. Let c be the average reward for action a, and c be the exploration coefficient. Let be the natural logarithm of the total number of rounds t; The number of times action a is selected. For the upper bound of confidence; Choose the action with the highest UCB value: ; in, The action chosen for round t. Indicates taking Biggest movement , Let M be the set of all M actions; Step 8.3: Score based on overall effect Update corresponding actions Statistics: ; in, For action The cumulative number of selections increases by 1. Add current reward to cumulative rewards ; A decreasing learning rate mechanism is introduced, and the average reward is updated using weighted averages. ; in, The updated average reward, This is the average reward before the update. Let be the learning rate in round t; Step 8.4: Continuously adjust the parameter configuration according to the UCB algorithm. After completing a certain number of recommendation feedbacks, calculate the average reward of each action, set the parameter of the action with the highest average reward as the current default configuration, apply it to subsequent recommendations, and output the current optimal parameter configuration, the number of times each action was selected and the average reward, the recent average system performance score trend, and automatically generate a system performance report.