A Dynamic Compensation Method, Device and Electronic Device for Weighing and Counting Medicines

By using weighing sensors and dynamic compensation algorithms in the drug storage device, the problem of weight and quantity measurement deviation between drug batches is solved, and the accuracy and stability of drug weight and quantity is achieved.

CN115235593BActive Publication Date: 2025-06-10SHENZHEN ENRICO TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210874560.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-22
Publication Date
2025-06-10
Estimated Expiration
2042-07-22

AI Technical Summary

Technical Problem

In the prior art, there is a difference between the true value and the approximate value of a single branch weight when the drug leaves the factory, resulting in a deviation in the quantity measurement of different batches of drugs when mixed.

Method used

By setting up a weighing sensor in the drug storage device, the total weight of the drug placed by the user is detected, and quantity calculation and compensation are carried out based on the theoretical single weight and calculated single weight, and the calculated single weight of the target quantity and reset are generated to ensure that the weight of the drug always tends to the standard value.

Benefits of technology

The problem of measurement deviation of the quantity of drugs in different batches is effectively solved. Through the dynamic compensation algorithm, the accuracy of the weight and quantity of drugs is ensured, and the problem of weight deviation is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115235593B_ABST
    Figure CN115235593B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device and electronic device for dynamically compensating the weighing and counting of medicines. The method includes: detecting that a user puts a number of medicines into a medicine storage device, and obtaining the total weight of the number of medicines put by the user; obtaining the theoretical single weight of the put medicines and the calculated single weight of the medicines; calculating a first quantity corresponding to the put medicines according to the theoretical single weight of the medicines; calculating a second quantity corresponding to the put medicines according to the calculated single weight of the medicines; determining whether the first quantity is the same as the second quantity; if the first quantity and the second quantity are not the same, then determining that a weight deviation occurs, performing quantity compensation according to the first quantity and the second quantity, generating a target quantity and a reset calculated single weight; and generating the actual weight of the added medicines according to the target quantity and the reset calculated single weight. The present invention can solve the deviation of the quantity of medicines of the same specification and type in different batches. Through a series of compensations of the algorithm, the weight of the medicines always tends to the standard value, and the problem of weight deviation is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of weight measurement, and particularly to a dynamic compensation method, device and electronic device for weighing and counting medicines. Background Art

[0002] Generally speaking, although different batches of injection medicines of the same specification and type have the same volume and concentration, the glass bottles may be thick or thin, or there may be a little more material in the plastic shaping process, etc., resulting in slightly different weights for each single injection in each batch. Therefore, the single weight at the time of medicine leaving the factory is only an approximate value, which is different from the true theoretical value of the single weight of the medicine.

[0003] There is a standard weight error value when the medicine leaves the factory. However, the error of each batch cannot be exactly the same. For example: Batch 0001 is 5% heavier than the standard weight; Batch 0002 is 2% heavier than the standard weight; Batch 0003 is 2% lighter than the standard weight, and so on.

[0004] If there is medicine from the previous batch in the medicine box and new batches are added, the increase in quantity will amplify the difference between the actual single weight and the theoretical weight, ultimately resulting in a deviation in quantity.

[0005] Therefore, the existing technology still needs to be improved and developed. Summary of the Invention

[0006] In view of the above deficiencies of the existing technology, the present invention provides a dynamic compensation method, device and electronic device for weighing and counting medicines, aiming to solve the problem that when new batches of medicines of the same specification and type are added to a medicine box with existing medicines, the quantity will deviate.

[0007] The technical solution of the present invention is as follows:

[0008] The first embodiment of the present invention provides a dynamic compensation method for weighing and counting medicines, which is applied to a medicine storage device in which medicines have already been stored. The method includes:

[0009] Detect that the user puts several medicines into the medicine storage device, and obtain the total weight of the several medicines put in by the user through the medicine storage device;

[0010] Obtain the theoretical single weight of the put-in medicines and the calculated single weight of the medicines;

[0011] Calculate the first quantity corresponding to the put-in medicines according to the total weight of the medicines and the theoretical single weight of the medicines;

[0012] Calculate the second quantity corresponding to the put-in medicines according to the total weight of the medicines and the calculated single weight of the medicines;

[0013] Judge whether the first quantity is the same as the second quantity;

[0014] If the first quantity and the second quantity are not the same, it is determined that the weight deviates. Quantity compensation is performed based on the first quantity and the second quantity to generate a target quantity and a recalculated unit weight.

[0015] Based on the target quantity and the recalculated unit weight, the actual weight of the added medicine is generated.

[0016] Furthermore, a weighing sensor is provided at the bottom of the medicine storage device. When it is detected that the user puts several medicines into the medicine storage device, the total weight of the several medicines put in by the user is obtained through the medicine storage device, including:

[0017] Collect the first voltage value before the user puts several medicines through the weighing sensor.

[0018] When it is detected that the user puts several medicines into the medicine storage device, collect the second voltage value when the medicines are put in through the weighing sensor.

