A control system and method for dispensing Chinese medicine pieces
By collecting and analyzing the weighing and environmental data during the adjustment of Chinese herbal medicines, dynamically adjusting the environmental compensation factor, the problem of dose inaccuracy caused by hygroscopicity and volatility during the weighing of Chinese herbal medicines is solved, and the dose is high accuracy of the dose is achieved and stability improves the quality of Chinese herbal medicines and the safety of patients' medication.
Patent Information
- Application Number
- CN202411170611.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2044-08-26
AI Technical Summary
During the adjustment of Chinese herbal medicines, because some Chinese herbal medicines are hygroscopic or volatile, the air humidity or volatility during the weighing process leads to changes in the weight of the medicinal material, which affects the dosage and efficacy of the drug, may lead to insufficient or excessive doses, and may even cause adverse reactions or Poisoning.
By collecting weighing data and environmental data, the weighing deviation characteristics and air humidity fluctuation characteristics are extracted, the data prediction model is constructed, the accuracy of weighing results is predicted, and the environmental compensation factor is dynamically adjusted according to the hygroscopicity and volatile data in the medicinal material database. , correct weighing results to ensure dose accuracy.
It improves the response ability of environmental changes during weighing, reduces weighing errors caused by humidity and temperature changes, ensures the accuracy and stability of the dose of Chinese herbal tablets, and improves the quality of the drug and the safety and efficacy of the patient's medication.
Smart Images

