Online concentration monitoring and feedback control method and system for cough syrup production
By installing image detection equipment inside the mixing tank and in the circulation pipeline, the mixing state inside the mixing tank can be analyzed in real time, and the timing for obtaining the refractive index can be determined. This solves the problem of concentration fluctuation in cough syrup production and improves production efficiency and concentration detection accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-03-10
AI Technical Summary
In the current production of cough syrup, the concentration fluctuations caused by local aggregation and uneven mixing after the liquid is added to the mixing tank necessitate a longer concentration stabilization confirmation time, which prolongs the production time and affects production efficiency.
By installing image detection devices inside the mixing tank and at the circulation pipeline, surface image datasets can be acquired in real time. The mixing degree inside the mixing tank can be analyzed to determine the timing for obtaining the refractive index. The uniform concentration value can be directly obtained for feedback control, reducing misjudgments and detection time.
It effectively reduces misjudgment of mixing in the mixing tank, improves production efficiency, reduces concentration detection error, and increases the production speed of a single batch.
Smart Images

Figure CN121633012A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of pharmaceutical technology, and in particular relates to a method and system for online concentration monitoring and feedback control in the production of cough syrup. Background Technology Online concentration monitoring and feedback control in cough syrup production includes two steps: online concentration detection and feedback adjustment control. Online concentration detection refers to continuously detecting the refractive index of the cough syrup using an online refractometer, and then converting the real-time detected refractive index into a concentration value according to a pre-set concentration-refractive index mapping table. Feedback control refers to adding medicine or syrup to the mixing tank based on whether the concentration value obtained from the online concentration detection step meets the preset concentration value and the comparison between the detected concentration value and the preset concentration value.
[0002] In related technologies, especially in the online concentration detection step, a circulation pipeline is generally set up outside the mixing tank. The cough syrup in the mixing tank is pumped to the circulation pipeline by a pump, and then the online refractometer set up at the circulation pipeline detects the refractive index of the cough syrup in the circulation pipeline. The cough syrup then flows from the circulation pipeline back to the mixing tank to form a detection cycle for online concentration detection.
[0003] During concentration detection, after the drug solution is added to the syrup in the mixing tank, factors such as local aggregation of the drug solution, delayed convection and diffusion, and replacement of pipeline residues prevent the drug solution and syrup from mixing instantly and uniformly, resulting in a significant local concentration gradient. The online refractometer captures the concentration changes in real time during this process from non-uniformity to uniformity, specifically as fluctuations in the detected concentration value. Existing processes typically require setting a concentration stabilization confirmation time, which is the minimum duration for the concentration value to remain within a stable range. Only after the detected concentration value has remained stable for a certain period can it be confirmed as the actual concentration in the mixing tank.
[0004] To ensure the reliability of concentration detection, the concentration stabilization confirmation time is often set to a preset duration (e.g., 5-10 minutes). While this reduces the risk of misjudgment, it significantly prolongs the overall time required for single-batch production and single feedback adjustment control. For example, if the concentration stabilization confirmation time is set to 5 minutes, after the first addition of medication in a batch of cough syrup, the concentration value needs to be continuously monitored and maintained within a stable range for 5 minutes before the concentration in the mixing tank is determined. If the cough syrup concentration does not meet the preset concentration, after the second addition of medication, the concentration value still needs to be continuously monitored and maintained within a stable range for 5 minutes. Therefore, because the concentration stabilization confirmation time accumulates with the increase in feedback adjustment control steps, it directly leads to a prolonged production timeline for cough syrup. Ultimately, the concentration stabilization confirmation time, originally intended to improve the reliability of concentration detection, becomes the core issue restricting the production efficiency of cough syrup. Even with extensive experimental data, the concentration stabilization confirmation time can only be optimized (e.g., reduced from 5 minutes to 2 minutes), and the problem restricting the production efficiency of cough syrup still exists. Summary of the Invention
[0005] This application provides an online concentration monitoring and feedback control method and system for cough syrup production, which can improve the problem of low production efficiency of cough syrup caused by the concentration stability confirmation time originally set to improve the reliability of concentration detection.
[0006] In a first aspect, embodiments of this application provide an online concentration monitoring and feedback control method for cough syrup production, including: In response to a mixing operation, a first dataset is acquired in real time via a first detection device, and a second dataset is acquired in real time via a second detection device. The mixing operation refers to the addition of the medicine solution to the syrup in the mixing tank. The first dataset refers to multiple surface images of the cough syrup in the mixing tank, and the second dataset refers to multiple surface images of the cough syrup at the circulation pipe. The first detection device is located above the liquid surface in the mixing tank, and the second detection device is located outside the circulation pipe. The inlet of the circulation pipe is connected to the bottom of the mixing tank, and the outlet of the circulation pipe is connected to the interior of the mixing tank. Based on the first dataset and the second dataset, the degree of difference is determined; wherein the degree of difference is used to reflect the overall mixing degree of the cough syrup in the mixing tank; When the degree of difference meets the analysis conditions, the detection timing is determined based on the second dataset; wherein the detection timing is used to reflect the timing of obtaining the refractive index of the cough syrup in the circulation channel; Based on the detection timing, the corresponding refractive information is obtained, and the detection concentration value is determined based on the refractive information; wherein, the detection concentration value refers to the concentration value when the cough syrup in the stirring tank reaches uniformity. The cough syrup in the mixing tank is adjusted based on the detected concentration value.
[0007] The technical solutions described in this application embodiment have at least the following technical effects: The online concentration monitoring and feedback control method for cough syrup production provided in this application embodiment first acquires a first dataset of multiple surface images of cough syrup in the mixing tank in real time through a first detection device, and a second dataset of multiple surface images of cough syrup at the circulation pipe in real time through a second detection device. Then, based on the first and second datasets, the degree of difference reflecting the overall mixing degree of cough syrup in the mixing tank is determined. When the degree of difference meets the analysis conditions, the detection timing for acquiring the refractive index of cough syrup at the circulation pipe is determined based on the second dataset. At the detection timing, the refractive information of cough syrup at the circulation pipe is acquired, and the concentration value of cough syrup in the mixing tank when uniformity is achieved is determined based on the refractive information. Finally, feedback control of cough syrup in the pipe is directly performed based on the concentration value.
[0008] This method effectively reduces the misjudgment that local stability equates to uniformity of the cough syrup by comparing the color value changes of a first dataset of surface images of cough syrup in the mixing tank with a second dataset of surface images of cough syrup in the circulation pipe. Only when the degree of difference meets the analysis conditions does it mean that the cough syrup in the mixing tank has basically reached a uniform state. Under this condition, the timing of uniformity of the cough syrup in the mixing tank is further determined based on the second dataset, and refraction information is obtained based on this timing. The concentration value corresponding to the refraction information is then confirmed as the concentration of the cough syrup in the mixing tank, and feedback control is directly performed based on this concentration. There is no need to continuously monitor and detect that the concentration value remains within a stable range for a certain period of time, directly eliminating the concentration stability confirmation time originally used to improve the reliability of concentration detection. This significantly improves the production efficiency of a single batch. Furthermore, since concentration detection is only initiated after overall mixing is uniform and at a determined detection timing, the refraction information obtained at the circulation pipe can truly reflect the actual concentration of the syrup in the mixing tank, effectively reducing the concentration deviation that easily occurs when detection is not uniform in traditional methods, and controlling the detection error within a more accurate range.
[0009] In one possible implementation of the first aspect, determining the degree of difference based on the first dataset and the second dataset includes: A first change value is determined based on the first dataset; wherein the first change value is used to reflect the change in surface color value of the cough syrup in the mixing tank; A second change value is determined based on the second dataset; wherein the second change value is used to reflect the change in the surface color value of the cough syrup at the circulation pipe; The degree of difference is determined based on the first change value and the second change value.
[0010] In one possible implementation of the first aspect, determining the first change value based on the first dataset includes: Based on the acquisition order of the surface images in the first dataset, two feature points are arbitrarily selected from the surface images, and the feature color value difference is obtained based on the feature points; wherein, the feature color value difference is used to reflect the color value difference between the two feature points; When the feature color value difference is 0, acquire the feature image in the first dataset where the feature color value difference is 0; The color value difference between the initial image in the first dataset and the feature image is identified as the first change value; wherein, the initial image is used to reflect the image corresponding to the first frame in the first dataset.
[0011] In one possible implementation of the first aspect, determining the second change value based on the second dataset includes: Based on refractive feature points, a first feature color value is determined from the initial image in the second dataset; wherein, the refractive feature points are used to reflect the acquisition location of the refraction information, and the first feature color value refers to the color value of the initial image in the second dataset at the refractive feature points; Based on the refractive feature points, a second feature color value is determined from the nth image in the second dataset; wherein, the second feature color value refers to the color value of the nth image in the second dataset at the refractive feature point, and i is a positive integer greater than or equal to 2; The difference between the first feature color value and the second feature color value is identified as the second change value.
[0012] In one possible implementation of the first aspect, determining the degree of difference based on the first change value and the second change value includes: Obtain a correction factor; wherein the correction factor is used to reflect the ratio between the thickness of the cough syrup at the circulation pipe and the thickness of the cough syrup in the mixing tank; The second change value is adjusted based on the correction coefficient to obtain the corrected change value; The difference between the first change value and the corrected change value is identified as the degree of difference.
[0013] In one possible implementation of the first aspect, determining the detection timing based on the second dataset when the degree of difference satisfies the analysis conditions includes: When the degree of difference is 0, it is confirmed that the degree of difference meets the analysis conditions, and the analysis timing is obtained; wherein, the analysis timing is used to reflect the moment when the degree of difference is 0; Based on the analysis timing and stirring cycle, multiple detection data chains are determined from the second dataset; wherein, the stirring cycle is used to reflect the time it takes for the cough syrup to rotate once in the stirring tank, and the detection data chains are used to reflect the changing trend of the color value of the cough syrup at the circulation pipeline during the stirring cycle; Based on multiple detection data chains, the detection timing is obtained.
[0014] In one possible implementation of the first aspect, determining multiple detection data chains from the second dataset based on the analysis timing and stirring cycle includes: Based on the stirring cycle, the second dataset is divided into multiple subsets; wherein, the subsets refer to datasets with the same time length obtained after dividing the second dataset according to the stirring cycle; Based on the analysis timing, a feature dataset is selected from multiple subsets of the datasets; wherein, the feature dataset refers to a subset of the datasets that includes the analysis timing. The subset of data that follows the feature dataset is identified as the detection dataset. Based on multiple detection datasets, multiple detection data chains are determined.
[0015] In one possible implementation of the first aspect, determining multiple detection data chains based on multiple detection datasets includes: Based on relative time, a feature data is matched from each of the multiple detection datasets; wherein, the relative time refers to time points with the same time offset in the stirring cycle; A detection data chain is constructed by arranging the multiple feature data in time sequence.
[0016] In one possible implementation of the first aspect, obtaining the detection timing based on multiple detection data chains includes: Based on the initial data chain among the multiple detection data chains, a first adjacent node difference is determined; wherein, the first adjacent node difference is used to reflect the color value difference between the (i+1)th node and the ith node in the initial data chain; Based on the intermediate data chain among the multiple detection data chains, a second adjacent node difference is determined; wherein, the second adjacent node difference is used to reflect the color value difference between the (i+1)th node and the ith node in the intermediate data chain; The time point when the difference between the first adjacent node and the difference between the second adjacent node are equal is taken as the detection time.
[0017] Secondly, embodiments of this application provide an online concentration monitoring and feedback control system for cough syrup production, comprising: A first acquisition unit is configured to, in response to a mixing operation, acquire a first dataset in real time via a first detection device and a second dataset in real time via a second detection device; wherein, the mixing operation refers to the operation of adding liquid medicine to syrup in a mixing tank, the first dataset refers to multiple surface images of cough syrup in the mixing tank, and the second dataset refers to multiple surface images of cough syrup at the circulation pipe; the first detection device is located above the liquid surface in the mixing tank, the second detection device is located outside the circulation pipe, the inlet of the circulation pipe is connected to the bottom of the mixing tank, and the outlet of the circulation pipe is connected to the interior of the mixing tank; The first determination unit is used to determine the degree of difference based on the first dataset and the second dataset; wherein the degree of difference is used to reflect the overall mixing degree of the cough syrup in the mixing tank; The second determination unit is used to determine the detection timing based on the second dataset when the degree of difference meets the analysis conditions; wherein the detection timing is used to reflect the timing of obtaining the refractive index of the cough syrup in the circulation channel; The second acquisition unit is used to acquire corresponding refraction information based on the detection timing, and determine the detection concentration value based on the refraction information; wherein, the detection concentration value refers to the concentration value when the cough syrup in the stirring tank reaches uniformity. The feedback adjustment unit is used to adjust the cough syrup in the mixing tank based on the detected concentration value.
[0018] Thirdly, embodiments of this application provide an online concentration monitoring and feedback control device for cough syrup production, including a detection device and a control device. The detection device is disposed on a stirring device for cough syrup production. Both the stirring device and the detection device are electrically connected to the control device. The control device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the method described in any of the first aspects above.
[0019] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in any of the first aspects above.
[0020] Fifthly, embodiments of this application provide a computer program that, when running on an online concentration monitoring and feedback control device for cough syrup production, causes the online concentration monitoring and feedback control device for cough syrup production to execute the online concentration monitoring and feedback control method for cough syrup production described in any of the first aspects.
[0021] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a schematic flowchart of an embodiment of the online concentration monitoring and feedback control method for cough syrup production provided in this application; Figure 2 This is a schematic diagram illustrating the implementation process of an online concentration monitoring and feedback control method for cough syrup production provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an online concentration monitoring and feedback control system for cough syrup production provided in an embodiment of this application; Figure 4 This is a schematic diagram of the control device of an online concentration monitoring and feedback control equipment for cough syrup production provided in an embodiment of this application. Detailed Implementation
[0024] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0025] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0026] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0027] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0028] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0029] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0030] In related technologies, especially in the online concentration detection step, a circulation pipeline is generally set up outside the mixing tank. The cough syrup in the mixing tank is pumped to the circulation pipeline by a pump, and then the online refractometer set up at the circulation pipeline detects the refractive index of the cough syrup in the circulation pipeline. The cough syrup then flows from the circulation pipeline back to the mixing tank to form a detection cycle for online concentration detection.
[0031] During concentration detection, after the drug solution is added to the syrup in the mixing tank, factors such as local aggregation of the drug solution, delayed convection and diffusion, and replacement of pipeline residues prevent the drug solution and syrup from mixing instantly and uniformly, resulting in a significant local concentration gradient. The online refractometer captures the concentration changes in real time during this process from non-uniformity to uniformity, specifically as fluctuations in the detected concentration value. Existing processes typically require setting a concentration stabilization confirmation time, which is the minimum duration for the concentration value to remain within a stable range. Only after the detected concentration value has remained stable for a certain period can it be confirmed as the actual concentration in the mixing tank.
[0032] To ensure the reliability of concentration detection, the concentration stabilization confirmation time is often set to a preset duration (e.g., 5-10 minutes). While this reduces the risk of misjudgment, it significantly prolongs the overall time required for single-batch production and single feedback adjustment control. For example, if the concentration stabilization confirmation time is set to 5 minutes, after the first addition of medication in a batch of cough syrup, the concentration value needs to be continuously monitored and maintained within a stable range for 5 minutes before the concentration in the mixing tank is determined. If the cough syrup concentration does not meet the preset concentration, after the second addition of medication, the concentration value still needs to be continuously monitored and maintained within a stable range for 5 minutes. Therefore, because the concentration stabilization confirmation time accumulates with the increase in feedback adjustment control steps, it directly leads to a prolonged production timeline for cough syrup. Ultimately, the concentration stabilization confirmation time, originally intended to improve the reliability of concentration detection, becomes the core issue restricting the production efficiency of cough syrup. Even with extensive experimental data, the concentration stabilization confirmation time can only be optimized (e.g., reduced from 5 minutes to 2 minutes), and the problem restricting the production efficiency of cough syrup still exists.
[0033] To address the aforementioned issues, this application provides an online concentration monitoring and feedback control method and system for cough syrup production. In this method, during the process of adding the syrup solution to the mixing tank, a first dataset of multiple surface images of the cough syrup in the mixing tank is acquired in real time using a first detection device, and a second dataset of multiple surface images of the cough syrup in the circulation pipe is acquired in real time using a second detection device. Based on the first and second datasets, the degree of difference reflecting the overall mixing degree of the cough syrup in the mixing tank is determined. When the degree of difference meets the analysis conditions, a detection timing for obtaining the refractive index of the cough syrup in the circulation pipe is determined based on the second dataset. At the detection timing, the refractive information of the cough syrup in the circulation pipe is acquired, and the concentration value at which the cough syrup in the mixing tank reaches uniformity is determined based on this refractive information. Finally, feedback control of the cough syrup in the pipe is directly performed based on this concentration value.
[0034] This method effectively reduces the misjudgment that local stability equates to uniformity of the cough syrup by comparing the color value changes of a first dataset of surface images of cough syrup in the mixing tank with a second dataset of surface images of cough syrup in the circulation pipe. Only when the degree of difference meets the analysis conditions does it mean that the cough syrup in the mixing tank has basically reached a uniform state. Under this condition, the timing of uniformity of the cough syrup in the mixing tank is further determined based on the second dataset, and refraction information is obtained based on this timing. The concentration value corresponding to the refraction information is then confirmed as the concentration of the cough syrup in the mixing tank, and feedback control is directly performed based on this concentration. There is no need to continuously monitor and detect that the concentration value remains within a stable range for a certain period of time, directly eliminating the concentration stability confirmation time originally used to improve the reliability of concentration detection. This significantly improves the production efficiency of a single batch. Furthermore, since concentration detection is only initiated after overall mixing is uniform and at a determined detection timing, the refraction information obtained at the circulation pipe can truly reflect the actual concentration of the syrup in the mixing tank, effectively reducing the concentration deviation that easily occurs when detection is not uniform in traditional methods, and controlling the detection error within a more accurate range.
[0035] The online concentration monitoring and feedback control method for cough syrup production provided in this application embodiment can be applied to the online concentration monitoring and feedback control equipment for cough syrup production. In this case, the online concentration monitoring and feedback control equipment for cough syrup production is the executing entity of the online concentration monitoring and feedback control method for cough syrup production provided in this application embodiment. This application embodiment does not impose any restrictions on the specific type of online concentration monitoring and feedback control equipment for cough syrup production.
[0036] The online concentration monitoring and feedback control equipment for cough syrup production includes a detection device and a control device. The detection device is installed on the stirring device used in cough syrup production. Both the stirring device and the detection device are electrically connected to the control device. The stirring device includes a stirring tank, a stirring mechanism, a circulation pipeline, a circulation pump, and a dosing device. The stirring tank is used to hold the cough syrup; for example, the stirring tank can be a sealed tank or an open tank. The stirring mechanism is located inside the stirring tank and includes a stirrer and a power supply component. The stirrer shears and mixes the cough syrup in the stirring tank; for example, the stirrer can be an anchor stirrer, a paddle stirrer, or a turbine stirrer. The power supply component provides kinetic energy to the stirrer; for example, the power supply component can be a rechargeable lithium battery, a solar panel, etc. The circulation pipeline is located outside the stirring tank. The inlet of the circulation pipeline is connected to the bottom side wall of the stirring tank via a flange or quick-connect fitting, and the outlet of the circulation pipeline is also connected to the inner side wall of the stirring tank via a flange or quick-connect fitting. The circulation pipeline forms an external path for the circulation of cough syrup. A circulation pump is installed at the inlet of the circulation pipeline to continuously pump cough syrup from the bottom of the mixing tank into the circulation pipeline, allowing the pumped cough syrup to flow through the entire circulation loop. The addition device includes a first addition device and a second addition device. The output port of the first addition device is connected to the top of the mixing tank via a pipe and valve. The first addition device is used to add the liquid medicine into the mixing tank; for example, the first addition device can be a metering pump or a tank with a flow meter. The output port of the second addition device is also connected to the top of the mixing tank via a pipe and valve. The second addition device is used to add syrup into the mixing tank; for example, the second addition device can be a metering pump or a tank with a flow meter. The detection device includes a first detection device and a second detection device. The first detection device is located inside the mixing tank above the surface of the liquid inside the tank, and the second detection device is located outside the circulation pipeline. Both the first and second detection devices can be industrial cameras or high-speed camera modules. The control device is used to monitor and automatically control the entire mixing process; for example, the control device can be a programmable logic controller (PLC), a distributed control system (DCS), or an industrial computer (IPC).
[0037] To better understand the online concentration monitoring and feedback control method for cough syrup production provided in this application embodiment, the specific implementation process of the online concentration monitoring and feedback control method for cough syrup production provided in this application embodiment will be described by way of example below.
[0038] Figure 1 and Figure 2 A schematic flowchart illustrating the online concentration monitoring and feedback control method for cough syrup production provided in this application is shown. Please refer to [link / reference]. Figure 1 and Figure 2 Online concentration monitoring and feedback control methods for cough syrup production include: S100, in response to the mixing operation, acquires a first dataset in real time through a first detection device and a second dataset in real time through a second detection device; wherein, the mixing operation refers to the operation of adding the medicine liquid into the syrup in the mixing tank, the first dataset refers to multiple surface images of the cough syrup in the mixing tank, and the second dataset refers to multiple surface images of the cough syrup at the circulation pipe; the first detection device is located above the liquid surface in the mixing tank, the second detection device is located outside the circulation pipe, the inlet of the circulation pipe is connected to the bottom of the mixing tank, and the outlet of the circulation pipe is connected to the inside of the mixing tank.
[0039] It is understood that both the first and second detection devices are image acquisition devices. The first detection device acquires the first dataset, and the second detection device acquires the second dataset at the time corresponding to the addition of the medicine to the syrup in the mixing tank. The first detection device acquires multiple surface images of the syrup in the mixing tank after the medicine has been added, ultimately forming the first dataset. The second detection device acquires multiple surface images of the exterior of the circulation pipe located outside the mixing tank, ultimately forming the second dataset. The first dataset is continuously updated as multiple surface images of the cough syrup in the mixing tank are acquired, and the second dataset is continuously updated as multiple surface images of the cough syrup in the circulation pipe are acquired.
[0040] For example, the acquisition time of the first and second datasets can be manually input to trigger the acquisition operation of the first and second detection devices. Alternatively, the timing of adding the medicine to the mixing tank from the storage tank containing the medicine can be directly obtained by the control device as the acquisition time of the first and second datasets, and so on.
[0041] S200, based on the first dataset and the second dataset, determines the degree of difference; where the degree of difference is used to reflect the overall mixing degree of cough syrup in the mixing tank.
[0042] For example, the surface color value change of cough syrup in the mixing tank can be determined using a first dataset, and the surface color value change of cough syrup in the circulation pipe can also be determined using the first dataset. The comparison value between the surface color value change of cough syrup in the mixing tank and the surface color value change of cough syrup in the circulation pipe can then be used as the degree of difference. Alternatively, the first and second datasets can be input into a learning model, which outputs the corresponding degree of difference. The training process of the learning model can use the processed data of the first and second datasets and the corresponding degree of difference as the training dataset for the learning model, and then input the training dataset into the learning model for training, ultimately obtaining the learning model. And so on, but not limited to these examples.
[0043] In one possible implementation, in step S200, the degree of difference is determined based on the first dataset and the second dataset, including: S210, determine a first change value based on the first dataset; wherein the first change value is used to reflect the change in surface color value of cough syrup in the mixing tank.
[0044] For example, based on the acquisition order of the first dataset, two points can be arbitrarily selected from each newly acquired image in the first dataset. When the difference between the color values of these two points is 0, the corresponding newly acquired image is used as a feature image, and the difference between the color value of this feature image and the color value of the initial image (i.e., the first image in the first dataset) is used as the first change value. Alternatively, the first dataset can be input into a learning model, and the learning model can output the corresponding first change value, and so on, but it is not limited to these methods.
[0045] In one possible implementation, in step S210, determining the first change value based on the first dataset includes: S211, based on the acquisition order of the surface images in the first dataset, arbitrarily select two feature points from the surface images, and obtain the feature color value difference based on the feature points; wherein, the feature color value difference is used to reflect the color value difference between the two feature points.
[0046] It can be understood that the acquisition order refers to the sequence in which surface images of the cough syrup inside the mixing tank are acquired in ascending order of time. A feature point refers to any two points on the surface image of the cough syrup inside the mixing tank. Because the first detection device continuously acquires images, the first dataset is constantly updated; that is, the feature points are selected from the most recently acquired image in the first dataset.
[0047] S212, when the feature color value difference is 0, obtain the feature image in the first dataset where the feature color value difference is 0.
[0048] It can be understood that if the color value difference between any two feature points in a newly acquired image in the first dataset is 0, then the image is identified as a feature image.
[0049] S213, the color value difference between the initial image and the feature image in the first dataset is identified as the first change value; wherein, the initial image is used to reflect the image corresponding to the first frame in the first dataset.
[0050] It can be understood that the first change value = the color value of the initial image - the color value of the feature image. Before the medicine is added, the mixing tank only contains uniformly stirred syrup. After the medicine is added and the first dataset is obtained through the first detection device, the feature image is obtained through the analysis of the first dataset. This shows that at the moment corresponding to the feature image, the surface of the cough syrup in the mixing tank is uniform after the medicine is added. That is, the first change value can reflect the process of the surface of the syrup in the mixing tank becoming uniform after the medicine is added, which is the change from the color value of the initial image to the color value of the feature image.
[0051] This setup, by monitoring the color difference between two feature points, allows for real-time reflection of the mixing progress in the upper region of the cough syrup. It simplifies complex surface image analysis into two-point difference monitoring, reducing data processing while sensitively reflecting subtle changes during the mixing process, providing a dynamic basis for subsequent judgment of mixing stability. The difference between the color values of the initial image and the feature image directly reflects the total change in surface color values throughout the entire mixing process, from the beginning to local homogenization. This initial change value effectively reflects the progress of surface mixing.
[0052] S220, determine a second change value based on a second dataset; wherein the second change value is used to reflect the change in surface color value of the cough syrup at the circulation pipe.
[0053] For example, the color value of an initial image can be determined from a second dataset by measuring the refractive index of the cough syrup at the location in the circulation pipe (i.e., the location where the refractive index detection device is set), and the color value of at least a second image can be determined from the second dataset. The difference between the color value of the initial image and the color value of at least the second image in the second dataset is then identified as the second change value. Alternatively, the second dataset can be input into a learning model, which outputs the corresponding second change value, and so on, but is not limited to these methods.
[0054] In one possible implementation, in step S220, determining the second change value based on the second dataset includes: S221, Based on the refractive feature points, determine the first feature color value from the initial image in the second dataset; wherein, the refractive feature points are used to reflect the location of the acquisition of refraction information, and the first feature color value refers to the color value of the initial image in the second dataset at the refractive feature points.
[0055] It is understandable that the refractive feature point refers to the location of the refractive index detection equipment set in the circulation pipeline.
[0056] For example, the first image is first selected from the second dataset, and then the specific pixel position corresponding to the refractive feature point is found on the first image of the second dataset based on the refractive feature point. The color value at the pixel position is then extracted, and finally the color value is used as the first feature color value.
[0057] S222, Based on the refractive feature points, determine the second feature color value from the nth image in the second dataset; where the second feature color value refers to the color value of the nth image in the second dataset at the refractive feature point, and i is a positive integer greater than or equal to 2.
[0058] It can be understood that the second feature color value is the color value of the refractive feature point in at least the second image in the second dataset. The second image is the most recently acquired image in the second dataset. Furthermore, the second change value is continuously changing data, not a fixed value.
[0059] For example, from the newly acquired image in the second dataset, using the refractive feature points as the localization basis, the specific pixel position corresponding to the refractive feature points is found on the newly acquired image in the second dataset, the color value at that pixel position is extracted, and finally the color value is used as the second feature color value.
[0060] S223, the difference between the first characteristic color value and the second characteristic color value is identified as the second change value.
[0061] It can be understood that the second change value = the first characteristic color value - the second characteristic color value.
[0062] For example, assuming the first feature color value corresponding to the refractive feature point of the initial image is 230, and the second feature color value corresponding to the refractive feature point of the third image in the second dataset is 205, then the second change value is 25 (230-205), and so on.
[0063] This setup, by varying the difference between two characteristic color values, reflects the mixing progress of the cough syrup's bottom region in real time. It simplifies complex surface image analysis into a comparison of data, reducing data processing while sensitively reflecting subtle changes during the mixing process, providing a dynamic basis for subsequent judgment of mixing stability. The difference between the first characteristic color value of the initial image and the second characteristic color value of the characteristic image directly reflects the total change in the color value at the bottom of the cough syrup throughout the entire mixing process, from the beginning to local homogenization. The second change value effectively reflects the progress of bottom mixing.
[0064] S230, determine the degree of difference based on the first change value and the second change value.
[0065] This is understandable, as the refractive index is measured by drawing a portion of the liquid from the bottom of the mixing tank into the circulation pipe; that is, the liquid in the circulation pipe is the liquid from the bottom of the mixing tank. The degree of difference refers to the color difference between the syrup at the surface and the bottom of the liquid after the addition of the drug solution.
[0066] For example, the second change value can be adjusted to obtain a corrected change value, and the difference between the first change value and the corrected second change value can be used as the degree of difference. Alternatively, the first change value and the second change value can be input into a learning model, and the learning model can output the corresponding degree of difference, and so on, but are not limited to these.
[0067] This setup allows for the calculation of the first change value, directly reflecting the mixing state of the syrup on the surface of the tank. As mixing progresses, the color value gradually stabilizes, and the first change value changes accordingly. Calculating the second change value reflects the mixing state of the deeper syrup within the tank. Both provide quantitative indicators for judging the overall mixing performance within the tank. Comparing the color value changes at these two locations provides a criterion for determining the timing of subsequent detection, improving the accuracy of subsequent feedback control.
[0068] In one possible implementation, in step S230, determining the degree of difference based on the first change value and the second change value includes: S231, obtain the correction factor; wherein the correction factor is used to reflect the ratio between the thickness of the cough syrup at the circulation pipe and the thickness of the cough syrup in the mixing tank.
[0069] It's understandable that variations in thickness lead to differences in light transmittance, resulting in inconsistent colors. Even with the same concentration, different thicknesses will produce different colors for the same concentration. The correction factor is adjusted based on the amount of cough syrup produced each time. The thickness of the cough syrup in the circulation pipe is the same as the thickness of the circulation pipe itself. The thickness of the cough syrup in the mixing tank refers to the height of the liquid inside the mixing tank. Because the amount of syrup in the mixing tank and the amount of medicine added to the mixing tank vary each time the cough syrup is prepared, the thickness of the cough syrup in the mixing tank constantly changes. However, the thickness of the cough syrup in the circulation pipe is consistent with the inner diameter of the circulation pipe. Therefore, the correction factor is a non-fixed parameter, and its value is calculated as the thickness of the cough syrup in the circulation pipe divided by the thickness of the cough syrup in the mixing tank.
[0070] For example, if the actual thickness of the cough syrup in the mixing tank is 1m and the actual thickness of the cough syrup in the circulation pipe is 0.2m, then the correction factor is 5 (1 ÷ 0.2). After feedback adjustment of the cough syrup in the mixing tank, the actual thickness of the cough syrup in the mixing tank becomes 1.1m and the actual thickness of the cough syrup in the circulation pipe becomes 0.2m, then the correction factor becomes 5.5 (1.1 ÷ 0.2), and so on.
[0071] S232, adjust the second change value based on the correction coefficient to obtain the corrected change value.
[0072] It is understandable that the thickness of the liquid affects its transmittance, causing color differences in liquids of the same concentration. This variation arises because the thickness of the cough syrup in the mixing tank differs from the thickness in the circulation pipe. The correction factor adjusts either the color value of the cough syrup in the circulation pipe or the thickness of the cough syrup in the mixing tank. The correction change value is calculated as: Correction Change Value = First Characteristic Color Value - Second Characteristic Color Value × Correction Factor. Alternatively, it can be: Correction Change Value = First Characteristic Color Value ÷ Correction Factor - Second Characteristic Color Value.
[0073] S233, the difference between the first change value and the corrected change value is identified as the degree of difference.
[0074] It can be understood that the degree of difference = first change value - corrected change value.
[0075] With this setup, for syrups of the same concentration, the color value variation of a thicker layer may be greater than that of a thinner layer. The correction factor essentially converts the color value variation of the thinner layer in the circulation pipe into a proportional factor equivalent to the variation of the thicker layer within the tank. By amplifying the color value variation in the circulation pipe or reducing the color value variation within the mixing tank, it ensures that the color value variations in the circulation pipe and the mixing tank, or vice versa, have the same thickness sensitivity benchmark. This step provides a clear quantitative basis for subsequent calibration, reducing the problem of color value variations in the same mixing state but different thicknesses caused by physical differences. Furthermore, by standardizing the color changes of cough syrup at different locations to the same thickness, it reveals the moment when the degree of difference is 0, thus indicating when the cough syrup in the mixing tank is generally uniform. This provides an important foundation for subsequent analysis of detection timing. Without first correcting the variation values to ensure that the color value variations at different locations are compared along the same thickness dimension, it is impossible to determine when the cough syrup in the mixing tank becomes uniform, making subsequent analysis of detection timing impossible.
[0076] S300, when the degree of difference meets the analysis conditions, the detection timing is determined based on the second dataset; wherein, the detection timing is used to reflect the timing of obtaining the refractive index of the cough syrup in the circulation channel.
[0077] It is understandable that when the degree of difference is 0, it indicates that the liquid in the mixing tank is close to reaching a homogeneous state. When the refractive index detection device acquires the refractive index at the detection time, the concentration corresponding to that refractive index can be confirmed as the concentration of the cough syrup in the mixing tank.
[0078] For example, the trend of the color value of the cough syrup in the circulation pipe during the stirring cycle can be determined from the second dataset using the moment when the difference is 0 and the time it takes for the cough syrup to rotate once in the stirring tank. Finally, the detection timing can be determined by reflecting the trend of the color value of the cough syrup in the circulation pipe during the stirring cycle. Alternatively, the difference and the second dataset can be input into the learning model, and the learning model can output the corresponding detection timing, etc., but are not limited to these.
[0079] In one possible implementation, in step S300, when the degree of difference meets the analysis conditions, the detection timing is determined based on the second dataset, including: S310, when the degree of difference is 0, it is confirmed that the degree of difference meets the analysis conditions, and the analysis timing is obtained; whereby the analysis timing is used to reflect the moment when the degree of difference is 0.
[0080] It is understandable that even if the degree of difference is 0, that is, the colors of the upper and lower layers in the mixing tank are the same, it only means that the liquid in the mixing tank is basically uniform.
[0081] For example, if the analysis shows that the difference is 0.8 at 10s, 0.3 at 15s, and drops to 0 at 20s, then it can be confirmed that the analysis condition is met at 20s. Then, the moment when the difference is 0 is recorded, which is the analysis timing for this time, and so on.
[0082] S320, based on the analysis timing and stirring cycle, determines multiple detection data chains from the second dataset; wherein, the stirring cycle is used to reflect the time it takes for the cough syrup to rotate once in the stirring tank, and the detection data chains are used to reflect the changing trend of the color value of the cough syrup in the circulation pipeline during the stirring cycle.
[0083] It is understandable that when determining the timing of the analysis, it can only be stated that the cough syrup in the mixing tank is basically uniform in the macroscopic longitudinal direction, but it has not yet been determined that the cough syrup in the mixing tank is uniform in the axial direction.
[0084] For example, the second dataset can be divided into multiple datasets with the mixing cycle as the time length, based on the mixing cycle. Then, based on the analysis timing, a subset containing the analysis timing can be selected from these datasets. The multiple datasets following the subset containing the analysis timing are then identified as the detection dataset. Multiple detection data chains can then be identified using these multiple detection datasets. Alternatively, the analysis timing, mixing cycle, and second dataset can be input into a learning model, which outputs the corresponding multiple detection data chains, and so on, but are not limited to these methods.
[0085] In one possible implementation, in step S320, based on the analysis timing and stirring cycle, multiple detection data chains are determined from the second dataset, including: S321, based on the stirring cycle, the second dataset is divided into multiple subsets; wherein, a subset refers to a dataset with the same time length obtained after dividing the second dataset according to the stirring cycle.
[0086] It is understandable that the duration of each subset is equal to the stirring period. Multiple subsets are arranged in chronological order to form the second dataset.
[0087] S322, Select a feature dataset from multiple subsets based on the analysis timing; wherein, the feature dataset refers to a subset of the multiple subsets that includes the analysis timing.
[0088] It can be understood that including the analysis timing means that each image in the subset of data has a corresponding timestamp. When the timestamp of an image is equal to the analysis timing, it means that the image with the timestamp equal to the analysis timing is a feature image, and the subset of data containing the feature image is the feature dataset. Since the second dataset was continuously acquired after the addition of the drug solution, it indicates that before the analysis timing, the upper and lower liquids in the mixing tank had not yet reached homogenization.
[0089] S323 identifies the subset of data that follows the feature dataset from among multiple subsets as the detection dataset.
[0090] For example, if there are five subsets, and the feature dataset is the second subset, then each subset from the third to the fifth subset is identified as the detection dataset.
[0091] S324, based on multiple detection datasets, determines multiple detection data chains.
[0092] It is understandable that the detection data chain can reflect the color value changes of the mixing tank at different positions in the axial space during the same period.
[0093] For example, by using time points with the same time offset within the mixing cycle, a corresponding feature data point can be matched from each of multiple detection datasets. These multiple feature data points are then constructed in chronological order to obtain a detection data chain. Since there are multiple time points with the same time offset within the mixing cycle, each time point can match a corresponding feature data point in each detection dataset. These corresponding feature data points, constructed in chronological order, can form multiple detection data chains. Alternatively, multiple detection datasets can be input into a learning model, which outputs multiple corresponding detection data chains, and so on, but are not limited to these methods.
[0094] This configuration, after periodic segmentation, ensures that the color value changes within each subset exhibit cyclical characteristics. Color values across different subsets can be compared based on the same time offset within the cycle, reducing data distortion caused by random disturbances. Subsets before the feature dataset, corresponding to the uneven mixing stage, exhibit drastic color value fluctuations due to insufficient blending of the medicine and syrup, failing to reflect stable cyclical trends. Subsets after the feature dataset, corresponding to the more homogeneous stage, show color value fluctuations solely due to periodic disturbances from stirring and rotation, resulting in more stable data. Filtering out invalid data reduces the workload of subsequent data processing and minimizes the interference of fluctuating data on the detection data chain trend, improving data processing efficiency and accuracy.
[0095] In one possible implementation, in step S324, multiple detection data chains are determined based on multiple detection datasets, including: S3241, based on relative time, matches a feature data from each of multiple detection datasets; where relative time refers to time points with the same time offset in the stirring cycle.
[0096] As can be understood, relative time refers to a time point within each stirring cycle that has the same time offset as the start time of the cycle (for example, if there are three detection datasets and the stirring cycle is 10 seconds, the 2nd second of each cycle is a relative time, that is, the 2nd second of the first stirring cycle, the 2nd second of the second stirring cycle, and the 2nd second of the third stirring cycle are all relative times). Feature data refers to the color values in the image corresponding to the relative time in each detection dataset.
[0097] S3242 constructs a detection data chain by arranging multiple feature data in time sequence.
[0098] As can be understood, temporal sequence refers to the order of time, that is, the order of the actual time corresponding to the feature data from early to late (for example, the actual time of the 2nd second of the first stirring cycle is 37s, the actual time of the 2nd second of the second stirring cycle is 47s, and the actual time of the 2nd second of the third stirring cycle is 57s). The detection data chain is a data sequence formed by arranging multiple feature data in chronological order.
[0099] With this setup, since the feature data corresponding to the same position of the syrup rotation in each cycle reflects the color value state of the same physical position in different cycles, the difference can truly reflect the color value fluctuation range at that position, rather than the color value difference caused by positional differences. This can provide a benchmark at the same position for subsequent comparison of differences between adjacent nodes.
[0100] The S330 determines the detection timing based on multiple detection data chains.
[0101] For example, the color value difference between the (i+1)th node and the ith node in the first detection data chain of multiple detection data chains can be determined. The color value difference between the (i+1)th node and the ith node in the middle detection data chain of multiple detection data chains can be obtained. When the color value difference between these two chains is the same, the time when the color value difference between these two chains is the same can be used as the detection opportunity.
[0102] This setup precisely pinpoints the initial mixing point, defining an effective time range for subsequent analysis. When the difference is zero, it indicates that after the above steps, the mixing progress on the surface of the mixing tank and in the circulation pipe is completely synchronized, and the syrup has entered a preliminary homogeneous state. The analytical timing obtained at this point clarifies that from this moment onward, all subsequent data are monitoring data from a homogeneous state, reducing the time required for re-verification of concentration homogeneity in subsequent analyses and setting an effective starting point for determining the detection timing.
[0103] In one possible implementation, in step S330, the detection timing is obtained based on multiple detection data chains, including: S331, based on the initial data chain in multiple detection data chains, determine the first adjacent node difference; wherein, the first adjacent node difference is used to reflect the color value difference between the (i+1)th node and the ith node in the initial data chain.
[0104] It is understandable that the initial data chain refers to the first data chain among multiple detection data chains.
[0105] S332, based on the intermediate data chain in multiple detection data chains, determine the second adjacent node difference; wherein, the second adjacent node difference is used to reflect the color value difference between the (i+1)th node and the ith node in the intermediate data chain.
[0106] It can be understood that the intermediate data chain refers to the data chain in the middle among multiple detection data chains. When the number of multiple detection data chains is odd, the intermediate data chain is the middle detection data chain among the odd number of detection data chains. When the number of multiple detection data chains is even, the middle two detection data chains among the even number of detection data chains are averaged to construct an average data chain, which is the intermediate data chain. The averaging method is to average the color values of the corresponding nodes of the two middle detection data chains, and then reconstruct the average data chain according to the node order (for example, averaging the two color values of the two middle detection data chains at the i-th node yields the color value data corresponding to the i-th node of the average data chain; averaging the two color values of the two middle detection data chains at the (i+1)-th node yields the color value data corresponding to the (i+1)-th node of the average data chain, and so on).
[0107] S333, the time point when the difference between the first adjacent node and the difference between the second adjacent node are equal is taken as the detection time.
[0108] It is understandable that when the difference between the first and second adjacent nodes is equal, it indicates that the positions with the greatest linear distance in the axial space plane within the mixing tank exhibit the same color value change before and after stirring in the same stirring cycle. This suggests that at this point in time, the cough syrup in the mixing tank tends to be homogeneous in the axial space. Therefore, the refractive index detected at this point in time is the refractive index of the cough syrup in the mixing tank when it is just homogeneous. This point in time is thus used as the opportunity to obtain the refractive index of the cough syrup in the circulation pipe.
[0109] With this setup, when the difference between the first and second adjacent nodes is equal, it indicates that the fluctuation amplitudes at the two ends with the greatest axial distance within the mixing tank are completely synchronized and stable. At this point, the color value fluctuations are consistent, and the refractive index is also necessarily stable. Detecting the concentration at this moment reduces detection deviations caused by differences in fluctuations at different locations. The obtained concentration value accurately represents the true concentration of the overall syrup within the mixing tank, allowing for direct concentration determination immediately upon reaching homogenization, without the need to passively wait for concentration stabilization confirmation.
[0110] S400 acquires the corresponding refraction information based on the detection timing and determines the detection concentration value based on the refraction information; wherein, the detection concentration value refers to the concentration value when the cough syrup in the mixing tank reaches uniformity.
[0111] It's understandable that the detection concentration value can be obtained by directly matching the concentration database with refractive information, or by directly matching it with a refractive index-concentration value mapping table, and then manually inputting the detection concentration value. The concentration database refers to a database containing cough syrups of different concentrations and their corresponding refractive indices. This data can be obtained through laboratory experiments, on-site measurements and monitoring, and past experience. After acquisition, the collected data is organized, classified, and archived, useful information and patterns are extracted, and the relevant data is then saved into the database to form the concentration database.
[0112] The S500 provides feedback adjustments to the cough syrup in the mixing tank based on the detected concentration value.
[0113] It is understood that the detected concentration value refers to the content of the medicine in the cough syrup. When the detected concentration value is less than the preset concentration value, medicine is added to the mixing tank. If the detected concentration value is greater than the preset concentration value, syrup is added to the mixing tank, and the cycle of steps S100 to S400 continues until the detected concentration value is the same as the preset concentration value. The preset concentration value refers to the concentration value of the cough syrup to be produced and prepared by the user in advance.
[0114] This setup eliminates the need for continuous monitoring to ensure the concentration value remains stable for a certain period, thus removing the concentration stability confirmation time originally used to improve the reliability of concentration detection. This significantly improves the production efficiency per batch. Furthermore, since concentration detection is only initiated after the overall mixture is homogeneous and at a predetermined timing, the refractive information obtained from the circulation pipeline accurately reflects the actual concentration of the syrup in the mixing tank. This effectively reduces the concentration deviation that is prone to occur when detection is not homogeneous in traditional methods, keeping the detection error within a more precise range and improving detection accuracy and production efficiency.
[0115] It should be understood that the sequence number of each step in the above embodiments does not imply 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 this application.
[0116] Corresponding to the online concentration monitoring and feedback control method for cough syrup production described in the above embodiments, this application also provides an online concentration monitoring and feedback control system for cough syrup production. Each module of the online concentration monitoring and feedback control system for cough syrup production can realize each step of the online concentration monitoring and feedback control method for cough syrup production. Figure 3 The diagram shows the structure of the online concentration monitoring and feedback control system for cough syrup production provided in this application embodiment. For ease of explanation, only the parts related to this application embodiment are shown.
[0117] Reference Figure 3The online concentration monitoring and feedback control system for cough syrup production includes: The first acquisition unit is used to acquire a first dataset in real time through a first detection device and a second dataset in real time through a second detection device in response to a mixing operation. The mixing operation refers to the operation of adding the medicine to the syrup in the mixing tank. The first dataset refers to multiple surface images of the cough syrup in the mixing tank, and the second dataset refers to multiple surface images of the cough syrup in the circulation pipe. The first detection device is located above the liquid surface in the mixing tank, and the second detection device is located outside the circulation pipe. The inlet of the circulation pipe is connected to the bottom of the mixing tank, and the outlet of the circulation pipe is connected to the inside of the mixing tank.
[0118] The first determination unit is used to determine the degree of difference based on the first dataset and the second dataset; wherein the degree of difference is used to reflect the overall mixing degree of cough syrup in the mixing tank.
[0119] The second determination unit is used to determine the detection timing based on the second dataset when the degree of difference meets the analysis conditions; wherein, the detection timing is used to reflect the timing of obtaining the refractive index of the cough syrup in the circulation channel.
[0120] The second acquisition unit is used to acquire the corresponding refraction information based on the detection timing, and determine the detection concentration value based on the refraction information; wherein, the detection concentration value refers to the concentration value when the cough syrup in the stirring tank reaches uniformity.
[0121] The feedback adjustment unit is used to adjust the cough syrup in the mixing tank based on the detected concentration value.
[0122] It should be noted that the information interaction and execution process between the above systems / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0123] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0124] This application also provides an online concentration monitoring and feedback control device for cough syrup production. The device includes a detection device and a control device, with the detection device mounted on a stirring device used in cough syrup production. Both the stirring device and the detection device are electrically connected to the control device. Figure 4 This is a schematic diagram of the structure of the control device 4 provided in one embodiment of this application. Figure 4 As shown, the control device 4 in this embodiment includes: at least one processor 40 ( Figure 4 Only one is shown in the image), at least one memory 41 ( Figure 4 (Only one is shown in the image) and a computer program 42 stored in the at least one memory 41 and executable on the at least one processor 40, wherein when the processor 40 executes the computer program 42, it causes the control device 4 to perform the steps in any of the above embodiments of the online concentration monitoring and feedback control method for cough syrup production, or causes the control device 4 to perform the functions of each module / unit in the above embodiments of the system.
[0125] For example, the computer program 42 may be divided into one or more modules / units, which are stored in the memory 41 and executed by the processor 40 to complete this application. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 42 in the control device 4.
[0126] The control device 4 can be a computing device such as a desktop computer, laptop, handheld computer, or cloud server. The control device 4 may include, but is not limited to, a processor 40 and a memory 41. Those skilled in the art will understand that... Figure 4This is merely an example of control device 4 and does not constitute a limitation on control device 4. It may include more or fewer components than shown, or combine certain components, or different components, such as input / output devices, network access devices, buses, etc.
[0127] The processor 40 can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0128] In some embodiments, the memory 41 may be an internal storage unit of the control device 4, such as a hard disk or memory of the control device 4. In other embodiments, the memory 41 may be an external storage device of the control device 4, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the control device 4. Furthermore, the memory 41 may include both internal storage units and external storage devices of the control device 4. The memory 41 is used to store operating systems, applications, bootloaders, data, and other programs, such as the program code of computer programs. The memory 41 can also be used to temporarily store data that has been output or will be output.
[0129] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0130] This application provides a computer program product that, when run on an online concentration monitoring and feedback control device for cough syrup production, enables the device to implement the steps described in any of the above method embodiments.
[0131] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate form. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to the online concentration monitoring and feedback control equipment for cough syrup production, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, such as a USB flash drive, a portable hard drive, a magnetic disk, or an optical disk.
[0132] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0133] Those skilled in the art will recognize that the units and algorithm steps of the various examples 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 implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0134] In the embodiments provided in this application, it should be understood that the disclosed online concentration monitoring and feedback control system for cough syrup production can be implemented in other ways. For example, the embodiments of the online concentration monitoring and feedback control system for cough syrup production described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0135] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0136] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for on-line concentration monitoring and feedback control of cough syrup production, characterized by, The method comprises the following steps: in response to a mixing operation, acquiring a first data set in real time by a first detection device and acquiring a second data set in real time by a second detection device; wherein the mixing operation refers to an operation of adding a liquid medicine into a syrup in a stirring tank, the first data set refers to a plurality of surface images of the cough syrup in the stirring tank, and the second data set refers to a plurality of surface images of the cough syrup at a circulating pipeline; the first detection device is located above the liquid surface in the stirring tank, and the second detection device is located outside the circulating pipeline, an input port of the circulating pipeline is communicated with the bottom of the stirring tank, and an output port of the circulating pipeline is communicated with the inside of the stirring tank; based on the first data set and the second data set, determining a difference degree; wherein the difference degree is used to reflect the overall mixing degree of the cough syrup in the stirring tank; when the difference degree meets an analysis condition, based on the second data set, determining a detection timing; wherein the detection timing is used to reflect the acquisition timing of the refractive index of the cough syrup at the circulating pipeline; based on the detection timing, acquiring corresponding refractive information, and based on the refractive information, determining a detection concentration value; wherein the detection concentration value refers to the concentration value of the cough syrup in the stirring tank when it reaches uniformity; based on the detection concentration value, performing feedback adjustment on the cough syrup in the stirring tank.
2. The on-line concentration monitoring and feedback control method of cough syrup production according to claim 1, wherein, The method further comprises the following steps: based on the first data set, determining a first change value; wherein the first change value is used to reflect the surface color value change of the cough syrup in the stirring tank; based on the second data set, determining a second change value; wherein the second change value is used to reflect the surface color value change of the cough syrup at the circulating pipeline; based on the first change value and the second change value, determining the difference degree.
3. The on-line concentration monitoring and feedback control method of cough syrup production according to claim 2, wherein, The method further comprises the following steps: based on the acquisition order of the surface images in the first data set, selecting two feature points from the surface images at random, and based on the feature points, obtaining a feature color value difference; wherein the feature color value difference is used to reflect the color value difference between the two feature points; when the feature color value difference is 0, obtaining a feature image in the first data set with the feature color value difference being 0; confirming the color value difference between an initial image in the first data set and the feature image as the first change value; wherein the initial image is used to reflect the image corresponding to the first frame in the first data set.
4. The on-line concentration monitoring and feedback control method of cough syrup production according to claim 2, wherein, The method further comprises the following steps: based on a refraction feature point, determining a first feature color value from an initial image in the second data set; wherein the refraction feature point is used to reflect the acquisition position of the refractive information, and the first feature color value refers to the color value of the initial image in the second data set at the refraction feature point; based on a refraction feature point, determining a second feature color value from an nth image in the second data set; wherein the second feature color value refers to the color value of the nth image in the second data set at the refraction feature point, and i is a positive integer greater than or equal to 2. A difference between the first characteristic color value and the second characteristic color value is determined as a second change value.
5. The on-line concentration monitoring and feedback control method of cough syrup production according to claim 2, wherein, The determining of the difference degree based on the first change value and the second change value comprises: an adjustment coefficient is obtained, wherein the adjustment coefficient is used to reflect a ratio between a thickness of the cough syrup at the circulating pipeline and a thickness of the cough syrup in the stirring tank; the second change value is adjusted based on the adjustment coefficient to obtain an adjusted change value; a difference between the first change value and the adjusted change value is determined as the difference degree.
6. The on-line concentration monitoring and feedback control method of cough syrup production according to any one of claims 1 to 5, wherein, The determining of the detection timing based on the second data set when the difference degree meets the analysis condition comprises: when the difference degree is 0, it is determined that the difference degree meets the analysis condition, and an analysis timing is obtained, wherein the analysis timing is used to reflect a moment when the difference degree is 0; a plurality of detection data chains are determined from the second data set based on the analysis timing and a stirring period, wherein the stirring period is used to reflect a time for the cough syrup in the stirring tank to rotate one round, and the detection data chain is used to reflect a change trend of the color value of the cough syrup at the circulating pipeline over the stirring period; the detection timing is obtained based on the plurality of detection data chains.
7. The on-line concentration monitoring and feedback control method of cough syrup production according to claim 6, wherein, The determining of the plurality of detection data chains from the second data set based on the analysis timing and the stirring period comprises: the second data set is divided into a plurality of sub-data sets based on the stirring period, wherein the sub-data set refers to a data set with the same time length obtained by dividing the second data set by the stirring period; a feature data set is selected from the plurality of sub-data sets based on the analysis timing, wherein the feature data set refers to a sub-data set containing the analysis timing in the plurality of sub-data sets; the sub-data set after the feature data set in the plurality of sub-data sets is determined as a detection data set; the plurality of detection data chains are determined based on the plurality of detection data sets.
8. The on-line concentration monitoring and feedback control method of cough syrup production according to claim 7, wherein, The determining of the plurality of detection data chains based on the plurality of detection data sets comprises: a feature data is matched from each of the plurality of detection data sets based on a relative time, wherein the relative time refers to a time point with the same time offset in the stirring period; a detection data chain is constructed based on the plurality of feature data in time sequence.
9. The on-line concentration monitoring and feedback control method of cough syrup production as claimed in claim 6 wherein, The obtaining of the detection timing based on the plurality of detection data chains comprises: a first adjacent node difference is determined based on an initial data chain in the plurality of detection data chains, wherein the first adjacent node difference is used to reflect a color value difference between an i+1th node and an ith node in the initial data chain; a second adjacent node difference is determined based on an intermediate data chain in the plurality of detection data chains, wherein the second adjacent node difference is used to reflect a color value difference between an i+1th node and an ith node in the intermediate data chain; a time point at which the first adjacent node difference is equal to the second adjacent node difference is determined as the detection timing.
10. An on-line concentration monitoring and feedback control system for cough syrup production, characterized by, The method comprises: The first acquisition unit is configured to acquire, in real time, a first data set by a first detection device and a second data set by a second detection device in response to a mixing operation, wherein the mixing operation refers to an operation of adding a liquid medicine into syrup in a stirring tank, the first data set refers to a plurality of surface images of cough syrup in the stirring tank, and the second data set refers to a plurality of surface images of cough syrup at a circulating pipeline; the first detection device is located above a liquid surface in the stirring tank, and the second detection device is located outside the circulating pipeline, an input port of the circulating pipeline is communicated with a bottom of the stirring tank, and an output port of the circulating pipeline is communicated with an inside of the stirring tank; The first determination unit is configured to determine a difference degree based on the first data set and the second data set, wherein the difference degree is used to reflect a whole mixing degree of cough syrup in the stirring tank; The second determination unit is configured to determine a detection timing based on the second data set when the difference degree meets an analysis condition, wherein the detection timing is used to reflect an acquisition timing of a refractive index of cough syrup at the circulating pipeline; The second acquisition unit is configured to acquire corresponding refractive information based on the detection timing and to determine a detection concentration value based on the refractive information, wherein the detection concentration value refers to a concentration value of cough syrup in the stirring tank when the cough syrup is uniform; The feedback adjustment unit is configured to perform feedback adjustment on cough syrup in the stirring tank based on the detection concentration value.