[0019] Obtain the voltage difference between the first voltage value and the second voltage value, and obtain the total weight of the several medicines put in by the user according to the voltage difference.

[0020] Furthermore, before obtaining the theoretical unit weight of the put-in medicine and the calculated unit weight of the medicine, it includes:

[0021] When the medicine is first put into the medicine storage device, obtain the unit weight of the medicine set by the user, and use the unit weight of the medicine set by the user as the calculated unit weight of the medicine.

[0022] Furthermore, determine whether the first quantity and the second quantity are the same.

[0023] If the first quantity and the second quantity are the same, it is determined that the weight does not deviate.

[0024] Furthermore, if the first quantity and the second quantity are not the same, it is determined that the weight deviates. Quantity compensation is performed based on the first quantity and the second quantity to generate a target quantity and a recalculated unit weight, including:

[0025] If the first quantity and the second quantity are not the same, it is determined that the weight deviates.

[0026] Obtain the integer part and the decimal part of the first quantity, record the integer part of the first quantity as the first integer part, and record the decimal part of the first quantity as the first decimal part.

[0027] Obtain the integer part and the decimal part of the second quantity, record the integer part of the second quantity as the second integer part, and record the decimal part of the second quantity as the second decimal part.

[0028] Determine whether the first integer part is equal to the second integer part;

[0029] If the first integer part is equal to the second integer part, then determine whether the absolute value of the difference between the first decimal part and the second decimal part is greater than the first threshold;

[0030] If the absolute value of the difference between the first decimal part and the second decimal part is greater than the first threshold, then calculate the first weight deviation corresponding to the theoretical single weight and calculate the second weight deviation corresponding to the single weight;

[0031] Determine the proximity of the first weight deviation and the second weight deviation to zero;

[0032] If the first weight deviation is closer to zero, then determine whether the absolute values of the first decimal part and the second decimal part are both greater than the second threshold;

[0033] If the absolute values of the first decimal part and the second decimal part are both greater than the second threshold, then reset the quantity of the medicine to the first integer part plus 1, calculate the first average single weight deviation according to the reset quantity of the medicine, and obtain the reset calculated single weight according to the first average single weight deviation;

[0034] If the absolute value of the first decimal part and / or the absolute value of the second decimal part is less than or equal to the second threshold, then reset the quantity of the medicine to the first integer part, calculate the first average single weight deviation according to the reset quantity of the medicine, and obtain the reset calculated single weight according to the first average single weight deviation.

[0035] Further, after determining whether the first integer part is equal to the second integer part, it also includes:

[0036] If the first integer part is not equal to the second integer part, then determine whether the absolute value of the difference between the first quantity and the second quantity is greater than the first threshold;

[0037] If the absolute value of the difference between the first quantity and the second quantity is greater than the first threshold, then calculate the first weight deviation corresponding to the theoretical single weight and calculate the second weight deviation corresponding to the single weight;

[0038] Determine the proximity of the first weight deviation and the second weight deviation to zero;

[0039] If the first weight deviation is closer to zero, then determine whether the absolute values of the first decimal part and the second decimal part are both greater than the second threshold;

[0040] If the absolute values of the first decimal part and the second decimal part are both greater than the second threshold, then reset the quantity of the medicine to the first integer part plus 1, calculate the first average single weight deviation according to the reset quantity of the medicine, and obtain the reset calculated single weight according to the first average single weight deviation;

[0041] If the absolute value of the first fractional part and / or the absolute value of the second fractional part is less than or equal to the second threshold, reset the quantity of the medicine to the first integer part, calculate the first average single weight deviation based on the reset quantity of the medicine, and obtain the reset calculated single weight according to the first average single weight deviation.

[0042] Further, after determining the proximity of the first weight deviation and the second weight deviation to zero, it further includes:

[0043] If the second weight deviation is closer to zero, determine whether the absolute values of the first fractional part and the second fractional part are both greater than the second threshold;

[0044] If the absolute values of the first fractional part and the second fractional part are both greater than the second threshold, reset the quantity of the medicine to the second integer part plus 1, calculate the second average single weight deviation based on the reset quantity of the medicine, and obtain the reset calculated single weight according to the second average single weight deviation;

[0045] If the absolute value of the first fractional part and / or the absolute value of the second fractional part is less than or equal to the second threshold, reset the quantity of the medicine to the second integer part, calculate the second average single weight deviation based on the reset quantity of the medicine, and obtain the reset calculated single weight according to the second average single weight deviation.

[0046] Another embodiment of the present invention provides a dynamic compensation device for weighing and counting medicines, which is applied to a medicine storage device, and the medicine storage device already stores medicines. The device includes:

[0047] A medicine weight acquisition module, configured to detect that a user puts a number of medicines into the medicine storage device, and acquire the total weight of the number of medicines put by the user through the medicine storage device;

[0048] A single weight acquisition module, configured to acquire the theoretical single weight of the put medicines and the calculated single weight of the medicines;

