Traditional Chinese medicine concentration intelligent formula management system based on block chain
Through the blockchain-based intelligent formula management system for concentrating traditional Chinese medicine, the scientific and intelligent problems of traditional Chinese medicine formula management are solved, personalized optimization of formulas and safe and reliable storage of data are achieved, and the concentration and treatment effect of traditional Chinese medicine are improved.
Patent Information
- Application Number
- CN202510422090.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-08-08
AI Technical Summary
Traditional Chinese medicine formula management lacks scientific and intelligent, and cannot achieve personalized optimization. The data storage security and reliability are insufficient, and the lack of effective user feedback mechanisms lead to unstable formula effects and easy data tampering.
The blockchain-based intelligent formula management system for Chinese medicine concentrate is adopted, including data collection, preprocessing, intelligent matching, blockchain storage, dynamic adjustment and security verification modules. The initial formula is generated through a similarity matching algorithm, the formula parameters are corrected in real time, and the two-factor hash verification is used to ensure the integrity and tamper-freeness of the data link.
It realizes scientific and intelligent management of traditional Chinese medicine formulas, improves the accuracy and efficiency of the formulas, enhances the security and traceability of data, and supports personalized optimization and continuous improvement.
Smart Images

Figure CN120448455A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of traditional Chinese medicine pharmaceutical technology and blockchain application technology. More specifically, the present invention relates to a blockchain-based intelligent formula management system for concentrated traditional Chinese medicine. Background Art
[0002] In the field of Traditional Chinese Medicine (TCM) pharmaceutical manufacturing, traditional methods of formula management suffer from numerous shortcomings. For one thing, the formulation of TCM formulas often relies on experience, lacking scientific and accurate data support, leading to unstable formula effects. Furthermore, the TCM concentration process lacks real-time monitoring and dynamic adjustment mechanisms, making it difficult to optimize based on user feedback and actual results. Furthermore, the storage and management of formula data is often centralized, making it prone to data tampering and loss, impacting the traceability and security of the formula.
[0003] In the process of implementing the embodiments of the present invention, the inventors found that there are at least the following problems or defects in the existing technology: the traditional recipe management method lacks intelligence and dynamic adjustment capabilities and cannot meet personalized needs; the security and reliability of data storage are insufficient, making it difficult to ensure the integrity and authenticity of the recipe; at the same time, there is a lack of an effective user feedback mechanism, which makes it impossible to achieve continuous optimization of the recipe. Summary of the Invention
[0004] The present invention provides a blockchain-based intelligent formula management system for concentrated traditional Chinese medicine, including:
[0005] Data acquisition module, used to obtain physical characteristic parameters and chemical composition data of Chinese medicinal materials;
[0006] A data preprocessing module, connected to the data acquisition module, for performing normalization processing and feature dimension reduction on the collected data;
[0007] An intelligent matching module, connected to the pre-processing module, generates an initial formulation scheme through a similarity matching algorithm;
[0008] Blockchain storage module, used to generate encrypted blocks and distribute storage of recipe parameters and operation records;
[0009] Dynamic adjustment module, which amends formula parameters in real time based on user feedback data and concentration effect monitoring data;
[0010] User feedback module, which collects user physiological index change data and efficacy evaluation data;
[0011] The security verification module ensures the integrity and non-tamperability of the data chain through two-factor hash verification.
[0012] Furthermore, the similarity matching algorithm includes:
[0013] Step S201: Create a target medicinal material component vector C1 = (c1, c2, ..., c n ) and the historical recipe component vector C2 = (c′ 1, c′2,...,c′ n ), where c i Indicates the content of the i-th active ingredient; c' i represents the content of the i-th active ingredient in the historical formula;
[0014] Step S202: Calculate component similarity S = Σ(w i ·|c i -c′ i |) / (Σw i ·max(c i ,c′ i )), where w i is the weight coefficient of the i-th component;
[0015] Step S203: When S≥0.85, automatic matching is triggered, and when 0.7≤S<0.85, the manual review process is started;
[0016] Step S204: Generate an evaluation report including a matching score and a list of difference components.
[0017] Furthermore, the weight coefficient w i The calculation formula is:
[0018] w i =α·(log(P i / P avg ))+β·(T i / T max )
[0019] Among them, α is the pharmacological activity regulatory factor (0.5≤α≤1.2), β is the toxicity impact factor (0.3≤β≤0.9), P i represents the standard pharmacological activity value of the i-th ingredient, P avg is the average pharmacological activity value of all ingredients T i Indicates the toxicity level of the i-th ingredient (1-5), T max The maximum toxicity level is 5.
[0020] Furthermore, the dynamic adjustment module includes:
[0021] The parameter correction unit calculates the adjustment coefficient K based on the feedback score F and the effect deviation value ΔE:
[0022] K = 1 / (1 + e(-(0.5F + 0.3ΔE)))
[0023] Where F∈[0,10] is the user feedback score ΔE=||E 实际 -E 理论 || / E 理论 , E 实际 Indicates the actual concentration effect value, E 理论 It indicates that the theoretical concentration effect value adjustment threshold is set to trigger the recipe adjustment when K>0.65.
[0024] Furthermore, when the parameter correction unit performs adjustment:
[0025] Step S501: Get the latest N adjustment records to form a time series K1, K2, ..., K N ;
[0026] Step S502: Calculate the trend factor λ = ∑(t·K t ) / (Σt 2 ), t=1 to N, t represents the sequence number of the time series, K t represents the adjustment coefficient of the tth adjustment;
[0027] Step S503: when λ>0.15, the radical adjustment mode is enabled and the adjustment range is increased by 1.5 times;
[0028] Step S504: When λ≤0, the stability detection is started and the automatic adjustment function is suspended.
[0029] Furthermore, the encryption block generation method of the blockchain storage module (104) includes:
[0030] Step S601: Set the current recipe parameter P now and the previous block hash value H prev Splicing
[0031] Step S602: Double hash operation
[0032] H new =SHA256(SHA256(P now ||H prev ||Nonce))
[0033] Among them, || represents the string concatenation operation, Nonce is a random number used to increase randomness in the hash operation, SHA256 is a cryptographic hash function used to hash the input data to obtain a fixed-length hash value, H new Represents the hash value of the newly generated encrypted block;
[0034] Step S603: Dynamic difficulty target value D=D base / (1+0.1·T), where T is the average generation time of the last 10 blocks, Dbase is the basic difficulty target value;
[0035] Step S604: When H new A block is considered valid when the number of leading zeros is ≥ D.
[0036] Furthermore, the method for adjusting the dynamic difficulty target value D includes:
[0037] Time monitoring unit, records the timestamps t1, t2, ..., t of the latest M blocks M Fluctuation calculation unit, calculates time variance σ 2 =Σ(t i -μ) 2 / (M-1), where t i Represents the timestamp of the i-th block, μ is the average block time, that is, μ = ∑t i / M (i ranges from 1 to M), M is the number of recorded blocks, σ 2 Represents time variance, which is used to measure the fluctuation of block generation time;
[0038] Correction unit, when σ 2 > threshold V, trigger D=D·(1+0.05·(σ 2 / V) 0 .5), where V is a pre-set time variance threshold used to determine whether the fluctuation of block generation time is too large; D is the current dynamic difficulty target value. The adjusted D value will cause the difficulty of subsequent block generation to change.
[0039] Furthermore, the operations performed by the security verification module include:
[0040] Step S801: Extract the metadata of the block to be verified to generate the verification hash H v ;
[0041] Step S802: Read the original hash H stored on the chain o ;
[0042] Step S803: Calculate the difference δ = (H v XORH o ) / 256;
[0043] Step S804: when δ>0.15, mark it as an abnormal block;
[0044] Step S805: Start the consensus node voting mechanism, and trigger data recovery when more than 2 / 3 of the nodes confirm the abnormality.
[0045] Furthermore, the consensus node voting mechanism includes:
[0046] The weight allocation unit allocates voting weight W = 1 + log (R / 0.8) based on the node's historical accuracy rate R;
[0047] Time decay unit, which applies a decay coefficient of η = 0.9 to voting records that are older than 24 hours t , t represents the number of days after 24 hours;
[0048] Dynamic threshold unit, set the pass threshold to ∑W i ≥N node 0.7 η max , where N node is the total number of nodes, η max is the maximum attenuation coefficient.
[0049] Furthermore, the user feedback module includes:
[0050] Biometric collection unit, real-time monitoring of user's heart rate HR, blood pressure BP and body temperature T;
[0051] Effect evaluation unit, calculating the comprehensive efficacy index E = 0.4·ΔHR + 0.3·ΔBP + 0.3·ΔT, where ΔHR represents the change in heart rate, ΔBP represents the change in blood pressure, and ΔT represents the change in body temperature;
[0052] Feedback calibration unit, triggering manual review when the difference between E and the user's subjective score exceeds 20%;
[0053] The data association unit establishes a bidirectional index relationship between the efficacy data and the corresponding formula block.
[0054] The above-described embodiments of the present invention have at least the following beneficial effects: The intelligent formula management system for concentrated traditional Chinese medicine (TCM) can achieve scientific and intelligent management of TCM formulas. The data acquisition module acquires physical characteristics and chemical composition data of TCM materials, and the data preprocessing module performs normalization and feature dimensionality reduction, providing accurate data support for formula generation. The intelligent matching module, combined with a similarity matching algorithm, can quickly generate initial formula solutions, improving the efficiency and accuracy of formula development. The blockchain storage module encrypts and distributes formula parameters and operation records, ensuring data integrity and immutability, and enhancing the security and traceability of formula management. The dynamic adjustment module adjusts formula parameters in real time based on user feedback and concentration effect monitoring data, enabling personalized optimization of formulas and improving the concentration and therapeutic effects of TCM. The user feedback module collects real-time changes in user physiological indicators and efficacy evaluation data, providing an objective basis for formula adjustments and further improving the scientific nature and reliability of formulas.
[0055] Furthermore, the security verification module of this invention utilizes a dual-factor hashing mechanism to effectively verify the integrity and authenticity of the data chain, promptly identifying and addressing abnormal blocks and ensuring the stable operation of the system. The consensus node voting mechanism further enhances the reliability and fairness of data recovery. Overall, this system can improve the management efficiency and quality of concentrated Chinese medicine formulas, promoting the modernization and intelligent development of Chinese medicine manufacturing technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily apparent by reading the following detailed description with reference to the accompanying drawings, in which several embodiments of the present invention are shown by way of example and not limitation, in which:
[0057] Figure 1 A schematic diagram of the structure of a blockchain-based intelligent formula management system for concentrated traditional Chinese medicine provided in one embodiment of the present invention. DETAILED DESCRIPTION
[0058] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided solely to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. Rather, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.
[0059] Those skilled in the art will appreciate that the embodiments of the present invention may be implemented as a system, apparatus, device, method, or computer program product. Therefore, the present invention may be implemented in the following forms: entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or in a combination of hardware and software.
[0060] It should be noted that any number of elements in the drawings is for illustration only and not for limitation, and any naming is only for distinction and does not have any limiting meaning.
[0061] Reference below Figure 1 , Figure 1 This is a schematic diagram of the structure of the blockchain-based Chinese medicine concentrated intelligent formula management system provided by one embodiment of the present invention. Figure 1 As shown, a blockchain-based intelligent formula management system 100 for concentrated Chinese medicine includes:
[0062] The data acquisition module 101 is used to obtain the physical characteristic parameters and chemical composition data of the Chinese medicinal material raw materials;
[0063] The data preprocessing module 102 is connected to the data acquisition module and is used to perform normalization and feature dimension reduction on the collected data;
[0064] Intelligent matching module 103, connected to the pre-processing module, generates an initial formulation scheme through a similarity matching algorithm;
[0065] Blockchain storage module 104, used to generate encrypted blocks from recipe parameters and operation records and store them in a distributed manner;
[0066] Dynamic adjustment module 105, which modifies recipe parameters in real time based on user feedback data and concentration effect monitoring data;
[0067] User feedback module 106, collecting user physiological index change data and efficacy evaluation data;
[0068] The security verification module 107 ensures the integrity and non-tamperability of the data chain through two-factor hash verification.
[0069] It should be noted that this blockchain-based intelligent formula management system for concentrated TCM is comprised of multiple functional modules. The data acquisition module collects physical characteristic parameters related to TCM raw materials (physical properties such as shape, size, color, and texture that can be obtained through observation or measurement) and chemical composition data (i.e., the types and content of various chemical components in the TCM). The data preprocessing module is connected to the data acquisition module. Normalization maps the collected data to a specific interval, eliminating dimensional differences and facilitating subsequent analysis and calculations. Feature dimensionality reduction removes redundant features from the data to improve computational efficiency. Based on the preprocessed data, the intelligent matching module uses a similarity matching algorithm to compare the target medicinal ingredient components with historical formula components to generate an initial formula. The blockchain storage module is responsible for converting formula parameters (such as the dosage and ratio of various medicinal ingredients, and other key formula information) and operation records (including relevant operational information during formula generation, adjustment, and use) into encrypted blocks and distributively storing them to ensure data security and traceability. The dynamic adjustment module modifies the formula parameters in real time based on user feedback data (such as physical changes after use, efficacy evaluation, etc.) and concentration effect monitoring data (such as the actual effect data of the active ingredient content and concentration of the concentrated traditional Chinese medicine), so that the formula is more in line with actual needs. The user feedback module specifically collects data on changes in user physiological indicators (such as changes in heart rate, blood pressure, body temperature and other physical indicators before and after using the formula) and efficacy evaluation data (that is, the user's evaluation of the effect after using the concentrated traditional Chinese medicine formula). The security verification module uses two-factor hash verification technology to ensure the integrity of the data chain (the data is complete and no key content has been deleted or modified) and non-tampering (once the data is recorded, it cannot be illegally changed).
[0070] Specifically, the data acquisition module can acquire data with the help of professional equipment, such as using a spectrometer to analyze chemical composition, using an electronic caliper to measure physical dimensions, etc. In the data preprocessing module, normalization can use the maximum-minimum normalization method to map the data to the [0,1] interval. The formula is
[0071] (XX min ) / (X max -X min )
[0072] Among them, X is the original data, X min and X max The minimum and maximum values in the data set; the principal component analysis (PCA) algorithm can be used for feature dimensionality reduction, which can transform multiple related original variables into a few independent comprehensive indicators. The similarity matching algorithm in the intelligent matching module constructs its component vector based on actual detection and historical data, and the weight coefficient w i According to the formula
[0073] w i =α·(log(P i / P avg ))+β·(T i / T max )
[0074] Calculation, α is between 0.5-1.2, β is between 0.3-0.9, P i 、P avg 、T i 、T max The acquisition and calculation methods are as described above. In the blockchain storage module, the relevant parameters for generating encrypted blocks, such as the random number Nonce generated by the system random number generator, the basic difficulty target value D base This can be set based on the system's expected block generation speed, generally resulting in an average block generation rate of 10-15 minutes. In the dynamic adjustment module, user feedback scores are obtained through user feedback on the system interface, ranging from 0 to 10. Actual concentration effects are obtained through experimental testing, while theoretical concentration effects are determined based on experience or theoretical models. The user feedback module's biometric data collection unit can use smart wearable devices or medical testing equipment to collect data. The security verification module's two-factor hashing algorithm typically uses the SHA256 algorithm.
[0075] Preferably, in addition to traditional testing equipment, the data acquisition module can also utilize near-infrared spectroscopy to rapidly acquire chemical composition information from traditional Chinese medicines, improving acquisition efficiency. When performing feature dimensionality reduction, the data preprocessing module can consider using the linear discriminant analysis (LDA) algorithm in addition to the PCA algorithm. For data with categorical labels, LDA may better extract categorical information. After generating initial formula solutions, the intelligent matching module can conduct preliminary screening of solutions based on the expert knowledge base to eliminate obviously unreasonable solutions. When generating encrypted blocks, the blockchain storage module can implement multi-signature technology in addition to double hashing to further enhance data security. When calculating adjustment coefficients, the dynamic adjustment module can factor in environmental factors (such as season and region) in addition to user feedback ratings and effect deviation values, ensuring more precise formula adjustments. When collecting physiological indicator change data, the user feedback module can periodically remind users to take measurements to ensure data integrity. The security verification module, in addition to two-factor hashing, adds data integrity checksum verification to ensure data has not been tampered with.
[0076] In some embodiments, the similarity matching algorithm includes:
[0077] Step S201: Create a target medicinal material component vector C1 = (c1, c2, ..., c n ) and the historical recipe component vector C2=(c′1,c′2,...,c′ n ), where c i Indicates the content of the i-th active ingredient; c' i Indicates the content of the i-th active ingredient in the historical formula.
[0078] Step S202: Calculate component similarity S = Σ(w i ·|c i -c′ i |) / (Σw i ·max(c i ,c′ i )), where w i is the weight coefficient of the i-th component;
[0079] Step S203: When S≥0.85, automatic matching is triggered, and when 0.7≤S<0.85, the manual review process is started;
[0080] Step S204: Generate an evaluation report including a matching score and a list of difference components.
[0081] It should be noted that this section mainly describes a similarity matching algorithm for the intelligent formula management system for concentrated traditional Chinese medicine. Step S201 is to construct a target medicinal material component vector and a historical formula component vector. These two vectors are used to represent the content of effective ingredients in medicinal materials from different sources. The elements in the vectors correspond to the content of various effective ingredients. Step S202 is used to calculate the similarity of the ingredients. A numerical value is obtained to measure the similarity by comprehensively considering the difference in the content of each ingredient and the weight coefficient through a specific formula. Step S203 sets different processing flows based on the calculated similarity value. When the similarity reaches a certain standard, automatic matching is triggered, and a manual review process is started in another range. Step S204 generates an evaluation report containing a matching score and a list of different ingredients after completing the similarity calculation and process judgment, which is convenient for subsequent analysis of the matching results.
[0082] Specifically, when constructing the target medicinal material component vector and the historical formula component vector, the data source of the target medicinal material component vector is the Chinese medicinal material that currently needs to be matched with the formula. Through professional component detection methods such as high-performance liquid chromatography and mass spectrometry, the content of each active ingredient is obtained to determine the value of each element in the vector. The historical formula component vector is constructed by extracting the corresponding active ingredient content information from a large amount of historical formula data stored in the system. Weight coefficient w i According to the formula
[0083] w i =α·(log(P i / P avg ))+β·(T i / T max )
[0084] Calculation, where the pharmacological activity regulation factor α can be in the range of 0.5≤α≤1.2, and the appropriate value can be selected according to the focus of different medicinal materials and formulas. For example, for formulas that focus on pharmacological activity, α can be close to 1.2; the toxicity influence factor β is selected in the range of 0.3≤β≤0.9. If the formula is more sensitive to toxicity, β can be close to 0.9. Standard pharmacological activity value P i You can refer to the pharmacological activity data of the ingredient recorded in professional Chinese medicine research literature and authoritative databases; the average pharmacological activity value P avg It is the average value of the standard pharmacological activity values of all ingredients. Toxicity level T i According to the authoritative toxicity classification standard, the maximum toxicity level value T max Fixed to 5. When determining the trigger process, the thresholds of 0.85 and 0.7 are empirical values and can be adjusted according to the actual application scenario and the requirements for matching accuracy.
[0085] Preferably, when calculating the component similarity, the weight coefficient wi In addition to considering pharmacological activity and toxicity factors, the calculation of the importance of the ingredients in traditional Chinese medicine theory can also be introduced. For example, certain ingredients that play a key role in classic prescriptions are given a higher weight bonus. When generating an evaluation report, the list of differential ingredients can be further refined. In addition to listing the differential ingredients, the differences in the pharmacological effects of these ingredients and the possible impact on the final formula effect can be marked. This can provide more valuable information for subsequent formula adjustments and manual review. When constructing a vector, if the content of certain ingredients is extremely low and difficult to detect accurately, a detection lower limit can be set. The ingredients below this value are uniformly calculated according to a certain proportion of the lower limit to ensure the accuracy and stability of the vector construction.
[0086] In some embodiments, the weight coefficient w i The calculation formula is:
[0087] w i =α·(log(P i / P avg ))+β·(T i / T max )
[0088] Among them, α is the pharmacological activity regulatory factor (0.5≤α≤1.2), β is the toxicity impact factor (0.3≤β≤0.9), P i represents the standard pharmacological activity value of the i-th ingredient, P avg is the average pharmacological activity value of all ingredients T i Indicates the toxicity level of the i-th ingredient (1-5), T max The maximum toxicity level is 5.
[0089] It should be noted that this section gives the weight coefficient w in the similarity matching algorithm i The formula takes into account multiple factors to determine the importance of each component in calculating similarity. The pharmacological activity adjustment factor α and the toxicity influence factor β are used to adjust the sensitivity of the weight coefficient to different factors. i It reflects the pharmacological activity of the i-th ingredient, and the average pharmacological activity value P avg It is the average value of the pharmacological activity of all ingredients, and the difference in the pharmacological activity of the ingredient relative to the whole is reflected by the logarithmic operation of the two. i Indicates the toxicity of the i-th ingredient, the maximum toxicity level value T max The effect of toxicity on the weight coefficient is measured by the operation of these two values.
[0090] Specifically, the pharmacological activity regulation factor α ranges from 0.5≤α≤1.2. If you want to focus more on the effect of pharmacological activity on the weight coefficient, α can be close to 1.2; if you want to relatively weaken the effect of pharmacological activity, you can take a value close to 0.5. The toxicity influence factor β ranges from 0.3≤β≤0.9. When you are more sensitive to toxicity, β is close to 0.9. If the toxicity requirement is not so strict, you can take a value close to 0.3. Standard pharmacological activity value P i It can be obtained from professional Chinese medicine research literature and authoritative pharmacological databases. avg The toxicity level is obtained by adding the standard pharmacological activity values of all ingredients and taking the average value. i It is determined according to professional toxicity classification standards, such as the degree of harm of the ingredients to the human body, clinical research data, etc., and is divided into levels 1-5. The maximum toxicity level value T max It is fixed at 5 as the upper limit reference value of the toxicity level.
[0091] Preferably, when calculating the weight coefficient w i When the standard pharmacological activity value P i In addition to referring to existing literature and databases, the P can also be updated in combination with the latest clinical research results. If new research shows that the pharmacological activity of a certain ingredient has changed, the P i The value of makes the weight coefficient more consistent with the actual situation. i In addition to the existing fixed classification standards, they can be regularly re-evaluated and adjusted according to the progress of new toxicological research. avg If new components are added to the system, P should be recalculated in time. avg , to ensure its accuracy. In addition, it is also possible to consider adding a clinical application frequency factor γ to the weight coefficient calculation formula. For example, a higher weight is given to the components with high frequency of use in clinical applications. The formula can be modified as follows:
[0092] w i =α·(log(P i / P avg ))+β·(T i / T max )+γ·f
[0093] Among them, f is a numerical value related to the clinical application frequency of the component, γ is the corresponding adjustment factor, and the value range can be set according to actual conditions.
[0094] In some embodiments, the dynamic adjustment module includes:
[0095] The parameter correction unit calculates the adjustment coefficient K based on the feedback score F and the effect deviation value ΔE:
[0096] K = 1 / (1 + e(-(0.5F + 0.3ΔE)))
[0097] Where F∈[0,10] is the user feedback score ΔE=||E 实际 -E 理论 || / E 理论 , E 实际 Indicates the actual concentration effect value, E 理论 It indicates that the theoretical concentration effect value adjustment threshold is set to trigger the recipe adjustment when K>0.65.
[0098] It should be noted that what is described here is the working method of the parameter correction unit in the dynamic adjustment module of the intelligent formula management system for concentrated traditional Chinese medicine. The parameter correction unit calculates the adjustment coefficient K based on the feedback score and the effect deviation value. This adjustment coefficient K determines whether the formula needs to be adjusted. The feedback score is the user's evaluation score of the effect of using the concentrated traditional Chinese medicine formula, ranging from 0 to 10. The higher the score, the more satisfied the user is with the effect. The effect deviation value is calculated by comparing the actual concentration effect value with the theoretical concentration effect value, reflecting the degree of difference between the actual effect and the expected effect. When the calculated adjustment coefficient K is greater than the set adjustment threshold of 0.65, the system will trigger the adjustment operation of the formula to optimize the formula.
[0099] Specifically, feedback scores can be obtained through a special user evaluation interface designed for the system. After using the concentrated Chinese medicine formula, users can rate it on a scale of 0-10 on this interface. The actual concentration effect value can be measured through specific testing equipment and methods. For example, the actual effect can be quantified by measuring the content and concentration of the active ingredients of the concentrated Chinese medicine; the theoretical concentration effect value is determined based on past experimental data, theoretical model calculations, or industry standards. For example, in a large number of past experiments, it was determined that the active ingredient content of a certain formula should reach a certain value under ideal conditions. This value can be used as the theoretical concentration effect value. When calculating the effect deviation value, the formula used is to divide the absolute value of the difference between the actual concentration effect value and the theoretical concentration effect value by the theoretical concentration effect value, so that the deviation ratio between the actual and theoretical effects can be accurately measured. The adjustment threshold of 0.65 is an empirical value and can be modified according to actual conditions and the sensitivity requirements for formula adjustment.
[0100] Preferably, when obtaining feedback scores, in addition to allowing users to score directly, some specific evaluation dimensions can also be set, such as taste, efficacy, ease of use, etc. After the user scores each dimension, the system performs a weighted calculation based on the importance of each dimension to obtain the final feedback score, making the feedback score more objective and comprehensive. For the measurement of the actual concentration effect value, a variety of detection methods can be used to verify each other, such as using chemical analysis and biological activity detection methods at the same time to improve the accuracy of the measurement. When determining the adjustment threshold, a machine learning algorithm can be introduced to dynamically determine the adjustment threshold based on historical formula adjustment data and adjusted effect feedback, so that it is more suitable for different formulas and application scenarios. For example, for some formulas that are more sensitive to effect changes, the adjustment threshold can be appropriately lowered to adjust the formula more promptly; for relatively stable formulas, the adjustment threshold can be appropriately increased to reduce unnecessary adjustment operations.
[0101] In some embodiments, when the parameter modification unit performs adjustment:
[0102] Step S501: Get the latest N adjustment records to form a time series K1, K2, ..., K N ;
[0103] Step S502: Calculate the trend factor λ = ∑(t·K t ) / (Σt 2 ), t=1 to N, t represents the sequence number of the time series, K t represents the adjustment coefficient of the tth adjustment;
[0104] Step S503: when λ>0.15, the radical adjustment mode is enabled and the adjustment range is increased by 1.5 times;
[0105] Step S504: When λ≤0, the stability detection is started and the automatic adjustment function is suspended.
[0106] It should be noted that this paragraph mainly describes a series of operational processes when the parameter correction unit performs adjustments in the intelligent formula management system for concentrated traditional Chinese medicine. In step S501, the latest N adjustment records are obtained to form a time series. This operation is to prepare for the subsequent analysis of the adjustment trend. The time series can reflect the changes in the adjustment coefficient over time. Step S502 calculates the trend factor λ through a specific formula. This factor is used to measure the changing trend of the adjustment coefficient and then determine the direction of the formula adjustment. Step S503 stipulates that when the trend factor λ is greater than 0.15, the aggressive adjustment mode is enabled, that is, the adjustment range is increased by 1.5 times to speed up the formula optimization speed. Step S504 indicates that when the trend factor λ is less than or equal to 0, the stability detection is started and the automatic adjustment function is suspended to prevent excessive adjustment from affecting the stability of the formula.
[0107] Specifically, in step S501, the value of N can be set according to the actual situation. Generally speaking, a value of N between 5 and 10 is more appropriate. If the value is too small, it may not accurately reflect the adjustment trend; if the value is too large, the amount of calculation will increase and it may contain too much outdated data that will affect the judgment. These adjustment records are stored in the system's database, and the system obtains the corresponding data through query operations. In step S502, in the formula for calculating the trend factor λ, t is the serial number of the time series, starting from 1 and increasing sequentially to N, which represents the order of each adjustment in the time series; K t represents the adjustment coefficient for the tth adjustment. This adjustment coefficient is calculated by the parameter correction unit based on the feedback score and the effect deviation value. In step S503, the threshold of 0.15 is set based on experience. In actual application, if the system prioritizes rapid formulation optimization, this threshold can be appropriately lowered; if stability is more important, the threshold can be appropriately increased. In step S504, stability testing can be performed by analyzing the changes in various indicators before and after the formulation adjustment over a period of time, such as observing fluctuations in the active ingredient content and the stability of the concentration effect.
[0108] Preferably, when obtaining the adjustment record in step S501, not only the adjustment coefficient is obtained, but also the relevant environmental parameters at the time of each adjustment, such as the operating parameters of the production equipment, the batch information of the raw materials, etc., which may have an impact on the formula adjustment and help to analyze the adjustment trend more comprehensively. When calculating the trend factor λ, in addition to using the current formula, weighted calculation can be introduced to give higher weights to recent adjustment records, because recent data can better reflect the current adjustment trend. In the radical adjustment mode of step S503, in addition to increasing the adjustment range by 1.5 times, other optimization strategies can be combined, such as giving priority to adjusting parameters that have a greater impact on the formula effect, so as to improve the pertinence and efficiency of the adjustment. When starting the stability test in step S504, a test cycle can be set, such as retesting the stability at regular intervals. If the stability meets the standard, the automatic adjustment function is restored instead of being suspended all the time. This ensures stability while not affecting the system's continuous optimization of the formula.
[0109] In some embodiments, the encryption block generation method of the blockchain storage module (104) includes:
[0110] Step S601: Set the current recipe parameter P now and the previous block hash value H prev Splicing
[0111] Step S602: Double hash operation
[0112] H new =SHA256(SHA256(P now ||H prev||N once ))
[0113] Among them, || represents the string concatenation operation, Nonce is a random number used to increase randomness in the hash operation, SHA256 is a cryptographic hash function used to hash the input data to obtain a fixed-length hash value, H new Indicates the hash value of the newly generated encrypted block.
[0114] Step S603: Dynamic difficulty target value D=D base / (1+0.1·T), where T is the average generation time of the last 10 blocks, D base Base difficulty target value
[0115] Step S604: When H new A block is considered valid when the number of leading zeros is ≥ D.
[0116] It should be noted that this part introduces the method for generating encrypted blocks in the blockchain storage module of the Chinese medicine concentrated intelligent formula management system. In step S601, the current formula parameter P now and the previous block hash value H prev The purpose of splicing is to associate the newly generated block with the previous block, build a chain structure of the blockchain, and ensure the continuity and traceability of the data. The double hash operation in step S602 uses the SHA256 cryptographic hash function to perform two hash calculations on the spliced information (including the random number Nonce) to generate a new encrypted block hash value H new , enhancing data security and encryption effect. Step S603 introduces a dynamic difficulty target value D, which is composed of the basic difficulty target value D base and the average generation time T of the last 10 blocks, which is used to control the difficulty of block generation. Step S604 stipulates that only when the newly generated hash value H new The block is considered valid only when the number of leading zeros is greater than or equal to the dynamic difficulty target value D, thereby maintaining the security and stability of the blockchain.
[0117] Specifically, the current recipe parameter P now It covers detailed information about the concentrated formula of traditional Chinese medicine, such as the type of medicinal materials, dosage, formula generation time, etc. prevIt is the hash value of the last successfully generated and stored block in the blockchain. It is unique and represents all the information of the previous block. SHA256 is a widely used cryptographic hash function that can convert data of any length into a hash value of fixed length (256 bits). It is irreversible and collision-resistant. The random number Nonce is generated by the system's random number generator. Its length and value range can be set according to the system security requirements. It is generally a 32-bit or 64-bit integer with a value range of 0 to 2. n -1 (n is the number of digits in Nonce). Basic difficulty target value D base This is a constant initially set by the system, used to determine the initial block generation difficulty. It is typically set based on system performance and the expected block generation rate, for example, to a difficulty value that generates a block every 10-15 minutes on average. When calculating the dynamic difficulty target value D, the average generation time T of the last 10 blocks is calculated by recording the generation time of each block and taking the average.
[0118] Preferably, in step S601, in order to further enhance data security, the current recipe parameter P now and the previous block hash value H prev Before, P now Perform a simple encryption process, such as using a symmetric encryption algorithm. In step S602, in addition to using the SHA256 function for double hashing, the result of the first hashing operation can be XORed with the key generated within the system before the second hashing operation to improve the security and complexity of the hash value. When calculating the dynamic difficulty target value D, in addition to considering the average generation time T of the last 10 blocks, it can also be adjusted in combination with the system load. If the current system load is too high, appropriately reduce the difficulty target value D to speed up the block generation speed and improve system performance; if the load is low, appropriately increase the difficulty target value D to enhance the security of the blockchain. In step S604, in addition to checking the hash value H new The number of leading zeros can be increased, and the overall distribution characteristics of the hash value can be checked, such as the entropy value of the hash value, to further ensure the validity and security of the block.
[0119] In some embodiments, the method for adjusting the dynamic difficulty target value D includes:
[0120] Time monitoring unit, records the timestamps t1, t2, ..., t of the latest M blocks M Fluctuation calculation unit, calculates time variance σ 2 =∑(t i -μ) 2 / (M-1), where t i Represents the timestamp of the i-th block, μ is the average block time, that is, μ = ∑t i / M (i ranges from 1 to M), M is the number of recorded blocks, σ 2 Represents time variance, which is used to measure the fluctuation of block generation time;
[0121] Correction unit, when σ 2 > threshold V, trigger D=D·(1+0.05·(σ 2 / V) 0 .5), where V is a pre-set time variance threshold used to determine whether the fluctuation of block generation time is too large; D is the current dynamic difficulty target value. The adjusted D value will change the difficulty of subsequent block generation.
[0122] It should be noted that this section introduces the method for adjusting the dynamic difficulty target value D in the system. The time monitoring unit is responsible for recording the timestamps of the last M blocks. These timestamps are the time information recorded when each block was generated, which is used for subsequent analysis of the regularity of block generation time. The fluctuation calculation unit calculates the time variance σ through a specific formula 2 Time variance is used to measure the fluctuation of block generation time and can reflect the stability of the system's block generation. The correction unit compares the time variance with a pre-set threshold V. When the time variance exceeds the threshold V, the dynamic difficulty target value D is adjusted. The adjusted D value affects the difficulty of subsequent block generation, thereby maintaining the stability of the system's block generation.
[0123] Specifically, the timestamp recorded by the time monitoring unit is accurate to the second level to meet the requirements, and the time when each block is generated can be obtained through the system's clock module. The value of M can generally be set between 10-20, for example, set to 15. If the value is too small, it cannot accurately reflect the fluctuation trend of the block generation time; if the value is too large, the amount of calculation will increase. The average block time μ is obtained by adding the M recorded block timestamps and dividing it by M. It reflects the average speed of block generation during this period. The time variance threshold V is an empirical value set according to the system's expected block generation stability. For example, a suitable value can be found by analyzing the system's historical data so that under this threshold, the stability of the system-generated blocks can meet expectations. When calculating the time variance σ 2 In the formula, (t i -μ) 2 The square of the deviation between each block timestamp and the average time is calculated, and the square of these deviations is added and divided by (M-1) to get the variance.
[0124] Preferably, when the time monitoring unit records the timestamp, some key operating parameters of the system when generating the block, such as CPU usage, memory occupancy, etc., can be recorded at the same time, so as to analyze the factors affecting the fluctuation of block generation time more comprehensively later. 2When adjusting the dynamic difficulty target value D, in addition to the current calculation formula, adjustments can also be made based on the system's business volume. If the current business volume is high and faster block generation is needed to process data, the adjustment range can be appropriately increased to speed up the difficulty adjustment.
[0125] In some embodiments, the operations performed by the security verification module include:
[0126] Step S801: Extract the metadata of the block to be verified to generate the verification hash H v ;
[0127] Step S802: Read the original hash H stored on the chain o ;
[0128] Step S803: Calculate the difference δ = (H v XORH o ) / 256;
[0129] Step S804: when δ>0.15, mark it as an abnormal block;
[0130] Step S805: Start the consensus node voting mechanism, and trigger data recovery when more than 2 / 3 of the nodes confirm the abnormality.
[0131] It should be noted that this section mainly describes a series of operation processes performed by the security verification module in the system. In step S801, the metadata of the block to be verified is extracted to generate the verification hash H v The metadata contains key information about the block, and a hash value is generated from this information so that it can be compared with the original hash later. Step S802 reads the original hash H stored on the chain. o The original hash is the hash value generated when the block was first stored on the blockchain, which serves as a benchmark for comparison. Step S803 calculates the difference δ through a specific formula to quantify the difference between the verification hash and the original hash. Step S804 sets a judgment standard. When the difference δ is greater than 0.15, the block is marked as an abnormal block. Step S805 stipulates that once it is marked as an abnormal block, the consensus node voting mechanism is activated. When more than 2 / 3 of the nodes confirm that the block is abnormal, the data recovery operation is triggered to ensure the accuracy and integrity of the system data.
[0132] Specifically, in step S801, the metadata of the block to be verified may include information such as the block's timestamp, version number, number of transactions, and block size. v The same hash algorithm as that used when generating the encrypted block in the blockchain storage module can be used, such as the SHA256 algorithm. In step S802, the original hash H stored on the chain is o It is generated and saved when the block is created and successfully stored in the blockchain. In step S803, in the formula for calculating the difference δ, XOR represents the exclusive OR operation, which is a basic logical operation. v and the original hash H o After performing the bit-by-bit XOR operation, divide by 256 to obtain the degree of difference. The 256 here is because the hash value is usually 256 bits. By dividing by 256, the XOR result is normalized to facilitate comparison and judgment. In step S804, the threshold of 0.15 is set based on experience and the system's requirements for data accuracy. If the system has high requirements for data accuracy, the threshold can be appropriately lowered; if a certain degree of error is allowed, the threshold can be appropriately increased. In step S805, the consensus nodes are nodes in the blockchain network that participate in the verification and maintenance of the blockchain, and they have voting rights. The data recovery operation can be achieved by restoring the correct data state before the abnormal block from the backup data.
[0133] Preferably, in step S801, in addition to extracting common metadata, some key attributes of transactions related to the block can also be extracted as supplements to the metadata, such as the address information of the two parties to the transaction, the transaction amount, etc., so that the generated verification hash can more comprehensively reflect the characteristics of the block. When calculating the difference δ, in addition to using the XOR operation, other hash difference calculation methods, such as the Hamming distance, can also be combined to measure the difference between hash values from multiple angles to improve the accuracy of the judgment. In step S805, for the consensus node voting mechanism, in addition to allocating voting weights based on the node's historical accuracy, the node's resource contribution (such as the computing resources and storage resources provided by the node) can also be considered to allocate weights. When triggering the data recovery operation, the abnormal block can be backed up first to facilitate subsequent analysis of the cause of the abnormality. At the same time, after the data is restored, the restored data is re-verified to ensure the correctness of the data recovery.
[0134] In some embodiments, the consensus node voting mechanism includes:
[0135] The weight allocation unit allocates voting weight W = 1 + log (R / 0.8) based on the node's historical accuracy rate R;
[0136] Time decay unit, which applies a decay coefficient of η = 0.9 to voting records that are older than 24 hours t , t represents the number of days after 24 hours;
[0137] Dynamic threshold unit, set the pass threshold to ∑W i ≥N node 0.7 η max , where N node is the total number of nodes, η max is the maximum attenuation coefficient.
[0138] It's important to note that this section describes the specific structure and operation of the consensus node voting mechanism in the system. The weight allocation unit assigns voting weight W based on the node's historical accuracy R, calculated using the formula W = 1 + log(R / 0.8). This aims to give nodes with a high historical accuracy greater say in voting, thereby improving the reliability of voting results. The time decay unit applies a decay coefficient η to votes older than 24 hours, calculated as η = 0.9t, where t represents the number of days past the 24-hour mark. This is done to give more recent votes greater influence and prevent outdated votes from influencing the final decision. The dynamic threshold unit sets a passing threshold, calculated as ∑Wi ≥ Nnode · 0.7 · ηmax, where Nnode is the total number of nodes and ηmax is the maximum decay coefficient. A voting result is only considered valid when the sum of the weighted votes of participating nodes reaches or exceeds this threshold, thus ensuring the rigor of voting decisions.
[0139] Specifically, the node historical accuracy R refers to the proportion of correct judgments made by a node in the consensus verifications it has participated in in the past. It can be obtained by counting the total number of times the node has participated in verification and dividing it by the number of correct verifications. In the formula of the weight distribution unit, 0.8 is a set baseline accuracy rate, which is used to adjust the scale of weight calculation. In the time decay unit, t is calculated from the moment it exceeds 24 hours. 0.9 is the base of the decay coefficient, which determines the rate at which the influence of the voting record decreases over time. In the dynamic threshold unit, Nnode can be obtained by the system automatically counting the total number of nodes in the blockchain network. ηmax is 1 without considering time decay, because η=0.9 t , when t=0, η takes the maximum value of 1.
[0140] Preferably, in addition to considering the node's historical accuracy R, the node's activity factor can also be taken into account in the weight distribution unit. For example, the number of times a node participates in voting within a certain period of time can be counted, and additional weight bonuses can be given to nodes with high activity. In the time decay unit, the decay coefficient of 0.9 can be dynamically adjusted according to the stability of the system and the frequency of data updates. If the system data is updated frequently, the decay coefficient can be appropriately increased to make the voting records more timely; if the system is relatively stable, the decay coefficient can be appropriately reduced. When setting the pass threshold in the dynamic threshold unit, in addition to considering the total number of nodes Nnode and the maximum decay coefficient ηmax, the proportional coefficient of 0.7 can also be adjusted in combination with the current network security risk level. When the network security risk is high, the proportional coefficient can be appropriately increased to increase the difficulty of voting and ensure that the voting results are more reliable; when the network security risk is low, the proportional coefficient can be appropriately reduced to improve voting efficiency.
[0141] In some embodiments, the user feedback module includes:
[0142] Biometric collection unit, real-time monitoring of user's heart rate HR, blood pressure BP and body temperature T;
[0143] Effect evaluation unit, calculating the comprehensive efficacy index E = 0.4·ΔHR + 0.3·ΔBP + 0.3·ΔT, where ΔHR represents the change in heart rate, ΔBP represents the change in blood pressure, and ΔT represents the change in body temperature;
[0144] Feedback calibration unit, triggering manual review when the difference between E and the user's subjective score exceeds 20%;
[0145] The data association unit establishes a bidirectional index relationship between the efficacy data and the corresponding formula block.
[0146] It should be noted that this section describes the specific components and functions of the user feedback module in the TCM concentrated intelligent formula management system. The biometric collection unit is responsible for real-time monitoring of the user's heart rate (HR), blood pressure (BP), and body temperature (T). These data can, to a certain extent, reflect the changes in the user's health after using the TCM concentrated formula. The effect evaluation unit calculates the comprehensive efficacy index (E) using a specific formula, weighting the changes in heart rate (ΔHR), blood pressure (ΔBP), and body temperature (ΔT) to derive a quantitative comprehensive efficacy indicator. The feedback calibration unit performs a verification function. When the comprehensive efficacy index (E) differs from the user's subjective score by more than 20%, a manual review is triggered to ensure the accuracy of the efficacy evaluation. The data association unit establishes a bidirectional index relationship between the efficacy data and the corresponding formula block, facilitating subsequent data query and analysis to understand the actual efficacy of different formulas on users.
[0147] Specifically, the biometric collection unit can utilize smart wearable devices, such as smart bracelets and smart blood pressure monitors. These devices have real-time monitoring capabilities and can transmit monitored data to the system in real time. The heart rate change value ΔHR refers to the difference in the user's heart rate before and after using the formula. Similarly, the blood pressure change value ΔBP and the body temperature change value ΔT are the differences in blood pressure and body temperature, respectively, before and after using the formula. In the formula for calculating the comprehensive efficacy index E, 0.4, 0.3, and 0.3 are the weighting coefficients for the heart rate change value, blood pressure change value, and body temperature change value, respectively. These weighting coefficients are pre-set based on the importance of these three physiological indicators in assessing efficacy. In the feedback calibration unit, the 20% difference threshold is set based on experience and actual testing and is used to determine whether manual review is required. When establishing a bidirectional index relationship, the data association unit associates the efficacy data with the unique identifier of the recipe block by setting up relevant data tables and fields in the system database.
[0148] Preferably, in addition to monitoring heart rate, blood pressure, and body temperature, the biometric acquisition unit can also monitor other physiological indicators, such as blood oxygen saturation and blood sugar, to make the collected data more comprehensive and enable a more accurate assessment of the therapeutic effect. When the effect evaluation unit calculates the comprehensive efficacy index E, the weight coefficient can be dynamically adjusted according to different Chinese medicine formulas and applicable populations. For example, for formulas that mainly treat cardiovascular diseases, the weights of the heart rate change value and the blood pressure change value can be appropriately increased; for formulas that treat colds and fevers, the weight of the body temperature change value can be increased. When the feedback calibration unit triggers manual review, it can not only rely on the difference between the comprehensive efficacy index E and the user's subjective score, but can also make a comprehensive judgment based on the user's medication time, dosage, and other information to improve the accuracy and pertinence of the manual review. When the data association unit establishes a bidirectional index relationship, blockchain technology can be used for encrypted storage to further improve the security and traceability of the data and prevent data tampering.
[0149] The above-described embodiments of the present invention have the following beneficial effects: The present invention uses a data acquisition module to acquire physical characteristics and chemical composition data of traditional Chinese medicines, and then performs normalization and feature dimension reduction in a data preprocessing module. This provides a precise data foundation for formula generation, thereby improving the scientific nature and reliability of the formula. The intelligent matching module, combined with a similarity matching algorithm, can quickly generate an initial formula based on the similarity between the target herbal ingredient and the historical formula ingredients. Automatic matching is performed when the similarity is high, and manual review is initiated when the similarity is low. This improves formula generation efficiency and ensures formula accuracy. The dynamic adjustment module adjusts formula parameters in real time based on user feedback and concentration effect monitoring data, enabling personalized optimization of formulas and improving the concentration and therapeutic effects of traditional Chinese medicines. The user feedback module collects real-time changes in user physiological indicators and efficacy evaluation data, providing an objective basis for formula adjustment, further improving the scientific nature and reliability of the formula. The security verification module, using a two-factor hashing mechanism, effectively verifies the integrity and authenticity of the data chain, promptly identifies and handles abnormal blocks, and ensures stable system operation. The consensus node voting mechanism further enhances the reliability and fairness of data recovery. Overall, the system can significantly improve the management efficiency and quality of concentrated Chinese medicine formulas, and promote the modernization and intelligent development of Chinese medicine pharmaceutical technology.
[0150] Furthermore, the blockchain storage module of the present invention encrypts and distributes recipe parameters and operation records, ensuring data integrity and immutability, enhancing the security and traceability of recipe management. A dynamic difficulty target value adjustment method dynamically adjusts the block generation difficulty based on fluctuations in block generation time, ensuring stable blockchain operation. During adjustment, the parameter correction unit generates a time series by acquiring the most recent N adjustment records and calculating a trend factor. When the trend factor exceeds a certain value, an aggressive adjustment mode is activated, increasing the adjustment range to quickly respond to changes in recipe requirements. When the trend factor is less than or equal to zero, a stability check is initiated, suspending the automatic adjustment function to avoid recipe instability caused by frequent adjustments. The weight coefficient calculation formula comprehensively considers pharmacological activity and toxicity, enabling a more scientific assessment of ingredient importance and providing a more rational basis for recipe generation. The comprehensive efficacy index calculation method incorporates changes in the user's heart rate, blood pressure, and body temperature to more comprehensively assess treatment efficacy and provide a more accurate reference for recipe adjustment. The feedback calibration unit triggers manual review when user feedback differs significantly from the comprehensive efficacy index, further improving the accuracy of feedback data. The data association unit establishes a bidirectional index relationship between the efficacy data and the corresponding formula block, which can easily trace the relationship between the formula and the efficacy, providing convenience for subsequent research and optimization.
[0151] Furthermore, the storage medium of the embodiment of the present application stores program instructions that can implement all the above methods, wherein the program instructions can be stored in the above storage medium in the form of a software product, including a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or a terminal device such as a computer, a server, a mobile phone, or a tablet.
[0152] The above descriptions are merely some preferred embodiments of the present invention and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present invention is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also encompass other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned inventive concept. For example, a technical solution formed by mutually replacing the above-mentioned features with (but not limited to) technical features having similar functions disclosed in the embodiments of the present invention.
Claims
1. A blockchain-based intelligent formula management system for concentrated Chinese medicine, characterized in that: include: Data acquisition module, used to obtain physical characteristic parameters and chemical composition data of Chinese medicinal materials; A data preprocessing module, connected to the data acquisition module, for performing normalization processing and feature dimension reduction on the collected data; An intelligent matching module, connected to the preprocessing module, generates an initial formulation scheme through a similarity matching algorithm; Blockchain storage module, used to generate encrypted blocks and distribute storage of recipe parameters and operation records; Dynamic adjustment module, which amends formula parameters in real time based on user feedback data and concentration effect monitoring data; User feedback module, which collects user physiological index change data and efficacy evaluation data; The security verification module ensures the integrity and non-tamperability of the data chain through two-factor hash verification.
2. The system according to claim 1, wherein: The similarity matching algorithm includes: Step S201: Create a target medicinal material component vector C1 = (c1, c2, ..., c n ) and the historical recipe component vector C2=(c′1,c′2,...,c′ n ), where c i Indicates the content of the i-th active ingredient; c' i represents the content of the i-th active ingredient in the historical formula; Step S202: Calculate component similarity S = Σ(w i ·|c i -c′ i |) / (Σw i ·max(c i ,c′ i )), where w i is the weight coefficient of the i-th component; Step S203: When S≥0.85, automatic matching is triggered, and when 0.7≤S<0.85, the manual review process is started; Step S204: Generate an evaluation report including a matching score and a list of difference components.
3. The system according to claim 2, characterized in that The weight coefficient w i The calculation formula is: w i =α·(log(P i / P avg ))+β·(T i / T max ) Among them, α is the pharmacological activity regulatory factor (0.5≤α≤1.2), β is the toxicity impact factor (0.3≤β≤0.9), P i represents the standard pharmacological activity value of the i-th ingredient, P avg is the average pharmacological activity value of all ingredients T i Indicates the toxicity level of the i-th ingredient (1-5), T max The maximum toxicity level is 5.
4. The system according to claim 1, wherein: The dynamic adjustment module includes: The parameter correction unit calculates the adjustment coefficient K based on the feedback score F and the effect deviation value ΔE: K = 1 / (1 + e(-(0.5F + 0.3ΔE))) Where F∈[0,10] is the user feedback score ΔE=||E 实际 -E 理论 || / E 理论 , E 实际 Indicates the actual concentration effect value, E 理论 It indicates that the theoretical concentration effect value adjustment threshold is set to trigger the recipe adjustment when K>0.
65.
5. The system according to claim 4, characterized in that When the parameter correction unit performs adjustment: Step S501: Get the latest N adjustment records to form a time series K1, K2, ..., K N ; Step S502: Calculate the trend factor λ = ∑(t·K t ) / (Σt 2 ), t=1 to N, t represents the sequence number of the time series, K t represents the adjustment coefficient of the tth adjustment; Step S503: when λ>0.15, the radical adjustment mode is enabled and the adjustment range is increased by 1.5 times; Step S504: When λ≤0, the stability detection is started and the automatic adjustment function is suspended.
6. The system according to claim 1, wherein: The encryption block generation method of the blockchain storage module (104) includes: Step S601: Set the current recipe parameter P now and the previous block hash value H prev Splicing Step S602: Double hash operation H new =SHA256(SHA256(P now ||H prev ||Nonce)) Among them, || represents the string concatenation operation, Nonce is a random number used to increase randomness in the hash operation, SHA256 is a cryptographic hash function used to hash the input data to obtain a fixed-length hash value, H new Represents the hash value of the newly generated encrypted block; Step S603: Dynamic difficulty target value D=D base / (1+0.1·T), where T is the average generation time of the last 10 blocks, D base is the basic difficulty target value; Step S604: When H new A block is considered valid when the number of leading zeros is ≥ D.
7. The system according to claim 6, characterized in that The method for adjusting the dynamic difficulty target value D includes: Time monitoring unit, records the timestamps t1, t2, ..., t of the latest M blocks M Fluctuation calculation unit, calculates time variance σ 2 =∑(t i -μ) 2 / (M-1), where t i Represents the timestamp of the i-th block, μ is the average block time, that is, μ = ∑t i / M (i ranges from 1 to M), M is the number of recorded blocks, σ 2 Represents time variance, which is used to measure the fluctuation of block generation time; Correction unit, when σ 2 > threshold V, trigger D=D·(1+0.05·(σ 2 / V) 0 .5), where V is a pre-set time variance threshold used to determine whether the fluctuation of block generation time is too large; D is the current dynamic difficulty target value. The adjusted D value will change the difficulty of subsequent block generation.
8. The system according to claim 1, wherein: The operations performed by the security verification module include: Step S801: Extract the metadata of the block to be verified to generate the verification hash H v ; Step S802: Read the original hash H stored on the chain o ; Step S803: Calculate the difference δ = (H v XORH o ) / 256; Step S804: when δ>0.15, mark it as an abnormal block; Step S805: Start the consensus node voting mechanism, and trigger data recovery when more than 2 / 3 of the nodes confirm the abnormality.
9. The system according to claim 8, characterized in that The consensus node voting mechanism includes: The weight allocation unit allocates voting weight W = 1 + log (R / 0.8) based on the node's historical accuracy rate R; Time decay unit, which applies a decay coefficient of η = 0.9 to voting records that are older than 24 hours t , t represents the number of days after 24 hours; Dynamic threshold unit, set the pass threshold to ∑W i ≥N node 0.7 η max , where N node is the total number of nodes, η max is the maximum attenuation coefficient.
10. The system according to claim 1, wherein: The user feedback module includes: Biometric collection unit, real-time monitoring of user's heart rate HR, blood pressure BP and body temperature T; Effect evaluation unit, calculating the comprehensive efficacy index E = 0.4·ΔHR + 0.3·ΔBP + 0.3·ΔT, where ΔHR represents the change in heart rate, ΔBP represents the change in blood pressure, and ΔT represents the change in body temperature; Feedback calibration unit, triggering manual review when the difference between E and the user's subjective score exceeds 20%; The data association unit establishes a bidirectional index relationship between the efficacy data and the corresponding formula block.