Water adding method and device for secondary decoction of medicine decoction based on visual identification
By combining visual recognition technology with a residue-liquid separator, the amount of water added for the second decoction is accurately calculated, which solves the problem of insufficient accuracy caused by the reliance on theoretical data for the amount of water added for the second decoction in existing technologies. This achieves automation of the decoction process of traditional Chinese medicine and stability of the amount of liquid.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-13
- Publication Date
- 2026-04-14
AI Technical Summary
The current calculation of water addition for the second decoction relies on theoretical data and cannot avoid the influence of pipeline residue, resulting in insufficient accuracy.
A visual recognition-based method for adding water during the second decoction of Chinese medicine is adopted. The first decoction liquid is extracted by a residue-liquid separator, and the actual amount of the first decoction liquid is determined by visual recognition using a preset image acquisition device. The amount of water to be added for the second decoction is calculated based on the required amount of liquid and the actual amount of liquid, thus achieving precise control.
By using visual recognition technology to accurately calculate the actual amount of decoction liquid in the first decoction, the influence of pipeline residue is avoided, and the amount of water added for the second decoction is accurately controlled, thereby improving the automation level and stability of the decoction liquid volume in the traditional Chinese medicine decoction process.
Smart Images

Figure CN121845944A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automated control technology for traditional Chinese medicine decoction, and more specifically, to a method and apparatus for adding water during the second decoction of traditional Chinese medicine based on visual recognition. Background Technology
[0002] The second decoction of traditional Chinese medicine is an indispensable step to ensure the full dissolution of the effective components of the medicinal slices and to guarantee the efficacy and dosage of the decoction. The accuracy of the amount of water added in the second decoction directly determines the total dosage and concentration stability of the final mixed decoction. Current methods for calculating the amount of water added in the second decoction mostly rely on empirical estimation or simple derivation based on the theoretical amount of decoction from the first decoction, which lacks accuracy and cannot avoid interference from residual equipment.
[0003] The existing methods for adding water for the second decoction on the market all rely on the theoretical water absorption rate of the medicinal slices and the theoretical amount of medicinal liquid in the first decoction, which are divorced from the actual decoction conditions. At the same time, during the process of the first decoction being transported from the residue-liquid separator to the packaging machine, some medicinal liquid is easily left on the inner wall of the pipe, resulting in a large deviation between the actual amount of medicinal liquid stored and the theoretical calculation value, which further exacerbates the distortion of the calculation of the amount of water added for the second decoction.
[0004] There is currently no effective solution to the problem that existing technologies rely on theoretical data to calculate the amount of water added during the second decoction process, and cannot avoid the influence of pipeline residues, resulting in insufficient accuracy.
[0005] Therefore, it is necessary to improve the relevant technology to overcome the aforementioned defects. Summary of the Invention
[0006] This application provides a method and apparatus for adding water during the second decoction of traditional Chinese medicine based on visual recognition, which at least solves the problem in related technologies that the calculation of the amount of water added during the second decoction relies on theoretical data and cannot avoid the influence of pipeline residues, resulting in insufficient accuracy.
[0007] According to one aspect of the embodiments of this application, a method for adding water for the second decoction of traditional Chinese medicine based on visual recognition is provided, comprising: after the first decoction has been completed in the decoction barrel, extracting the first decoction liquid from the decoction barrel using a residue-liquid separator, wherein the decoction barrel is used to complete the decoction of the target prescription, and the decoction includes the first decoction; acquiring images of a packaging machine using a preset image acquisition device, and performing visual recognition on the obtained image data to obtain the actual volume of the first decoction liquid, wherein the packaging machine is used to store the first decoction liquid; determining the amount of water to be added for the second decoction based on the required volume of the target prescription and the actual volume of the liquid, and adding water to the decoction barrel according to the amount of water to be added for the second decoction, wherein the decoction includes the second decoction.
[0008] In an exemplary embodiment, before the decoction liquid is extracted from the decoction barrel by a residue-liquid separator after the first decoction has been completed in the decoction barrel, the method further includes: performing drug detail analysis on the target prescription to obtain the drug details of the target prescription, wherein the drug details include: the names of multiple drugs and the weights of the multiple drugs; using the drug details as input, calculating the amount of water to be added to the first decoction of the target prescription through an artificial intelligence adaptive learning method; and adding water to the decoction barrel according to the amount of water to be added to the first decoction to perform the first decoction in the decoction barrel.
[0009] In an exemplary embodiment, after the decoction barrel has completed one decoction, a decoction liquid is extracted from the decoction barrel using a residue-liquid separator. This includes: transferring the decoction barrel to the residue-liquid separator using a robotic arm; using the residue-liquid separator to squeeze the residue in the decoction barrel to fully extract the decoction liquid; and then transporting the decoction liquid through a pipeline to the packaging machine for temporary storage.
[0010] In an exemplary embodiment, visual recognition is performed on the obtained image data to obtain the actual volume of the decoction, including: correcting the image data by angle using an angle correction algorithm to obtain corrected image data, wherein the angle correction algorithm is used to eliminate the angle tilt deviation of the image data; performing visual recognition on the corrected image data using visual recognition technology to determine the liquid level of the decoction in the packaging machine; determining the volume of the decoction based on the liquid level, and determining the actual volume of the decoction based on the liquid volume.
[0011] In an exemplary embodiment, determining the amount of water to be added for the second decoction based on the required amount of medicinal liquid in the target prescription and the actual amount of medicinal liquid includes: calculating the amount of water to be added for the second decoction using the formula E=D-C+F, where E is the amount of water to be added for the second decoction, D is the required amount of medicinal liquid, C is the actual amount of medicinal liquid, F is the amount of medicinal liquid retained as a sample, and F is determined based on the decoction environment parameters.
[0012] In an exemplary embodiment, after adding water to the decoction barrel according to the amount of water added for the second decoction and performing the second decoction in the decoction barrel, the method further includes: after the second decoction is completed in the decoction barrel, extracting the second decoction liquid from the decoction barrel using the residue-liquid separator; transporting the second decoction liquid through a pipeline to the packaging machine, mixing it with the first decoction liquid to obtain a mixed liquid; and heating the mixed liquid to boiling to obtain the final decoction liquid of the target prescription.
[0013] In an exemplary embodiment, before the decoction liquid is extracted from the decoction tank by a residue-liquid separator after the first decoction has been completed in the decoction tank, the method further includes: adding the target medicinal material corresponding to the target prescription to the decoction tank and fully soaking the target medicinal material in the decoction tank; after the target medicinal material has been fully soaked, transferring the decoction tank to a first decoction station by a robotic arm, and performing the first decoction in the decoction tank at the first decoction station; wherein, water is added to the decoction tank according to the amount of water added for the second decoction. After the decoction barrel is boiled a second time with water, the method further includes: adding water to the decoction barrel according to the amount of water added for the second decoction, and transferring the decoction barrel to the second decoction station by the robotic arm, and performing the second decoction on the decoction barrel at the second decoction station; after the second decoction is completed, extracting the second decoction liquid from the decoction barrel by the residue-liquid separator; transporting the second decoction liquid to the packaging machine through a pipeline, packaging the final decoction liquid in the packaging machine, and cleaning the decoction barrel.
[0014] According to another aspect of the embodiments of this application, a visual recognition-based decoction second-decoction water addition device is also provided, comprising: a liquid extraction module, used to extract a first-decoction liquid from the decoction barrel by means of a residue-liquid separator after the first-decoction has been completed, wherein the decoction barrel is used to complete the decoction of the target prescription, and the decoction includes the first-decoction; a visual recognition module, used to acquire images of a packaging machine through a preset image acquisition device, and to perform visual recognition on the obtained image data to obtain the actual volume of the first-decoction liquid, wherein the packaging machine is used to store the first-decoction liquid; and a decoction module, used to determine the amount of water to be added for the second decoction according to the required volume of the target prescription and the actual volume of the liquid, and to add water to the decoction barrel according to the amount of water to be added for the second decoction, thereby performing the second decoction in the decoction barrel, wherein the decoction includes the second-decoction.
[0015] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described method for adding water to the second decoction of medicine based on visual recognition when it is run.
[0016] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-mentioned visual recognition-based decoction method for adding water during the second decoction through the computer program.
[0017] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps of the methods described in various embodiments of this application.
[0018] This application addresses the following: After the first decoction of the target prescription is completed in the decoction tank, a residue-liquid separator extracts the first decoction liquid from the decoction tank. A pre-set image acquisition device captures images of the packaging machine storing the first decoction liquid and performs visual recognition to obtain the actual volume of the first decoction liquid. Based on the required volume of liquid for the target pharmacy and the actual volume of the first decoction liquid, the amount of water to be added for the second decoction is determined, and water is added to the decoction tank according to the amount of water to be added for the second decoction. By adopting the above scheme, the actual volume of the first decoction liquid in the packaging machine is accurately calculated through visual recognition technology, avoiding the influence of pipeline residue and achieving precise control of the amount of water added for the second decoction. This solves the problem in related technologies where the calculation of the amount of water added for the second decoction relies on theoretical data and cannot avoid the influence of pipeline residue, resulting in insufficient accuracy. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a hardware structure block diagram of a computer terminal for a visual recognition-based method of adding water during the second decoction of traditional Chinese medicine, according to an embodiment of this application.
[0022] Figure 2 This is a flowchart of a method for adding water during the second decoction of traditional Chinese medicine based on visual recognition, according to an embodiment of this application.
[0023] Figure 3 This is a flowchart illustrating a method for precise water addition during the second decoction of traditional Chinese medicine based on visual recognition, according to an embodiment of this application.
[0024] Figure 4 This is a schematic diagram of the structural composition of a vision-based intelligent decoction system according to an embodiment of this application;
[0025] Figure 5 This is a structural block diagram of a visual recognition-based decoction and water addition device according to an embodiment of this application. Detailed Implementation
[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0028] The methods and embodiments provided in this application can be executed on a computer terminal or similar computing device. Taking running on a computer terminal as an example, Figure 1 This is a hardware structure block diagram of a computer terminal for a visual recognition-based method of adding water during the second decoction of traditional Chinese medicine, according to an embodiment of this application. Figure 1 As shown, a computer terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a central processing unit (CPU) or a programmable gate array (FPGA)) and a memory 104 for storing data are also shown. The computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the computer terminal described above. For example, the computer terminal may also include components that are more complex than those described above. Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0029] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the data integration method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0030] The computer terminal uses a wireless network provided by a communications provider. In one example, transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0031] This embodiment provides a method for adding water during the second decoction of traditional Chinese medicine based on visual recognition. Figure 2 This is a flowchart of a visual recognition-based method for adding water during the second decoction of traditional Chinese medicine, according to an embodiment of this application. Figure 2 As shown, the process includes the following steps:
[0032] Step S202: After the decoction barrel has completed the first decoction, a decoction liquid is extracted from the decoction barrel by a residue-liquid separator. The decoction barrel is used to complete the decoction of the target prescription, and the decoction includes the first decoction.
[0033] Step S204: The packaging machine is image-acquired by a preset image acquisition device, and the obtained image data is visually recognized to obtain the actual amount of the decoction. The packaging machine is used to store the decoction.
[0034] Step S206: Determine the amount of water to be added for the second decoction based on the required amount of medicinal liquid in the target prescription and the actual amount of medicinal liquid, and add water to the decoction pot according to the amount of water to be added for the second decoction, wherein the decoction includes the second decoction.
[0035] This application addresses the following: After the first decoction of the target prescription is completed in the decoction tank, a residue-liquid separator extracts the first decoction liquid from the decoction tank. A pre-set image acquisition device captures images of the packaging machine storing the first decoction liquid and performs visual recognition to obtain the actual volume of the first decoction liquid. Based on the required volume of liquid for the target pharmacy and the actual volume of the first decoction liquid, the amount of water to be added for the second decoction is determined, and water is added to the decoction tank according to the amount of water to be added for the second decoction. By adopting the above scheme, the actual volume of the first decoction liquid in the packaging machine is accurately calculated through visual recognition technology, avoiding the influence of pipeline residue and achieving precise control of the amount of water added for the second decoction. This solves the problem in related technologies where the calculation of the amount of water added for the second decoction relies on theoretical data and cannot avoid the influence of pipeline residue, resulting in insufficient accuracy.
[0036] In an exemplary embodiment, before the decoction liquid is extracted from the decoction barrel by a residue-liquid separator after the first decoction has been completed in the decoction barrel, the method further includes: performing drug detail analysis on the target prescription to obtain the drug details of the target prescription, wherein the drug details include: the names of multiple drugs and the weights of the multiple drugs; using the drug details as input, calculating the amount of water to be added to the first decoction of the target prescription through an artificial intelligence adaptive learning method; and adding water to the decoction barrel according to the amount of water to be added to the first decoction to perform the first decoction in the decoction barrel.
[0037] For the target prescription, the drug details are first analyzed, including the name and weight parameters of each drug. Using this data as a driving force, an advanced artificial intelligence adaptive learning model is employed to calculate the amount of water required for the first decoction. The model is trained based on extensive historical data analysis, comprehensively considering the characteristics of the medicinal herbs and the rules of decoction, ensuring that the output water amount accurately matches the current prescription's needs. Based on the calculation results, the automated system precisely injects the corresponding amount of water into the decoction pot and randomly starts the first decoction process.
[0038] In this process, the artificial intelligence adaptive learning method, with complex neural networks and efficient decision tree algorithms at its core, constructs a highly intelligent data analysis model that can autonomously optimize and adjust parameters to ensure that the calculation of water addition each time meets the most suitable decoction conditions. From its initial design, the model fully considered the diversity of Chinese medicinal herbs and the uncertainty of the decoction environment, and through continuous learning and evolution, it possesses strong predictive capabilities and adaptability.
[0039] This embodiment pre-analyzes the drug details and uses an artificial intelligence adaptive learning method to calculate the amount of water to be added for the first decoction. This not only achieves precise water injection into the decoction pot, but also lays a solid foundation for the subsequent visual recognition-based water addition strategy for the second decoction. The entire decoction process is highly automated, and the accuracy of liquid volume control is greatly improved. It effectively overcomes the problems caused by human estimation and equipment errors in the traditional decoction process, ensuring the stability of the quality of Chinese medicine decoction and the safety of patients' medication.
[0040] In an exemplary embodiment, after the decoction barrel has completed one decoction, a decoction liquid is extracted from the decoction barrel using a residue-liquid separator. This includes: transferring the decoction barrel to the residue-liquid separator using a robotic arm; using the residue-liquid separator to squeeze the residue in the decoction barrel to fully extract the decoction liquid; and then transporting the decoction liquid through a pipeline to the packaging machine for temporary storage.
[0041] After the first decoction is completed, the robotic arm immediately moves the decoction pot to the residue-liquid separator, randomly activating the separation mechanism to perform a meticulous squeezing operation on the residue in the pot, aiming to thoroughly extract any remaining liquid and ensure that every drop of effective ingredient is fully utilized. The separated liquid is then transferred through a dedicated pipeline to a packaging machine for temporary storage.
[0042] The slag-liquid separator integrates precision sensors and high-precision extrusion components, enabling efficient separation of medicinal liquid without damaging the structure of the slag, thus reducing the loss of efficacy. The robotic arm ensures seamless connection between the decoction pot and the separator, avoiding the risk of secondary contamination and liquid spillage caused by manual handling.
[0043] This embodiment achieves seamless flow and efficient separation of medicinal liquid from the decoction pot to the packaging machine by using an automated robotic arm in conjunction with a slag-liquid separator. This ensures the purity and integrity of the medicinal liquid and creates an ideal premise for the subsequent precise water addition step based on visual recognition. Overall, it improves the automation level and accuracy of Chinese medicine decoction, reduces the errors and time consumption of traditional manual operation, and strongly supports the modernization and standardization of Chinese medicine.
[0044] In an exemplary embodiment, visual recognition is performed on the obtained image data to obtain the actual volume of the decoction, including: correcting the image data by angle using an angle correction algorithm to obtain corrected image data, wherein the angle correction algorithm is used to eliminate the angle tilt deviation of the image data; performing visual recognition on the corrected image data using visual recognition technology to determine the liquid level of the decoction in the packaging machine; determining the volume of the decoction based on the liquid level, and determining the actual volume of the decoction based on the liquid volume.
[0045] After acquiring the image of the medicine liquid from the dispensing machine, an angle correction algorithm automatically corrects for deviations caused by the shooting angle, ensuring the accuracy and unbiasedness of the image data. Next, visual recognition technology precisely locates the position of the liquid level relative to the bottom of the dispensing machine. This height information is randomly converted into the liquid volume. Taking into account the cross-sectional area and scale information of the dispensing machine, this conversion step achieves the leap from a two-dimensional image to the actual volume. The system further considers the calculated volume value as the actual amount of medicine in one decoction.
[0046] The angle correction algorithm intelligently adjusts the image angle by analyzing the image edges and the physical characteristics of the packaging machine, ensuring that even under non-orthogonal shooting conditions, it can obtain unbiased liquid height information.
[0047] By employing visual recognition technology and angle correction algorithms, this embodiment can directly and accurately measure the actual amount of the first decoction liquid in the packaging machine, eliminating the influence of residual liquid in the pipeline on the calculation of water addition for the second decoction. This ensures precise control of the amount of liquid during the decoction process and stability of the final dosage, making an important contribution to improving the automation level and quality consistency of traditional Chinese medicine decoction.
[0048] This embodiment combines visual recognition technology with a sophisticated angle correction algorithm, which can accurately measure the actual amount of liquid medicine in the dispensing machine. This significantly improves the accuracy of the second decoction water addition calculation and reduces the dosage deviation of the liquid medicine, which is of great value for improving the automation level and quality control of traditional Chinese medicine decoction.
[0049] In an exemplary embodiment, determining the amount of water to be added for the second decoction based on the required amount of medicinal liquid in the target prescription and the actual amount of medicinal liquid includes: calculating the amount of water to be added for the second decoction using the formula E=D-C+F, where E is the amount of water to be added for the second decoction, D is the required amount of medicinal liquid, C is the actual amount of medicinal liquid, F is the amount of medicinal liquid retained as a sample, and F is determined based on the decoction environment parameters.
[0050] For the target prescription, the required volume of decoction (D) and the actual volume of decoction (C) obtained through visual recognition after the first decoction are comprehensively assessed. Combined with the volume of sample decoction (F) adjusted based on environmental parameters such as temperature and humidity, a mathematical model is used to calculate the precise amount of water (E) to be added for the second decoction. This calculation process follows the formula E=D-C+F, clearly and intuitively reflecting the scientific calculation of the water added for the second decoction. It ensures that the total volume of decoction meets the predetermined requirements while reserving an appropriate amount to monitor the decoction quality, demonstrating a high degree of flexibility and intelligence.
[0051] The amount of sample liquid F is not fixed, but dynamically adjusted according to environmental parameters such as temperature and humidity during decoction. This mechanism fully considers the evaporation loss during the decoction process, making the calculation of the amount of water added more in line with the actual working conditions, and further improving the accuracy of the liquid volume control.
[0052] This embodiment achieves precise control over the amount of water added during the second decoction, effectively compensating for the natural loss of medicinal liquid during the decoction process. At the same time, it also retains samples to monitor the quality of the decoction, ensuring the accuracy of the final dosage and the reliability of the quality of the medicinal liquid, and greatly optimizing the level of automation management in the process of traditional Chinese medicine decoction.
[0053] In an exemplary embodiment, after adding water to the decoction barrel according to the amount of water added for the second decoction and performing the second decoction in the decoction barrel, the method further includes: after the second decoction is completed in the decoction barrel, extracting the second decoction liquid from the decoction barrel using the residue-liquid separator; transporting the second decoction liquid through a pipeline to the packaging machine, mixing it with the first decoction liquid to obtain a mixed liquid; and heating the mixed liquid to boiling to obtain the final decoction liquid of the target prescription.
[0054] After accurately calculating the amount of water to be added for the second decoction, the system guides the decoction tank to receive the corresponding amount of clean water, and then automatically switches to the second decoction mode until the decoction is completed. A robotic arm seamlessly connects the decoction tank to the residue separator, which precisely squeezes the residue to ensure the complete extraction of the second decoction liquid, collecting it in a pipeline and directing it into the packaging machine. At this point, the first and second decoction liquids meet and mix in the packaging machine, forming a preliminary mixed liquid. The system then heats and boils this mixture, ultimately producing the finished liquid of the required specifications for the target prescription.
[0055] The automated control enables precise water addition and decoction, mixing of medicinal liquid and heating to boiling. This series of steps are closely linked, which greatly improves the efficiency of Chinese medicine decoction and the quality of medicinal liquid. It ensures high standard consistency in dosage and efficacy of the finished medicinal liquid, marking a new stage in the automation technology of Chinese medicine decoction.
[0056] In an exemplary embodiment, before the decoction liquid is extracted from the decoction tank by a residue-liquid separator after the first decoction has been completed in the decoction tank, the method further includes: adding the target medicinal material corresponding to the target prescription to the decoction tank and fully soaking the target medicinal material in the decoction tank; after the target medicinal material has been fully soaked, transferring the decoction tank to a first decoction station by a robotic arm, and performing the first decoction in the decoction tank at the first decoction station; wherein, water is added to the decoction tank according to the amount of water added for the second decoction. After the decoction barrel is boiled a second time with water, the method further includes: adding water to the decoction barrel according to the amount of water added for the second decoction, and transferring the decoction barrel to the second decoction station by the robotic arm, and performing the second decoction on the decoction barrel at the second decoction station; after the second decoction is completed, extracting the second decoction liquid from the decoction barrel by the residue-liquid separator; transporting the second decoction liquid to the packaging machine through a pipeline, packaging the final decoction liquid in the packaging machine, and cleaning the decoction barrel.
[0057] In an optional embodiment, this application provides a vision-based intelligent decoction system, the structure of which is as follows: Figure 4 As shown, the system consists of a medicinal material delivery module 41, an intelligent soaking unit 42, a robotic arm 43, a dual-station decoction chamber 44 (including the aforementioned first and second decoction stations), a residue-liquid separator 45, a visual metering and packaging machine 46 (equivalent to the aforementioned packaging machine), a dynamic water addition module 47, a boiling mixing device 48, and a self-cleaning circuit 49. The coordinated operation of all components of the system enables unmanned operation of the entire decoction process.
[0058] The herbal medicine delivery module 41 automatically weighs and accurately delivers the medicinal slices into the decoction pot according to the prescription, ensuring consistent feeding.
[0059] The intelligent soaking unit 42 is equipped with a stirring mechanism, which fully stirs and soaks the medicinal materials after adding water according to the set time, thereby improving the dissolution efficiency of the active ingredients;
[0060] The robotic arm 43 is equipped with a high-precision servo positioning system, which can quickly switch between soaking, first decoction, second decoction, and cleaning stations by moving the decoction pot, with a stroke error of less than 0.5mm.
[0061] The dual-station decoction chamber 44 adopts independent temperature zone control and pressure sensing technology, supporting the simultaneous operation of the first and second decoction stations, allowing for the simultaneous decoction of different prescriptions and avoiding waiting at each station.
[0062] The slag-liquid separator 45 integrates multi-layer filters and a hydraulic extrusion arm, applying a pressure of no less than 0.8 MPa to the slag, achieving a liquid recovery rate of over 98% and a residue rate of less than 1.5%.
[0063] The visual measurement and packaging machine 46 has an industrial camera and a linear grating embedded in the inner wall of the scale. Combined with the angle correction algorithm, it can achieve ±1ml level liquid level recognition, providing a true benchmark for adding water for the second decoction.
[0064] The dynamic water addition module 47 uses a high-precision mass flow meter and closed-loop feedback control, achieving a water addition accuracy of ±2ml and a response time of less than 0.3 seconds.
[0065] The boiling mixing device 48 uses ultrasonic assistance and constant temperature circulation to ensure that the first decoction and the second decoction are fully homogenized and to avoid component separation.
[0066] The self-cleaning circuit 49 adopts a combination of high-temperature steam rinsing and ozone sterilization, which can complete the cleaning of the inner wall of the decoction pot without dead corners within 5 minutes, meeting the GMP hygiene standards for Chinese medicine decoction.
[0067] All component data is uploaded to the central control system in real time, forming a digital archive of the entire decoction process, supporting quality traceability and model retraining.
[0068] In an optional embodiment, to address the problem that existing methods for calculating the amount of water added during the second decoction rely on theoretical data and cannot avoid the influence of pipeline residues, resulting in insufficient accuracy, this application provides a visual recognition-based method for accurately adding water during the second decoction. The specific implementation process of this method is as follows: Figure 3 As shown, it includes the following steps:
[0069] 3.1 Intelligent Water Addition and Decoction: For the prescription of Chinese medicine to be decocted (equivalent to the target prescription mentioned above), the theoretical water addition for the first decoction is calculated using an artificial intelligence adaptive learning method. After adding the corresponding amount of water to the decoction pot, the decoction process is completed. The artificial intelligence adaptive learning method takes the prescription drug details (drug name, weight) as the core input and calculates the water addition based on a model trained on historical big data of "drug-weight-water addition-liquid volume". In addition, a full-coverage basic water absorption rate test is carried out on all Chinese medicine decoction pieces. The water absorption rate data is only used as a reference for traceability and is not included in the model variables.
[0070] 3.2 Extraction of the first decoction liquid: After the first decoction is completed, the robotic arm grabs the decoction bucket and transfers it to the residue-liquid separator. The residue is squeezed by the residue-liquid separator to extract the first decoction liquid and transport it through pipeline to the packaging machine for temporary storage, ensuring that all the liquid is delivered to the packaging machine.
[0071] 3.3 Visual Recognition and Liquid Volume Calculation of the Dispensing Machine: After confirming that all the decoction liquid has been delivered to the dispensing machine, the camera preset at the scale of the dispensing machine is triggered to take a picture. The control system first corrects the tilt angle of the photo through an algorithm (correction angle ≤ 3°) to eliminate the shooting angle deviation. Then, visual recognition technology is used to identify the height from the bottom of the dispensing machine to the liquid surface and the height from the bottom of the dispensing machine to the highest scale line. Combining C1 = liquid surface height, C2 = container scale height, and C3 = the capacity value corresponding to the maximum scale of the container, the formula C = C1 / C2 is used to calculate the volume. C3 accurately calculates the actual volume C of the decoction stored in the packaging machine (ignoring the density difference of the decoction, the volume and weight are approximately equivalent), which is used as the final calculation value of the actual amount of decoction.
[0072] 3.4 Precise Calculation of Water Addition for Second Decoction: The control system calls the theoretical total liquid volume D preset in the prescription, and combines it with the preset evaporation amount and the sum of the retained liquid volume F. The water addition amount E required for the second decoction is calculated using the formula E=D-C'+F. The value of F is based on the preset benchmark value of historical decoction data and can be dynamically adjusted according to the temperature and humidity of the decoction environment to further improve the accuracy of water addition.
[0073] 3.5 Second Decoction Water Addition and Decoction: The robotic arm grabs the decoction barrel and moves it to the second decoction water addition station. The water supply module accurately injects the corresponding amount of water into the decoction barrel according to the calculated water addition amount E, and then moves it to the decoction station to complete the second decoction.
[0074] 3.6 Mixing and Packaging: After the second decoction is completed, the liquid is squeezed and extracted into the same packaging machine, mixed with the first decoction, and then the mixed liquid is heated to boiling. The packaging and labeling process is completed according to the standard procedure.
[0075] This method is based on AI-powered intelligent water addition for the first decoction. It uses visual recognition technology to accurately calculate the actual amount of liquid in the first decoction in the packaging machine, corrects residual deviations in the pipeline, and dynamically adjusts the amount of water added for the second decoction. This ensures that the total amount of liquid after the two decoctions are mixed is within a reasonable range from the theoretical requirements of the prescription (equivalent to the above-mentioned required amount of liquid), thus guaranteeing the stability of the decoction quality.
[0076] This embodiment innovatively uses visual recognition technology to directly calculate the actual amount of medicine liquid in the dispensing machine, accurately correcting deviations caused by pipeline residues. It completely eliminates the reliance of traditional methods on theoretical water absorption rate of medicinal slices and theoretical amount of medicine liquid in the first decoction. The calculation of water addition for the second decoction is more in line with actual needs. Finally, the total amount of mixed medicine liquid deviates from the theoretical value of the prescription by less than 2.8%, which is significantly better than traditional methods (the deviation is generally 16.5%).
[0077] On the other hand, the solution eliminates shooting angle deviation through angle correction algorithm, and accurately calculates the amount of medicine by combining the scale of the packaging machine and the cross-sectional area parameter. It has high visual recognition accuracy and can effectively avoid interference from factors such as medicine fluctuation and ambient light, thus ensuring the stability of accounting data.
[0078] The method will be further described in detail below with reference to specific embodiments:
[0079] Example: A specific application of a visual recognition-based method for precisely adding water during the second decoction of traditional Chinese medicine.
[0080] 1. Preparation and Real-time Processing of the First Decoction: A second decoction prescription containing 10 kinds of Chinese medicinal herbs was selected, with a total weight of 200g and a theoretical total liquid volume of D=400ml. Standardized water absorption rate tests were conducted on all medicinal herbs, and the data was retained for traceability. Using an AI hybrid model (CNN+XGBoost), the name and weight of the herbs were input to calculate the amount of water to be added for the first decoction, which was 350ml. After being poured into the decoction pot, the first decoction was completed according to the standard process.
[0081] 2. Extraction and Visual Recognition of the First Decoction: After the first decoction is completed, the liquid is extracted to the packaging machine via a residue-liquid separator. Upon confirmation of successful delivery, a camera is triggered to take a picture. The system corrects the image tilt angle by 2°, recognizing the height from the bottom of the packaging machine to the liquid surface as 12cm and the height from the bottom to the highest graduation line as 20cm. The volume corresponding to 20cm is 500ml, calculated using the formula C=12 / 20. 500 = 300ml, accurately calculating the actual amount of liquid in one decoction.
[0082] 3. Calculation and implementation of water addition for the second decoction: The preset decoction evaporation volume + sample liquid volume F = 50ml. Using the formula E = 400 - 300 + 50 = 150ml, the water addition for the second decoction is calculated to be 150ml. After accurately adding 150ml of water at the water addition station for the second decoction, the medicine is transferred to the decoction tank to complete the second decoction.
[0083] 4. Effect verification: The second decoction was extracted and mixed with the first decoction in the packaging machine. After heating and boiling, the total volume of the mixed decoction was measured to be 448ml. After deducting the 20ml sample, the actual dosage was 428ml. The deviation from the theoretical requirement of 400ml of core effective decoction was controlled within 2.8%. The accuracy was significantly better than the traditional theoretical calculation method, and the interference of pipeline residue was completely avoided.
[0084] This embodiment only requires the addition of a camera and a matching control system at the scale of the packaging machine. No major modifications are needed to core equipment such as the decoction pot and the residue-liquid separator. It can be directly adapted to existing automated decoction production lines, resulting in low promotion costs and wide applicability. Furthermore, visual imaging, angle correction, and data calculation are all completed automatically by the system without manual intervention. Simultaneously, it records key parameters such as visual recognition data and the amount of water added during the second decoction, forming a complete decoction data chain and facilitating standardized management of the traditional Chinese medicine decoction process.
[0085] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0086] Figure 5 This is a structural block diagram of a vision recognition-based decoction and water-adding device for the second decoction according to an embodiment of this application. The device includes:
[0087] The liquid extraction module 52 is used to extract a decoction liquid from the decoction tank by means of a residue-liquid separator after the first decoction has been completed in the decoction tank. The decoction tank is used to complete the decoction of the target prescription, and the decoction includes the first decoction.
[0088] The visual recognition module 54 is used to acquire images of the packaging machine through a preset image acquisition device, and to perform visual recognition on the obtained image data to obtain the actual amount of the decoction liquid. The packaging machine is used to store the decoction liquid.
[0089] The decoction module 56 is used to determine the amount of water to be added for the second decoction based on the required amount of liquid in the target prescription and the actual amount of liquid, and to add water to the decoction pot according to the amount of water to be added for the second decoction, thereby performing the second decoction in the decoction pot, wherein the decoction includes the second decoction.
[0090] Using the aforementioned device, after the first decoction of the target prescription is completed in the decoction tank, the first decoction liquid is extracted from the decoction tank by a residue-liquid separator. A preset image acquisition device captures images of the packaging machine storing the first decoction liquid and performs visual recognition to obtain the actual volume of the first decoction liquid. Based on the required volume of liquid for the target pharmacy and the actual volume of the first decoction liquid, the amount of water to be added for the second decoction is determined, and water is added to the decoction tank according to this amount for the second decoction. This scheme, employing visual recognition technology, accurately calculates the actual volume of the first decoction liquid in the packaging machine, avoiding the influence of pipeline residue and achieving precise control of the water added for the second decoction. This solves the problem in related technologies where the calculation of the water added for the second decoction relies on theoretical data and cannot avoid the influence of pipeline residue, resulting in insufficient accuracy.
[0091] In an exemplary embodiment, the above-mentioned liquid extraction module 52 is further configured to perform drug detail analysis on the target prescription to obtain the drug details of the target prescription, wherein the drug details include: the drug names of multiple drugs and the drug weights of the multiple drugs; using the drug details as input, calculating the amount of water to be added to the first decoction of the target prescription through an artificial intelligence adaptive learning method; adding water to the decoction pot according to the amount of water to be added to the first decoction, and performing the first decoction in the decoction pot.
[0092] In an exemplary embodiment, the above-mentioned liquid extraction module 52 is further configured to transfer the decoction barrel to the residue-liquid separator via a robotic arm, and to squeeze the residue in the decoction barrel through the residue-liquid separator to fully extract the decoction liquid, thereby obtaining the decoction liquid; and to transport the decoction liquid through a pipeline to the packaging machine for temporary storage.
[0093] In an exemplary embodiment, the visual recognition module 54 is further configured to perform angle correction on the image data using an angle correction algorithm to obtain corrected image data, wherein the angle correction algorithm is used to eliminate the angle tilt deviation of the image data; perform visual recognition on the corrected image data using visual recognition technology to determine the liquid level height of the decoction in the packaging machine; determine the volume of the decoction based on the liquid level height; and determine the actual amount of decoction based on the volume of the decoction.
[0094] In an exemplary embodiment, the above-mentioned decoction module 56 is further configured to calculate the amount of water added for the second decoction using the formula E=D-C+F, where E is the amount of water added for the second decoction, D is the required amount of medicinal liquid, C is the actual amount of medicinal liquid, F is the amount of medicinal liquid retained as a sample, and F is determined based on the decoction environment parameters.
[0095] In an exemplary embodiment, the above-mentioned decoction module 56 is further configured to, after the second decoction is completed in the decoction barrel, extract the second decoction liquid from the decoction barrel through the residue-liquid separator; transport the second decoction liquid through a pipeline to the packaging machine, mix it with the first decoction liquid to obtain a mixed liquid; and heat the mixed liquid to boiling to obtain the final decoction liquid of the target prescription.
[0096] In an exemplary embodiment, the aforementioned visual recognition-based decoction and water-adding device for the second decoction is further configured to add the target medicinal material corresponding to the target prescription to the decoction barrel and fully soak the target medicinal material in the decoction barrel; after the target medicinal material has been fully soaked, the decoction barrel is transferred to the first decoction station by a robotic arm, and the first decoction is performed in the first decoction station; water is added to the decoction barrel according to the second decoction water amount, and after the second decoction is performed in the decoction barrel, water is added to the decoction barrel according to the second decoction water amount, and the decoction barrel is transferred to the second decoction station by the robotic arm, and the second decoction is performed in the second decoction station; after the second decoction is completed in the decoction barrel, the second decoction liquid is extracted from the decoction barrel by the residue-liquid separator; the second decoction liquid is transported to the packaging machine through a pipeline, and the final decoction liquid in the packaging machine is packaged, and the decoction barrel is cleaned.
[0097] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.
[0098] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0099] S1, after the decoction barrel has completed one decoction, a decoction liquid is extracted from the decoction barrel by a residue-liquid separator, wherein the decoction barrel is used to complete the decoction of the target prescription, and the decoction includes the first decoction.
[0100] S2, the image acquisition device acquires images of the packaging machine and performs visual recognition on the obtained image data to obtain the actual amount of the decoction, wherein the packaging machine is used to store the decoction.
[0101] S3, determine the amount of water to be added for the second decoction based on the required amount of medicinal liquid in the target prescription and the actual amount of medicinal liquid, and add water to the decoction pot according to the amount of water to be added for the second decoction, wherein the decoction includes the second decoction.
[0102] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0103] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0104] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0105] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0106] S1, after the decoction barrel has completed one decoction, a decoction liquid is extracted from the decoction barrel by a residue-liquid separator, wherein the decoction barrel is used to complete the decoction of the target prescription, and the decoction includes the first decoction.
[0107] S2, the image acquisition device acquires images of the packaging machine and performs visual recognition on the obtained image data to obtain the actual amount of the decoction, wherein the packaging machine is used to store the decoction.
[0108] S3, determine the amount of water to be added for the second decoction based on the required amount of medicinal liquid in the target prescription and the actual amount of medicinal liquid, and add water to the decoction pot according to the amount of water to be added for the second decoction, wherein the decoction includes the second decoction.
[0109] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0110] Embodiments of this application also provide a computer program product, including a non-volatile computer-readable storage medium storing the computer program product, wherein the computer program, when executed by a processor, implements the steps of the methods described in various embodiments of this application.
[0111] Optionally, in this embodiment, the computer program described above can be configured to perform the following steps when executed by the processor:
[0112] S1, after the decoction barrel has completed one decoction, a decoction liquid is extracted from the decoction barrel by a residue-liquid separator, wherein the decoction barrel is used to complete the decoction of the target prescription, and the decoction includes the first decoction.
[0113] S2, the image acquisition device acquires images of the packaging machine and performs visual recognition on the obtained image data to obtain the actual amount of the decoction, wherein the packaging machine is used to store the decoction.
[0114] S3, determine the amount of water to be added for the second decoction based on the required amount of medicinal liquid in the target prescription and the actual amount of medicinal liquid, and add water to the decoction pot according to the amount of water to be added for the second decoction, wherein the decoction includes the second decoction.
[0115] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0116] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0117] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for adding water during the second decoction of traditional Chinese medicine based on visual recognition, characterized in that, include: After the first decoction is completed in the decoction barrel, a decoction liquid is extracted from the decoction barrel by a residue-liquid separator. The decoction barrel is used to complete the decoction of the target prescription, and the decoction includes the first decoction. The image acquisition device acquires images of the packaging machine and performs visual recognition on the obtained image data to obtain the actual amount of the decoction. The packaging machine is used to store the decoction. The amount of water to be added for the second decoction is determined based on the required amount of medicinal liquid in the target prescription and the actual amount of medicinal liquid. Water is then added to the decoction pot according to the amount of water to be added for the second decoction. The decoction of medicinal liquid includes the second decoction.
2. The method according to claim 1, characterized in that, Before the decoction liquid is extracted from the decoction tank by a residue-liquid separator after the first decoction has been completed in the decoction tank, the method further includes: The target prescription is analyzed to obtain the drug details of the target prescription, wherein the drug details include: the drug names of multiple drugs and the drug weights of the multiple drugs; Using the drug details as input, the amount of water to be added for one decoction of the target prescription is calculated using an artificial intelligence adaptive learning method; Water is added to the decoction pot according to the amount of water to be added in the first decoction, and the decoction pot is used to perform the first decoction.
3. The method according to claim 1, characterized in that, After one decoction is completed in the decoction pot, a decoction liquid is extracted from the decoction pot using a residue-liquid separator, including: The decoction barrel is transferred to the residue-liquid separator by a robotic arm. The residue-liquid separator squeezes the residue in the decoction barrel to fully extract the decoction liquid. The decoction is transported through a pipeline to the packaging machine for temporary storage.
4. The method according to claim 1, characterized in that, Visual recognition is performed on the obtained image data to obtain the actual volume of the decoction, including: The image data is corrected by an angle correction algorithm to obtain corrected image data, wherein the angle correction algorithm is used to eliminate the angle tilt deviation of the image data; The corrected image data is visually identified using visual recognition technology to determine the liquid level of the decoction in the packaging machine. The volume of the decoction is determined based on the liquid level, and the actual amount of decoction is determined based on the liquid volume.
5. The method according to claim 4, characterized in that, The amount of water to be added for the second decoction is determined based on the required volume of the target prescription and the actual volume of the prescription, including: The amount of water added for the second decoction is calculated using the formula E=D-C+F, where E is the amount of water added for the second decoction, D is the required amount of medicinal liquid, C is the actual amount of medicinal liquid, and F is the amount of medicinal liquid retained as a sample. F is determined based on the decoction environment parameters.
6. The method according to claim 3, characterized in that, The method further includes adding water to the decoction pot according to the amount of water added for the second decoction, and then performing the second decoction in the decoction pot: After the second decoction is completed in the decoction barrel, the second decoction liquid is extracted from the decoction barrel by the residue-liquid separator; The second decoction is transported through a pipeline to the packaging machine and mixed with the first decoction to obtain a mixed decoction. The mixed medicinal liquid is heated to boiling to obtain the final decoction of the target prescription.
7. The method according to claim 1, characterized in that, Before the decoction liquid is extracted from the decoction tank by a residue-liquid separator after the first decoction has been completed in the decoction tank, the method further includes: Add the target medicinal materials corresponding to the target prescription to the decoction pot, and soak the target medicinal materials thoroughly in the decoction pot; After the target medicinal material has been fully soaked, the decoction barrel is transferred to a decoction station by a robotic arm, where the decoction barrel is decocted for the first time. The method further includes, after adding water to the decoction pot according to the amount of water added for the second decoction, and performing the second decoction in the decoction pot: Water is added to the decoction barrel according to the amount of water to be added for the second decoction, and the decoction barrel is transferred to the second decoction station by the robotic arm, where the decoction barrel is boiled for the second decoction. After the second decoction is completed in the decoction barrel, the second decoction liquid is extracted from the decoction barrel by the residue-liquid separator; The second decoction is transported to the packaging machine through a pipeline, and the final decoction in the packaging machine is packaged and the decoction barrel is cleaned.
8. A device for adding water for the second decoction of traditional Chinese medicine based on visual recognition, characterized in that, include: The liquid extraction module is used to extract a decoction liquid from the decoction tank by means of a residue-liquid separator after the first decoction has been completed in the decoction tank. The decoction tank is used to complete the decoction of the target prescription, and the decoction includes the first decoction. A visual recognition module is used to acquire images of the packaging machine through a preset image acquisition device, and to perform visual recognition on the obtained image data to obtain the actual amount of the decoction liquid. The packaging machine is used to store the decoction liquid. The decoction module is used to determine the amount of water to be added for the second decoction based on the required amount of liquid in the target prescription and the actual amount of liquid, and to add water to the decoction pot according to the amount of water to be added for the second decoction, wherein the decoction includes the second decoction.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method of any one of claims 1 to 7.
10. A computer program product, comprising a computer program, 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 7.