[0049] A first quantity calculation module, configured to calculate the first quantity corresponding to the put medicines according to the total weight of the medicines and the theoretical single weight of the medicines;

[0050] A second quantity calculation module, configured to calculate the second quantity corresponding to the put medicines according to the total weight of the medicines and the calculated single weight of the medicines;

[0051] A judgment module, configured to judge whether the first quantity is the same as the second quantity;

[0052] A single weight reset module, configured to, if the first quantity and the second quantity are not the same, determine that a weight deviation has occurred, perform quantity compensation according to the first quantity and the second quantity, and generate a target quantity and a reset calculated single weight;

[0053] A target weight acquisition module, configured to generate the actual weight of the added medicine according to the target quantity and the recalculated single weight.

[0054] Another embodiment of the present invention provides an electronic device, which includes at least one processor; and,

[0055] a memory communicatively connected to the at least one processor; wherein,

[0056] the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned medicine weighing and counting dynamic compensation method.

[0057] Another embodiment of the present invention further provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the one or more processors can execute the above-mentioned medicine weighing and counting dynamic compensation method.

[0058] Advantageous effects: The medicine weighing and counting dynamic compensation method according to the embodiments of the present invention can solve the deviation of the quantity of medicines of the same specification and type in different batches. Through a series of compensations of the algorithm, the weight of the medicine always tends to the standard value, thereby solving the problem of weight deviation. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] The present invention will be further described below in conjunction with the drawings and embodiments. In the drawings:

[0060] Figure 1 is a flowchart of a preferred embodiment of a medicine weighing and counting dynamic compensation method of the present invention;

[0061] Figure 2 is a schematic diagram of functional modules of a preferred embodiment of a medicine weighing and counting dynamic compensation device of the present invention;

[0062] Figure 3 is a schematic diagram of the hardware structure of a preferred embodiment of an electronic device of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0063] To make the objectives, technical solutions and effects of the present invention clearer and more definite, the present invention will be further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0064] The embodiments of the present invention will be introduced below in conjunction with the drawings.

[0065] In view of the above problems, an embodiment of the present invention provides a medicine weighing and counting dynamic compensation method. Please refer to Figure 1, Figure 1 is a flowchart of a preferred embodiment of a method for dynamically compensating the weighing and counting of a drug according to the present invention. As Figure 1 shown, it includes:

[0066] Step S100: Detect that the user puts several drugs into the drug storage device, and obtain the total weight of the several drugs put by the user through the drug storage device;

[0067] Step S200: Obtain the theoretical single weight of the put drugs and the calculated single weight of the drugs;

[0068] Step S300: Calculate the first quantity corresponding to the put drugs according to the total weight of the drugs and the theoretical single weight of the drugs;

[0069] Step S400: Calculate the second quantity corresponding to the put drugs according to the total weight of the drugs and the calculated single weight of the drugs;

[0070] Step S500: Determine whether the first quantity is the same as the second quantity. If so, execute step S800. If not, execute step S600;

[0071] Step S600: Determine that the weight has deviated, perform quantity compensation according to the first quantity and the second quantity, and generate the target quantity and the reset calculated single weight;

[0072] Step S700: Generate the actual weight of the added drugs according to the target quantity and the reset calculated single weight;

[0073] Step S800: Determine that the weight has not deviated.

[0074] Specifically in implementation, the method for dynamically compensating the weighing and counting of drugs in the embodiment of the present invention is applied to a drug storage device, and there are already drugs stored in the drug storage device, which solves the problem that when adding new batches of drugs of the same specification and type in the case where the drug storage device is not empty (there are drugs), ensuring that the weight and quantity are always unbiased. The drug storage device includes, but is not limited to, a medicine box, a medicine chest, and other devices that can store injection drugs.

[0075] In the embodiment of the present invention, weight = single weight * quantity. This algorithm will record two single weight values internally: the theoretical single weight (S1) and the calculated single weight (S2).

[0076] Theoretical single weight: Manually set the single weight of the drug on the medicine box. Calculated single weight: The single weight used inside the algorithm. Set single weight: The theoretical single weight value of the drugs stored in this medicine box, manually set. Calculated single weight: The approximate single weight value of the drugs stored in this medicine box, manually set for the first use, and automatically set by the computer subsequently.

[0077] Put the medicine in, collect the corresponding voltage value through the sensor, perform analog-to-digital conversion, and then turn it into a voltage value. Calculate the quantities (SHL1, SHL2) in two single-weight cases. Determine whether the quantities in the two single-weight cases are exactly the same;

[0078] If they are the same, skip it, and there is no deviation in the single weight. If they are different, respectively take out the decimal parts (SL1, SL2) and integer parts (SH1, SH2) of the quantities, and perform dynamic compensation for medicine weighing and counting.