Figure CN118692624B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Chinese medicine slice dispensing, and in particular to a Chinese medicine slice dispensing control system and method. Background Art
[0002] In the Chinese medicine dispensing area, the dispensing control of Chinese medicine pieces is carried out by strictly following the standardized operating procedures (SOP), using precision weighing equipment, double-checking key steps, regularly calibrating equipment, and recording each operation link in detail. However, when using precision electronic weighing equipment to weigh each Chinese medicine piece according to the dosage in the prescription, since some Chinese medicine pieces are hygroscopic or volatile, the weight of the medicinal materials may change due to air humidity or volatilization during the weighing process. Changes in the weight of medicinal materials will lead to inaccurate weighing results and affect the dosage and efficacy of the medicine. For example, if the medicinal material absorbs moisture and increases in weight, the actual effective ingredients will decrease, resulting in insufficient dosage and poor treatment effect. If the medicinal material evaporates and loses weight, the actual effective ingredients will increase, resulting in excessive dosage, which may cause adverse reactions or poisoning. Summary of the invention
[0003] The object of the present invention is to provide a Chinese herbal medicine dispensing control system and method to solve the deficiencies in the background technology.
[0004] In order to achieve the above object, the present invention provides the following technical solution: a method for controlling the dispensing of Chinese herbal medicine slices, comprising the following steps:
[0005] S1: Collect the weighing data of the weighing equipment during the weighing process of Chinese herbal medicine pieces and the environmental data monitored by the environmental monitoring equipment in the Chinese herbal medicine dispensing area;
[0006] S2: preprocessing the collected weighing data and environmental data, performing feature extraction on the preprocessed weighing data and environmental data, respectively extracting weighing deviation features in the weighing data and air humidity fluctuation features in the environmental data;
[0007] S3: Construct a data prediction model to predict the accuracy of the weighing results of Chinese herbal medicine pieces based on the weighing deviation characteristics in the weighing data and the air humidity fluctuation characteristics in the environmental data;
[0008] S4: Determine the environmental compensation factor of the weighing equipment through the data charts of the hygroscopicity and volatility of the medicinal materials in the medicinal materials database, and dynamically adjust the environmental compensation factor according to the accuracy of the weighing results of the Chinese herbal medicines;
[0009] S5: Correct the weighing results of the Chinese herbal medicines according to the adjusted environmental compensation factors, analyze the errors of the corrected weighing results of the Chinese herbal medicines, and adjust the dosage of the Chinese herbal medicines according to the analysis results.
[0010] Preferably, in S2, a weighing deviation index is generated according to the weighing deviation characteristics in the weighing data, and the weighing deviation index is obtained by:
[0011] Obtain the real-time weighing data of the weighing equipment within the s time period and establish a weighing data set , where i=1, 2, 3, ..., n, and n is a positive integer greater than 0. Determine the smoothing coefficient α, set the initial smoothing value, and select the value of the first data point as the initial smoothing value. For each time point i, calculate the smoothing value through a recursive expression, which is: ; In the formula, is the smoothed value at time point i, is the actual weighing value at time point i. After calculating the smoothed values of all time points, the absolute deviation of each time point is calculated by comparing the actual value and the smoothed value, and the weighing deviation index is calculated after averaging. The specific calculation expression is: ; In the formula, is the weighing deviation index.
[0012] Preferably, in S2, an air humidity fluctuation index is generated according to the air humidity fluctuation characteristics in the environmental data, and the method for obtaining the air humidity fluctuation index is:
[0013] The air humidity data in the s time period is obtained in real time through the air humidity sensor installed in the Chinese medicine dispensing area, the humidity data is standardized, and the fast Fourier transform is applied to the standardized humidity data to obtain the frequency domain representation, and the amplitude of different frequency components is calculated. The expression is: ;in, is the amplitude of the frequency component, is the original air humidity data at time point s, N is the total number of signal sample points, It is the kernel function of Fourier transform, which identifies the frequency fmax with the largest amplitude. The amplitude A(fmax) corresponding to this frequency represents the maximum frequency component. The air humidity fluctuation index is calculated by the amplitude and energy of the maximum frequency component. The specific calculation expression is: ; In the formula, It is the air humidity fluctuation index.
[0014] Preferably, in S3, the accuracy of the weighing results of the Chinese herbal medicines is predicted, specifically by normalizing the weighing deviation index and the air humidity fluctuation index, and calculating the accuracy coefficient of the weighing results of the Chinese herbal medicines by the normalized weighing deviation index and the air humidity fluctuation index.
[0015] Preferably, the accuracy coefficient of the obtained Chinese herbal medicine weighing result is compared with a preset accuracy coefficient reference threshold. If the accuracy coefficient of the Chinese herbal medicine weighing result is greater than or equal to the preset accuracy coefficient reference threshold, the accuracy of the Chinese herbal medicine weighing result is high, and its weighing result is marked as an accuracy result, and an accurate weighing signal is generated at this time; if the accuracy coefficient of the Chinese herbal medicine weighing result is less than the preset accuracy coefficient reference threshold, the accuracy of the Chinese herbal medicine weighing result is low, and its weighing result is marked as an inaccuracy result, and an inaccurate weighing signal is generated at this time.
[0016] Preferably, in S4, the environmental compensation factor of the weighing equipment is determined through the data chart of the hygroscopicity and volatility of the medicinal materials in the medicinal materials database, and the environmental compensation factor is dynamically adjusted according to the accuracy of the weighing result of the Chinese herbal medicine slices, specifically:
[0017] Collect the hygroscopicity and volatility data of various Chinese herbal medicines, collect the temperature and humidity data of the environment during the weighing process in real time, query the hygroscopicity and volatility data of the corresponding medicinal materials in the database according to the Chinese herbal medicines to be weighed, determine the weight change data of the medicinal materials under the reference humidity and temperature conditions, calculate the difference between the actual environmental conditions and the reference environmental conditions, and according to the hygroscopicity data of the medicinal materials, add up the effects of humidity and temperature on the weight, and determine the environmental compensation factor. The calculation formula of the compensation factor is: ; Where F is the environmental compensation factor, Hdiff is the humidity difference, Hrate is the hygroscopicity percentage, Tdiff is the temperature difference, and Trate is the volatility percentage;
[0018] Dynamically adjust the environmental compensation factor according to the accuracy of the weighing result of the Chinese herbal medicine slices, and adjust the environmental compensation factor when the accuracy coefficient of the weighing result of the Chinese herbal medicine slices is less than a preset accuracy coefficient reference threshold;
[0019] The compensation factor is adjusted according to the deviation of the accuracy coefficient. The adjustment formula is: Fnew=Fold×(1+y×(Aref−NK) / Aref); where Fnew is the adjusted environmental compensation factor, Fold is the original environmental compensation factor, and Aref is the reference threshold of the accuracy coefficient. is the current accuracy coefficient, and y is the adjustment scale coefficient.
[0020] Preferably, in S5, the weighing result of the Chinese herbal medicine slices is corrected according to the adjusted environmental compensation factor, the error of the corrected weighing result of the Chinese herbal medicine slices is analyzed, and the dosage of the Chinese herbal medicine slices is regulated according to the analysis result, specifically:
[0021] Use the dynamically adjusted environmental compensation factor to correct the weighing data. The correction formula is: Wcorrected = Wmeasured × Fnew; where Wcorrected is the weighing data after correction, and Wmeasured is the weighing data before correction.
[0022] Set the target dose as Dtarget and the corrected weighing result as Wcorrected, then the error calculation formula is: E=Wcorrected−Dtarget; where E is the weighing error;
[0023] Analyze the size and direction of the error and compare the absolute value of the error with the allowable error range: ≤ΔDallowed, no adjustment is required; if >ΔDallowed, adjustment is required, where ΔDallowed is the allowable error range.
[0024] Preferably, the dosage is adjusted according to the size and direction of the error, specifically:
[0025] If the corrected weight is greater than the target dose, a positive error adjustment is made, and the adjustment expression is: Dadjusted = Dtarget − E = Dtarget − (Wcorrected − Dtarget) = 2Dtarget − Wcorrected; where Dadjusted is the adjusted target dose;
[0026] If the corrected weight is less than the target dose, a negative error adjustment is made, and the adjustment expression is: Dadjusted = Dtarget − E = Dtarget − (Wcorrected − Dtarget) = 2Dtarget − Wcorrected;
[0027] The adjusted dose calculation formula is consistent: Dadjusted=2Dtarget−Wcorrected.
[0028] The present invention also provides a Chinese medicine slice dispensing control system, comprising a data acquisition module, a feature extraction module, an accuracy prediction module, an environmental compensation factor adjustment module and a dosage control module;
[0029] Data acquisition module: collects the weighing data of the weighing equipment during the weighing process of Chinese herbal medicine pieces and the environmental data monitored by the environmental monitoring equipment in the Chinese herbal medicine dispensing area;
[0030] Feature extraction module: preprocess the collected weighing data and environmental data, perform feature extraction on the preprocessed weighing data and environmental data, and respectively extract the weighing deviation features in the weighing data and the air humidity fluctuation features in the environmental data;
[0031] Accuracy prediction module: Build a data prediction model to predict the accuracy of the weighing results of Chinese herbal medicine pieces based on the weighing deviation characteristics in the weighing data and the air humidity fluctuation characteristics in the environmental data;
[0032] Environmental compensation factor adjustment module: Determine the environmental compensation factor of the weighing equipment through the hygroscopicity and volatility data charts of the medicinal materials in the medicinal materials database, and dynamically adjust the environmental compensation factor according to the accuracy of the weighing results of the Chinese herbal medicines;
[0033] Dosage control module: correct the weighing results of Chinese herbal medicines according to the adjusted environmental compensation factor, analyze the errors of the corrected weighing results of Chinese herbal medicines, and control the dosage of Chinese herbal medicines according to the analysis results.
[0034] In the above technical solution, the technical effects and advantages provided by the present invention are:
[0035] 1. The present invention can accurately predict the accuracy of weighing results by real-time collection and preprocessing of weighing data and environmental data, extracting key features, and constructing a data prediction model. The environmental compensation factor is determined by the hygroscopicity and volatility data in the medicinal material database, and the weighing results are corrected and error analyzed in combination with a dynamic adjustment mechanism, and the dosage is regulated according to the analysis results, thereby ensuring the dosage accuracy and stability of Chinese herbal medicine slices.
[0036] 2. The present invention not only improves the responsiveness to environmental changes during the weighing process, but also ensures that the weighing results of medicinal materials always maintain high accuracy. Through a systematic monitoring and adjustment mechanism, the weighing error caused by humidity and temperature changes is effectively reduced, the risk of insufficient or excessive efficacy is avoided, and ultimately the quality of Chinese herbal medicines and the safety and efficacy of patients' medication are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0038] Figure 1 The figure is a flow chart of the method of the present invention.
[0039] Figure 2 It is a system module diagram of the present invention. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] Example 1, please refer to Figure 1 As shown, a Chinese medicine slice dispensing control method described in this embodiment comprises the following steps:
[0042] S1: Collect the weighing data of the weighing equipment during the weighing process of Chinese herbal medicine pieces and the environmental data monitored by the environmental monitoring equipment in the Chinese herbal medicine dispensing area;
[0043] S2: preprocessing the collected weighing data and environmental data, performing feature extraction on the preprocessed weighing data and environmental data, respectively extracting weighing deviation features in the weighing data and air humidity fluctuation features in the environmental data;
[0044] S3: Construct a data prediction model to predict the accuracy of the weighing results of Chinese herbal medicine pieces based on the weighing deviation characteristics in the weighing data and the air humidity fluctuation characteristics in the environmental data;
[0045] S4: Determine the environmental compensation factor of the weighing equipment through the data charts of the hygroscopicity and volatility of the medicinal materials in the medicinal materials database, and dynamically adjust the environmental compensation factor according to the accuracy of the weighing results of the Chinese herbal medicines;
[0046] S5: Correct the weighing results of the Chinese herbal medicines according to the adjusted environmental compensation factors, analyze the errors of the corrected weighing results of the Chinese herbal medicines, and adjust the dosage of the Chinese herbal medicines according to the analysis results.
[0047] Among them, in S1, the weighing data of the weighing equipment in the weighing process of Chinese herbal medicine pieces and the environmental data monitored by the environmental monitoring equipment in the Chinese herbal medicine dispensing area are collected, specifically:
[0048] Connect the weighing equipment and environmental monitoring equipment to the data acquisition system via data cables or wireless connections (such as Bluetooth, Wi-Fi). Confirm that the equipment can work properly and output data.
[0049] Write a data acquisition script to obtain weighing data and environmental data from the device at regular intervals (e.g. once per second) and record the timestamp. Store the data in a local file or database for subsequent processing.
[0050] Weighing equipment includes electronic balances, which are used to accurately weigh the weight of Chinese herbal medicine pieces, usually with high precision (such as 0.01 grams or higher).
[0051] Model selection: For example, precision electronic balances from brands such as Mettler Toledo and Sartorius. These devices usually have built-in digital interfaces (such as USB, RS232) to facilitate data transmission.
[0052] Data Interface: Choose a balance with a digital interface to transfer weighing data in real time to a computer or data acquisition system.
[0053] Environmental monitoring equipment includes temperature and humidity sensors, which are used to monitor the air temperature and humidity in the Chinese medicine preparation area. These data have a direct impact on the weighing results.
[0054] Model selection: For example, high-precision temperature and humidity sensors such as DHT22 and SHT31. These sensors can provide accurate temperature and humidity data and have digital interfaces for connecting to computers.
[0055] Data interface: Select sensors with digital output capabilities (such as I2C, SPI, or serial interfaces) to facilitate integration with data acquisition systems.
[0056] Using a comprehensive environmental monitoring system, multiple environmental parameters such as temperature, humidity, air pressure, etc. can be monitored simultaneously to ensure comprehensive control of the conditioning environment.
[0057] Model selection: You can choose an environmental monitoring system that meets pharmaceutical industry standards, such as Thermo Fisher's Smart-Vue system.
[0058] Connection of weighing equipment: Connect the electronic balance to the computer or data acquisition system via USB cable, RS232 serial cable or other compatible data transmission cable. Ensure that the connection is stable and the equipment can transmit weighing data normally.
[0059] Equipment initialization: Turn on the electronic balance and perform necessary self-tests and calibrations to ensure that the equipment works in the best condition.
[0060] Connection of environmental monitoring equipment: Connect the temperature and humidity sensor to a microcontroller (such as Arduino, Raspberry Pi) or computer through its digital interface (such as I2C, SPI, UART, etc.). If an environmental monitoring system is used, connect it directly to the data acquisition network through the system's communication interface (such as Ethernet, RS485).
[0061] Equipment initialization: Turn on the sensor or environmental monitoring system, perform self-test and calibration to ensure the accuracy of monitoring data.
[0062] Connect the weighing equipment and environmental monitoring equipment to the data acquisition system via data cables or wireless connections (such as Bluetooth, Wi-Fi). Confirm that the equipment can work properly and output data.
[0063] Write a data acquisition script to obtain weighing data and environmental data from the device at regular intervals (e.g. once per second) and record the timestamp. Store the data in a local file or database for subsequent processing.
[0064] Use a data cable to connect environmental monitoring devices such as thermometers and hygrometers to a computer or data acquisition system. If the environmental monitoring device supports wireless connection, set up the wireless connection according to the device manual. Confirm that the connection is successful and ensure that the computer can recognize and communicate with the environmental monitoring device. Perform initialization operations according to the device manual, including self-test, zero point calibration, etc. Ensure that the weighing equipment is in normal working condition and can output weighing data stably and accurately. Turn on the thermometer and hygrometer and perform initialization operations according to the device manual, including self-test, calibration, etc. Ensure that the environmental monitoring equipment is in normal working condition and can output temperature and humidity data stably and accurately. Use a programming language (such as Python) to write a data acquisition script to obtain data from the weighing equipment and environmental monitoring equipment at a regular interval. Set the frequency of data acquisition as required, for example, collect data once per second.
[0065] Get weighing data from the weighing device and record the timestamp. Get temperature and humidity data from the environmental monitoring device and record the timestamp. Store the collected data in variables or data structures for subsequent processing and analysis.
[0066] Choose the appropriate data storage method based on your needs, such as saving data to a local file (such as CSV or JSON format) or storing it in a database (such as SQLite or MySQL). Add data storage logic to the data collection script to save the collected data to the specified location according to the set format. Append the collected data to a CSV file each time. Insert the data into the corresponding table in the database.
[0067] S2: preprocessing the collected weighing data and environmental data, performing feature extraction on the preprocessed weighing data and environmental data, and respectively extracting weighing data deviation features in the weighing data and air humidity fluctuation features in the environmental data.
[0068] The collected data are subjected to outlier detection, missing value filling, data smoothing (such as moving average) and normalization to ensure data quality and consistency.
[0069] Preprocess the collected weighing data and environmental data, check the range of weighing data, such as weighing data should usually be between 0-100 grams, and data outside this range is considered an outlier. Use statistical methods to identify outliers, such as calculating the mean and standard deviation of the data, and removing outliers that exceed 3 times the standard deviation. If there are missing values in the weighing data or environmental data, use linear interpolation to fill in the missing values. For example, if data is missing at a certain time point, interpolation can be performed based on the data at the previous and next time points.
[0070] Time alignment ensures that the timestamps of weighing data and environmental data are consistent. Weighing data and environmental data are sorted by timestamp and the data is time aligned to ensure that each weighing data point has a corresponding temperature and humidity data point.
[0071] Perform moving average processing on the weighing data. For example, set a window size (such as 5 data points) and calculate the moving average of each data point to reduce short-term fluctuations. Use a low-pass filter to smooth the data and remove high-frequency noise in the data to make the data smoother and more continuous.
[0072] Normalization is to normalize the weight data and environmental data. For example, the data is scaled to between 0 and 1, or the mean of the data is 0 and the standard deviation is 1, so that the data of different features are on the same order of magnitude.
[0073] Weighing deviation features (such as weighing deviation index) are extracted from weighing data, and air humidity fluctuation features (such as air humidity fluctuation index) are extracted from environmental data. These features are the core inputs of subsequent data prediction models.
[0074] The weighing deviation characteristics in the weighing data and the air humidity fluctuation characteristics in the environmental data are extracted respectively, and the weighing deviation index is generated according to the weighing deviation characteristics in the weighing data. The method for obtaining the weighing deviation index is:
[0075] Obtain the real-time weighing data of the weighing equipment within the s time period and establish a weighing data set , where i=1, 2, 3, ..., n, and n is a positive integer greater than 0. Determine the smoothing coefficient α. The larger the smoothing coefficient, the higher the weight of the latest data point; the smaller the smoothing coefficient, the higher the weight of the historical data point. Set the initial smoothing value and select the value of the first data point as the initial smoothing value;
[0076] For each time point i, the smoothed value is calculated by the recursive expression, which is: ; In the formula, is the smoothed value at time point i, is the actual weighing value at time point i. After calculating the smoothed values of all time points, the absolute deviation of each time point is calculated by comparing the actual value and the smoothed value, and the weighing deviation index is calculated after averaging. The specific calculation expression is: ; In the formula, is the weighing deviation index.
[0077] When the weighing deviation index is large, it means that there is a large fluctuation and uncertainty in the weighing data. The large deviation between the actual weighing result and the expected value may be caused by factors such as environmental changes (such as humidity and temperature changes) or equipment failure. In this case, the reliability of the weighing data is questioned, which may lead to inaccurate dosage of Chinese herbal medicines and affect the treatment effect and safety of patients.
[0078] Among them, the air humidity fluctuation index is generated according to the air humidity fluctuation characteristics in the environmental data, and the method for obtaining the air humidity fluctuation index is:
[0079] The air humidity data in the s time period is obtained in real time through the air humidity sensor installed in the Chinese medicine dispensing area, the humidity data is standardized, and the fast Fourier transform is applied to the standardized humidity data to obtain the frequency domain representation, and the amplitude of different frequency components is calculated. The expression is: ;in, is the amplitude of the frequency component, is the original air humidity data at time point s, N is the total number of signal sample points, It is the kernel function of Fourier transform, which identifies the frequency fmax with the largest amplitude. The amplitude A(fmax) corresponding to this frequency represents the maximum frequency component. The air humidity fluctuation index is calculated by the amplitude and energy of the maximum frequency component. The specific calculation expression is: ; In the formula, It is the air humidity fluctuation index.
[0080] The air humidity fluctuation index is an indicator to measure the degree of fluctuation of air humidity in the environment. The larger the air humidity fluctuation index, the more drastic the change in air humidity in the environment, which will have a negative impact on the accuracy of the weighing results of Chinese herbal medicines. When the air humidity fluctuation index is large, it means that the humidity of the weighing environment changes greatly, causing the Chinese herbal medicines to absorb or lose water during the weighing process. This humidity change will directly affect the weight of the medicinal materials, resulting in instability and increased errors in the weighing results, which in turn affects the accurate dosage of the Chinese herbal medicines. The increase in the deviation of the weighing results may lead to unstable efficacy and affect the treatment effect of patients.
[0081] S3: Construct a data prediction model to predict the accuracy of the weighing results of Chinese herbal medicines based on the weighing deviation characteristics in the weighing data and the air humidity fluctuation characteristics in the environmental data.
[0082] The weighing deviation index and air humidity fluctuation index were normalized, and the accuracy coefficient of the weighing results of Chinese herbal medicine pieces was calculated based on the normalized weighing deviation index and air humidity fluctuation index.
[0083] A data prediction model is constructed to predict the accuracy of the weighing results of Chinese herbal medicine pieces. The calculation expression of the data prediction model in the present invention is: ; In the formula, is the accuracy coefficient of the weighing results of Chinese herbal medicine pieces, is the weighing deviation index, is the air humidity fluctuation index, is the proportionality coefficient of the weighing deviation index and the air humidity fluctuation index, and .
[0084] The accuracy coefficient of the obtained Chinese herbal medicine weighing result is compared with the preset accuracy coefficient reference threshold. If the accuracy coefficient of the Chinese herbal medicine weighing result is greater than or equal to the preset accuracy coefficient reference threshold, it means that the accuracy of the Chinese herbal medicine weighing result is high, and its weighing result is marked as an accuracy result, and an accurate weighing signal is generated at this time; if the accuracy coefficient of the Chinese herbal medicine weighing result is less than the preset accuracy coefficient reference threshold, it means that the accuracy of the Chinese herbal medicine weighing result is low, and its weighing result is marked as an inaccuracy result, and an inaccurate weighing signal is generated at this time.
[0085] In this application, by constructing a data prediction model, the accuracy coefficient of the weighing result of Chinese herbal medicine slices is calculated using the normalized weighing deviation index and air humidity fluctuation index, and compared with the preset accuracy reference threshold, the accuracy of the weighing result can be effectively judged. Environmental changes and equipment errors in the weighing process of Chinese herbal medicine slices can be monitored and evaluated in real time to improve the reliability and stability of the weighing results. When the accuracy coefficient reaches or exceeds the threshold, a weighing accuracy signal is generated to ensure the accuracy of the drug dosage; when the accuracy coefficient is lower than the threshold, an inaccurate weighing signal is generated to remind the operator to take measures to correct it. This systematic monitoring and adjustment mechanism helps to ensure the quality of Chinese herbal medicine slices and the safety of patients' medication.
[0086] S4: Determine the environmental compensation factor of the weighing equipment through the hygroscopicity and volatility data charts of the medicinal materials in the medicinal materials database, and dynamically adjust the environmental compensation factor according to the accuracy of the weighing results of the Chinese herbal medicines.
[0087] Collect hygroscopic and volatile data for various Chinese herbal medicines. This data can come from literature, experimental studies, and historical records. The data includes the percentage change in weight of each herbal medicine under different humidity and temperature conditions. Create a database containing information such as herbal medicine name, hygroscopic data, volatility data, reference temperature and humidity conditions, etc.
[0088] Real-time monitoring: Through environmental monitoring equipment, the temperature and humidity data of the environment during the weighing process are collected in real time to ensure the accuracy and timeliness of environmental data.
[0089] According to the Chinese herbal medicine to be weighed, query the hygroscopicity and volatility data of the corresponding medicinal material in the database, and determine the weight change data of the medicinal material under the reference humidity and temperature conditions.
[0090] Calculate the difference between the actual ambient conditions and the reference ambient conditions. For example, if the actual humidity is 65% and the reference humidity is 60%, the humidity difference is 5%.
[0091] Based on the hygroscopicity data of the medicinal material, calculate the effect of humidity difference on weight. If the hygroscopicity of a certain medicinal material at the reference humidity is 5%, and the actual humidity is 5% higher than the reference humidity, then the effect of humidity on weight is 5. Similarly, based on the volatility data of the medicinal material, calculate the effect of temperature difference on weight.
[0092] The effects of humidity and temperature on weight are accumulated to determine the environmental compensation factor. The calculation formula for the compensation factor is: ; Where F is the environmental compensation factor, Hdiff is the humidity difference, Hrate is the hygroscopicity percentage, Tdiff is the temperature difference, and Trate is the volatility percentage.
[0093] Hdiff represents the difference between the actual ambient humidity and the reference humidity. The calculation formula is: Hdiff = Hact − Href; where Hact is the humidity value in the actual environment and Href is the humidity value under standard or reference conditions.
[0094] Hrate represents the hygroscopicity of Chinese herbal medicines under different humidity conditions. It is usually determined through experiments and indicates the percentage of weight increase of Chinese herbal medicines for every 1% increase in humidity.
[0095] Tdiff represents the difference between the actual ambient temperature and the reference temperature. The calculation formula is: Tdiff = Tact − Tref; where Tact is the temperature value in the actual environment and Tref is the temperature value under standard or reference conditions.
[0096] Trate indicates the volatility of Chinese herbal medicines under different temperature conditions. It indicates the percentage of weight reduction of Chinese herbal medicines for every 1°C increase in temperature.
[0097] The environmental compensation factor is dynamically adjusted according to the accuracy of the weighing results of Chinese herbal medicines. When the accuracy coefficient of the weighing results of Chinese herbal medicines is less than the preset accuracy coefficient reference threshold, it means that the accuracy of the weighing results of Chinese herbal medicines is low and the environmental compensation factor needs to be adjusted to ensure the accuracy and stability of the weighing results.
[0098] The compensation factor is adjusted according to the deviation of the accuracy coefficient. The adjustment formula is: Fnew=Fold×(1+y×(Aref−NK) / Aref); where Fnew is the adjusted environmental compensation factor, Fold is the original environmental compensation factor, and Aref is the reference threshold of the accuracy coefficient. Aref is a reference value of the accuracy coefficient obtained by actual measurement under standard or ideal conditions. This value is usually the mean or median obtained through repeated measurements during multiple experiments. For example: Aref=0.95 means that under standard environmental conditions, the accuracy of weighing Chinese herbal medicine slices reaches 95%. is the current accuracy coefficient, and y is the adjustment scale factor (usually a positive value less than 1). The sensitivity of the compensation factor under different environmental conditions is determined through experiments. You can adjust different y values through multiple experiments, record the error after each adjustment, and select the y value corresponding to the minimum error as the final parameter.
[0099] Typical range: Generally, y is a positive value less than 1, and may range from 0.01 to 0.1. This range can be selected based on experimental data or industry standards. In patent documents, a reasonable range may be disclosed, for example: y = 0.05 to 0.1.
[0100] S5: Correct the weighing results of the Chinese herbal medicines according to the adjusted environmental compensation factors, analyze the errors of the corrected weighing results of the Chinese herbal medicines, and adjust the dosage of the Chinese herbal medicines according to the analysis results.
[0101] Use the dynamically adjusted environmental compensation factor to correct the weighing data. Correction formula: Wcorrected = Wmeasured × Fnew; where Wcorrected is the weighing data after correction and Wmeasured is the weighing data before correction.
[0102] Calculate the error between the corrected weighing result and the target dose. Evaluate the size of the error and determine whether dose adjustment is needed based on the size and direction of the error.
[0103] According to the error results, the dosage of Chinese herbal medicines is adjusted to ensure that the final dosage is within the allowable error range.
[0104] Set the target dose as Dtarget and the corrected weighing result as Wcorrected, then the error calculation formula is: E=Wcorrected−Dtarget; where E is the weighing error.
[0105] Analyze the size and direction of the error and compare the absolute value of the error with the allowable error range: ≤ΔDallowed, no adjustment is required; if >ΔDallowed, adjustment is required, where ΔDallowed is the allowable error range.
[0106] Adjust the dosage according to the size and direction of the error, specifically:
[0107] If the corrected weight is greater than the target dose, a positive error adjustment is made, and the adjustment expression is: Dadjusted = Dtarget − E = Dtarget − (Wcorrected − Dtarget) = 2Dtarget − Wcorrected; where Dadjusted is the adjusted target dose;
[0108] If the corrected weight is less than the target dose, a negative error adjustment is made, and the adjustment expression is: Dadjusted = Dtarget − E = Dtarget − (Wcorrected − Dtarget) = 2Dtarget − Wcorrected;
[0109] The adjusted dose calculation formula is consistent: Dadjusted=2Dtarget−Wcorrected.
[0110] In this application, the weighing results of Chinese herbal medicines are corrected by dynamically adjusted environmental compensation factors, and the errors of the correction results are analyzed and the dosage is regulated, so as to ensure the high accuracy of the weighing results. By using the compensation factor to correct the weighing data, the corrected weighing error is calculated and analyzed, and the dosage of the Chinese herbal medicines is adjusted according to the size and direction of the error to make it within the allowable error range. The advantage of doing so is that the weighing error caused by environmental changes is significantly reduced, the accuracy and stability of the drug dosage are ensured, and the quality of the Chinese herbal medicines and the safety of the patient's medication are ultimately improved.
[0111] In this embodiment, by collecting, preprocessing and extracting features of the weighing data of the weighing equipment and the environmental data of the environmental monitoring equipment during the weighing process of Chinese herbal medicines, a data prediction model based on the weighing deviation characteristics and the air humidity fluctuation characteristics is constructed to accurately predict the accuracy of the weighing results. The hygroscopicity and volatility data charts in the medicinal material database are used to determine and dynamically adjust the environmental compensation factor, correct the weighing results, and analyze the corrected errors for dosage regulation. This systematic and dynamic adjustment method greatly improves the accuracy and stability of the weighing results, ensures the accuracy of the medicinal material dosage, and ultimately guarantees the safety and efficacy of the patient's medication.
[0112] Example 2, please refer to Figure 2As shown, a Chinese medicine slice dispensing control system described in this embodiment includes a data acquisition module, a feature extraction module, an accuracy prediction module, an environmental compensation factor adjustment module and a dosage control module;
[0113] Data acquisition module: collects the weighing data of the weighing equipment during the weighing process of Chinese herbal medicine pieces and the environmental data monitored by the environmental monitoring equipment in the Chinese herbal medicine dispensing area;
[0114] Feature extraction module: preprocess the collected weighing data and environmental data, perform feature extraction on the preprocessed weighing data and environmental data, and respectively extract the weighing deviation features in the weighing data and the air humidity fluctuation features in the environmental data;
[0115] Accuracy prediction module: Build a data prediction model to predict the accuracy of the weighing results of Chinese herbal medicine pieces based on the weighing deviation characteristics in the weighing data and the air humidity fluctuation characteristics in the environmental data;
[0116] Environmental compensation factor adjustment module: Determine the environmental compensation factor of the weighing equipment through the hygroscopicity and volatility data charts of the medicinal materials in the medicinal materials database, and dynamically adjust the environmental compensation factor according to the accuracy of the weighing results of the Chinese herbal medicines;
[0117] Dosage control module: correct the weighing results of Chinese herbal medicines according to the adjusted environmental compensation factor, analyze the errors of the corrected weighing results of Chinese herbal medicines, and control the dosage of Chinese herbal medicines according to the analysis results.
[0118] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.
[0119] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0120] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.
[0121] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0122] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0123] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A method for controlling the dispensing of Chinese herbal medicine slices, characterized in that: The steps include: S1: Collect the weighing data of the weighing equipment during the weighing process of Chinese herbal medicine pieces and the environmental data monitored by the environmental monitoring equipment in the Chinese herbal medicine dispensing area; S2: preprocessing the collected weighing data and environmental data, performing feature extraction on the preprocessed weighing data and environmental data, respectively extracting weighing deviation features in the weighing data and air humidity fluctuation features in the environmental data; Step S2 includes: generating a weighing deviation index according to the weighing deviation characteristics in the weighing data, and obtaining the weighing deviation index by: obtaining the real-time weighing data of the weighing device within a time period s, and establishing a weighing data set V = {v1, v2, v3, ..., v i ,...,v n }, where i = 1, 2, 3, ..., n, where n is a positive integer greater than 0, determine the smoothing coefficient α, set the initial smoothing value, and select the value of the first data point as the initial smoothing value; for each time point i, calculate the smoothing value through a recursive expression, and the recursive expression is: Q i =α×v i +(1-α)×Q i-1 Where Q i is the smoothed value at time point i, v i is the actual weighing value at time point i. After calculating the smoothed values of all time points, the absolute deviation of each time point is calculated by comparing the actual value and the smoothed value, and the weighing deviation index is calculated after averaging. The specific calculation expression is: Where, CM is the weighing deviation index; The air humidity fluctuation index is generated according to the air humidity fluctuation characteristics in the environmental data. The method for obtaining the air humidity fluctuation index is as follows: the air humidity data within a time period s is obtained in real time through the air humidity sensor installed in the Chinese medicine dispensing area, the humidity data is standardized, and the fast Fourier transform is applied to the standardized humidity data to obtain the frequency domain representation, and the amplitude of different frequency components is calculated. The expression is: Where A(f) is the amplitude of the frequency component, d(s) is the original air humidity data at time point s, N is the total number of signal sample points, and e -j2πfs / N It is the kernel function of Fourier transform, which identifies the frequency fmax with the largest amplitude. The amplitude A(fmax) corresponding to this frequency represents the maximum frequency component. The air humidity fluctuation index is calculated by the amplitude and energy of the maximum frequency component. The specific calculation expression is: In the formula, AR is the air humidity fluctuation index; S3: Construct a data prediction model to predict the accuracy of the weighing results of Chinese herbal medicine pieces based on the weighing deviation characteristics in the weighing data and the air humidity fluctuation characteristics in the environmental data; The weighing deviation index and the air humidity fluctuation index are normalized, and the accuracy coefficient of the weighing result of the Chinese herbal medicine slices is calculated by the weighing deviation index and the air humidity fluctuation index after normalization. A data prediction model is constructed to predict the accuracy of the weighing results of Chinese herbal medicine pieces. The calculation expression of the data prediction model in the present invention is: Wherein, NK is the accuracy coefficient of the weighing result of Chinese herbal medicine slices, CM is the weighing deviation index, AR is the air humidity fluctuation index, a1 and a2 are the proportional coefficients of the weighing deviation index and the air humidity fluctuation index, and a2>a1>0; Compare the accuracy coefficient of the obtained Chinese herbal medicine weighing result with the preset accuracy coefficient reference threshold value. If the accuracy coefficient of the Chinese herbal medicine weighing result is greater than or equal to the preset accuracy coefficient reference threshold value, it means that the accuracy of the Chinese herbal medicine weighing result is high, and its weighing result is marked as an accuracy result, and a weighing accurate signal is generated at this time; if the accuracy coefficient of the Chinese herbal medicine weighing result is less than the preset accuracy coefficient reference threshold value, it means that the accuracy of the Chinese herbal medicine weighing result is low, and its weighing result is marked as an inaccuracy result, and a weighing inaccuracy signal is generated at this time; S4: Determine the environmental compensation factor of the weighing equipment through the data charts of the hygroscopicity and volatility of the medicinal materials in the medicinal materials database, and dynamically adjust the environmental compensation factor according to the accuracy of the weighing results of the Chinese herbal medicines; Step S4 specifically includes: determining the environmental compensation factor of the weighing equipment through the data chart of the hygroscopicity and volatility of the medicinal materials in the medicinal materials database, and dynamically adjusting the environmental compensation factor according to the accuracy of the weighing result of the Chinese herbal medicine slices, specifically: Collect the hygroscopicity and volatility data of various Chinese herbal medicines, collect the temperature and humidity data of the environment during the weighing process in real time, query the hygroscopicity and volatility data of the corresponding medicinal materials in the database according to the Chinese herbal medicines to be weighed, determine the weight change data of the medicinal materials under the reference humidity and temperature conditions, calculate the difference between the actual environmental conditions and the reference environmental conditions, and according to the hygroscopicity data of the medicinal materials, add up the effects of humidity and temperature on the weight, and determine the environmental compensation factor. The calculation formula of the compensation factor is: Where F is the environmental compensation factor, Hdiff is the humidity difference, Hrate is the hygroscopicity percentage, Tdiff is the temperature difference, and Trate is the volatility percentage; Dynamically adjust the environmental compensation factor according to the accuracy of the weighing result of the Chinese herbal medicine slices, and adjust the environmental compensation factor when the accuracy coefficient of the weighing result of the Chinese herbal medicine slices is less than a preset accuracy coefficient reference threshold; The compensation factor is adjusted according to the deviation of the accuracy coefficient, and the adjustment formula is: Fnew = Fold × (1 + y × (Aref-NK) / Aref); where Fnew is the adjusted environmental compensation factor, Fold is the original environmental compensation factor, Aref is the reference threshold of the accuracy coefficient, NK is the current accuracy coefficient, and y is the adjustment ratio coefficient; S5: Correcting the weighing result of the Chinese herbal medicine slices according to the adjusted environmental compensation factor, analyzing the error of the corrected weighing result of the Chinese herbal medicine slices, and regulating the dosage of the Chinese herbal medicine slices according to the analysis result; Step S5 specifically includes: correcting the weighing result of the Chinese herbal medicine slices according to the adjusted environmental compensation factor, analyzing the error of the corrected weighing result of the Chinese herbal medicine slices, and regulating the dosage of the Chinese herbal medicine slices according to the analysis result, specifically: Use the dynamically adjusted environmental compensation factor to correct the weighing data. The correction formula is: Wcotrected = Wmeasured × Fnew; where Wcorrected is the weighing data after correction, and Wmeasured is the weighing data before correction; Set the target dose as Dtarget, and the corrected weighing result as Wcorrected, then the error calculation formula is: E = Wco1TeCted-Dtarget; where, E is the weighing error; Analyze the size and direction of the error, and compare the absolute value of the error with the allowable error range: if |E|≤ΔDallowed, no adjustment is required; if |E|>ΔDallowed, adjustment is required; where ΔDallowed is the allowable error range; According to the size and direction of the error, the dosage is adjusted. Specifically, if the corrected weight is greater than the target dosage, a positive error adjustment is made. The adjustment expression is: Dadjusted=Dtarget-E=Dtarget-(Wcorrected-Dtarget)=2Dtarget-Wcorrected; Where Dadjusted is the adjusted target dose; if the corrected weight is less than the target dose, a negative error adjustment is performed, and the adjustment expression is: Dadjusted=Dtarget-E=Dtarget-(Wcorrected-Dtarget)=2Dtarget-Wcorrected; The adjusted dose calculation formula is consistent: Dadjusted = 2Dtarget-Wcorrected.
2. A Chinese herbal medicine dispensing control system, used to implement a Chinese herbal medicine dispensing control method according to claim 1, characterized in that: It includes data acquisition module, feature extraction module, accuracy prediction module, environmental compensation factor adjustment module and dosage control module; Data acquisition module: collects the weighing data of the weighing equipment during the weighing process of Chinese herbal medicine pieces and the environmental data monitored by the environmental monitoring equipment in the Chinese herbal medicine dispensing area; Feature extraction module: preprocess the collected weighing data and environmental data, perform feature extraction on the preprocessed weighing data and environmental data, and respectively extract the weighing deviation features in the weighing data and the air humidity fluctuation features in the environmental data; Accuracy prediction module: Build a data prediction model to predict the accuracy of the weighing results of Chinese herbal medicine pieces based on the weighing deviation characteristics in the weighing data and the air humidity fluctuation characteristics in the environmental data; Environmental compensation factor adjustment module: Determine the environmental compensation factor of the weighing equipment through the hygroscopicity and volatility data charts of the medicinal materials in the medicinal materials database, and dynamically adjust the environmental compensation factor according to the accuracy of the weighing results of the Chinese herbal medicines; Dosage control module: correct the weighing results of Chinese herbal medicines according to the adjusted environmental compensation factor, analyze the errors of the corrected weighing results of Chinese herbal medicines, and control the dosage of Chinese herbal medicines according to the analysis results.
Citation Information
Patent Citations
Weighing system and method capable of conducting weighing operation under ship shaking environment
CN104535143A
Traditional chinese medicine particle prescription system
CN208156784U