Method and system for generating medicine decocting guidance scheme and medicine decocting equipment
Through OCR technology and drug database generation, the decoction guidance plan is solved, and the problem of inaccurate control of the amount of water added and decoction time in traditional self-decoction methods is achieved, personalized decoction guidance is achieved, and the quality and efficiency of decoction are improved.
Patent Information
- Application Number
- CN202510525693.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-08-08
AI Technical Summary
The traditional self-decoction method is difficult to accurately control the amount of water, order of dosing and cooking time, resulting in poor efficacy of traditional Chinese medicine and waste of drugs. The existing decoction service cannot provide scientific and reasonable decoction guidance.
The prescription image is identified through OCR technology, combined with the pre-constructed drug details database and water addition calculation model, the decoction guidance plan is automatically generated, including the decoction time, water addition and method of taking medicine, and personalized decoction guidance is provided.
It improves the convenience and quality of decoction, reduces drug waste, ensures the full decoction of effective ingredients of traditional Chinese medicine, and improves the decoction experience and efficacy.
Smart Images

Figure CN120452664A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and system for generating a decoction guidance plan, and decoction equipment. Background Art
[0002] Traditional Chinese medicine decoctions are the most widely used compound dosage form in clinical practice. Many hospitals and institutions offer decoction services, but these services present numerous drawbacks. For example, they fail to distinguish the order in which herbs are decocted, placing them all in the boiler simultaneously. This can lead to the volatilization or destruction of active ingredients in herbs that require longer decoctions, while preventing the full extraction of those that do. Furthermore, they often inaccurately control the amount of water added to the decoction. To avoid insufficient extraction, the amount of water is often increased, and the excess liquid is discarded after bagging. Compared to self-decoction, decoction services not only compromise the efficacy of the medication but also result in drug waste.
[0003] Many patients choose to self-decoct the herbs. Traditionally, this method involves using ceramic vessels such as clay pots and sand pots over an open flame with an adjustable temperature. This produces a concentrated decoction with good clinical efficacy. However, many patients lack the scientific and correct decoction techniques and are unable to accurately control the amount of water added, the order of adding herbs, and the decoction time. Clinicians, often overwhelmed by their busy clinic schedules, are unable to provide comprehensive and detailed guidance. This results in a failure to ensure that the herbs are properly and scientifically prepared, compromising their efficacy.
[0004] Therefore, there is an urgent need to design a software or decoction device that can automatically generate a scientific, comprehensive and quantitative decoction plan based on the treatment prescription to guide users to decoct the medicine. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide a decoction guidance scheme generation method, system and decoction equipment, which automatically and quickly generate a decoction guidance scheme from multiple dimensions such as the order of adding medicines, decoction time and amount of water added, so as to improve the convenience of decoction and the decoction experience.
[0006] In a first aspect, a method for generating a decoction guidance scheme is provided, which is applied to a decoction auxiliary client. The method comprises:
[0007] acquiring a treatment prescription image scanned by an image acquisition device;
[0008] Recognizing text information in the prescription image based on OCR technology, the text information at least including the prescription type, the name of each drug, and the dosage of each drug in the prescription image;
[0009] Determining the decoction time corresponding to the prescription type in the prescription image based on a preset correspondence between the prescription type and the decoction time;
[0010] Based on the drug name of each drug, the efficacy type and water absorption coefficient of each drug are searched in a pre-built drug detailed database, and the medication method of each drug is determined based on the efficacy type of each drug; the medication method of each drug constitutes the medication order; the medication method of each drug is a conventional medication method or a special medication method, the conventional medication method is to add the drugs at the same time; the special medication method is one of decoction first, subsequent addition, decoction in a package, decoction separately, melting, and taking with water;
[0011] The dosage of each drug, the water absorption coefficient of each drug, the decoction time and the target amount of the juice are input into the pre-built water addition calculation model to calculate the water addition amount;
[0012] Generate a decoction guidance plan based on the decoction time, water addition amount and the medicinal method of each medicine.
[0013] Optionally, recognizing text information in the prescription image based on OCR technology includes:
[0014] Preprocessing the prescription image, wherein the preprocessing includes at least noise reduction processing and binarization processing;
[0015] Performing character segmentation processing on the pre-processed prescription image to obtain various Chinese characters and various non-Chinese characters;
[0016] Cropping all Chinese characters located between non-Chinese characters into a first picture set, and cropping each non-Chinese character into a second picture set;
[0017] Format the pictures in the first picture set and the second picture set respectively so that the pictures have the same size;
[0018] Inputting the formatted first image set into a pre-trained Chinese character recognition model to obtain a Chinese character recognition result, and inputting the formatted second image set into a pre-trained non-Chinese character recognition model to obtain a non-Chinese character recognition result;
[0019] The Chinese character recognition results and non-Chinese character recognition results are integrated to output the final text information.
[0020] Optionally, the prescription types include at least antipyretic dosage forms, tonic dosage forms, and other dosage forms other than antipyretic dosage forms and tonic dosage forms; the preset correspondence between the prescription types and the decoction time is:
[0021] The decoction time corresponding to the antipyretic dosage form is the first time of decocting on low heat after boiling;
[0022] The decoction time corresponding to the tonic dosage form is the second time of decocting on low heat after boiling;
[0023] The corresponding decoction time for other dosage forms is the third period of decocting on low heat after boiling;
[0024] The first duration is greater than or equal to 20 minutes and less than the third duration, the third duration is less than the second duration, and the second duration is greater than or equal to 60 minutes.
[0025] Optionally, the water addition amount calculation model includes a first water addition amount calculation model; inputting the drug dosage of each drug, the water absorption coefficient of each drug, the decoction time and the target amount of the juice into the pre-built water addition amount calculation model to calculate the water addition amount includes:
[0026] determining the amount of water absorbed by each drug based on the drug dosage of each drug and the water absorption coefficient of each drug, and determining the total amount of water absorbed based on the water absorption of each drug;
[0027] Determining the total liquid evaporation amount within the boiling time based on the boiling time and the pre-calibrated liquid evaporation amount per unit time;
[0028] The total water absorption, total liquid evaporation and target medicinal juice volume are input into the first water addition calculation model to calculate the water addition volume for the first decoction;
[0029] Among them, the first water addition calculation model is:
[0030] Amount of water added = total water absorption + total liquid evaporation + target medicine juice amount.
[0031] Optionally, the water addition amount calculation model further includes a second water addition amount calculation model; when the decoction is performed multiple times, the water addition amount for the first decoction is calculated using the first water addition amount calculation model, and the water addition amount for the second and subsequent decoctions is calculated using the second water addition amount calculation model. The second water addition amount calculation model is:
[0032] Amount of water added = total liquid evaporation amount + target medicine juice amount.
[0033] Optionally, generating a decoction guidance plan based on the decoction time, the amount of water added, and the medicinal method of each medicine includes:
[0034] The decoction time, amount of water added, and the medicinal method of each medicine are added to the corresponding fields in the pre-built decoction guidance template to generate a decoction guidance plan.
[0035] Optionally, the method further comprises:
[0036] Obtain the patient's age information;
[0037] Determine the daily dosage based on the patient's age information;
[0038] Determine the target amount of medicine juice based on the daily dosage.
[0039] In a second aspect, a system for generating a decoction guidance plan is provided, which is applied to a decoction auxiliary client. The system includes:
[0040] an acquisition unit, configured to acquire the treatment prescription image scanned by the image acquisition device;
[0041] a recognition unit, configured to recognize text information in the treatment prescription image based on OCR technology, the text information including at least the prescription type, the name of each drug, and the dosage of each drug in the treatment prescription image;
[0042] a first determining unit, configured to determine a decoction time corresponding to a prescription type in the prescription image based on a preset correspondence between prescription types and decoction times;
[0043] A search unit, configured to search for the efficacy type and water absorption coefficient of each drug in a pre-built drug detail database based on the drug name of each drug;
[0044] The second determining unit is configured to determine the administration method of each drug based on the efficacy type of each drug; the administration method of each drug constitutes the order of administration; the administration method of each drug is a conventional administration method or a special administration method, the conventional administration method is simultaneous administration; the special administration method is one of decocting first, adding later, decocting in a package, decocting separately, melting, and taking with water;
[0045] A calculation unit is used to input the drug dosage of each drug, the water absorption coefficient of each drug, the decoction time and the target amount of medicine juice into a pre-built water addition calculation model to calculate the amount of water to be added;
[0046] The generation unit is used to generate a decoction guidance plan based on the decoction time, the amount of water added and the medicinal method of each medicine.
[0047] In a third aspect, a decoction device is provided, comprising a decoction device body, a decoction container, a heating system, a scanner, a timer, a liquid level detector, a display, and a processor;
[0048] The decoction container is assembled and connected with the decoction equipment body; the decoction container is used for decoction of medicine;
[0049] The heating system is arranged inside the decoction device body; the heating system is used to heat the decoction container;
[0050] The scanner and the timer are installed inside the medicine decoction device body and exposed on the outer surface of the medicine decoction device body; the scanner is used to scan and process the prescription image; the timer is used to detect the decoction time;
[0051] The liquid level detector is installed in the cavity of the decoction container; the liquid level detector is used to detect the amount of water added in the decoction container and the target amount of medicinal juice;
[0052] The processor is installed inside the decoction device body, and the processor is electrically connected to the heating system, the scanner, the timer, and the liquid level detector respectively; the processor is used to generate a decoction guidance program using the method of any one of claims 1 to 7;
[0053] The display is installed inside the medicine-decocting device body and exposed on the outer surface of the medicine-decocting device body, and the display is electrically connected to the processor; the display is used to display the medicine-decocting guidance program.
[0054] Optionally, a temperature sensor is further included;
[0055] The temperature sensor is installed on the inner wall of the cavity of the decoction container, and the temperature sensor is electrically connected to the processor; the temperature sensor is used to detect the temperature of the inner wall of the cavity of the decoction container during the process of decocting medicine through the decoction container;
[0056] The processor is further configured to determine a current decoction temperature based on the temperature of the inner wall of the cavity of the decoction container, and to notify a timer to start timing the decoction time when the current decoction temperature reaches a boiling temperature.
[0057] The present invention provides a decoction guidance scheme generation method, device and decoction equipment. Through a pre-built drug details database, the method of using the medicine is determined according to the efficacy type of each medicine, and the decoction time is determined according to the prescription type. The amount of water to be added is calculated according to a water addition calculation model. Based on the method of using the medicine, decoction time, amount of water to be added, etc. obtained in the above manner, a decoction guidance scheme is automatically and quickly generated. The method can provide users with a comprehensive decoction guidance scheme, thereby improving the convenience and decoction experience of decoction, and indirectly improving the decoction quality and decoction rate.
[0058] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0060] Figure 1 A flow chart of a method for generating a decoction guidance scheme provided by an embodiment of the present invention is shown;
[0061] Figure 2 A flowchart of identifying and treating prescription images based on OCR technology provided by an embodiment of the present invention is shown;
[0062] Figure 3 A schematic diagram of a character recognition process based on a network structure of a Chinese character recognition model and a non-Chinese character recognition model provided by an embodiment of the present invention is shown;
[0063] Figure 4 A schematic diagram showing the structure of a system for generating a decoction guidance program provided by an embodiment of the present invention is shown;
[0064] Figure 5 The figure shows a schematic structural diagram of a medicine decoction device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.
[0066] Traditionally, decoctions are prepared in ceramic vessels, such as clay pots, over an open flame with adjustable heat. This produces a concentrated decoction with good clinical efficacy. However, many patients struggle to master the correct decoction method and are unable to accurately control the amount of water added, the order in which the herbs are added, and the duration of the decoction. Furthermore, clinicians, often overwhelmed by their busy clinic schedules, are unable to provide comprehensive and detailed guidance, resulting in a failure to ensure the scientific and rational decoction of Chinese medicine, impacting its efficacy.
[0067] Based on this, an embodiment of the present invention provides a method for generating a decoction guidance scheme, which is described below through an embodiment. The decoction guidance scheme generation method provided by the embodiment of the present invention is applied to a decoction auxiliary client, which can be installed in a mobile terminal or in a decoction device, for example, in an electric decoction pot. Figure 1 As shown, the method includes the following steps:
[0068] Step S101: Acquire a treatment prescription image scanned by an image acquisition device.
[0069] In this step, the image acquisition device can be a camera in a mobile terminal such as a mobile phone. If the decoction auxiliary client is installed in the mobile terminal, the decoction auxiliary client can call the image acquisition device in the mobile terminal to capture and obtain the image of the processed prescription. If the decoction auxiliary client is installed in a decoction device, the decoction device can establish a communication connection with the mobile terminal via wireless communication methods such as Bluetooth. The decoction auxiliary client can obtain the image of the processed prescription captured by the image acquisition device in the mobile terminal through the communication transmission between the decoction device and the mobile terminal. The image acquisition device can also be a separate camera device embedded in the decoction device. The decoction auxiliary client can call the image acquisition device in the decoction device to capture and obtain the image of the processed prescription.
[0070] Step S102: Recognize text information in the prescription image based on OCR (Optical Character Recognition) technology, wherein the text information at least includes the prescription type, the name of each drug, and the dosage of each drug in the prescription image.
[0071] In an embodiment of the present invention, the treatment prescription image may be an image of an electronic prescription or an image of a handwritten prescription. It is more difficult to recognize the image of a handwritten prescription. Therefore, an embodiment of the present invention uses an improved method to recognize the text information in the treatment prescription image.
[0072] In a feasible embodiment, the text information in the prescription image is recognized based on OCR technology, including the following steps: Figure 2 As shown:
[0073] Step S102A: Pre-processing the treatment prescription image.
[0074] In this step, the preprocessing includes at least the following operations: noise reduction processing and binarization processing.
[0075] Noise reduction processing is used to remove noise points in the image and improve recognition accuracy; binarization processing is used to convert the image into a black and white image and highlight the text part for subsequent operations.
[0076] Step S102B: performing character segmentation processing on the pre-processed prescription image to obtain various Chinese characters and various non-Chinese characters.
[0077] In this step, the first step is to perform character segmentation on the preprocessed prescription image, separating the character portion and the blank space between each character. In one feasible embodiment, a horizontal projection method can be used for character segmentation. First, the number of black dots in each row of pixels contained in the preprocessed prescription image is calculated, and a curve is formed from each black dot. The blank space between each character causes troughs in the curve, which can be used to determine the upper and lower boundaries of the character. Based on the projection results, the image is cut at the appropriate troughs to achieve segmentation of the characters and the blank space.
[0078] In the second step, the recognized characters are further divided into Chinese characters and non-Chinese characters.
[0079] In this step, Chinese characters refer to Chinese characters defined in Unicode, which are usually in the range of u4e00-u9fff; non-Chinese characters refer to all characters other than Chinese characters, including but not limited to Latin letters, numbers, punctuation marks, and text in other languages.
[0080] In one feasible implementation, Chinese characters can be extracted through a regular expression, such as hanzi_pattern=re.compile(r'[\u4e00-\u9fff]+'). After the Chinese characters are extracted through this regular expression, the remaining characters are non-Chinese characters. The regular expression is used to match one or more consecutive Chinese characters. The specific rules are as follows: [\u4e00-\u9fff]: indicates matching characters in the Unicode encoding range from \u4e00 to \u9fff, which covers most commonly used Chinese characters and some extended Chinese characters. +: indicates that the leading character (i.e., the Chinese character) must appear once or multiple times to ensure matching of a continuous Chinese string.
[0081] Step S102C: cropping all Chinese characters located between non-Chinese characters into a first picture set, and cropping each non-Chinese character into a second picture set.
[0082] In an example, for example, the treatment prescription is "Shijueming 2g, Muli 3g"; the first cropped picture set includes pictures 1 and 2, the character in picture 1 is Shijueming; the character in picture 2 is Muli; the second picture set includes pictures 3 and 4, the character in picture 3 is 2g, and the character in picture 4 is 3g.
[0083] Step S102D: formatting the pictures in the first picture set and the second picture set respectively so that the pictures have the same size.
[0084] In one example, each picture is resized to a size of 64x960 pixels.
[0085] Since the cropped images have different sizes, it is not convenient for model processing. Therefore, in order to facilitate model processing, the size of the cropped images is adjusted to make them consistent, which is convenient for subsequent unified model processing.
[0086] Step S102E: inputting the formatted first picture set into a pre-trained Chinese character recognition model to obtain Chinese character recognition results, and inputting the formatted second picture set into a pre-trained non-Chinese character recognition model to obtain non-Chinese character recognition results.
[0087] In this step, the network structures of the Chinese character recognition model and the non-Chinese character recognition model are the same, except that the training data samples are different. Both the Chinese character recognition model and the non-Chinese character recognition model include convolutional layers and recurrent layers. Figure 3 As shown, the first and second images of 64x960x1 size are input into the Chinese character recognition model and the non-Chinese character recognition model respectively. After four layers of convolutional layers, spatial dimension features (such as the shape and position of the characters) are extracted to obtain 64 feature maps of 4x60 size. These feature maps are reshaped into 60 4x64 sequence features and input into the recurrent network to extract the dependency between the characters in the sequence features, so as to better understand the structure of the entire sentence or paragraph. Finally, the beam search algorithm (beam search algorithm) is used to select the result with the highest probability. In one example, the recurrent network can adopt an LSTM (Long Short-Term Memory) neural network.
[0088] In another embodiment, if the recognition result of a certain Chinese character or non-Chinese character is inaccurate, the image containing the character can be re-input into the model for recognition to correct the final recognition result.
[0089] Step S102F: The Chinese character recognition results and the non-Chinese character recognition results are integrated to output the final text information.
[0090] In this step, the fusion needs to be combined with the correspondence between the Chinese characters and the non-Chinese characters in the original prescription image to ensure the correctness of the information.
[0091] The embodiment of the present invention recognizes Chinese characters and non-Chinese characters separately because Chinese characters (Chinese characters) and other characters (such as Latin letters, numbers, punctuation marks, etc.) are very different in shape and structure. Using different models can optimize the characteristics of each character and improve recognition accuracy. In particular, for the recognition of handwritten Chinese characters, separate processing can better adapt to the characteristics of these handwritten Chinese characters, thereby ensuring that the recognition results are more accurate. In addition, recognizing Chinese characters and non-Chinese characters separately can also help reduce the complexity of the model and improve computing efficiency. Because if all types of characters are put into the same model for training, the model may become too large and difficult to train, and it also increases unnecessary computing burden.
[0092] Because OCR recognition may contain errors, the extracted text information needs to be verified and corrected as necessary. For example, methods such as rule-based matching and machine learning model prediction can be used to ensure the accuracy of the extracted text information. Furthermore, the verified text information is stored in a preset format, at least in JSON format, to facilitate subsequent processing.
[0093] Step S103: determining the decoction time corresponding to the prescription type in the treatment prescription image based on a preset correspondence between the prescription type and the decoction time.
[0094] In one example, the prescription types include at least antipyretic dosage forms, tonic dosage forms, and other dosage forms other than antipyretic dosage forms and tonic dosage forms; the preset correspondence between the prescription type and the decoction time is:
[0095] The decoction time corresponding to the antipyretic dosage form is the first time of simmering over low heat after boiling.
[0096] In the embodiments of the present invention, the antipyretic dosage form and other medicines containing volatile active ingredients should not be decocted for a long time. They should be boiled with high heat and then maintained with low heat for at least 20 minutes.
[0097] Among them, the description of high heat and low heat is recorded in "Compendium of Materia Medica·Volume 6": "First use high heat and then use low heat, and take it according to the method." That is, when decocting medicine, it is generally advisable to use high heat to boil the medicine liquid as quickly as possible to save time; then continue decocting with low heat to prevent the medicine juice from overflowing or drying up too quickly.
[0098] The corresponding decoction time for tonic dosage forms is the second time of simmering after boiling.
[0099] Tonic dosage forms belong to the nourishing category. For example, medicines such as minerals, bones, horns, shells, and crustaceans have active ingredients that are not easy to be decocted out. Therefore, they need to be decocted for a long time to allow the active ingredients to fully dissolve.
[0100] The corresponding decoction time for other types (except conventional dosage forms for diaphoresis and tonic) is the third period of decocting over low heat after boiling;
[0101] The first duration is greater than or equal to 20 minutes and less than the third duration, the third duration is less than the second duration, and the second duration is greater than or equal to 60 minutes.
[0102] Step S104: Based on the drug name of each drug, the efficacy type and water absorption coefficient of each drug are searched in the pre-built drug detailed database, and the medication method of each drug is determined based on the efficacy type of each drug.
[0103] The water absorption coefficient of each drug can be calibrated based on experimental data. The medicinal method of each drug is a conventional medicinal method or a special medicinal method. The conventional medicinal method is to use the drugs at the same time; the special medicinal methods are decocting first, adding the drug later, decocting with a package, decocting separately, melting, and taking with water. The medicinal method of each drug varies according to its efficacy type. The medicinal method of each drug can be one of the following: decocting first, adding the drug later, decocting with a package, decocting separately, melting, and taking with water.
[0104] In an embodiment of the present invention, Chinese medicinal materials are classified in the drug details database. In one example, they can be roughly divided into the following six categories:
[0105] Medications whose active ingredients are difficult to extract by decoction require pre-decoction. Generally speaking, animal horns, crustaceans (such as buffalo horns, goat horns, deer horns, tortoise shells, turtle shells, sea clam shells, stone cassia seeds, oysters, mother-of-pearl, and purple clam teeth), and minerals (such as gypsum, stamen stone, hearth loess, native copper, pumice, real estate, magnetite, hematite, dragon bones, pig iron, and purple quartz) often require pre-decoction for about half an hour before adding other herbs. Among herbal medicines, the active ingredients of herbs like chinaberry bark are also poorly soluble in water, so they also require pre-decoction if used with other herbs. Furthermore, some herbs (such as Chuanwu, Kusnezoffia, Aconite, and Tripterygium wilfordii) can reduce their toxicity by prolonged decoction, and these herbs should also be decocted beforehand. For example, herbs like processed Chuanwu, Kusnezoffia, and processed Aconite should be decocted for half an hour until the mouth is no longer numb; herbs like Tripterygium wilfordii should be decocted for an hour.
[0106] 2. Medications containing volatile active ingredients that are easily lost after long-term decoction (such as honeysuckle, forsythia, houttuynia, Cynanchum indica, cinnamon, agarwood, sandalwood, dalbergia odorifera, rose, and most of the antipyretic and anti-dampness drugs) and medicinal ingredients that are not resistant to decoction and easily destroyed after long-term decoction (such as Artemisia annua, rhubarb, senna leaves, stinking sycamore (used for lowering blood pressure), malt, barley sprout, Shenqu, white mustard seeds, apricot kernel, Uncaria rhynchophylla, cassia seed (used for laxatives)) should be added to the decoction later when used with general medicinal ingredients. After the other ingredients have been decocted for a certain period of time, these medicinal ingredients should be added and decocted for a certain period of time. Some medicinal ingredients (such as rhubarb and senna leaves) can even be soaked in boiling water.
[0107] 3. Medicines that have hairs or float on the liquid surface and are difficult to decoct (such as magnolia, inula flower, etc.), medicines that are powdery or easily make the decoction turbid after decoction (such as sea sand, herb frost, cattail pollen, sea clam shell powder, silkworm feces, catechu, stove heart loess, aconite fat, etc.), and medicines whose decoction is viscous and difficult to filter out (such as plantain seed, etc.) should be wrapped in gauze and decocted when made into decoctions.
[0108] 4. Precious medicines (such as ginseng, American ginseng, antelope horn, etc.) should be decocted separately to obtain juice, so as to prevent the effective ingredients of the decoction from being absorbed by the residues of other medicines in the same dose, resulting in waste of precious medicinal materials.
[0109] 5. Glue-based drugs (such as donkey-hide gelatin, deer antler glue, tortoise shell glue, etc.) are easy to stick to the pan and burn if decocted with other medicines. They will also adhere to other medicinal materials, which will not only cause waste of glue-based drugs, but also affect the dissolution of the effective ingredients of other medicines. Therefore, they should be melted separately and taken.
[0110] 6. Medicines that dissolve in water (such as Glauber's salt), juice-type medicines (such as bamboo juice, honey, malt sugar, etc.), and juices obtained by grinding antelope horns, agarwood, etc. with water do not need to be decocted and should be taken directly with boiled water or juice.
[0111] The embodiment of the present invention can generate a more professional decoction scheme by classifying and limiting the medicinal method of each medicine in the prescription, thereby achieving a better decoction effect.
[0112] Step S105: inputting the drug dosage of each drug, the water absorption coefficient of each drug, the decoction time and the target amount of medicinal juice into a pre-built water addition calculation model to calculate the water addition amount.
[0113] In an embodiment of the present invention, the water addition amount calculation model includes at least a first water addition amount calculation model; the drug dosage of each drug, the water absorption coefficient of each drug, the decoction time, and the target amount of the medicinal juice are input into the pre-built water addition amount calculation model to calculate the water addition amount, including:
[0114] Step S105A: Determine the water absorption amount of each drug based on the drug dosage and the water absorption coefficient of each drug, and determine the total water absorption amount based on the water absorption amount of each drug.
[0115] Step S105B: determining the total liquid evaporation amount within the boiling time based on the boiling time and the pre-calibrated liquid evaporation amount per unit time.
[0116] In this step, the amount of liquid evaporated per unit time can be calibrated based on experimental data. The amount of liquid is based on the water content. For example, if the boiling time is 20 minutes and the liquid evaporated per unit time is preset to 10 ml per minute, the total evaporation amount is 200 ml.
[0117] Step S105C: Input the total water absorption, total liquid evaporation and target medicinal juice volume into the first water addition calculation model to calculate the water addition volume for the first decoction; wherein the first water addition calculation model is:
[0118] Amount of water added = total water absorption + total liquid evaporation + target medicine juice amount.
[0119] In a specific example, the first water addition amount = A + (B1×M1+B2×M2+...+Bn×Mn)+C×T;
[0120] Among them, A is the target amount of medicine juice, for example, 250 ml; Bi is the water absorption coefficient of the i-th medicine; Mi is the drug dosage of the i-th medicine; n is the number of medicines in the treatment prescription; C is the liquid evaporation amount per unit time; T is the decoction time.
[0121] Optionally, the water addition amount calculation model further includes a second water addition amount calculation model; when the decoction is performed multiple times, the water addition amount for the first decoction is calculated using the first water addition amount calculation model, and the water addition amount for the second and subsequent decoctions is calculated using the second water addition amount calculation model; wherein the second water addition amount calculation model is:
[0122] Amount of water added = total liquid evaporation amount + target medicine juice amount.
[0123] Because the medicine has absorbed enough water during the first decoction, the amount of water absorbed by the medicine during the second and subsequent decoctions can be ignored.
[0124] Step S106: Generate a decoction guidance plan based on the decoction time, the amount of water added, and the medicinal method of each medicine.
[0125] In a feasible embodiment, generating a decoction guidance scheme based on the decoction time, the amount of water added, and the medicinal method of each medicine includes:
[0126] The decoction time, amount of water added, and the medicinal method of each medicine are added to the corresponding fields in the pre-built decoction guidance template to generate a decoction guidance plan.
[0127] In an example, the decoction instruction template contains the following content:
[0128] 1. Frying utensils
[0129] It is advisable to use ceramic utensils such as casseroles and sand pots for decocting medicine.
[0130] 2. Water for decoction
[0131] The water used for decoction must be odorless, clean, clear, and low in minerals and impurities. Generally speaking, any water that is suitable for drinking can be used for decoction. However, water that contains excessive amounts of heavy metals, or is contaminated by industrial wastewater, pesticides, or radioactive substances should not be used for decoction.
[0132] 3. Amount of water added
[0133] XXmL.
[0134] 4. Soak before frying
[0135] Proper soaking before decoction facilitates the extraction of active ingredients. Direct heating and decocting without soaking can cause the starch and protein on the medicinal surface to swell, blocking capillaries and making it difficult for water to enter the slices and for the active ingredients to diffuse outward. Soaking before decoction not only facilitates the full dissolution of active ingredients but also shortens the decoction time, preventing the loss and destruction of active ingredients caused by prolonged decoction.
[0136] Most medicinal herbs should be soaked in cold or warm water (e.g., 25-50°C) (almonds should be soaked in boiling water). General medicinal herbs can be soaked for 20-30 minutes. Seed- or fruit-based medicinal herbs can be soaked for 1 hour. In the summer, when temperatures are high, soaking for too long is advised to prevent spoilage.
[0137] 5. Cooking Temperature and Cooking Time
[0138] Bring to a boil over high heat first, then simmer over low heat for XX minutes (the simmering time mentioned above).
[0139] 6. Filter the juice in time
[0140] 7. Decoction times
[0141] XXX times (e.g. 1, 2, or 3 times, etc.).
[0142] 8. Medicinal Methods
[0143] XXX.
[0144] By adding the decoction time, amount of water added and the medicinal method of each medicine to the decoction guidance template, a decoction guidance plan can be generated.
[0145] It should be noted that the above template is only an example, and the steps and content of the template can be adjusted according to actual needs. For example, if the decoction auxiliary client is installed in a decoction device (such as an electric decoction pot), the guidance on the decoction utensils can be removed.
[0146] The embodiment of the present invention uses a pre-built drug details database to determine the method of using each drug according to the efficacy type of each drug, and determines the decoction time according to the prescription type, and calculates the amount of water to be added according to the water addition calculation model. Based on the method of using the drug, decoction time, amount of water to be added, etc. obtained in the above manner, a decoction guidance plan is automatically and quickly generated and presented in a visual manner, thereby providing users with a comprehensive and integrated decoction guidance plan, improving the convenience and decoction experience of decoction, and indirectly improving the decoction quality and decoction rate.
[0147] Based on the above embodiment, the method further includes:
[0148] Obtain the patient's age information;
[0149] Determine the daily dosage based on the patient's age information;
[0150] Determine the target amount of medicine juice based on the daily dosage.
[0151] The target amount of the decoction is generally uniformly set in the prior art, but the embodiment of the present invention is more personalized and can be set according to the specific situation of the patient. For example, for the elderly and children who take less medicine and are not suitable for taking too much medicine, it can be recommended to boil the target amount of the decoction to 200 ml / day; for young and middle-aged people who take more medicine, it can be recommended to boil the target amount of the decoction to 400 ml / day. By determining the target amount of the decoction according to the patient's age group, personalized settings can be achieved, which is more in line with the patient's situation.
[0152] Based on the same inventive concept, the embodiment of the present invention provides a decoction guidance scheme generation system, which is applied to a decoction auxiliary client, such as Figure 4 As shown, the system includes:
[0153] The acquisition unit 401 is configured to acquire the treatment prescription image scanned by the image acquisition device.
[0154] The recognition unit 402 is configured to recognize text information in the treatment prescription image based on OCR technology, where the text information at least includes the prescription type, the name of each drug, and the dosage of each drug in the treatment prescription image.
[0155] The first determining unit 403 is configured to determine the decoction time corresponding to the prescription type in the treatment prescription image based on a preset correspondence relationship between the prescription type and the decoction time.
[0156] The search unit 404 is configured to search the efficacy type and water absorption coefficient of each drug in a pre-built drug detailed database based on the drug name of each drug.
[0157] The second determination unit 405 is used to determine the medication method of each medicine based on the efficacy type of each medicine; the medication method of each medicine constitutes the medication order; the medication method of each medicine is a conventional medication method or a special medication method, the conventional medication method is to add the medicines at the same time; the special medication method is one of decocting first, adding later, decocting in a package, decocting separately, melting, and taking with water.
[0158] The calculation unit 406 is used to input the drug dosage of each drug, the water absorption coefficient of each drug, the decoction time and the target amount of medicine juice into the pre-built water addition calculation model to calculate the amount of water to be added.
[0159] The generating unit 407 is used to generate a decoction guidance plan based on the decoction time, the amount of water added and the medicinal method of each medicine.
[0160] In one possible embodiment, the recognition unit 402 is used to preprocess the treatment prescription image, and the preprocessing includes at least noise reduction processing and binarization processing; perform character segmentation processing on the preprocessed treatment prescription image to obtain various Chinese characters and various non-Chinese characters; crop all Chinese characters located between various non-Chinese characters into a first picture set, and crop various non-Chinese characters into a second picture set; format the pictures in the first picture set and the second picture set respectively to make the pictures have the same size; input the formatted first picture set into a pre-trained Chinese character recognition model to obtain Chinese character recognition results, and input the formatted second picture set into a pre-trained non-Chinese character recognition model to obtain non-Chinese character recognition results; and fuse the Chinese character recognition results and the non-Chinese character recognition results to output the final text information.
[0161] In one possible embodiment, the prescription types include at least antipyretic dosage forms, tonic dosage forms, and other dosage forms other than antipyretic dosage forms and tonic dosage forms; the preset correspondence between the prescription type and the decoction time is:
[0162] The decoction time corresponding to the antipyretic dosage form is the first time of decocting on low heat after boiling;
[0163] The decoction time corresponding to the tonic dosage form is the second time of decocting on low heat after boiling;
[0164] The corresponding decoction time for other dosage forms is the third period of decocting on low heat after boiling;
[0165] The first duration is greater than or equal to 20 minutes and less than the third duration, the third duration is less than the second duration, and the second duration is greater than or equal to 60 minutes.
[0166] In one possible embodiment, the water addition amount calculation model includes a first water addition amount calculation model; the calculation unit is configured to: determine the water absorption amount of each drug based on the drug dosage of each drug and the water absorption coefficient of each drug, and determine the total water absorption amount based on the water absorption amount of each drug;
[0167] Determining the total liquid evaporation amount within the boiling time based on the boiling time and the pre-calibrated liquid evaporation amount per unit time;
[0168] The total water absorption, total liquid evaporation and target medicinal juice volume are input into the first water addition calculation model to calculate the water addition volume for the first decoction;
[0169] Among them, the first water addition calculation model is:
[0170] Amount of water added = total water absorption + total liquid evaporation + target medicine juice amount.
[0171] Optionally, the water addition amount calculation model further includes a second water addition amount calculation model; when the decoction is performed multiple times, the water addition amount for the first decoction is calculated using the first water addition amount calculation model, and the water addition amount for the second and subsequent decoctions is calculated using the second water addition amount calculation model. The second water addition amount calculation model is:
[0172] Amount of water added = total liquid evaporation amount + target medicine juice amount.
[0173] In a possible real-time manner, the generating unit is used to add the decoction time, the amount of water added, and the medicinal method of each medicine to the corresponding fields in the pre-built decoction guidance template to generate a decoction guidance plan.
[0174] In one possible real-time approach, the system further comprises:
[0175] Obtain the patient's age information;
[0176] Determine the daily dosage based on the patient's age information;
[0177] Determine the target amount of medicine juice based on the daily dosage.
[0178] A third aspect provides a decoction device, such as Figure 5 As shown, it includes a decoction device body, a decoction container, a scanner 502, a timer 503, a liquid level detector 504, a display 505 and a processor 501;
[0179] The decoction container is assembled and connected with the decoction equipment body; the decoction container is used for decocting medicines.
[0180] The assembly connection can be achieved in a variety of ways, for example, it can be any one of a pluggable connection, a pipe hose connection, an integrated / split combination, a one-piece mechanical fixation, etc.
[0181] The heating system is arranged inside the decoction device body; the heating system is used to heat the decoction container;
[0182] The scanner and the timer are installed inside the medicine decoction device body and exposed on the outer surface of the medicine decoction device body; the scanner is used to scan and process the prescription image; the timer is used to detect the decoction time;
[0183] The liquid level detector is installed in the cavity of the decoction container; the liquid level detector is used to detect the amount of water added in the decoction container and the target amount of medicinal juice;
[0184] The processor is installed inside the decoction device body, and the processor is electrically connected to the heating system, the scanner, the timer, and the liquid level detector respectively; the processor is used to generate a decoction guidance program using the method of any one of claims 1 to 7;
[0185] The display is installed inside the medicine-decocting device body and exposed on the outer surface of the medicine-decocting device body, and the display is electrically connected to the processor; the display is used to display the medicine-decocting guidance program.
[0186] In a possible implementation, a temperature sensor is further included;
[0187] The temperature sensor is installed on the inner wall of the cavity of the decoction container, and the temperature sensor is electrically connected to the processor; the temperature sensor is used to detect the temperature of the inner wall of the cavity of the decoction container during the process of decocting medicine through the decoction container;
[0188] The processor is further configured to determine a current decoction temperature based on the temperature of the inner wall of the cavity of the decoction container, and to notify a timer to start timing the decoction time when the current decoction temperature reaches a boiling temperature.
[0189] Specifically, for prescriptions of antipyretic type, they are simmered for 20 minutes after boiling. Then, after the temperature sensor detects that the current decoction temperature has reached 100 degrees, it switches to simmering, and the timer starts counting and counts to 20 minutes.
[0190] In a possible embodiment, after the timing ends, a voice broadcast device can be used to remind the user. Therefore, a voice broadcast device can also be provided on the decoction device.
[0191] The above-mentioned processor 501 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0192] The method for generating a decoction guidance scheme provided in an embodiment of the present invention can also be implemented as a computer program product, which includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the previous method embodiment. For specific implementation, please refer to the method embodiment and will not be repeated here.
[0193] The decoction guidance scheme generation system provided in the embodiment of the present invention can be specific hardware on the device or software or firmware installed on the device. The system provided in the embodiment of the present invention has the same implementation principle and technical effects as the aforementioned method embodiment. For the sake of brief description, any part not mentioned in the system embodiment can be referred to the corresponding content in the aforementioned method embodiment. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment and will not be repeated here.
[0194] In the embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. The system embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. 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. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interface, the indirect coupling or communication connection of the system or unit may be electrical, mechanical or other forms.
[0195] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0196] In addition, each functional unit in the embodiment provided by the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0197] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0198] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0199] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or replace some of the technical features therein with equivalents. However, such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. They should all be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A method for generating a decoction guidance scheme, characterized in that: Applied to a decoction auxiliary client, the method includes: acquiring a treatment prescription image scanned by an image acquisition device; Recognizing text information in the treatment prescription image based on OCR technology, wherein the text information at least includes a prescription type, a name of each drug, and a dosage of each drug in the treatment prescription image; Determining the decoction time corresponding to the prescription type in the treatment prescription image based on a preset correspondence between the prescription type and the decoction time; Based on the names of the drugs, the efficacy types and water absorption coefficients of the drugs are searched in a pre-built drug detail database, and the administration methods of the drugs are determined based on the efficacy types of the drugs; the administration methods of the drugs constitute the order of drug addition; the administration methods of the drugs are conventional or special, the conventional administration method is simultaneous administration; the special administration method is one of decocting first, adding later, decocting in a package, decocting separately, melting, and taking with water; The dosage of each drug, the water absorption coefficient of each drug, the decoction time, and the target amount of the decoction are input into a pre-built water addition calculation model to calculate the amount of water to be added; A decoction guidance scheme is generated based on the decoction time, the amount of water added and the medicinal method of each medicine.
2. The method according to claim 1, characterized in that The identifying of text information in the prescription image based on OCR technology includes: Preprocessing the prescription image, wherein the preprocessing includes at least noise reduction and binarization; Performing character segmentation processing on the pre-processed prescription image to obtain various Chinese characters and various non-Chinese characters; Cropping all Chinese characters located between the non-Chinese characters into a first picture set, and cropping the non-Chinese characters into a second picture set; formatting the pictures in the first picture set and the second picture set respectively so that the pictures have the same size; Inputting the formatted first image set into a pre-trained Chinese character recognition model to obtain a Chinese character recognition result, and inputting the formatted second image set into a pre-trained non-Chinese character recognition model to obtain a non-Chinese character recognition result; The Chinese character recognition result and the non-Chinese character recognition result are fused to output the final text information.
3. The method according to claim 1, characterized in that The prescription types include at least antipyretic dosage forms, tonic dosage forms, and other dosage forms other than the antipyretic dosage forms and tonic dosage forms; the correspondence between the preset prescription types and the decoction time is as follows: The decoction time corresponding to the antipyretic dosage form is the first time of decocting on low heat after boiling; The decoction time corresponding to the tonic dosage form is the second time of decocting on low heat after boiling; The decoction time corresponding to the other dosage forms is the third time of decocting on low heat after boiling; The first duration is greater than or equal to 20 minutes and less than the third duration, the third duration is less than the second duration, and the second duration is greater than or equal to 60 minutes.
4. The method according to claim 1, wherein The water addition amount calculation model includes a first water addition amount calculation model; the step of inputting the drug dosage of each drug, the water absorption coefficient of each drug, the decoction time, and the target amount of medicinal juice into the pre-built water addition amount calculation model to calculate the water addition amount includes: determining the water absorption amount of each drug based on the drug dosage of each drug and the water absorption coefficient of each drug, and determining the total water absorption amount based on the water absorption amount of each drug; Determining a total amount of liquid evaporated during the boiling time based on the boiling time and a pre-calibrated amount of liquid evaporated per unit time; Inputting the total water absorption amount, the total liquid evaporation amount and the target medicinal juice amount into a first water addition amount calculation model to calculate the water addition amount for the first decoction; Wherein, the first water addition amount calculation model is: Amount of water added = total water absorption + total liquid evaporation + target medicine juice amount.
5. The method according to claim 4, characterized in that The water addition amount calculation model also includes a second water addition amount calculation model; when the decoction is performed multiple times, the water addition amount for the first decoction is calculated using the first water addition amount calculation model, and the water addition amount for the second and subsequent decoctions is calculated using the second water addition amount calculation model, and the second water addition amount calculation model is: Amount of water added = total liquid evaporation amount + target medicine juice amount.
6. The method according to claim 1, characterized in that The generating of the decoction guidance scheme based on the decoction time, the amount of water added and the medicinal method of each medicine includes: The decoction time, the amount of water added and the medicinal method of each medicine are respectively added to the corresponding fields in the pre-built decoction guidance template to generate the decoction guidance plan.
7. The method according to claim 1, characterized in that The method further comprises: Obtain the patient's age information; determining a daily dosage based on the patient's age information; The target amount of medicine juice is determined based on the daily medication amount.
8. A system for generating a decoction guidance plan, characterized in that: Applied to the client side of medicine decoction assistance, the system includes: an acquisition unit, configured to acquire the treatment prescription image scanned by the image acquisition device; a recognition unit, configured to recognize text information in the treatment prescription image based on an OCR technology, wherein the text information includes at least a prescription type, a name of each drug, and a dosage of each drug in the treatment prescription image; a first determining unit, configured to determine a decoction time corresponding to the prescription type in the treatment prescription image based on a preset correspondence relationship between the prescription type and the decoction time; a search unit, configured to search, based on the drug name of each drug, the efficacy type of each drug and the water absorption coefficient of each drug in a pre-built drug detailed database; The second determining unit is configured to determine the administration method of each drug based on the efficacy type of each drug; the administration method of each drug constitutes a drug addition order; the administration method of each drug is a conventional administration method or a special administration method, wherein the conventional administration method is simultaneous administration; and the special administration method is one of decocting first, adding later, decocting in a package, decocting separately, melting, and taking with water; a calculation unit, configured to input the dosage of each drug, the water absorption coefficient of each drug, the decoction time, and the target amount of medicinal juice into a pre-built water addition amount calculation model to calculate the amount of water to be added; A generating unit is used to generate a decoction guidance plan based on the decoction time, the amount of water added and the medicinal method of each medicine.
9. A decoction device, characterized in that: It includes a decoction device body, a decoction container, a heating system, a scanner, a timer, a liquid level detector, a display and a processor; The decoction container is assembled and connected with the decoction equipment body; the decoction container is used for decoction of medicine; The heating system is arranged inside the decoction device body; the heating system is used to heat the decoction container; The scanner and the timer are installed inside the decoction device body and exposed on the outer surface of the decoction device body; the scanner is used to scan and process the prescription image; the timer is used to detect the decoction time; The liquid level detector is installed in the cavity of the decoction container; the liquid level detector is used to detect the amount of water added and the target amount of medicinal juice in the decoction container; The processor is installed inside the decoction device body, and the processor is electrically connected to the heating system, the scanner, the timer and the liquid level detector respectively; the processor is used to generate a decoction guidance program using the method according to any one of claims 1 to 7; The display is installed inside the medicine-decocting device body and exposed on the outer surface of the medicine-decocting device body, and the display is electrically connected to the processor; the display is used to display the medicine-decocting guidance program.
10. The medicine decoction device according to claim 9, characterized in that: Also includes a temperature sensor; The temperature sensor is mounted on the inner wall of the cavity of the decoction container, and the temperature sensor is electrically connected to the processor; the temperature sensor is used to detect the temperature of the inner wall of the cavity of the decoction container during the process of decocting medicine through the decoction container; The processor is further configured to determine a current decoction temperature based on the temperature of an inner wall of the cavity of the decoction container, and notify the timer to start timing the decoction time when the current decoction temperature reaches a boiling temperature.