[0079] Example: The theoretical single weight of the medicine is 2.50 g. When the box is used for the first time and 10 medicine pieces are added, the weight collected by the box is 25.1 g. Then set the single-weight operation result to 10.04 pieces, and calculate the single-weight operation result to be 10.04 pieces. Through the dynamic compensation algorithm for medicine weighing and counting in the embodiment of the present invention, the modified calculated single weight is obtained as 2.51 g. Assume that the first batch is not used. When 10 medicine pieces are added for the second time, the weight change collected by the box is 25.6 g. Then the weight of the medicine added for the second time is 25.6 g. Then the single-weight operation result for the second time is set to 10.24 pieces, and the calculated single-weight operation result is 10.19 pieces. Through the algorithm in the flowchart, the modified calculated single weight is obtained as 2.55 g.

[0080] In one embodiment, a weighing sensor is provided at the bottom of the medicine storage device. When it is detected that the user puts several medicine pieces into the medicine storage device, the total weight of the several medicine pieces put by the user is obtained through the medicine storage device, including:

[0081] Collect the first voltage value before the user puts several medicine pieces through the weighing sensor;

[0082] When it is detected that the user puts several medicine pieces into the medicine storage device, collect the second voltage value when the medicine is put in through the weighing sensor;

[0083] Obtain the voltage difference between the first voltage value and the second voltage value, and obtain the total weight of the several medicine pieces put by the user according to the voltage difference.

[0084] Specifically, for example, when the user puts more than 5 medicine pieces into the medicine storage device, collect the current voltage value through the weighing sensor at the bottom of the medicine box. After waiting for the voltage value to stabilize, calculate the voltage difference before and after, and perform analog-to-digital conversion on the difference to turn it into a weight value, and obtain the total weight of the several medicine pieces put by the user.

[0085] In one embodiment, before obtaining the theoretical single weight of the medicine put in and the calculated single weight of the medicine, it includes:

[0086] When the medicine is put into the medicine storage device for the first time, obtain the single weight of the medicine set by the user, and use the single weight of the medicine set by the user as the calculated single weight of the medicine.

[0087] In specific implementation, taking the medicine storage device as a medicine box as an example, when the user first puts medicine into the medicine box, obtain the single weight of the medicine set by the user as the initial calculated single weight of the medicine.

[0088] In one embodiment, if the first quantity and the second quantity are different, it is determined that the weight deviates, and quantity compensation is performed according to the first quantity and the second quantity to generate a target quantity and a reset calculated single weight, including:

[0089] If the first quantity and the second quantity are different, it is determined that the weight deviates.

[0090] Obtain the integer part and the decimal part of the first quantity, record the integer part of the first quantity as the first integer part, and record the decimal part of the first quantity as the first decimal part;

[0091] Obtain the integer part and the decimal part of the second quantity, record the integer part of the second quantity as the second integer part, and record the decimal part of the second quantity as the second decimal part;

[0092] Judge whether the first integer part is equal to the second integer part;

[0093] If the first integer part is equal to the second integer part, judge whether the absolute value of the difference between the first decimal part and the second decimal part is greater than the first threshold;

[0094] If the absolute value of the difference between the first decimal part and the second decimal part is greater than the first threshold, calculate the first weight deviation corresponding to the theoretical single weight and the second weight deviation corresponding to the calculated single weight;

[0095] Judge the closeness of the first weight deviation and the second weight deviation to zero;

[0096] If the first weight deviation is closer to zero, judge whether the absolute values of the first decimal part and the second decimal part are both greater than the second threshold;

[0097] If the absolute values of the first decimal part and the second decimal part are both greater than the second threshold, reset the quantity of the medicine to the first integer part plus 1, calculate the first average single weight deviation according to the reset quantity of the medicine, and obtain the reset calculated single weight according to the first average single weight deviation;

[0098] If the absolute value of the first decimal part and / or the absolute value of the second decimal part is less than or equal to the second threshold, reset the quantity of the medicine to the first integer part, calculate the first average single weight deviation according to the reset quantity of the medicine, and obtain the reset calculated single weight according to the first average single weight deviation.

[0099] In specific implementation, the first threshold and the second threshold are determined based on the maximum deviation of the drug, which is artificially defined. Taking the first threshold as 0.2 and the second threshold as 0.5 as an example, both SL1 and SL2 here are decimal parts. A decimal part difference of 0.2 means a single weight difference of 0.2 * the single weight of each drug. The deviation limits of drugs with different single weights from the theoretical single weight are also different.

[0100] When the decimal part exceeds 0.5, it is reasonable to consider the case of +1. Since the reported quantity accuracy is an integer, the reported quantity may be +1. The weight unit of the present invention is all grams (g), the accuracy is two decimal places, the quantity unit is all pieces, the internal accuracy of the algorithm is two decimal places, and the reported quantity accuracy is an integer.

[0101] Judge whether SH1 is equal to SH2;

[0102] If SH1 is equal to SH2, then judge whether the absolute value of SL1 minus SL2 is greater than 0.2;

