A method, system, device and medium for assisting generation of a traditional Chinese medicine storage strategy
Patent Information
- Application Number
- CN202611030151.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-11
- Publication Date
- 2026-09-25
AI Technical Summary
即便引入了自动化设备,其核心控制逻辑仍然停留在静态规则层面,缺乏对不同药材特性差异(如挥发油类与根茎类药材对温湿度的不同敏感度)和地域气候多变性(如梅雨季节与干旱季节的环境波动)的动态适应能力
[0050]通过融合多源异构数据和在线自校准机制,打破传统静态阈值或人工经验调控的局限,使数字孪生模型能够动态适应不同药材特性、地域气候差异和仓储过程中参数漂移,同时将参数不确定性量化为概率性预测并融入机会约束优化,从而在源头防虫防霉与最大化药效保留之间实现风险可控的鲁棒决策,显著提升仓储管理的智能化水平、预测精度和长期运行可靠性。
Smart Images

Figure CN122820089A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of traditional Chinese medicine storage technology, and in particular relates to an auxiliary method, system, equipment and medium for generating traditional Chinese medicine storage strategies. Background Technology
[0002] With the application of the Internet of Things and automated control in the warehousing field, the management of traditional Chinese medicine (TCM) warehousing is gradually shifting from manual experience to equipment-assisted regulation. Some warehouses have already deployed temperature and humidity sensors and automatic ventilation, dehumidification, and refrigeration equipment, enabling real-time monitoring of environmental parameters and automatic adjustment triggered by thresholds. This technological approach can improve the controllability of the warehousing environment to a certain extent and promote the initial intelligentization process of TCM warehousing.
[0003] Traditional methods of generating storage strategies for Chinese medicinal herbs typically rely on pre-set fixed environmental parameter thresholds, such as activating refrigeration when the temperature exceeds 25°C, or manual adjustments based on the personal experience of warehouse management personnel. Even with the introduction of automated equipment, the core control logic remains at the level of static rules, lacking the ability to dynamically adapt to the differences in the characteristics of different medicinal herbs (such as the different sensitivities of volatile oils and rhizomes to temperature and humidity) and the variability of regional climates (such as environmental fluctuations between the rainy season and the dry season).
[0004] However, existing technologies cannot fully utilize multi-source information such as real-time environmental monitoring data, medicinal material sampling data (e.g., active ingredient content, mold area), and future weather forecasts. This results in environmental control strategies lagging behind the actual changes in the state of medicinal materials, making it difficult to achieve a dynamic optimal balance between pest and mold prevention and efficacy preservation. Furthermore, the biochemical reaction parameters of the medicinal materials themselves (e.g., degradation rate, mold growth threshold) drift with batch, origin, and storage time. Static models cannot self-calibrate, and prediction accuracy decreases with accumulated errors, making control decisions lack a scientific basis. Summary of the Invention
[0005] Therefore, it is necessary to provide an auxiliary decision-making method that can dynamically generate the optimal warehouse environment control strategy based on multi-source data fusion and adaptive model calibration to address the above-mentioned technical problems.
[0006] Firstly, this application provides an auxiliary method for generating a storage strategy for traditional Chinese medicinal materials, including:
[0007] For the Chinese medicinal materials in the target warehouse, a digital twin is constructed, and a prior probability distribution is assigned to the parameters to be calibrated in the digital twin; the digital twin includes an active ingredient degradation kinetic model and an insect and mold growth prediction model;
[0008] Observational data of Chinese medicinal materials are obtained through periodic non-destructive testing, and the environmental temperature and humidity data of the physical warehouse and the observational data are asynchronously time-aligned and fused to generate a fused observational dataset; the observational data includes the observed values of effective ingredient concentration and mold area.
[0009] Based on the fused observation dataset, prior probability distribution, and digital twin, the sequential Monte Carlo particle filter algorithm is used to perform online backpropagation update of the parameters to be calibrated, and the posterior probability distribution of the parameters to be calibrated is obtained.
[0010] Based on the posterior probability distribution and combined with meteorological forecast data for a future preset time domain, the digital twin is driven to perform forward simulation propagation to generate a sequence of particle trajectories within the future preset time domain.
[0011] Using particle trajectory sequences as input, a multi-objective cost function is constructed, which includes the objective of drug efficacy retention, the penalty for mold risk, and the energy consumption cost. The multi-objective cost function is then solved to generate the optimal warehouse environment control strategy sequence for a future preset time domain.
[0012] Furthermore, based on the fused observation dataset, prior probability distribution, and digital twin, the sequential Monte Carlo particle filter algorithm is used to perform online backpropagation updates of the parameters to be calibrated, obtaining the posterior probability distribution of the parameters to be calibrated, including:
[0013] Based on the prior probability distribution, an initial particle set is generated through random sampling, and the state variables of the medicinal materials are initialized with the observed data for each particle in the initial particle set to obtain the initial value of the state of the medicinal materials; wherein, each particle in the initial particle set carries the parameter value to be calibrated and the normalized weight;
[0014] For the time interval between two adjacent observation times, obtain the sequence of continuously collected environmental temperature and humidity data within the time interval;
[0015] Based on the environmental temperature and humidity data sequence, combined with the parameter values to be calibrated for each particle and the initial state of the medicinal material, the differential equations of the effective component degradation kinetic model and the insect and mold growth prediction model are numerically integrated to obtain the state prediction value of each particle at the current observation time.
[0016] Obtain the state observation value at the current observation time from the fused observation dataset, and calculate the Mahalanobis distance between the state prediction value and the state observation value for each particle;
[0017] Based on Mahalanobis distance and Gaussian likelihood function, the weight of each particle is updated to obtain the updated weight, and all updated weights are normalized to obtain normalized new weights.
[0018] By summing all the particles that have received the new normalized weights, we obtain the weighted particle set;
[0019] Perform a system resampling operation on the weighted particle set to obtain a resampled particle set, and set the resampled particle set as the posterior probability distribution of the parameter to be calibrated.
[0020] Furthermore, based on the posterior probability distribution and combined with meteorological forecast data for a predetermined future time domain, the digital twin is driven to perform forward simulation propagation, generating a sequence of particle trajectories within the predetermined future time domain, including:
[0021] From the posterior probability distribution, obtain the calibration parameter value carried by each particle and the current state value of the medicinal material corresponding to each particle;
[0022] Obtain hourly environmental temperature and relative humidity prediction sequences from the current moment to a preset future time domain;
[0023] For each particle, the initial value of the medicinal material state is used as the integration value, the model coefficient is used as the parameter to be calibrated, and the environmental temperature prediction sequence and relative humidity prediction sequence are used as external drivers. The differential equation system of the active ingredient degradation kinetic model and the insect and mold growth prediction model is numerically integrated to obtain the particle trajectory sequence in the future preset time domain. Each particle trajectory in the particle trajectory sequence includes the active ingredient concentration trajectory and the mold area trajectory.
[0024] Furthermore, using the particle trajectory sequence as input, a multi-objective cost function is constructed, including the drug efficacy retention objective, mold risk penalty, and energy consumption cost. The multi-objective cost function is then solved to generate a sequence of optimal warehouse environment control strategies for a future preset time domain, including:
[0025] All particle trajectories in the particle trajectory sequence are set as possible future scenarios, and a multi-objective cost function is constructed based on these future scenarios; the expression for the multi-objective cost function is:
[0026]
[0027] in, For a multi-objective cost function, To obtain the expectation in all future scenarios, for The concentration of the effective ingredient at any given time This represents the initial concentration of the active ingredient. for The area of mold growth at any given time. for Energy consumption at any time , , , Preset weighting coefficients;
[0028] Set opportunity constraints, the expression for which is:
[0029]
[0030] in, As an opportunity constraint, The safe threshold for moldy area. To pre-set risk tolerance;
[0031] By combining multi-objective cost functions and chance constraints, a deterministic nonlinear programming problem is generated; the decision variables of the deterministic nonlinear programming problem are the sequence of environmental control actions within a future preset time domain; the sequence of environmental control actions includes the air conditioner set temperature, the dehumidifier start / stop status, and the ventilation fan speed;
[0032] The particle swarm optimization algorithm is used to solve the deterministic nonlinear programming problem, obtain the optimal control action sequence, and determine the optimal warehouse environment control strategy sequence.
[0033] Furthermore, for the Chinese medicinal materials in the target warehouse, a digital twin is constructed, and a prior probability distribution is assigned to the parameters to be calibrated in the digital twin, including:
[0034] Obtain basic characteristic data of Chinese medicinal materials in the target warehouse. The basic characteristic data includes the name of the medicinal material, the initial concentration of active ingredients, the initial moisture content, the density, the thermal conductivity, and empirical values of insect and mold growth kinetic parameters.
[0035] Based on the geometric dimensions, shelf layout, and airflow organization of the physical warehouse, a virtual three-dimensional model with the same geometry as the physical warehouse is constructed in the digital space, and the basic characteristic data is associated with the corresponding medicinal material stacking position in the virtual three-dimensional model.
[0036] A digital twin is obtained by embedding an active ingredient degradation kinetic model and an insect and fungal growth prediction model into a virtual 3D model; wherein the active ingredient degradation kinetic model and the insect and fungal growth prediction model are respectively:
[0037]
[0038]
[0039] in, The rate of change of concentration over time. Pre-exponential factor, For activation energy, Let be the ideal gas constant. For growth temperature, This refers to the concentration of the effective components in medicinal materials. The rate of change of the degree of mold growth over time. This refers to the area of mold growth on the medicinal materials. It is the lag phase. For the maximum specific growth rate, This represents the upper limit of the degree of mold growth. It is a natural constant. For time;
[0040] Prior probability distributions are set for the parameters to be calibrated in the active ingredient degradation kinetic model and the insect and fungus growth prediction model in the digital twin. The parameters to be calibrated include the pre-exponential logarithm in the active ingredient degradation kinetic model, the activation energy in the active ingredient degradation kinetic model, the optimal maximum specific growth rate in the insect and fungus growth prediction model, the minimum growth temperature in the insect and fungus growth prediction model, the optimal growth temperature in the insect and fungus growth prediction model, the maximum growth temperature in the insect and fungus growth prediction model, the minimum water activity in the insect and fungus growth prediction model, and the shape parameters in the insect and fungus growth prediction model.
[0041] Secondly, this application also provides an auxiliary generation system for traditional Chinese medicine storage strategies, including:
[0042] The digital twin construction module is used to construct digital twins for Chinese medicinal materials in the target warehouse and assign prior probability distributions to the parameters to be calibrated in the digital twins; the digital twins include a degradation kinetic model of active ingredients and a prediction model of insect and fungal growth.
[0043] The data acquisition module is used to acquire observational data of Chinese medicinal materials through periodic non-destructive testing, and to asynchronously time-align and fuse the environmental temperature and humidity data of the physical warehouse with the observational data to generate a fused observational dataset; the observational data includes observed values of effective ingredient concentration and observed values of moldy area;
[0044] The parameter update module is used to perform online backpropagation updates of the parameters to be calibrated based on the fused observation dataset, prior probability distribution, and digital twin, using the sequential Monte Carlo particle filter algorithm to obtain the posterior probability distribution of the parameters to be calibrated.
[0045] The model prediction module is used to drive the digital twin to perform forward simulation propagation based on the posterior probability distribution and combined with meteorological forecast data in the future preset time domain, so as to generate a sequence of particle trajectory in the future preset time domain.
[0046] The strategy generation module is used to construct a multi-objective cost function, including the drug efficacy retention target, mold risk penalty, and energy consumption cost, using the particle trajectory sequence as input. It then solves the multi-objective cost function to generate the optimal warehouse environment control strategy sequence for the future preset time domain.
[0047] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, the at least one program, the code set or instruction set is loaded and executed by the processor to implement an auxiliary generation method for a Chinese medicinal material storage strategy as described in any of the embodiments of this application.
[0048] Fourthly, this application also provides a computer-readable storage medium storing at least one piece of program code, which is loaded and executed by a processor to implement an auxiliary generation method for a Chinese medicinal material storage strategy as described in any of the embodiments of this application.
[0049] The aforementioned auxiliary generation method, system, equipment, and medium for a Chinese medicinal herb storage strategy include: constructing a digital twin containing a biochemical kinetic model and assigning a prior distribution of parameters to establish an initial simulation framework for the evolution of medicinal herb quality; acquiring observational data on the concentration of effective components and the area of mold growth through periodic non-destructive testing, and asynchronously aligning and fusing this data with real-time environmental temperature and humidity data collected from the physical warehouse to generate a fused observation dataset, enabling the synergistic use of sparse, noisy state observations and continuous, high-frequency environmental drivers; and using the fused observation dataset as a priori update basis, employing a sequential Monte Carlo particle filter algorithm to... The parameters to be calibrated in the digital twin are updated online through backpropagation to obtain the posterior probability distribution of the parameters, realizing adaptive calibration and uncertainty quantification of the model parameters. Subsequently, the posterior distribution is used as a particle set, combined with meteorological forecast data in the future time domain, to drive the digital twin to perform forward simulation propagation, generating a particle trajectory sequence, so that the uncertainty of the parameters is fully transmitted to the prediction of the future state. Finally, using the particle trajectory sequence as input, a multi-objective cost function that takes into account drug efficacy preservation, mold risk penalty and energy consumption cost is constructed and chance constraints are introduced. By solving a deterministic nonlinear programming problem, the optimal warehouse environment control strategy sequence in the future time domain is generated.
[0050] By integrating multi-source heterogeneous data and an online self-calibration mechanism, the limitations of traditional static thresholds or manual experience-based control are broken. This enables the digital twin model to dynamically adapt to different medicinal material characteristics, regional climate differences, and parameter drift during storage. At the same time, parameter uncertainty is quantified into probabilistic predictions and incorporated into opportunity-constrained optimization. This allows for robust decision-making with controllable risks between preventing pests and mold at the source and maximizing the preservation of medicinal efficacy, significantly improving the intelligence level, prediction accuracy, and long-term operational reliability of storage management. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 This is a flowchart illustrating an auxiliary generation method for a Chinese medicinal herb storage strategy in one embodiment.
[0053] Figure 2 This is a flowchart illustrating the steps of generating a particle trajectory sequence in a future preset time domain by driving a digital twin to perform forward simulation propagation based on a posterior probability distribution and combined with meteorological forecast data in the future preset time domain, as shown in one embodiment.
[0054] Figure 3 This is a schematic diagram of the structure of an auxiliary generation system for a Chinese medicinal herb storage strategy in one embodiment. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0056] In one embodiment, an auxiliary method for generating a storage strategy for traditional Chinese medicinal materials is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, and can also be applied to a system including a terminal and a server, and can be implemented through the interaction between the terminal and the server. Figure 1 As shown, in this embodiment, the method includes the following steps:
[0057] Step S101: For the Chinese medicinal materials in the target warehouse, construct a digital twin and assign a prior probability distribution to the parameters to be calibrated in the digital twin; wherein, the digital twin includes an effective component degradation kinetic model and an insect and mold growth prediction model.
[0058] Among them, the active ingredient degradation kinetic model refers to a quantitative mathematical model used to describe the decomposition, transformation or inactivation process of core chemical components with biological activity or functionality in products such as drugs and pesticides over time; the insect and fungal growth prediction model refers to a model used to describe the dynamic process of growth, infection and reproduction of insect pathogenic fungi in the environment; and the Chinese medicinal materials in the target warehouse refer to the batch of Chinese medicinal materials that are planned to be put into storage, under key management and prepared for storage.
[0059] For example, based on the types of Chinese medicinal herbs stored in the target warehouse, basic characteristic data of the herbs are obtained. Based on the measured geometric dimensions, shelf layout, and airflow organization of the physical warehouse, a virtual three-dimensional model is constructed in the digital space, and the basic characteristic data is associated with the corresponding stacking positions of the herbs in the virtual model. An active ingredient degradation kinetic model and an insect and mold growth prediction model are embedded within this virtual three-dimensional model, and prior probability distributions are set for all parameters to be calibrated in both models, resulting in a digital twin. This twin has the ability to simulate the future state of the herbs, but its prediction results have significant uncertainty. Here, the physical warehouse refers to a real warehouse in the real world used to store physical goods; the digital space refers to a virtual environment or information domain constructed using digital technology; and embedding refers to converting the mathematical model into executable computational logic and attaching it to each herb entity in the virtual model.
[0060] Step S102: Obtain observation data of Chinese medicinal materials through periodic non-destructive testing, and asynchronously time-align and fuse the environmental temperature and humidity data of the physical warehouse and the observation data to generate a fused observation dataset; wherein, the observation data includes the observed values of effective ingredient concentration and moldy area.
[0061] Asynchronous time alignment fusion refers to matching two types of data with inconsistent timestamps and different frequencies to the same moment or time period according to the time axis, and integrating complementary information in the aligned time sequence dimension; periodic non-destructive testing is a method of checking the status of medicinal materials at fixed time intervals without damaging the tested object.
[0062] For example, the system receives raw ambient temperature and relative humidity data continuously uploaded at high-frequency sampling intervals (e.g., once per minute) from temperature and humidity sensors deployed at multiple locations within the physical warehouse. Simultaneously, it receives the start / stop status and power feedback signals of environmental control equipment, generating a high-frequency environmental data stream. At low-frequency intervals (e.g., once a week), it receives the detection results uploaded by on-site operators after non-destructive scanning of a specified batch of medicinal materials using a portable near-infrared spectrometer. These results include: the proportion of mold spots on the surface of the medicinal material to the total area of the material, estimated using a built-in quantitative calibration model, as the observed value of moldy area; and the relative content of key active ingredients, as the observed value of effective ingredient concentration. The raw spectral data in the high-frequency environmental data stream undergoes multivariate scattering correction and Savitzky-Golay smoothing filtering to eliminate sensor noise and random fluctuations, resulting in a noise-reduced ambient temperature and relative humidity sequence. When a low-frequency observation is completed, the observed values of effective ingredient concentration and moldy area obtained from that observation are combined with the timestamp of that observation time, and the observation noise covariance matrix pre-calculated based on the root mean square error predicted by the quantitative calibration model, and then packaged into an observation data package. The observation data packet is correlated and aligned with all denoised environmental temperature and relative humidity sequences stored from the previous observation time to the current observation time to generate a structured fused observation dataset. This dataset contains both high-frequency environmental driving data and sparse real observation values of medicinal herb conditions.
[0063] Among them, temperature and humidity sensors refer to electronic components that simultaneously detect ambient temperature and relative humidity, converting physical quantities into electrical or digital signals for easy device reading; environmental control equipment refers to a general term for devices used to actively adjust and control environmental indicators within a space, maintaining temperature, humidity, ventilation, etc., within the required range, such as air conditioners, dehumidifiers, and ventilation fans; portable near-infrared spectrometers are optical detection devices that can be carried around for rapid on-site analysis. Their core function is to utilize the interaction between near-infrared light and molecules to non-destructively and rapidly determine the chemical composition and content of samples; non-destructive scanning refers to rapid detection of a batch of traditional Chinese medicine materials without damaging the materials themselves, without cutting, crushing, or consuming the sample. This directly determines the quality, authenticity, composition, or presence of problems; the quantitative calibration model is a multivariate calibration model used to establish a stable mathematical correlation between the collected spectral signals from the surface of medicinal materials and the proportion of mold spots and the concentration of effective components; multivariate scattering correction, by assuming that the spectra of different samples can be regarded as the result of linear transformation of ideal reference spectra, corrects each spectrum to have a similar mean and variance to a reference spectrum, thereby eliminating or reducing the multiple scattering effects caused by physical factors such as sample surface inhomogeneity and particle size differences, thus improving the quality of spectral data and the accuracy of subsequent quantitative analysis, classification, and other modeling; Savitzky-Golay smoothing filtering is a method based on local polynomial least squares simulation. The combined digital signal smoothing technique achieves smoothing by fitting a polynomial of a specified order to data points within a sliding window, replacing the original data points with the function value of this polynomial at the center point of the window. The calculation of the observation noise covariance matrix depends on the predictive performance of the near-infrared quantitative calibration model. During the model training phase, a batch of samples with known chemical values are input into the near-infrared spectrometer, and methods such as partial least squares regression are used to establish a regression model between spectral characteristics, effective component concentration, and mold area. After training, cross-validation is used to calculate the difference between the model's predicted values and the actual chemical values, obtaining the root mean square error of the effective component concentration prediction and the root mean square error of the mold area prediction. This assumes the prediction of two observed variables... Assuming that the errors are independent and follow a zero-mean Gaussian distribution, the observation noise covariance matrix is set as a diagonal matrix, with its diagonal elements being the squares of the two prediction root mean square errors. In practice, this matrix is pre-calculated and fixed as a model parameter, and is directly called when generating each observation data package. Encapsulation refers to organizing and packaging specific observation data according to agreed-upon formats, structures, and metadata requirements to form complete, transmissible, and parseable data units. Partial least squares regression is a multivariate statistical regression method that simultaneously reduces the dimensionality of the independent variable X and the dependent variable Y, extracts comprehensive latent variables, maximizes the correlation between the extracted latent variables X and Y, and then uses these few latent variables for regression to avoid collinearity and overfitting.Cross-validation involves dividing the dataset into multiple parts, using one part as the training set and the remaining part as the test set in turn, and then averaging the results after multiple training and evaluations.
[0064] Step S103: Based on the fused observation dataset, prior probability distribution, and digital twin, the sequential Monte Carlo particle filter algorithm is used to perform online backpropagation update of the parameters to be calibrated, thereby obtaining the posterior probability distribution of the parameters to be calibrated.
[0065] Among them, sequential Monte Carlo particle filtering is a recursive Bayesian estimation method for nonlinear, non-Gaussian dynamic systems. Its core is to use weighted random samples (particles) to approximate the posterior probability distribution of the system state. Online backpropagation update refers to updating the calibration parameters in real time using the backpropagation algorithm while the model is running, without interrupting or retraining the entire model.
[0066] For example, based on the prior probability distribution of the parameters to be calibrated and the fused observation dataset, the sequential Monte Carlo particle filter algorithm is used to perform online backpropagation updates on the parameters to be calibrated of the two models in the digital twin, so as to obtain the posterior probability distribution of the parameters to be calibrated.
[0067] Step S104: Based on the posterior probability distribution and combined with meteorological forecast data in the future preset time domain, drive the digital twin to perform forward simulation propagation to generate a particle trajectory sequence in the future preset time domain.
[0068] Among them, forward simulation propagation refers to the process of calculating and transmitting the system state and output step by step from the initial state in a time or logical order during the simulation modeling process; driving refers to the automatic running of the entire simulation process by relying on real-time data, algorithms or control commands; the future preset time domain refers to a future time range that is artificially set and looked forward in control, timing prediction or planning, such as 72 hours.
[0069] For example, the system obtains hourly environmental temperature prediction sequences and relative humidity prediction sequences from the current moment to a preset future time domain. Based on the environmental temperature prediction sequences and relative humidity prediction sequences, and combined with the posterior probability distribution, the system drives the digital twin to perform forward simulation propagation, generating a particle trajectory sequence within the preset future time domain.
[0070] Step S105: Using the particle trajectory sequence as input, construct a multi-objective cost function that includes the drug efficacy retention target, mold risk penalty, and energy consumption cost, and solve the multi-objective cost function to generate the optimal storage environment control strategy sequence for the future preset time domain.
[0071] For example, using a particle trajectory sequence as input, a multi-objective cost function is constructed, consisting of a drug efficacy retention term, a mold risk penalty term, and an energy consumption cost term. Simultaneously, opportunity constraints are introduced to limit the mold risk. Combining the cost function and opportunity constraints forms a deterministic nonlinear programming problem. This programming problem can be solved using a particle swarm optimization algorithm to obtain the optimal control action sequence that minimizes the cost function and satisfies all constraints, and this sequence serves as the optimal warehouse environment control strategy sequence. This sequence can be directly issued to the warehouse's automated control system for execution, or it can be provided to managers for reference through a visual interface. The automated control system refers to a system that uses sensors, controllers, and actuators to replace humans, allowing equipment or production processes to operate automatically according to set goals without constant human monitoring; the visual interface refers to a user interface that presents information and interactive elements in a graphical way (such as charts).
[0072] One embodiment of this application provides an auxiliary generation method for traditional Chinese medicine (TCM) storage strategies. The method includes constructing a digital twin containing a biochemical kinetic model and assigning a prior distribution to its parameters; asynchronously fusing periodic non-destructive testing data and continuous environmental data; using a sequential Monte Carlo particle filter algorithm to update the posterior distribution of model parameters online; propagating parameter uncertainties to future state predictions through forward simulation to generate a particle trajectory sequence; and using this particle trajectory sequence as input to construct and solve a multi-objective cost function with opportunity constraints to generate an optimal storage environment control strategy. This method can abandon traditional static threshold or manual experience-based control modes, dynamically adapting to different TCM characteristics, regional climate differences, and the drift of TCM state over time. It achieves a scientific trade-off between source pest and mold prevention and maximizing efficacy preservation, significantly improving the intelligence level and decision robustness of TCM storage management.
[0073] In one embodiment, based on the fused observation dataset, prior probability distribution, and digital twin, a sequential Monte Carlo particle filter algorithm is used to perform online backpropagation updates on the parameters to be calibrated, obtaining the posterior probability distribution of the parameters to be calibrated, including:
[0074] Step S201: Based on the prior probability distribution, an initial particle set is generated by random sampling, and the medicinal material state variables are initialized as observation data for each particle in the initial particle set to obtain the initial value of the medicinal material state; wherein, each particle in the initial particle set carries the parameter value to be calibrated and the normalized weight.
[0075] For example, random sampling is performed from the prior probability distribution of the parameters to be calibrated. This prior probability distribution typically adopts a Gaussian or uniform distribution, and sampling is performed independently for each parameter. The sampling is repeated N times according to a preset total number of particles N, each time obtaining a complete parameter vector, constituting the parameter part of a particle. An initial weight is assigned to each particle, and the initial weights of all particles are equal. After parameter sampling is completed, the effective component concentration observation value at the first observation time, i.e., the initial storage time or the first non-destructive detection time, is extracted from the fused observation dataset. and observed area of mold These two values are directly assigned to each particle as the initial values of its medicinal herb state variable. This means that all particles share the same medicinal herb state at the initial moment, but carry different parameters. After completing the above initialization, an initial particle set containing N particles is obtained, where each particle stores its parameter vector, current state vector, and weight value in the form of a structure.
[0076] Among them, the preset total number of particles refers to the upper limit of the total number of particles set in advance, such as an integer between 500 and 1000 based on computing resources and accuracy requirements; the Gaussian distribution, also known as the normal distribution, is one of the most important continuous probability distributions in probability theory and statistics. Its probability density function is a bell-shaped curve, symmetrical about the mean μ, and is completely determined by two parameters: the mean μ and the standard deviation σ. The mean is used to determine the location of the distribution center, and the standard deviation is used to determine the degree of dispersion of the distribution; the uniform distribution is a basic concept in probability theory and statistics, which means that when a random variable takes values in a certain finite interval, its probability density function (continuous) or probability mass function (discrete) remains constant throughout the entire range of values, that is, the probability of each possible value or each equal-length subinterval is equal; random sampling refers to the unbiased and completely random selection of a portion of the sample from a whole, so that the probability of each individual being selected is equal or known, and this portion of the sample is used to represent the whole and infer the characteristics of the whole.
[0077] Step S202: For the time interval between two adjacent observation times, obtain the continuously collected environmental temperature and humidity data sequence within the time interval.
[0078] For example, during the recursive process of performing particle filtering, a time axis needs to be maintained. Two adjacent observation times are denoted as... and ,in This refers to the time point of the last non-destructive testing. This represents the current detection time point. Timestamps located within open intervals are extracted from the fused observation dataset. All ambient temperature and humidity records within the range. Because the environmental sensors continuously collect data at a high frequency (e.g., once per minute), this range typically contains multiple sampling points, forming a time series. Each sampling point contains the ambient temperature at that moment. and relative humidity During the extraction of this sequence, the operating status of the equipment corresponding to each sampling point, such as the start-stop records of air conditioners, dehumidifiers, and ventilation fans, is also acquired to correct for abnormal fluctuations in environmental data when necessary. The length of this environmental temperature and humidity data sequence depends on the time interval between two adjacent observations and the sensor's sampling frequency. This sequence is arranged in chronological order and used as the external driving input for subsequent numerical integration. Simultaneously, the previous observation time is acquired. The particle set saved at the end, i.e., the particle set after the previous round of resampling, is prepared for further processing. arrive Status prediction. Maintenance refers to the continuous recording, updating, and organizing of a series of events in chronological order, ensuring that it remains clear, complete, and organized.
[0079] Step S203: Based on the environmental temperature and humidity data sequence, and combined with the parameter values to be calibrated for each particle and the initial state of the medicinal material, numerical integration is performed on the differential equation system of the effective component degradation kinetic model and the insect and mold growth prediction model to obtain the state prediction value of each particle at the current observation time.
[0080] Numerical integration involves dividing the integration interval into many small segments, approximating the area under the curve with a simple shape (such as a rectangle) for each segment, and summing up the areas of all the small segments to obtain an approximate result of the integration.
[0081] For example, for each particle in the initial particle set, its position at the previous observation time... The final state value of the medicinal materials, i.e., the concentration of the active ingredients. and moldy area , as the initial value for the integration of the differential equation system, and the parameters to be calibrated carried by it are used as constant coefficients in the model. Using the acquired environmental temperature and humidity data sequence as external input, the relative humidity is first... Convert to water activity Empirical formulas can usually be used. (Assuming temperature and humidity equilibrium). The following simultaneous differential equations can then be integraled forward over time using the fourth-order Runge-Kutta method: The insect and fungal growth model is as follows: The degradation model of the effective component is as follows: The integration step size is kept consistent with the sampling interval of the ambient temperature and humidity data (e.g., 1 minute) to ensure the accuracy of the external drive. Integration from... Begin, proceed to End. After integration, each particle receives its current state prediction, denoted as... and Repeat the above integration process for all N particles to obtain N state prediction values, which constitute the prediction distribution.
[0082] Among them, forward time integration refers to the process of gradually advancing the solution according to the natural evolution of time in numerical calculation or differential equation solving; the fourth-order Runge-Kutta method is a single-step numerical method for solving initial value problems of ordinary differential equations. It improves accuracy by using a weighted average of the slopes of multiple points in the interval instead of a single slope to advance the next solution. , , , , and These represent the optimal maximum specific growth rate, minimum growth temperature, optimal growth temperature, maximum growth temperature, and minimum water activity in the insect and fungal growth prediction model. , , For shape parameters; numerical solution refers to the process of calculating step by step from the initial value.
[0083] Step S204: Obtain the state observation value at the current observation time from the fused observation dataset, and calculate the Mahalanobis distance between the state prediction value and the state observation value of each particle.
[0084] For example, once the numerical integration is complete, the value of each particle at the current observation time has been obtained. State prediction vector Extracting data from the fused observation dataset and the current observation time. The corresponding true observation vector And the observation noise covariance matrix accompanying the observation. Observation noise covariance matrix It is a 2×2 symmetric positive definite matrix, where the diagonal elements are the variances of the effective component concentration observations and the moldy area observations, and the off-diagonal elements are the covariance between the two, usually assumed to be 0. For each particle i, the Mahalanobis distance between its predicted state value and the actual observed value is calculated using the following formula: .
[0085] Step S205: Based on Mahalanobis distance and Gaussian likelihood function, update the weight of each particle to obtain the updated weight, and normalize all the updated weights to obtain normalized new weights.
[0086] Normalization refers to scaling data of different magnitudes and units to the same fixed range.
[0087] For example, assuming the observation noise follows a Gaussian distribution with zero mean, the likelihood of particle i (i.e., the probability of observing the true value under these particle parameters) can be calculated using the Gaussian likelihood function. This function is expressed in exponential form using Mahalanobis distance: ,in, The Mahalanobis distance, This is the determinant of the observation noise covariance matrix. Since the constant factor in the denominator is the same for all particles, it can be omitted in actual calculations, and only the exponent part is retained for relative likelihood calculation to reduce computational complexity. The weight of each particle at the previous time step is then calculated. Multiply by the likelihood of the particle The updated weights after unnormalization are obtained: For the first update, the weights from the previous time step are the initial weights. After calculating the weights for all particles, sum all the unnormalized weights to obtain the total weights. Divide the unnormalized weight of each particle by the total weight to obtain the normalized new weights: The normalized weights satisfy... This allows the weight of each particle to be interpreted as the posterior probability mass of the particle's parameter values under given observation data.
[0088] Step S206: Summarize all particles that have obtained the new normalized weights to obtain the weighted particle set.
[0089] For example, for each particle i, the value of the parameter to be calibrated (e.g.) is carried by it. , , etc.), the state value of the medicinal materials at the current observation time (i.e. and and the newly calculated normalized weights These records are combined to form a complete particle record. These records are then organized into a set according to particle index order; this set is called the weighted particle set. In this weighted particle set, the parameter and state values of the particles remain unchanged, but the weights are used to reflect the confidence level of each particle under the current observation information.
[0090] Step S207: Perform a system resampling operation on the weighted particle set to obtain the resampled particle set, and set the resampled particle set as the posterior probability distribution of the parameter to be calibrated.
[0091] Among them, system resampling is the core operation in particle filtering / Monte Carlo method to solve particle weight degradation: for a weighted particle set, particles are uniformly and regularly selected and copied according to their weight, particles with extremely low weight are eliminated, particles with high weight are retained / copied, and finally all particles are restored to equal weight, so as to ensure that the particle set can accurately represent the target probability distribution.
[0092] For example, in the interval Generate an initial random number according to a uniform distribution. Calculate the cumulative weight sequence of particles in the weighted particle set. For the i-th particle, its cumulative weight is... And set an ordered sequence of target locations. ,in Iterate through each target location. Search for the sequence that satisfies the cumulative weight sequence Find the smallest index i, and completely copy the parameter and state values of the i-th particle in the weighted particle set into a new particle. Repeat this process N times to generate N new particles. Among these new particles, particles from high-weight regions will be copied multiple times, while particles from low-weight regions may not be copied at all. After copying, reset the weights of all new particles to the minimum index i, and copy the parameter and state values of the i-th particle in the weighted particle set into a new particle. The original weight information is discarded. The resampled particle set still statistically approximates the original posterior distribution. This resampled particle set is set as the posterior probability distribution of the parameter to be calibrated at the current observation time, and is used for the prediction step of the next observation period, i.e., the re-execution of steps S202 to S203. At the same time, the mean, covariance matrix, and other statistical quantities of this particle set can be output as the final results of parameter estimation and uncertainty quantification at the current time.
[0093] In one embodiment, such as Figure 2 As shown, based on the posterior probability distribution and combined with meteorological forecast data for a predetermined future time domain, the digital twin is driven to perform forward simulation propagation, generating a sequence of particle trajectories within the predetermined future time domain, including:
[0094] Step S301: Obtain the calibration parameter value carried by each particle and the current state value of the medicinal material corresponding to each particle from the posterior probability distribution.
[0095] For example, data is read from the resampled particle set, and for the i-th particle, its parameter vector is extracted, which includes the pre-exponential logarithm of the active ingredient degradation kinetics model. and activation energy And the optimal maximum specific growth rate in the insect and fungal growth prediction model. Minimum growth temperature Optimal growth temperature Maximum growth temperature Minimum water activity and shape parameters , , Simultaneously, extract the current time corresponding to the particle (i.e., the most recent observation time). The medicinal material's state value, including the concentration of active ingredients. and moldy area .
[0096] Step S302: Obtain the hourly environmental temperature prediction sequence and relative humidity prediction sequence from the current time to the future preset time domain.
[0097] For example, a request can be sent to a regional numerical weather prediction service via a network communication interface to obtain data from the current time. To the future preset time domain The request requests weather forecast data. Parameters include the current geographic coordinates (i.e., the latitude and longitude of the physical warehouse), the required time resolution, and the forecast duration. The weather service typically returns hourly sampled forecasts, including ambient temperature forecast sequences. and relative humidity prediction series ,in This is the future time offset starting from the current moment, with a value of [value]. (Unit: hours). After receiving the raw meteorological forecast data, check the data integrity. For missing or abnormal forecast values, linear interpolation can be used to complete them. Depending on the step size required for subsequent numerical integration, the hourly data can be optionally densified to a time resolution consistent with the sampling frequency of the temperature and humidity sensors (e.g., once per minute) through cubic spline interpolation to improve simulation accuracy. The final effective time range is from... arrive The environmental temperature prediction sequence and relative humidity prediction sequence.
[0098] Among them, network communication interface refers to the standardized set of connection points and rules on which software systems exchange data or between a system and the external environment; regional numerical weather prediction system refers to a numerical weather prediction system designed and operated for a specific geographical area (such as a province, a river basin, or a city); software system, simply put, is a whole composed of multiple programs, data, and documents that can work together to complete a specific function; linear interpolation is a mathematical method for constructing new data points between two known data points by assuming that the change between the two points is linear, that is, by connecting the two points with a straight line, and estimating the function value at any intermediate position; cubic spline interpolation refers to smoothly connecting a batch of discrete points using piecewise cubic polynomials, while maintaining second-order continuous differentiability at the connection points, resulting in a natural, smooth, and jitter-free overall curve.
[0099] Step S303: For each particle, the medicinal material state value is used as the initial value for integration, the parameter value to be calibrated is used as the model coefficient, and the environmental temperature prediction sequence and relative humidity prediction sequence are used as external drivers to perform numerical integration on the differential equation system of the effective ingredient degradation kinetic model and the insect and mold growth prediction model to obtain the particle trajectory sequence in the future preset time domain. Each particle trajectory in the particle trajectory sequence includes the effective ingredient concentration trajectory and the mold area trajectory.
[0100] For example, a forward simulation is performed independently for each acquired particle. For the i-th particle, its current medicinal state value is... and Set as the initial value for the integral of the system of differential equations. Use the environmental temperature prediction sequence. and relative humidity prediction series As an external input, relative humidity needs to be converted into water activity. The calibration parameters carried by the particle are substituted into the degradation kinetics model of the active ingredient and the insect and fungal growth prediction model to form a deterministic set of differential equations. A fourth-order Runge-Kutta method can be used, with the integration step size consistent with the temporal resolution of the meteorological forecast sequence, such as one step per hour or one step per minute after interpolation. Points to During the integration process, the effective component concentration and moldy area values are recorded at each integration time, forming two time series. After all particles have completed integration, the trajectories of all particles are combined to obtain a particle trajectory sequence containing N trajectories. Each trajectory is used to describe a possible evolution path of the medicinal material's state within a preset future time domain.
[0101] In one embodiment, a multi-objective cost function is constructed using the particle trajectory sequence as input, including the drug efficacy retention objective, mold risk penalty, and energy consumption cost. The multi-objective cost function is then solved to generate a sequence of optimal warehouse environment control strategies for a future preset time domain, including:
[0102] Step S401: Set all particle trajectories in the particle trajectory sequence as possible future scenarios, and construct a multi-objective cost function based on the future scenarios; wherein the expression of the multi-objective cost function is:
[0103]
[0104] in, For a multi-objective cost function, To obtain the expectation in all future scenarios, for The concentration of the effective ingredient at any given time This represents the initial concentration of the active ingredient. for The area of mold growth at any given time. for Energy consumption at any time , , , These are preset weighting coefficients.
[0105] For example, all N trajectories are read from the particle trajectory sequence, and each trajectory is treated as an independent future scenario. Each scenario contains future time-domain events under specific parameter values. The predicted concentration of the active ingredient and the predicted area of mold growth are calculated at each time step. A multi-objective cost function is constructed to quantitatively evaluate the merits of any candidate environmental control strategy. The cost function consists of three terms: the first term is the efficacy retention cost, which can be expressed as the normalized squared deviation of the active ingredient concentration relative to the initial value, with the penalty increasing as the concentration decreases; the second term is the mold growth risk cost, which can be expressed as an exponential function of the mold growth area to amplify the risk brought by high mold growth levels; the third term is the energy consumption cost, which can be directly expressed as the integral of the instantaneous power of the environmental control equipment over time. Each of the three terms is multiplied by a preset weighting coefficient. , , , Then sum them up and take the expected value over all future scenarios. The expected value is calculated as follows: for each time step... Calculate the arithmetic mean of the cost function values at that moment across all N scenarios. This expected value reflects the total cost expected to be incurred under the influence of parameter uncertainty when employing a certain control strategy. The preset weighting coefficients are fixed values pre-defined to represent the importance of each factor.
[0106] Step S402, set opportunity constraints. The expression for the opportunity constraints is:
[0107]
[0108] in, As an opportunity constraint, The safe threshold for moldy area. This is to pre-set a risk tolerance level.
[0109] For example, a safe threshold for moldy area is obtained based on the varietal characteristics and storage quality standards of Chinese medicinal materials. and preset risk tolerance The opportunity constraint requires that at any future time... Mold area Exceeding the safety threshold The probability must be less than or equal to the preset tolerance. Record the N future scenarios currently obtained, and the area of mold growth in each scenario. Since the time function is known, the chance constraint can be approximated as: in all N scenarios, such that... The number of established scenarios does not exceed Among these, "approximation" refers to replacing probabilistic constraints that are difficult to handle directly with deterministic constraints that are easier to solve; the varietal characteristics of Chinese medicinal materials are inherent attributes that distinguish them from other varieties; the safe threshold for moldy area refers to the maximum allowable proportion of moldy area for a particular variety of medicinal material, such as 1% or 2% of the total area. Exceeding this proportion is considered unqualified and poses a safety risk; the preset risk tolerance is a pre-set upper limit value, usually taken as 0.05 or 0.1, representing the maximum probability of violation allowed.
[0110] Step S403: Combine the multi-objective cost function and opportunity constraints to generate a deterministic nonlinear programming problem; wherein, the decision variables of the deterministic nonlinear programming problem are the sequence of environmental control actions within a future preset time domain; the sequence of environmental control actions includes the air conditioner set temperature, the dehumidifier start / stop status, and the ventilation fan speed.
[0111] For example, the multi-objective cost function and the opportunity constraints approximated by the scenario are combined to form a complete deterministic nonlinear programming problem. The decision variables are defined as future time domain variables. Internal environmental control action sequence ,in Discretized time points are used, such as one decision point per hour. Each control action is a vector that can include three components: the air conditioner set temperature, the dehumidifier's on / off status, and the ventilation fan speed. The air conditioner set temperature is a continuous variable in degrees Celsius; the dehumidifier's on / off status is a binary variable, with 0 representing off and 1 representing on; and the ventilation fan speed is a continuous variable, typically normalized to between 0 and 1. A simplified warehouse thermal and humidity environment response model needs to be established to describe the control actions. How to affect the temperature inside a warehouse and water activity The response model can be a lumped-parameter form of energy balance and humidity balance ordinary differential equations. This response model typically employs the lumped-parameter method, treating the entire warehouse as a control volume with uniform temperature and humidity. Its mathematical form is a system of first-order ordinary differential equations representing energy balance and humidity balance. For example, the energy balance equation can be written as: Similarly, the humidity balance equation can be written as: Controlling actions Appearing in different ways on the right-hand side of these equations: the air conditioner set temperature determines... The magnitude and direction of the dehumidifier; the start / stop status of the dehumidifier determines whether the dehumidification rate is non-zero; the fan speed affects the coefficient of the ventilation term. Through this model, the control action indirectly affects the environmental input in the differential equation of the medicinal herb state. By incorporating the integral term of the cost function, the constraints of the differential equation, the upper and lower bound constraints of the control variables, and the chance constraints (converted to scenario counting constraints) into the optimization problem, a nonlinear programming problem in a continuous-mixed integer space is obtained. The goal of this problem is to minimize the expected total cost while ensuring that at least In each scenario, the area of mold growth never exceeded the safety threshold.
[0112] in, The density of the air inside the warehouse; The volume of the free space inside the warehouse; It is the specific heat capacity of air at constant pressure; The instantaneous temperature of the air inside the warehouse; For time, This represents the rate of change of the internal energy of the air inside the warehouse over time. It refers to the power of heat exchange between the warehouse enclosure (walls, roof, ground) and the outdoor environment, and it is related to the indoor and outdoor temperature difference. It is directly proportional, and the proportionality coefficient depends on the heat transfer coefficient and area of the building envelope; This refers to the cooling or heating capacity of the air conditioning system for the air inside the warehouse; its magnitude and direction are determined by the temperature setting of the air conditioning system. and current indoor temperature Joint decision; It is the heat exchange power brought about by ventilation, which is determined by the fan speed. Control the ventilation volume, and make it proportional to the temperature difference between indoors and outdoors; It is the heat generated by the respiration of Chinese medicinal materials themselves, which is related to the mass, moisture content and current temperature of the pile of medicinal materials, and can usually be simplified as a function of temperature; an air conditioning system refers to a set of equipment that regulates indoor temperature, humidity and cleanliness by circulating air. The absolute humidity of the air inside the warehouse; This represents the rate of change of absolute humidity over time. The rate of change of water vapor mass within the warehouse; This refers to the dehumidification rate of the dehumidifier, determined by its on / off state. and current absolute humidity Joint decision; It is the rate of water vapor exchange brought about by ventilation, which is determined by the fan speed. Control the ventilation volume and the absolute humidity difference between indoors and outdoors. Proportional; It is the rate at which Chinese medicinal materials release moisture into the air, which depends on the moisture content of the medicinal materials, their surface temperature, and the saturation difference of the air.
[0113] Step S404: The particle swarm optimization algorithm is used to solve the deterministic nonlinear programming problem, obtain the optimal control action sequence, and determine the optimal warehouse environment control strategy sequence.
[0114] Among them, particle swarm optimization is a swarm intelligence optimization algorithm that simulates the foraging behavior of birds: a group of "particles" search for the optimal solution in the solution space. Each particle has a position and velocity. The particles will update their velocity and position by following their own historical best and the overall swarm's best, and continuously iterate until they converge to an approximate optimal solution.
[0115] For example, a population of M particles is initialized, where each particle represents a candidate sequence of control actions, i.e., a set of values for decision variables. The position vector dimension of each particle is equal to the total number of decision variables, i.e., the number of control steps multiplied by the dimension of each control action. The position and velocity of each particle are randomly initialized, and the individual optimal position and global optimal position of each particle are recorded. In each iteration, for each candidate sequence of control actions, the following operations are performed: the warehouse thermal and humidity environment response model is invoked, and the corresponding time-by-time sequence of warehouse internal temperature and water activity in the future time domain is calculated based on the control action sequence; this temperature and humidity sequence is used as a new external driver, and the forward simulation process of step S303 is invoked again, and the updated medicinal material state trajectory in each scenario is calculated based on the parameters and initial state in the existing particle trajectory sequence, thereby evaluating the cost function value and checking the satisfaction of the chance constraints; the fitness value of the candidate solution is calculated based on the cost function value (and the penalty term for constraint violation). The individual optimal position of each particle and the global optimal position of the entire population are updated based on the fitness value, and the positions of all particles are adjusted according to the particle swarm velocity update formula. When the number of iterations reaches the preset upper limit, the optimization is terminated, and the control action sequence corresponding to the globally optimal particle is output. This sequence is the optimal warehouse environment control strategy sequence.
[0116] Among them, the preset upper limit refers to the maximum number of iterations set in advance; initialization refers to the process of setting the initial state, default value or preparatory conditions for variables, objects, devices or systems when the program runs or the system starts, which is a basic step to ensure that subsequent operations can be carried out normally.
[0117] In one embodiment, a digital twin is constructed for the target warehouse of Chinese medicinal materials, and a prior probability distribution is assigned to the parameters to be calibrated in the digital twin, including:
[0118] Step S501: Obtain basic characteristic data of the Chinese medicinal materials in the target warehouse. The basic characteristic data includes the name of the medicinal material, the initial concentration of the effective ingredients, the initial moisture content, the density, the thermal conductivity, and the empirical values of the growth kinetic parameters of insects and molds.
[0119] For example, the system receives basic characteristic data of medicinal materials in the target warehouse, including at least: the name of the medicinal material, the initial concentration of active ingredients, the initial moisture content, density, thermal conductivity, and empirical values of insect and mold growth kinetic parameters, such as the minimum water activity for mold growth and the optimal growth temperature range reported in the literature. Each record is bound to a specific batch of medicinal materials and the storage location. If certain parameters cannot be obtained from the existing data source, the administrator is prompted to supplement the input. After the data is obtained, a reasonableness check is performed, such as checking whether the initial moisture content is within a reasonable range. Reasonableness check refers to checking whether the data, logic, or behavior conforms to common sense, rules, scope, and business logic, and determining whether it is reasonable and valid.
[0120] Step S502: Based on the geometric dimensions, shelf layout, and airflow organization of the physical warehouse, construct a virtual three-dimensional model in the digital space that is geometrically consistent with the physical warehouse, and associate the basic characteristic data with the corresponding medicinal material stacking position in the virtual three-dimensional model.
[0121] For example, the precise geometric dimensions of the physical warehouse are obtained, including length, width, height, and the locations of walls, doors, and windows. Simultaneously, information on the warehouse's internal shelving layout, such as the number of rows, layers, and spacing of shelves, as well as airflow organization patterns, including the location of ventilation openings, the direction of air conditioning supply, and the arrangement of exhaust fans, is acquired. Based on this data, a virtual 3D model that perfectly matches the geometry of the physical warehouse can be constructed in digital space using 3D modeling technology. This model consists of walls, floors, ceilings, shelves, and stacks of medicinal herbs, each occupying a specific coordinate area within the model. Basic characteristic data is linked to the corresponding stack locations of medicinal herbs in the virtual 3D model, ensuring that each stack carries the initial concentration of active ingredients, moisture content, density, thermal conductivity, and insect and mold growth parameters of the medicinal herbs it stores.
[0122] Among them, 3D modeling refers to the technology of digitally constructing virtual objects or scenes with three dimensions of length, width, and height in a computer; association refers to connecting or attributing an object, data, or matter to another target.
[0123] Step S503: Embed the active ingredient degradation kinetic model and the insect and mold growth prediction model into the virtual 3D model to obtain a digital twin; wherein, the active ingredient degradation kinetic model and the insect and mold growth prediction model are respectively:
[0124]
[0125]
[0126] in, The rate of change of concentration over time. Pre-exponential factor, For activation energy, Let be the ideal gas constant. For growth temperature, This refers to the concentration of the effective components in medicinal materials. The rate of change of the degree of mold growth over time. This refers to the area of mold growth on the medicinal materials. It is the lag phase. For the maximum specific growth rate, This represents the upper limit of the degree of mold growth. It is a natural constant. For time.
[0127] For example, a biochemical kinetic model describing the evolution of medicinal material quality is embedded on top of a virtual 3D model. The degradation kinetic model of the active ingredient can adopt a first-order reaction form based on the Arrhenius equation: the higher the temperature, the higher the reaction rate constant. The larger the value, the faster the concentration of the active ingredient decreases. This model requires the current temperature as input. The output concentration change rate is shown. The *Insecta* and *Moldavoteca* growth prediction model can use the modified Gompertz equation to describe the three stages of mold growth: the lag phase, the exponential phase, and the stationary phase. The model contains... For the maximum specific growth rate, The duration of the lag period, This represents the upper limit of the moldy area. This is further expressed as a function of temperature and water activity. These two models are embedded into a virtual 3D model in the form of mathematical expressions, allowing each medicinal herb stack to independently invoke the model for state deduction. After model embedding is complete, a digital twin is obtained, which can calculate the dynamic changes in the concentration of effective components and the area of mold growth in the medicinal herbs based on the input environmental parameters (temperature, water activity) and time step.
[0128] Step S504: Set prior probability distributions for the parameters to be calibrated in the active ingredient degradation kinetic model and the insect and fungus growth prediction model in the digital twin; wherein, the parameters to be calibrated include the pre-exponential logarithm in the active ingredient degradation kinetic model, the activation energy in the active ingredient degradation kinetic model, the optimal maximum specific growth rate in the insect and fungus growth prediction model, the minimum growth temperature in the insect and fungus growth prediction model, the optimal growth temperature in the insect and fungus growth prediction model, the maximum growth temperature in the insect and fungus growth prediction model, the minimum water activity in the insect and fungus growth prediction model, and the shape parameters in the insect and fungus growth prediction model.
[0129] For example, the parameter to be calibrated in the embedded model is identified. For the active ingredient degradation kinetics model, the parameter to be calibrated is the pre-exponential factor. and activation energy .because Typically, it has a large order of magnitude range, allowing for selection of... Calibration is performed to improve numerical stability. For the Inonotus thuringiensis growth prediction model, the parameters to be calibrated include the optimal maximum specific growth rate. Minimum growth temperature Optimal growth temperature Maximum growth temperature Minimum water activity and shape parameters , , A prior probability distribution is independently set for each parameter to be calibrated. The prior distribution is typically a Gaussian distribution, described by two parameters: mean and variance. The mean is based on literature reports or historical experimental data of similar medicinal materials, while the variance reflects the confidence level in this prior knowledge; the larger the variance, the weaker the prior. For parameters lacking prior information, a uniform distribution can be used as an uninformative prior. These prior probability distributions are stored in a digital twin in a parameterized form (e.g., mean and standard deviation).
[0130] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0131] Based on the same inventive concept, this application also provides an auxiliary system for generating a Chinese medicinal herb storage strategy to implement the aforementioned auxiliary generation method. The solution provided by this system is similar to the implementation described in the above method. Therefore, the specific limitations of one or more embodiments of the auxiliary system for generating a Chinese medicinal herb storage strategy provided below can be found in the limitations of the auxiliary generation method for generating a Chinese medicinal herb storage strategy described above, and will not be repeated here.
[0132] In one exemplary embodiment, such as Figure 3 As shown, a system 300 for assisting in the generation of traditional Chinese medicine storage strategies is provided, comprising:
[0133] The twin construction module 301 is used to construct a digital twin for the Chinese medicinal materials in the target warehouse and assign a prior probability distribution to the parameters to be calibrated in the digital twin; wherein, the digital twin includes an active ingredient degradation kinetic model and an insect and mold growth prediction model;
[0134] The data acquisition module 302 is used to acquire observation data of Chinese medicinal materials through periodic non-destructive testing, and to asynchronously time-align and fuse the environmental temperature and humidity data of the physical warehouse and the observation data to generate a fused observation dataset; wherein, the observation data includes the observed values of effective ingredient concentration and mold area;
[0135] The parameter update module 303 is used to perform online backpropagation update of the parameters to be calibrated based on the fused observation dataset, prior probability distribution and digital twin, using the sequential Monte Carlo particle filter algorithm to obtain the posterior probability distribution of the parameters to be calibrated.
[0136] The model prediction module 304 is used to drive the digital twin to perform forward simulation propagation based on the posterior probability distribution and combined with meteorological forecast data in the future preset time domain, so as to generate a particle trajectory sequence in the future preset time domain.
[0137] The strategy generation module 305 is used to construct a multi-objective cost function, including the drug efficacy retention target, the mold risk penalty, and the energy consumption cost, with the particle trajectory sequence as input, and solve the multi-objective cost function to generate the optimal warehouse environment control strategy sequence for the future preset time domain.
[0138] In one embodiment, the parameter update module 303 is further configured to:
[0139] Based on the prior probability distribution, an initial particle set is generated through random sampling, and the state variables of the medicinal materials are initialized with the observed data for each particle in the initial particle set to obtain the initial value of the state of the medicinal materials; wherein, each particle in the initial particle set carries the parameter value to be calibrated and the normalized weight;
[0140] For the time interval between two adjacent observation times, obtain the sequence of continuously collected environmental temperature and humidity data within the time interval;
[0141] Based on the environmental temperature and humidity data sequence, combined with the parameter values to be calibrated for each particle and the initial state of the medicinal material, the differential equations of the effective component degradation kinetic model and the insect and mold growth prediction model are numerically integrated to obtain the state prediction value of each particle at the current observation time.
[0142] Obtain the state observation value at the current observation time from the fused observation dataset, and calculate the Mahalanobis distance between the state prediction value and the state observation value for each particle;
[0143] Based on Mahalanobis distance and Gaussian likelihood function, the weight of each particle is updated to obtain the updated weight, and all updated weights are normalized to obtain normalized new weights.
[0144] By summing all the particles that have received the new normalized weights, we obtain the weighted particle set;
[0145] Perform a system resampling operation on the weighted particle set to obtain a resampled particle set, and set the resampled particle set as the posterior probability distribution of the parameter to be calibrated.
[0146] In one embodiment, the model prediction module 304 is further configured to:
[0147] From the posterior probability distribution, obtain the calibration parameter value carried by each particle and the current state value of the medicinal material corresponding to each particle;
[0148] Obtain hourly environmental temperature and relative humidity prediction sequences from the current moment to a preset future time domain;
[0149] For each particle, the initial value of the medicinal material state is used as the integration value, the model coefficient is used as the parameter to be calibrated, and the environmental temperature prediction sequence and relative humidity prediction sequence are used as external drivers. The differential equation system of the active ingredient degradation kinetic model and the insect and mold growth prediction model is numerically integrated to obtain the particle trajectory sequence in the future preset time domain. Each particle trajectory in the particle trajectory sequence includes the active ingredient concentration trajectory and the mold area trajectory.
[0150] In one embodiment, a multi-objective cost function is constructed using the particle trajectory sequence as input, including the drug efficacy retention objective, mold risk penalty, and energy consumption cost. The multi-objective cost function is then solved to generate a sequence of optimal warehouse environment control strategies for a future preset time domain, including:
[0151] All particle trajectories in the particle trajectory sequence are set as possible future scenarios, and a multi-objective cost function is constructed based on these future scenarios; the expression for the multi-objective cost function is:
[0152]
[0153] in, For a multi-objective cost function, To obtain the expectation in all future scenarios, for The concentration of the effective ingredient at any given time This represents the initial concentration of the active ingredient. for The area of mold growth at any given time. for Energy consumption at any time , , , Preset weighting coefficients;
[0154] Set opportunity constraints, the expression for which is:
[0155]
[0156] in, As an opportunity constraint, The safe threshold for moldy area. To pre-set risk tolerance;
[0157] By combining multi-objective cost functions and chance constraints, a deterministic nonlinear programming problem is generated; the decision variables of the deterministic nonlinear programming problem are the sequence of environmental control actions within a future preset time domain; the sequence of environmental control actions includes the air conditioner set temperature, the dehumidifier start / stop status, and the ventilation fan speed;
[0158] The particle swarm optimization algorithm is used to solve the deterministic nonlinear programming problem, obtain the optimal control action sequence, and determine the optimal warehouse environment control strategy sequence.
[0159] In one embodiment, the twin building module 301 is further configured to:
[0160] Obtain basic characteristic data of Chinese medicinal materials in the target warehouse. The basic characteristic data includes the name of the medicinal material, the initial concentration of active ingredients, the initial moisture content, the density, the thermal conductivity, and empirical values of insect and mold growth kinetic parameters.
[0161] Based on the geometric dimensions, shelf layout, and airflow organization of the physical warehouse, a virtual three-dimensional model with the same geometry as the physical warehouse is constructed in the digital space, and the basic characteristic data is associated with the corresponding medicinal material stacking position in the virtual three-dimensional model.
[0162] A digital twin is obtained by embedding an active ingredient degradation kinetic model and an insect and fungal growth prediction model into a virtual 3D model; wherein the active ingredient degradation kinetic model and the insect and fungal growth prediction model are respectively:
[0163]
[0164]
[0165] in, The rate of change of concentration over time. Pre-exponential factor, For activation energy, Let be the ideal gas constant. For growth temperature, This refers to the concentration of the effective components in medicinal materials. The rate of change of the degree of mold growth over time. This refers to the area of mold growth on the medicinal materials. It is the lag phase. For the maximum specific growth rate, This represents the upper limit of the degree of mold growth. It is a natural constant. For time;
[0166] Prior probability distributions are set for the parameters to be calibrated in the active ingredient degradation kinetic model and the insect and fungus growth prediction model in the digital twin. The parameters to be calibrated include the pre-exponential logarithm in the active ingredient degradation kinetic model, the activation energy in the active ingredient degradation kinetic model, the optimal maximum specific growth rate in the insect and fungus growth prediction model, the minimum growth temperature in the insect and fungus growth prediction model, the optimal growth temperature in the insect and fungus growth prediction model, the maximum growth temperature in the insect and fungus growth prediction model, the minimum water activity in the insect and fungus growth prediction model, and the shape parameters in the insect and fungus growth prediction model.
[0167] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the auxiliary generation method for a traditional Chinese medicine storage strategy as described above.
[0168] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0169] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0170] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of this application, and these modifications and improvements all fall within the protection scope of the embodiments of this application.
Claims
1. A method for assisting in the generation of a storage strategy for traditional Chinese medicinal materials, characterized in that, The method includes: For the Chinese medicinal materials in the target warehouse, a digital twin is constructed, and a prior probability distribution is assigned to the parameters to be calibrated in the digital twin; wherein, the digital twin includes an active ingredient degradation kinetic model and an insect and mold growth prediction model; The observation data of the Chinese medicinal materials are obtained through periodic non-destructive testing, and the environmental temperature and humidity data of the physical warehouse and the observation data are asynchronously time-aligned and fused to generate a fused observation dataset; wherein, the observation data includes observed values of effective ingredient concentration and observed values of moldy area; Based on the fused observation dataset, the prior probability distribution, and the digital twin, the sequential Monte Carlo particle filter algorithm is used to perform online backpropagation updates on the parameters to be calibrated, thereby obtaining the posterior probability distribution of the parameters to be calibrated. Based on the posterior probability distribution and combined with meteorological forecast data for a future preset time domain, the digital twin is driven to perform forward simulation propagation to generate a particle trajectory sequence within the future preset time domain. Using the particle trajectory sequence as input, a multi-objective cost function is constructed, including the drug efficacy retention target, the mold risk penalty, and the energy consumption cost. The multi-objective cost function is then solved to generate the optimal storage environment control strategy sequence for the future preset time domain.
2. The method according to claim 1, characterized in that, Based on the fused observation dataset, the prior probability distribution, and the digital twin, the sequential Monte Carlo particle filter algorithm is used to perform online backpropagation updates on the parameters to be calibrated, obtaining the posterior probability distribution of the parameters to be calibrated, including: Based on the prior probability distribution, an initial particle set is generated by random sampling, and the medicinal material state variable is initialized to the observed data for each particle in the initial particle set to obtain the initial value of the medicinal material state; wherein, each particle in the initial particle set carries a parameter value to be calibrated and a normalized weight; For the time interval between two adjacent observation times, obtain the sequence of continuously collected environmental temperature and humidity data within the time interval; Based on the environmental temperature and humidity data sequence, combined with the parameter value to be calibrated for each particle and the initial state value of the medicinal material, the differential equation system of the effective component degradation kinetic model and the insect and mold growth prediction model is numerically integrated to obtain the state prediction value of each particle at the current observation time. Obtain the state observation value at the current observation time from the fused observation dataset, and calculate the Mahalanobis distance between the state prediction value and the state observation value for each particle; Based on the Mahalanobis distance and Gaussian likelihood function, the weight of each particle is updated to obtain the updated weight, and all the updated weights are normalized to obtain normalized new weights. By summing all the particles that have received the new normalized weights, a weighted particle set is obtained; A system resampling operation is performed on the weighted particle set to obtain a resampled particle set, and the resampled particle set is set as the posterior probability distribution of the parameter to be calibrated.
3. The method according to claim 1, characterized in that, The step of driving the digital twin to perform forward simulation propagation based on the posterior probability distribution and combined with meteorological forecast data in the future preset time domain to generate a particle trajectory sequence in the future preset time domain includes: From the posterior probability distribution, obtain the calibration parameter value carried by each particle and the current state value of the medicinal material corresponding to each particle; Obtain hourly environmental temperature and relative humidity prediction sequences from the current moment to a future preset time domain; For each particle, the medicinal material state value is used as the initial value for integration, the parameter to be calibrated is used as the model coefficient, and the environmental temperature prediction sequence and the relative humidity prediction sequence are used as external drivers to numerically integrate the differential equation system of the active ingredient degradation kinetic model and the insect and mold growth prediction model to obtain the particle trajectory sequence in the future preset time domain. Each particle trajectory in the particle trajectory sequence includes the active ingredient concentration trajectory and the mold area trajectory.
4. The method according to claim 1, characterized in that, The process of constructing a multi-objective cost function, including the drug efficacy retention target, mold risk penalty, and energy consumption cost, using the particle trajectory sequence as input, and solving the multi-objective cost function to generate the optimal storage environment control strategy sequence for the future preset time domain, includes: All particle trajectories in the particle trajectory sequence are set as possible future scenarios, and a multi-objective cost function is constructed based on the future scenarios; wherein the expression of the multi-objective cost function is: in, For a multi-objective cost function, To obtain the expectation under all the described future scenarios, for The concentration of the effective ingredient at any given time This represents the initial concentration of the active ingredient. for The area of mold growth at any given time. for Energy consumption at any time , , , Preset weighting coefficients; Set opportunity constraints, the expressions for which are: in, As an opportunity constraint, The safe threshold for moldy area. To pre-set risk tolerance; The multi-objective cost function and the opportunity constraint are combined to generate a deterministic nonlinear programming problem; wherein, the decision variables of the deterministic nonlinear programming problem are the environmental control action sequence within the future preset time domain; the environmental control action sequence includes the air conditioner set temperature, the dehumidifier start / stop status, and the ventilation fan speed; The deterministic nonlinear programming problem is solved using the particle swarm optimization algorithm to obtain the optimal control action sequence, and the optimal control action sequence is determined as the optimal warehouse environment control strategy sequence.
5. The method according to claim 1, characterized in that, The process involves constructing a digital twin for the target warehouse of Chinese medicinal herbs and assigning a prior probability distribution to the parameters to be calibrated in the digital twin, including: Acquire basic characteristic data of Chinese medicinal materials in the target warehouse. The basic characteristic data includes the name of the medicinal material, the initial concentration of active ingredients, the initial moisture content, the density, the thermal conductivity, and empirical values of insect and mold growth kinetic parameters. Based on the geometric dimensions, shelf layout, and airflow organization of the physical warehouse, a virtual three-dimensional model with the same geometry as the physical warehouse is constructed in the digital space, and the basic characteristic data is associated with the corresponding medicinal material stacking position in the virtual three-dimensional model. A digital twin is obtained by embedding an active ingredient degradation kinetic model and an insect and fungal growth prediction model into the virtual 3D model; wherein the active ingredient degradation kinetic model and the insect and fungal growth prediction model are respectively: in, The rate of change of concentration over time. Pre-exponential factor, For activation energy, Let be the ideal gas constant. For growth temperature, This refers to the concentration of the effective components in medicinal materials. The rate of change of the degree of mold growth over time. This refers to the area of mold growth on the medicinal materials. It is the lag phase. For the maximum specific growth rate, This represents the upper limit of the degree of mold growth. It is a natural constant. For time; The prior probability distribution is set for the parameters to be calibrated in the active ingredient degradation kinetic model and the insect and fungus growth prediction model in the digital twin; wherein the parameters to be calibrated include the pre-exponential logarithm of the active ingredient degradation kinetic model, the activation energy of the active ingredient degradation kinetic model, the optimal maximum specific growth rate of the insect and fungus growth prediction model, the minimum growth temperature of the insect and fungus growth prediction model, the optimal growth temperature of the insect and fungus growth prediction model, the maximum growth temperature of the insect and fungus growth prediction model, the minimum water activity of the insect and fungus growth prediction model, and the shape parameter of the insect and fungus growth prediction model.
6. An auxiliary generation system for traditional Chinese medicine storage strategies, characterized in that, The system includes: A digital twin construction module is used to construct digital twins for Chinese medicinal materials in a target warehouse and assign prior probability distributions to the parameters to be calibrated in the digital twins; wherein, the digital twins include an active ingredient degradation kinetic model and an insect and mold growth prediction model; The data acquisition module is used to acquire observation data of the Chinese medicinal materials through periodic non-destructive testing, and to asynchronously time-align and fuse the environmental temperature and humidity data of the physical warehouse with the observation data to generate a fused observation dataset; wherein, the observation data includes observed values of effective ingredient concentration and observed values of moldy area; The parameter update module is used to update the parameters to be calibrated online by using the sequential Monte Carlo particle filter algorithm based on the fused observation dataset, the prior probability distribution and the digital twin, so as to obtain the posterior probability distribution of the parameters to be calibrated. The model prediction module is used to drive the digital twin to perform forward simulation propagation based on the posterior probability distribution and combined with meteorological forecast data in the future preset time domain, so as to generate a particle trajectory sequence in the future preset time domain. The strategy generation module is used to construct a multi-objective cost function, including the drug efficacy retention target, mold risk penalty and energy consumption cost, using the particle trajectory sequence as input, and solve the multi-objective cost function to generate the optimal storage environment control strategy sequence for the future preset time domain.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.