[0103] If the absolute value of SL1 minus SL2 is greater than 0.2, calculate the weight deviation under S1, denoted as the first weight deviation: SL1 * S1 - S1; calculate the weight deviation under S2: SL2 * S2 - S2, denoted as the second weight deviation;

[0104] Judge which of the two deviations is closer to 0;

[0105] If the first weight deviation is closer to 0, then judge whether the absolute values of SL1 and SL2 are both greater than 0.5;

[0106] If the absolute values of SL1 and SL2 are both greater than 0.5, calculate the average single weight deviation S’1: average single weight deviation = (SL1 * S1 - S1) / (SH1 + 1), and the current quantity is SH1 + 1;

[0107] If the absolute value of SL1 and / or the absolute value of SL2 is less than or equal to 0.5, calculate the average single weight deviation S’1: average single weight deviation = (SL1 * S1 - S1) / SH1, and the current quantity is SH1;

[0108] Redesign the calculated single weight: S2 = S1 + S’1; report the quantity; use S2 for operation and correct the weight: weight = S2 * the current quantity.

[0109] If the absolute value of SL1 minus SL2 is less than or equal to 0.2, report the quantity calculated by S1, and the reported single weight is incorrect.

[0110] In one embodiment, after judging whether the first integer part is equal to the second integer part, it further includes:

[0111] If the first integer part is not equal to the second integer part, determine whether the absolute value of the difference between the first quantity and the second quantity is greater than the first threshold value;

[0112] If the absolute value of the difference between the first quantity and the second quantity is greater than the first threshold value, calculate the first weight deviation corresponding to the theoretical single weight and calculate the second weight deviation corresponding to the single weight;

[0113] Determine the proximity of the first weight deviation and the second weight deviation to zero;

[0114] If the first weight deviation is closer to zero, determine whether the absolute values of the first decimal part and the second decimal part are both greater than the second threshold value;

[0115] If the absolute values of the first decimal part and the second decimal part are both greater than the second threshold value, reset the quantity of the medicine to the first integer part plus 1, calculate the first average single weight deviation according to the reset quantity of the medicine, and obtain the reset calculated single weight according to the first average single weight deviation;

[0116] If the absolute value of the first decimal part and / or the absolute value of the second decimal part is less than or equal to the second threshold value, reset the quantity of the medicine to the first integer part, calculate the first average single weight deviation according to the reset quantity of the medicine, and obtain the reset calculated single weight according to the first average single weight deviation.

[0117] In specific implementation, if SH1 is not equal to SH2, determine whether the absolute value of SHL1 minus SHL2 is greater than 0.2;

[0118] If the absolute value of SHL1 minus SHL2 is greater than 0.2, calculate the weight deviation under S1, denoted as the first weight deviation: SL1*S1 - S1; calculate the weight deviation under S2: SL2*S2 - S2, denoted as the second weight deviation;

[0119] Determine which of the two deviations is closer to the 0 point;

[0120] If S1 is closer to the 0 point, determine whether the absolute values of SL1 and SL2 are both greater than 0.5;

[0121] If the absolute values of SL1 and SL2 are both greater than 0.5, calculate the average single weight deviation S’1: average single weight deviation = (SL1*S1 - S1) / (SH1 + 1), and the current quantity is SH1 + 1;

[0122] If the absolute value of SL1 and / or the absolute value of SL2 is less than or equal to 0.5, calculate the average single weight deviation S’1: average single weight deviation = (SL1*S1 - S1) / SH1, and the current quantity is SH1;

[0123] Redesign the calculated single weight: S2 = S1 + S’1;

[0124] Reported quantity;

[0125] Using the S2 operation, correct the weight: weight = S2 * current quantity;

[0126] If the absolute value of SHL1 minus SHL2 is less than or equal to 0.2, report the quantity calculated by the S1 operation, indicating that the reported single weight is incorrect.

[0127] In one embodiment, after determining the proximity of the first weight deviation and the second weight deviation to zero, it further includes:

[0128] If the second weight deviation is closer to zero, determine whether the absolute values of the first fractional part and the second fractional part are both greater than the second threshold;

[0129] If the absolute values of the first fractional part and the second fractional part are both greater than the second threshold, reset the quantity of the medicine to the second integer part plus 1, calculate the second average single weight deviation based on the reset quantity of the medicine, and obtain the reset calculated single weight according to the second average single weight deviation;

[0130] If the absolute value of the first fractional part and / or the absolute value of the second fractional part is less than or equal to the second threshold, reset the quantity of the medicine to the second integer part, calculate the second average single weight deviation based on the reset quantity of the medicine, and obtain the reset calculated single weight according to the second average single weight deviation.

[0131] In specific implementation, if the second weight deviation is closer to 0, determine whether the absolute values of SL1 and SL2 are both greater than 0.5;

[0132] If the absolute values of SL1 and SL2 are both greater than 0.5, calculate the average single weight deviation S’2: average single weight deviation S’2 = (SL2 * S2 - S2) / (SH2 + 1), and the current quantity is SH2 + 1;

[0133] If the absolute value of SL1 and / or the absolute value of SL2 is less than or equal to 0.5, calculate the average single weight deviation S’2: average single weight deviation S’2 = (SL2 * S2 - S2) / SH2, and the current quantity is SH2;

[0134] Redesign the calculated single weight: S2 = S1 + S’2;

[0135] Reported quantity;

[0136] Using the S2 operation, correct the weight: weight = S2 * current quantity.

[0137] It should be noted that there is not necessarily a certain sequence among the above steps. Those of ordinary skill in the art can understand according to the description of the embodiments of the present invention that in different embodiments, the above steps can have different execution sequences, that is, they can be executed in parallel or exchanged, etc.

[0138] Another embodiment of the present invention provides a drug weighing and counting dynamic compensation device, as Figure 2 shown, the device 1 includes:

[0139] A drug weight acquisition module 11, configured to detect that a user puts a number of drugs into the drug storage device, and acquire the total weight of the number of drugs put by the user through the drug storage device;

[0140] A single weight acquisition module 12, configured to acquire the theoretical single weight of the put drugs and the calculated single weight of the drugs;

[0141] A first quantity calculation module 13, configured to calculate a first quantity corresponding to the put drugs according to the total weight of the drugs and the theoretical single weight of the drugs;

[0142] A second quantity calculation module 14, configured to calculate a second quantity corresponding to the put drugs according to the total weight of the drugs and the calculated single weight of the drugs;

[0143] A judgment module 15, configured to judge whether the first quantity is the same as the second quantity;

[0144] A single weight reset module 16, configured to, if the first quantity and the second quantity are not the same, determine that the weight has deviated, perform quantity compensation according to the first quantity and the second quantity, and generate a target quantity and a reset calculated single weight;

[0145] A target weight acquisition module 17, configured to generate the actual weight of the added drugs according to the target quantity and the reset calculated single weight.

[0146] For the specific implementation manner, refer to the method embodiment, which will not be elaborated here.

[0147] Another embodiment of the present invention provides an electronic device, as Figure 3 shown, the electronic device 10 includes:

[0148] One or more processors 110 and a memory 120, Figure 3 Taking one processor 110 as an example for introduction, the processor 110 and the memory 120 can be connected through a bus or other means, Figure 3 Taking the connection through the bus as an example.

[0149] The processor 110 is used to complete various control logics of the electronic device 10, and it can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine), or other programmable logic devices, discrete gate or transistor logic, discrete hardware controls, or any combination of these components. Moreover, the processor 110 can also be any conventional processor, microprocessor, or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration.

[0150] The memory 120, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions corresponding to the drug weighing and counting dynamic compensation method in the embodiments of the present invention. The processor 110 executes various functional applications and data processing of the device 10 by running the non-volatile software programs, instructions, and units stored in the memory 120, that is, implements the drug weighing and counting dynamic compensation method in the above method embodiments.

[0151] The memory 120 can include a program storage area and a data storage area. Among them, the program storage area can store an operating device and application programs required for at least one function; the data storage area can store data created according to the use of the device 10, etc. In addition, the memory 120 can include high-speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 120 optionally includes a memory remotely set relative to the processor 110, and these remote memories can be connected to the device 10 through a network. Examples of the above networks include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0152] One or more units are stored in the memory 120, and when executed by one or more processors 110, they execute the drug weighing and counting dynamic compensation method in any of the above method embodiments. For example, they execute the Figure 1 method steps S100 to step S800 described above.

[0153] The embodiments of the present invention provide a non-volatile computer-readable storage medium, and the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors. For example, they execute the Figure 1 method steps S100 to step S800 described above.

[0154] By way of example, the non-volatile storage medium can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. The volatile memory can include random access memory (RAM) as an external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory controls or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memories.

[0155] Another embodiment of the present invention provides a computer program product. The computer program product includes a computer program stored on a non-volatile computer-readable storage medium. The computer program includes program instructions that, when executed by a processor, cause the processor to execute the drug weighing and counting dynamic compensation method of the above method embodiment. For example, execute the Figure 1 method steps S100 to step S800 described above.

[0156] The embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0157] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution, in essence, or the part that contributes to the related technology can be embodied in the form of a software product. The computer software product can exist in a computer-readable storage medium such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiments.

[0158] Among other things, conditional language such as "able to", "can", "may", or "could" generally aims to convey that a particular embodiment can include (while other embodiments do not include) a particular feature, element, and / or operation, unless specifically stated otherwise or otherwise understood within the context in which it is used. Thus, such conditional language generally also aims to imply that the feature, element, and / or operation is in some way required for one or more embodiments or that one or more embodiments must include logic for determining whether the feature, element, and / or operation is included or will be performed in any particular embodiment, with or without input or prompting.

[0159] What has been described herein in the specification and drawings includes examples of a method and apparatus capable of providing a dynamic compensation method and apparatus for weighing and counting medicines. Of course, it is not possible to describe every conceivable combination of elements and / or methods for the purpose of describing the various features of the present disclosure, but it will be recognized that many additional combinations and permutations of the disclosed features are possible. Thus, it is apparent that various modifications can be made to the present disclosure without departing from the scope or spirit thereof. In addition, or in the alternative, other embodiments of the present disclosure may be apparent from consideration of the specification and drawings and practice of the present disclosure as presented herein. The intention is that the examples presented in the specification and drawings be considered illustrative in all respects and not restrictive. Although specific terms are employed herein, they are used in a generic and descriptive sense and not for purposes of limitation.

Claims

1. A dynamic compensation method for weighing and counting medicines, characterized in that, it is applied to a medicine storage device, and the medicine storage device already stores medicines, and the method includes: detecting that a user puts several medicines into the medicine storage device, and obtaining the total weight of the several medicines put in by the user through the medicine storage device; obtaining the theoretical single weight of the put-in medicines and the calculated single weight of the medicines; calculating a first quantity corresponding to the put-in medicines according to the total weight of the medicines and the theoretical single weight of the medicines; calculating a second quantity corresponding to the put-in medicines according to the total weight of the medicines and the calculated single weight of the medicines; judging whether the first quantity is the same as the second quantity; if the first quantity and the second quantity are not the same, then it is determined that a weight deviation has occurred, and quantity compensation is performed according to the first quantity and the second quantity to generate a target quantity and a reset calculated single weight; generating the actual weight of the added medicines according to the target quantity and the reset calculated single weight; before obtaining the theoretical single weight of the put-in medicines and the calculated single weight of the medicines, it includes: if medicines are put into the medicine storage device for the first time, obtaining the single weight of the medicines set by the user, and taking the single weight of the medicines set by the user as the calculated single weight of the medicines; the if the first quantity and the second quantity are not the same, then it is determined that a weight deviation has occurred, and quantity compensation is performed according to the first quantity and the second quantity to generate a target quantity and a reset calculated single weight, includes: if the first quantity and the second quantity are not the same, then it is determined that a weight deviation has occurred, obtaining the integer part and the decimal part of the first quantity, denoting the integer part of the first quantity as the first integer part, and denoting the decimal part of the first quantity as the first decimal part; obtaining the integer part and the decimal part of the second quantity, denoting the integer part of the second quantity as the second integer part, and denoting the decimal part of the second quantity as the second decimal part; judging whether the first integer part is equal to the second integer part; if the first integer part is equal to the second integer part, then judging whether the absolute value of the difference between the first decimal part and the second decimal part is greater than a first threshold; if the absolute value of the difference between the first decimal part and the second decimal part is greater than the first threshold, then calculating a first weight deviation corresponding to the theoretical single weight and a second weight deviation corresponding to the calculated single weight; judging the closeness of the first weight deviation and the second weight deviation to zero; if the first weight deviation is closer to zero, then judging whether the absolute values of the first decimal part and the second decimal part are both greater than a second threshold; if the absolute values of the first decimal part and the second decimal part are both greater than the second threshold, then resetting the quantity of the medicines to the first integer part plus 1, calculating a first average single weight deviation according to the reset quantity of the medicines, and obtaining a reset calculated single weight according to the first average single weight deviation; if the absolute value of the first decimal part and / or the absolute value of the second decimal part is less than or equal to the second threshold, then resetting the quantity of the medicines to the first integer part, calculating a first average single weight deviation according to the reset quantity of the medicines, and obtaining a reset calculated single weight according to the first average single weight deviation.

2. The method according to claim 1, characterized in that, A weighing sensor is provided at the bottom of the medicine storage device. When it is detected that the user puts several medicines into the medicine storage device, the total weight of the several medicines put in by the user is obtained through the medicine storage device, including: Collecting a first voltage value by the weighing sensor before the user puts several medicines; When it is detected that the user puts several medicines into the medicine storage device, collecting a second voltage value by the weighing sensor when the medicines are put in; Obtaining the voltage difference between the first voltage value and the second voltage value, and obtaining the total weight of the several medicines put in by the user according to the voltage difference.

3. The method according to claim 2, characterized in that, after determining whether the first quantity is the same as the second quantity, further comprising: if the first quantity and the second quantity are the same, it is determined that the weight has not deviated.

4. The method according to claim 3, characterized in that, after determining whether the first integer part is equal to the second integer part, further comprising: if the first integer part is not equal to the second integer part, determining whether the absolute value of the difference between the first quantity and the second quantity is greater than a first threshold; if the absolute value of the difference between the first quantity and the second quantity is greater than the first threshold, calculating a first weight deviation corresponding to the theoretical single weight and calculating a second weight deviation corresponding to the single weight; judging the closeness of the first weight deviation and the second weight deviation to zero; if the first weight deviation is closer to zero, determining whether the absolute values of the first decimal part and the second decimal part are both greater than a second threshold; if the absolute values of the first decimal part and the second decimal part are both greater than the second threshold, resetting the number of medicines to the first integer part plus 1, calculating a first average single weight deviation according to the reset number of medicines, and obtaining a reset calculated single weight according to the first average single weight deviation; if the absolute value of the first decimal part and / or the absolute value of the second decimal part is less than or equal to the second threshold, resetting the number of medicines to the first integer part, calculating a first average single weight deviation according to the reset number of medicines, and obtaining a reset calculated single weight according to the first average single weight deviation.

5. The method according to claim 3 or 4, characterized in that, after judging the closeness of the first weight deviation and the second weight deviation to zero, further comprising: if the second weight deviation is closer to zero, determining whether the absolute values of the first decimal part and the second decimal part are both greater than a second threshold; if the absolute values of the first decimal part and the second decimal part are both greater than the second threshold, resetting the number of medicines to the second integer part plus 1, calculating a second average single weight deviation according to the reset number of medicines, and obtaining a reset calculated single weight according to the second average single weight deviation; if the absolute value of the first decimal part and / or the absolute value of the second decimal part is less than or equal to the second threshold, resetting the number of medicines to the second integer part, calculating a second average single weight deviation according to the reset number of medicines, and obtaining a reset calculated single weight according to the second average single weight deviation.

6. A medicine weighing and counting dynamic compensation device, characterized in that, applied to a medicine storage device, and medicines have been stored in the medicine storage device, the device includes: A drug weight acquisition module, configured to detect that a user places several drugs into a drug storage device, and acquire the total weight of the several drugs placed by the user through the drug storage device; A single weight acquisition module, configured to acquire the theoretical single weight of the placed drugs and the calculated single weight of the drugs; A first quantity calculation module, configured to calculate a first quantity corresponding to the placed drugs according to the total weight of the drugs and the theoretical single weight of the drugs; A second quantity calculation module, configured to calculate a second quantity corresponding to the placed drugs according to the total weight of the drugs and the calculated single weight of the drugs; A judgment module, configured to judge whether the first quantity is the same as the second quantity; A single weight reset module, configured to, if the first quantity and the second quantity are not the same, determine that a weight deviation occurs, perform quantity compensation according to the first quantity and the second quantity, generate a target quantity and a reset calculated single weight; A target weight acquisition module, configured to generate the actual weight of the added drugs according to the target quantity and the reset calculated single weight; Before acquiring the theoretical single weight of the placed drugs and the calculated single weight of the drugs, it includes: If the drugs are placed in the drug storage device for the first time, acquire the single weight of the drugs set by the user, and use the single weight of the drugs set by the user as the calculated single weight of the drugs; The step of, if the first quantity and the second quantity are not the same, determining that a weight deviation occurs, performing quantity compensation according to the first quantity and the second quantity, and generating a target quantity and a reset calculated single weight, includes: If the first quantity and the second quantity are not the same, determine that a weight deviation occurs, Acquire the integer part and the decimal part of the first quantity, denote the integer part of the first quantity as the first integer part, and denote the decimal part of the first quantity as the first decimal part; Acquire the integer part and the decimal part of the second quantity, denote the integer part of the second quantity as the second integer part, and denote the decimal part of the second quantity as the second decimal part; Judge whether the first integer part is equal to the second integer part; If the first integer part is equal to the second integer part, judge whether the absolute value of the difference between the first decimal part and the second decimal part is greater than a first threshold; If the absolute value of the difference between the first decimal part and the second decimal part is greater than the first threshold, calculate a first weight deviation corresponding to the theoretical single weight and a second weight deviation corresponding to the calculated single weight; Judge the proximity of the first weight deviation and the second weight deviation to zero; If the first weight deviation is closer to zero, judge whether the absolute values of the first decimal part and the second decimal part are both greater than a second threshold; If the absolute values of the first decimal part and the second decimal part are both greater than the second threshold, reset the quantity of the drugs to the first integer part plus 1, calculate a first average single weight deviation according to the reset quantity of the drugs, and obtain the reset calculated single weight according to the first average single weight deviation; If the absolute value of the first decimal part and / or the absolute value of the second decimal part is less than or equal to the second threshold, reset the quantity of the drugs to the first integer part, calculate a first average single weight deviation according to the reset quantity of the drugs, and obtain the reset calculated single weight according to the first average single weight deviation.

7. An electronic device, characterized in that the electronic device includes at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the dynamic compensation method for weighing and counting medicines according to any one of claims 1-5.

8. A non-volatile computer-readable storage medium, characterized in that, the non-volatile computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by one or more processors, the one or more processors can be enabled to execute the dynamic compensation method for weighing and counting medicines according to any one of claims 1-5.

Citation Information

Patent Citations

  • Drug measuring method of smart medicine cabinet, smart medicine cabinet and storage medium

    CN109141594A

  • Drug quantity management device

    JP2021032872A