Medicine cabinet weighing method, device and system and storage medium

By selecting a stable reference drug compartment in the medicine cabinet and calculating the gravity change data, the actual gravity value of the drug compartment is quickly and accurately determined, which solves the problem of low weight measurement efficiency of liquid drugs and improves the management efficiency of the drug refill process.

CN118548964APending Publication Date: 2024-08-27SHENZHEN NUBOMED EQUIP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410608269.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-16
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

When existing medicine cabinets replenish liquid medicines, the jitter data received by the gravity sensor is inaccurate, resulting in low weight counting efficiency. The buffer time after the drawer is closed needs to be extended to ensure a stable gravity value, which affects the efficiency of medicine storage management.

Method used

By periodically collecting the gravity value of the medicine grid, selecting a stable reference medicine grid, and calculating the gravity change data to determine the actual gravity value of the medicine grid, fast and accurate weighting can be achieved.

Benefits of technology

It improves the weight counting efficiency of liquid medicines, reduces the waiting time after closing the drawer, and improves the management efficiency of the medicine refilling process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118548964A
    Figure CN118548964A
Patent Text Reader

Abstract

The embodiment of the invention provides a medicine cabinet weighing method, device and system and a storage medium, and belongs to the technical field of medicine storage equipment. The method comprises the following steps: selecting a second medicine lattice from medicine lattices on the same drawer as a reference medicine lattice of a first medicine lattice, and after the reference medicine lattice is determined, respectively obtaining gravity change data of the first medicine lattice in each sampling period, the gravity change data comprises first gravity change data representing the dispersion degree difference of the gravity values between the first medicine lattice and the reference medicine lattice in k sampling periods, and second gravity change data representing the dispersion degree of the gravity values of the first medicine lattice in n sampling periods; and when the gravity change data of one sampling period meets a preset weighing condition, obtaining a gravity value in a first statistical period taking the sampling period meeting the weighing condition as a statistical end point, and determining an actual gravity value of the first medicine lattice according to the gravity value in the first statistical period. According to the embodiment of the invention, the weighing efficiency of the liquid medicine can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of medicine storage equipment, and in particular to a method, device, system and storage medium for weighing a medicine cabinet. Background Art

[0002] In the related art, in order to improve the convenience of medicine storage management in the medicine cabinet, gravity sensors are usually used to sense the changes in the gravity of the medicines in each medicine compartment in each medicine cabinet, so as to calculate the number of changes in the medicines in the medicine compartment through the gravity change, and report the data of taking medicine / replenishing medicine to the upper computer. However, in actual use, for large liquid medicines such as infusion solvents, when the liquid medicine is replenished in the medicine compartment, the liquid is easy to shake at the moment when the liquid medicine is put in and the moment when the drawer is closed, and such shaking will cause several seconds of jitter when transmitted to the gravity sensor. Therefore, in order to ensure the accuracy of the statistical data, the buffer time is usually extended after the medicine cabinet is closed, and the gravity value of the liquid medicine in the medicine compartment is counted to ensure that the gravity value is stable during the statistics, which results in the need to report the number at least 5 seconds after the drawer is closed. Therefore, in the related art, after the medicine cabinet is closed, it is necessary to wait for a few seconds to accurately determine whether the replenishment is completed, resulting in low efficiency of medicine storage management. Therefore, how to improve the efficiency of weighing liquid medicines is a technical problem that needs to be solved urgently. Summary of the invention

[0003] The main purpose of the embodiments of the present application is to provide a method, device, system and storage medium for weighing a medicine cabinet, which can improve the weighing efficiency of liquid medicines.

[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application provides a method for weighing a medicine cabinet, the method comprising:

[0005] Periodically collect the gravity values ​​of each medicine grid on the same drawer;

[0006] Select a second medicine grid from each medicine grid on the same drawer as a reference medicine grid for the first medicine grid, wherein the second medicine grid is a medicine cabinet with a stable gravity value before replenishing medicine for the first medicine grid;

[0007] After determining the reference medicine grid, respectively obtain the gravity change data of the first medicine grid in each sampling period, wherein the gravity change data includes first gravity change data characterizing the difference between the discrete degree of the gravity value of the first medicine grid and the discrete degree of the gravity value of the reference medicine grid in k sampling periods, and second gravity change data characterizing the discrete degree of the gravity value of the first medicine grid in n sampling periods; k and n are both positive integers greater than 0, and n is less than k;

[0008] When there is a sampling period in which the gravity change data meets the preset weighing condition, the actual gravity value of the first medicine grid is determined according to the gravity value in the first statistical period. The first statistical period includes n consecutive sampling periods and the sampling period when the weighing condition is met is the statistical end point.

[0009] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a device for weighing a medicine cabinet, and the device for weighing a medicine cabinet includes:

[0010] A communication module, the communication module is used to receive the gravity value of each medicine grid;

[0011] at least one processor,

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

[0013] The memory stores instructions, and the instructions are executed by at least one processor, so that when the at least one processor executes the instructions, the method for weighing a medicine cabinet as described in any one of claims 1 to 7 is implemented.

[0014] To achieve the above-mentioned purpose, a third aspect of an embodiment of the present application proposes a medicine cabinet system, comprising:

[0015] A medicine cabinet, wherein the medicine cabinet is provided with at least one drawer, the drawer is provided with at least two medicine compartments, each medicine compartment is provided with a corresponding gravity sensor, and the gravity sensor is used to periodically detect the gravity value of the corresponding medicine compartment;

[0016] As in the above-mentioned device for weighing a medicine cabinet, the device for weighing a medicine cabinet is communicatively connected with the gravity sensor.

[0017] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, which is a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, it implements the method of weighing the medicine cabinet described in the first aspect above.

[0018] The method, device, system and storage medium for weighing a medicine cabinet proposed in the present application determine the gravity values ​​collected by the reference medicine grid and the first medicine grid itself within the sampling period to determine the gravity change data including the first gravity change data and the second change gravity data, so that the sampling period when the first medicine cabinet is in a relatively static state can be determined based on the second gravity change data and the weighing conditions, and the relative gravity change trend between the first medicine cabinet and the reference medicine cabinet can be determined based on the first gravity change data and the weighing conditions, so as to determine the state of the drawer, and then the sampling period for calculating the actual gravity value can be determined in combination with the state of the drawer and the first medicine cabinet, so as to timely count the gravity of the first medicine cabinet. Therefore, compared with the related art, the embodiment of the present application can improve the weighing efficiency of liquids. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a flowchart of an embodiment of a method for weighing a medicine cabinet provided in an embodiment of the present application;

[0020] Figure 2 It is a schematic diagram of a gravity curve of a medicine compartment when a drawer is closed in one embodiment of a method for weighing a medicine cabinet provided in an embodiment of the present application;

[0021] Figure 3 It is a structural schematic diagram of a drawer of an embodiment of a method for weighing a medicine cabinet provided in an embodiment of the present application;

[0022] Figure 4a It is a schematic diagram of the gravity variance of the reference medicine cabinet after the drawer is closed in the method for weighing the medicine cabinet provided in the embodiment of the present application;

[0023] Figure 4b It is a schematic diagram of the gravity variance of the first medicine cabinet after the drawer is closed in the method for weighing the medicine cabinet provided in the embodiment of the present application;

[0024] Figure 5 is a schematic diagram of the covariance between the first medicine cabinet and the reference medicine cabinet after the drawer is closed in the method for weighing the medicine cabinet provided in an embodiment of the present application;

[0025] Figure 6 This is a hardware block diagram corresponding to the method for weighing a medicine cabinet provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0027] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0028] like Figure 1 As shown, according to the method for weighing a medicine cabinet provided in an embodiment of the present application, the method includes:

[0029] Step S100, periodically collecting the gravity values ​​of each medicine grid located on the same drawer;

[0030] Step S200, selecting a second medicine grid from the medicine grids on the same drawer as a reference medicine grid for the first medicine grid, wherein the second medicine grid is a medicine cabinet with a stable gravity value before replenishing medicine for the first medicine grid;

[0031] Step S300, after determining the reference medicine grid, respectively obtain the gravity change data of the first medicine grid in each sampling period, wherein the gravity change data includes first gravity change data representing the difference between the discrete degree of the gravity value of the first medicine grid and the discrete degree of the gravity value of the reference medicine grid in k sampling periods, and second gravity change data representing the discrete degree of the gravity value of the first medicine grid in n sampling periods; k and n are both positive integers greater than 0, and n is less than k;

[0032] Step S400: When there is a sampling period of gravity change data that meets the preset weighing condition, the actual gravity value of the first medicine grid is determined according to the gravity value in the first statistical period. The first statistical period includes n consecutive sampling periods and the sampling period when the weighing condition is met is the statistical end point.

[0033] Therefore, by determining the gravity values ​​collected by the reference medicine grid and the first medicine grid itself during the sampling period, the gravity change data including the first gravity change data and the second change gravity data is determined, so that the sampling period when the first medicine cabinet is in a relatively static state can be determined based on the second gravity change data and the weighing conditions, and the relative gravity change trend between the first medicine cabinet and the reference medicine cabinet can be determined based on the first gravity change data and the weighing conditions, so as to determine the state of the drawer, and then the sampling period for calculating the actual gravity value can be determined in combination with the state of the drawer and the first medicine cabinet, so as to timely count the gravity of the first medicine cabinet. Therefore, compared with the related art, the embodiment of the present application can improve the weighing efficiency of liquids.

[0034] It should be noted that the medicine cabinet weighing method of the embodiment of the present application can be used for medicine compartments that are in a fluctuating state when the drawer is closed and whose gravity is not calculated.

[0035] It should be noted that, for the convenience of management, the types or specifications of the medicines in the medicine compartments on the same drawer are often not very different, and the medicines in one medicine compartment are replenished after the medicines in another medicine compartment are replenished. Therefore, when the push-pull vibration occurs after the medicines in the last medicine compartment are replenished, the other medicine compartments on the same drawer are in a stable state before closing. Therefore, when the drawer is closed, there is a follow-up vibration, and its vibration amplitude is smaller than the vibration amplitude caused by replenishing the medicines. Figure 2 As shown, Figure 2 A is for following, and B is for supplementary medicine. Figure 2 The gravity fluctuation curve of the gravity values ​​of A and B after the drawer is closed immediately after B replenishes the medicine is shown in the figure. Figure 2 The vertical axis represents the collected gravity value, and the horizontal axis represents time; Figure 2 It can be seen from the gravity curve that after the drawer is closed, the last medicine grid B that has been replenished will continue to shake for a long time before stabilizing. Therefore, in the related art, it will take a long time to calculate the gravity of the medicine grid B after the drawer is closed.

[0036] It should be noted that the first medicine grid is the medicine grid for which the gravity is to be calculated. When the weighing conditions are met, n sampling periods correspond to the sampling periods in which the medicines in the medicine grid are relatively static, and k sampling periods include the sampling periods in which the gravity changes suddenly during the medicine replenishment process. Therefore, the calculation of the gravity value can be made more accurate by using the discrete degrees within the two different sampling periods.

[0037] It should be noted that the second medicine grid can be a medicine grid that does not need to be replenished after the drawer is pulled out, or it can be another medicine grid other than the last medicine grid in the same drawer that replenishes medicine. For example, there are 3 medicine grids in a drawer, among which medicine grid 1 does not need to be replenished, while medicine grid 2 and medicine grid 3 need to be replenished, and the order of replenishing medicine is medicine grid 2 and medicine grid 3. Then, medicine grid 1 can be used as a reference medicine grid, and medicine grid 2 and medicine grid 3 can be used as the first medicine grid respectively, to calculate the actual gravity value in the above steps. Medicine grid 1 can also be used as a reference medicine grid for medicine grid 2, and after medicine grid 2 has been replenished, medicine grid 2 can be used as a reference medicine grid for medicine grid 3. For example, Figure 3 As shown, two medicine grids are arranged on a drawer, namely, medicine grid A and medicine grid B. The order of replenishing medicine is medicine grid A and medicine grid B, then medicine grid A can be set as the reference medicine grid of medicine grid B. In the embodiment of the present application, the selection of the reference medicine grid is not limited.

[0038] It should be noted that the variance and the difference of the variance can be used to represent the discrete degree of a single medicine grid to represent the second gravity change data, and the covariance and the difference of the covariance between two medicine grids can be used to represent the first gravity change data.

[0039] It should be noted that the weighing condition indicates that the gravity value detected by the first medicine grid has fluctuated within a certain range for n sampling cycles and the gravity value can represent the stable fluctuating gravity value after the drawer is closed. The actual gravity value can adopt the average gravity value of n sampling cycles, or the intermediate value in n sampling cycles. In this regard, the embodiment of the present application does not limit the calculation method of the actual gravity value. Therefore, the calculation timing of the actual gravity value of the first medicine grid is dynamically determined by the first gravity data and the second gravity data. Compared with the related art, the actual gravity value of the first medicine grid can be calculated in advance, thereby improving the efficiency of weighing liquids during the medicine replenishment process.

[0040] It is understandable that the first gravity mean value and gravity change data of the first medicine grid in each sampling period are respectively obtained in step S400, including:

[0041] For each sampling period, a second statistical period with each sampling period as a statistical end point is determined, and the second statistical period includes m consecutive sampling periods; m=kn;

[0042] Respectively obtain the first gravity mean value and the first gravity variance value of the first medicine grid in each sampling period within the same first statistical period;

[0043] Respectively obtain the second gravity mean value and the second gravity variance value of the reference medicine grid in each sampling period within the same first statistical period;

[0044] According to the first gravity variance value, second gravity change data corresponding to the sampling period is obtained;

[0045] The first gravity variation data of each sampling period is obtained according to the first gravity variance value and the second gravity variance value of each sampling period in each second statistical period.

[0046] It should be noted that, in some embodiments, the first gravity mean value and the first gravity variance value can be calculated after step S100, without distinguishing whether a reference medicine grid is set, and can also be calculated in real time in step 300. This embodiment of the present application does not limit this.

[0047] It should be noted that each sampling period has a one-to-one correspondence with a first statistical period and a second statistical period. The first gravity mean value represents the average value of the gravity values ​​in the first statistical period corresponding to each sampling period, and the first gravity variance value represents the degree of dispersion of the first gravity mean value in the first statistical period corresponding to each period. For example, for the current sampling period T to be calculated j represents the jth sampling period. Assuming n is 3 and m=4, then T j The corresponding first statistical period includes T j-2 , T j-1 , T j ; Tj The corresponding second statistical period includes T j-3 , T j-2 , T j-1 , T j Assume T j-3 , T j-2 , T j-1 , T j The gravity values ​​of the first medicine cabinet detected are WeightA j 、Weight A j-1 、Weight A j-2 、Weight A j-3 ; The gravity values ​​of the second medicine cabinet are WeightB j-2 、Weight B j-1 、Weight B j ; then for T j The sampling period of the second gravity mean First gravity variance value Second gravity variance value By analogy, the first gravity mean value, the first gravity variance value, the second gravity mean value and the second gravity variance value of each sampling period can be obtained. At this time, the first gravity variance value can be used as one of the second gravity change data; the second gravity variance value and the first gravity variance value of the second statistical period can obtain the second gravity change data. Wherein, i represents the subscript of the sampling period.

[0048] Therefore, by calculating the gravity variance value of each sampling period with n sampling periods as a first statistical period, and evaluating the gravity change trend according to the gravity variance value of each sampling period in each second statistical period, the result of the actual gravity value used for calculation in the first statistical period is more reliable.

[0049] It is understandable that, according to the first gravity variance value and the second gravity variance value of each sampling period in each second statistical period, the first gravity change data of each sampling period is obtained, including:

[0050] According to the first gravity variance value of each sampling period in the same second statistical period, the first variance mean value of the first medicine grid of each corresponding sampling period is obtained;

[0051] According to the second gravity variance value of each sampling period in the same second statistical period, the second variance mean value of the reference medicine grid of each corresponding sampling period is obtained;

[0052] According to the first variance mean, the first gravity variance value, the second gravity variance value and the second variance mean of the same sampling period, the first gravity covariance value of each sampling period is obtained;

[0053] The first gravity change data is obtained according to the first gravity covariance value of the same sampling period.

[0054] For example, it is assumed that for the current sampling period T to be calculated j represents the jth sampling period. Assuming n is 3 and m=4, then T j The corresponding first statistical period includes T j-2 , T j-1 , T j ; T j The corresponding second statistical period includes T j-3 , T j-2 , T j-1 , T j ; then the first variance mean Second variance mean At this point, we can get T j The first gravity covariance

[0055] It should be noted that during the replenishment process of medicine compartment A and medicine compartment B in the same drawer, if Figure 4a , Figure 4b and Figure 2 It can be seen that for medicine box A, when the medicine is replenished, the gravity changes stepwise, and then it returns from the shaking state to the stable state. Even if the push-pull drawer shakes, this state trend still remains. Similarly, for medicine box B, when the medicine is replenished, the gravity changes stepwise, and then it returns from the shaking state to the stable state. Even if the push-pull drawer shakes, this state trend still remains. Figure 5 As shown in the figure, after B replenishes the medicine, he pushes the drawer, and the variance of B falls back. A changes from static to shaking, and the variance becomes larger. At this time, the covariance of AB shows a state of regression from negative to 0. Therefore, the accuracy of the actual gravity value calculation in the sampling period when the weighing conditions are met can be further guaranteed by jointly assisting judgment through the first gravity variance value and the first gravity covariance value.

[0056] It is understandable that the first gravity change data is obtained according to the first gravity covariance value of the same sampling period, including:

[0057] Obtain a second gravity covariance value, where the second gravity covariance value is the first gravity covariance value at a sampling period interval j of the sampling period corresponding to the first gravity covariance value; j is a positive integer greater than 0;

[0058] Taking the difference between the second gravity covariance value and the corresponding first gravity covariance value as the covariance derivative of the corresponding sampling period;

[0059] Combining the first gravity covariance value and the corresponding covariance derivative to obtain first gravity change data;

[0060] According to the first gravity variance value, the second gravity change data corresponding to the sampling period is obtained, including:

[0061] Obtain a third gravity variance value, and use the difference between the third gravity variance value and the corresponding first gravity variance value as the variance derivative of the corresponding sampling period; the third gravity variance value is the first gravity variance value j sampling periods before the sampling period corresponding to the first gravity variance value;

[0062] The first gravity variance value and the corresponding variance derivative are combined to obtain the second gravity change data.

[0063] It should be noted that by introducing the variance derivative and the covariance derivative for auxiliary judgment, it can be further ensured whether the current gravity value of the first medicine grid satisfies the trend of stabilizing after the drawer is closed after replenishing the medicine, thereby further ensuring the accuracy of the actual gravity value calculation.

[0064] For example, it is assumed that for the current sampling period T to be calculated j represents the jth sampling period, assuming n is 3, m = 4; j = 4; then T j The corresponding first statistical period includes T j-2 , T j-1 , T j ; T j The corresponding second statistical period includes T j-3 , T j-2 , T j-1 , T j ; then with T j The interval is j sampling periods T j-4 The second gravity covariance value is Then the covariance derivative Variance derivative

[0065] It is understandable that the second gravity change data includes the first gravity variance value and the variance derivative, the first gravity change data includes the first gravity covariance value and the covariance derivative, and the preset weighing conditions satisfied in step S400 include:

[0066] The first gravity variance value is less than a preset gravity variance threshold of the reference medicine grid;

[0067] The absolute value of the first gravity covariance is less than the preset covariance threshold of the reference medicine grid;

[0068] The variance derivative is greater than a preset variance derivative threshold of the reference medicine grid;

[0069] The covariance derivative is greater than a preset covariance derivative threshold of the reference drug grid.

[0070] It should be noted that the gravity variance threshold, covariance threshold, variance derivative threshold and covariance derivative threshold can be determined based on actual experiments. For example, by taking different medicines, the gravity values ​​of each sampling period in the drug replenishment process are obtained multiple times, so that the variance derivative, covariance derivative, gravity variance value and gravity covariance of each type of medicine can be obtained, and the corresponding thresholds can be determined.

[0071] It should be noted that, taking A replenishing medicine first and B replenishing medicine later as an example, the drawer is closed immediately after B replenishes medicine, and the B medicine compartment tends to be relatively stable after being impacted by gravity, so the variance will approach 0, because 0 is a static state. Whether the relative static state is reached is determined by detecting whether the variance threshold is less than the gravity variance threshold TH_VarB, because it is impossible to be completely static when collecting data. Therefore, in some embodiments, after collecting data through experiments, the mean of the variance of the nth sampling period after the impact caused by the drawer closing is completed is used as TH_VarB.

[0072] It should be noted that in order to distinguish the sensor self-reflection rigid fluctuation return and the fluctuation return generated by the medicine replenishment, the degree of variance reduction is used to separate them. Among them, for the same medicine cabinet, the variance derivative generated by the sensor impact return caused by the medicine replenishment is much larger than that of the rigid fluctuation return. Therefore, the threshold variance derivative threshold TH_dVarB is generated through experimental determination. Figure 5 As shown, after B replenishes the medicine, the drawer is pushed, and the variance data of B replenishing the medicine will change from large to small after the impact is completed. A changes from static to shaking, and the variance changes from small to large. At this time, the AB covariance data presents a state of regression from a large negative number to 0. Therefore, in some embodiments, the covariance before the covariance is zeroed and the covariance value in the experiment are respectively used as the covariance threshold TH_CovAB and the gradient threshold value covariance derivative threshold TH_dCovAB.

[0073] It is understandable that, in step S400, determining the actual gravity value of the first medicine grid according to the gravity value in the first statistical period includes:

[0074] The gravity values ​​collected in each sampling period within the first statistical period are taken as the first gravity values;

[0075] According to n first gravity values, a first gravity mean is obtained;

[0076] The first gravity mean value is taken as the actual gravity value of the first medicine grid.

[0077] It is understandable that the first statistical period is less than 1S, and m is less than or equal to 2n.

[0078] Refer to the following Figures 1 to 5Describe a specific embodiment of the present application, in which a drawer is provided with two medicine boxes, namely, medicine box A and medicine box B. Since medicine boxes A and B are physically connected and fixed, in actual application, the two medicine boxes will not be operated at the same time, that is, one medicine box is in a follow-up jitter at the moment of push-pull jitter, and is judged as a follow-up by the static state of the previous state being greater than a certain time, and the following medicine box is determined as the reference medicine box. Then, for each sampling period, the second gravity mean of A and the first gravity mean of B are calculated respectively, wherein the second gravity mean The first gravity mean Among them, WeightA[i] represents the gravity value of the A medicine grid collected in the i-th sampling period within the first statistical period; WeightB[i] represents the gravity value of the B medicine grid collected in the i-th sampling period within the first statistical period; at this time, for each sampling period, the second gravity variance value of the sampling period can be calculated First gravity variance value Then use the covariance values ​​of sensors A and B to collect the fluctuation directions of the two sensors and obtain the second variance mean of the sampling period First variance mean Among them, VarA[i] represents the second gravity variance value of the i-th sampling period in the second statistical period corresponding to the sampling period; VarB[i] represents the first gravity variance value of the i-th sampling period in the second statistical period corresponding to the sampling period; at this time, the covariance of the sampling period can be obtained When the replenishment of medicine in cell B is completed, after a step change in gravity, there is a physical phenomenon of returning from a jitter state to a stable state. Even when the drawer is pushed and pulled and shaken, this state trend still remains. To capture this state, the state of the completion of the replenishment of medicine in cell B can be collected through the variance derivative, where dVarB = VarB[k] - VarB[k - j]. Then, for the k-th sampling period, by comparing with the variance value of the sampling period j intervals apart, it is determined whether it has returned to the stable state. Among them, j is determined according to the test data. After the replenishment of medicine B, when the drawer is pushed, the variance of B drops, and A changes from stationary to shaking, and the variance becomes larger. At this time, the covariance of AB shows a state of returning from a negative number to 0. The covariance derivative is used to capture this state, and the covariance derivative dCovAB = CovAB[k] - CovAB[k - j]. When VarB < TH_VarB and |CovAB| < TH_CovAB and dVarB > TH_dVarB and dCovAB > TH_dVarB are satisfied, the mean value of the current first statistical period is used as the actual gravity value. Among them, the gravity variance threshold, covariance threshold, variance derivative threshold, and covariance derivative threshold can be determined by statistically analyzing the data of each medicine before the weighing method of this application is executed. Specifically, the data statistics are carried out according to the format shown in Table 1. Among them, the time column in Table 1 represents the sampling period, the A value column represents the gravity value of cell A measured in the corresponding sampling period, the B value column represents the gravity value of cell B measured in the corresponding sampling period, the data in each cell in the averageA column represents the average gravity value of cell A in the first statistical period with the sampling period where the row is located as the statistical end point, the data in each cell in the averageB column represents the average gravity value of cell B in the first statistical period with the sampling period where the row is located as the statistical focus, the data in each cell in the varA column represents the variance of cell A in the first statistical period with the sampling period where the row is located as the statistical end point, the data in each cell in the varB column represents the variance of cell B in the first statistical period with the sampling period where the row is located as the statistical end point; the data in each cell in the covAB column represents the first covariance value in the second statistical period with the sampling period where the row is located as the statistical end point; the data in each cell in the variance B derivative column represents the variance difference between the sampling period where the row is located and the sampling period j intervals apart; the data in each cell in the covariance derivative column represents the covariance difference between the sampling period where the row is located and the sampling period j intervals apart.

[0079] time A Value B value averageA averaeB VarA VarB avB Variance B derivative Covariance derivative 2 1658.03 1588.45 1500 5000 -1000 10000 3 1658.05 1588.51 4 1658.14 1588.59 5 1658.11 1588.64 6 1658.06 1588.65 1658.078 1588.568 0.00207 0.00742 -1499.9925 0 7 1658.07 1588.39 1658.076667 1588.538333 0.001666667 0.011216667 0.011216667 0 8 1658 1588.57 1658.071667 1588.558333 0.002376667 0.009376667 -2.48631E-07 0.009376667 -2.48631E-07 9 1658.15 1588.5 1658.08833 1588.556667 0.003176667 0.009586667 -3.99967E-07 0.009586667 -3.99967E-07 10 1658.06 1588.78 1658.075 1588.588333 0.00259 0.018136667 -3.31022E-07 0.01071666 -3.31022E-07 11 1658.11 1588.6 1658.075 1588.581667 0.00259 0.017576667 -1.07816E-06 0.00636 -8.29532E-07 12 1658.02 1588.59 1658.068333 1588.571667 0.003096667 0.016536667 -1.48622E-07 0.00716 2.51344E-07

[0080] Table 1

[0081] It should be noted that when the first statistical period is small enough, the probability of including unstable data in the statistical period is smaller, so the result is more reliable. Setting m less than or equal to 2n can reduce the risk of filtering out key information. Key information is such as gravity jitter data generated by tonic. In some embodiments, m is less than n. The value of m can be determined through actual experiments.

[0082] It is understandable that a medicine cabinet weighing device provided in the present application includes:

[0083] A communication module, the communication module is used to receive the gravity value of each medicine grid;

[0084] at least one processor,

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

[0086] The memory stores instructions, and the instructions are executed by at least one processor, so that when the at least one processor executes the instructions, any one of the above-mentioned methods for weighing a medicine cabinet is implemented.

[0087] It is understandable that a medicine cabinet system provided according to an embodiment of the present application includes:

[0088] A medicine cabinet, wherein the medicine cabinet is provided with at least one drawer, and the drawer is provided with at least two medicine compartments, and each medicine compartment is provided with a corresponding gravity sensor, and the gravity sensor is used to periodically detect the gravity value of the corresponding medicine compartment;

[0089] Like the device for weighing a medicine cabinet as mentioned above, the device for weighing a medicine cabinet is communicatively connected with a gravity sensor.

[0090] It is understandable that if Figure 6 As shown, an embodiment of the present application further provides an electronic device, the electronic device comprising:

[0091] The processor 501 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0092] The memory 502 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 502 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 502, and the processor 501 calls and executes the medicine cabinet weight measurement method of the embodiment of this application;

[0093] Input / output interface 503, used to implement information input and output;

[0094] Communication interface 504, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);

[0095] A bus 505 that transmits information between the various components of the device (e.g., the processor 501, the memory 502, the input / output interface 503, and the communication interface 504);

[0096] The processor 501 , the memory 502 , the input / output interface 503 and the communication interface 504 are connected to each other in communication within the device via the bus 505 .

[0097] An embodiment of the present application further provides a storage medium, which is a computer-readable storage medium and stores a computer program. When the computer program is executed by a processor, the above-mentioned medicine cabinet weight measuring method is implemented.

[0098] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0099] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0100] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

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

[0102] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0103] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0104] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0105] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0106] The units described above 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 on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0107] In addition, each functional unit in each embodiment of the present application 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0108] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0109] The preferred embodiments of the present application are described above with reference to the accompanying drawings, but the scope of the rights of the present application is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present application should be within the scope of the rights of the present application.

Claims

1. A method for weighing a medicine cabinet, characterized in that: The method comprises: Periodically collect the gravity values ​​of each medicine grid on the same drawer; Select a second medicine grid from each medicine grid on the same drawer as a reference medicine grid for the first medicine grid, wherein the second medicine grid is a medicine cabinet with a stable gravity value before replenishing medicine for the first medicine grid; After determining the reference medicine grid, respectively obtain the gravity change data of the first medicine grid in each sampling period, wherein the gravity change data includes first gravity change data characterizing the difference between the discrete degree of the gravity value of the first medicine grid and the discrete degree of the gravity value of the reference medicine grid in k sampling periods, and second gravity change data characterizing the discrete degree of the gravity value of the first medicine grid in n sampling periods; k and n are both positive integers greater than 0, and n is less than k; When there is a sampling period in which the gravity change data meets the preset weighing condition, the actual gravity value of the first medicine grid is determined according to the gravity value in the first statistical period. The first statistical period includes n consecutive sampling periods and the sampling period when the weighing condition is met is the statistical end point.

2. The method for weighing a medicine cabinet according to claim 1, characterized in that: The step of respectively acquiring the gravity change data of the first medicine grid in each sampling period includes: For each of the sampling periods, a second statistical period with each of the sampling periods as a statistical end point is determined, wherein the second statistical period includes m consecutive sampling periods; wherein m=kn; Respectively obtaining a first gravity mean value and a first gravity variance value of the first medicine grid in each sampling period within the same first statistical period; Respectively obtaining the second gravity mean value and the second gravity variance value of the reference medicine grid in each sampling period within the same first statistical period; According to the first gravity variance value, obtaining second gravity change data corresponding to a sampling period; The first gravity variation data of each sampling period is obtained according to the first gravity variance value and the second gravity variance value of each sampling period within each second statistical period.

3. The method for weighing a medicine cabinet according to claim 2, characterized in that: The step of obtaining the first gravity change data of each sampling period according to the first gravity variance value and the second gravity variance value of each sampling period within each second statistical period comprises: According to the first gravity variance value of each sampling period within the same second statistical period, obtaining the first variance mean value of the first medicine grid of each corresponding sampling period; According to the second gravity variance value of each sampling period within the same second statistical period, obtaining the second variance mean value of the reference medicine grid of each corresponding sampling period; Obtaining a first gravity covariance value of each sampling period according to the first variance mean, the first gravity variance value, the second gravity variance value and the second variance mean of the same sampling period; The first gravity change data is obtained according to the first gravity covariance value of the same sampling period.

4. The method for weighing a medicine cabinet according to claim 3, characterized in that: The obtaining the first gravity change data according to the first gravity covariance value of the same sampling period includes: Obtaining a second gravity covariance value, where the second gravity covariance value is a first gravity covariance value that is j sampling periods apart from the sampling period corresponding to the first gravity covariance value; j is a positive integer greater than 0; taking the difference between the second gravity covariance value and the corresponding first gravity covariance value as the covariance derivative of the corresponding sampling period; Combining the first gravity covariance value and the corresponding covariance derivative to obtain second gravity change data; The step of obtaining second gravity change data corresponding to a sampling period according to the first gravity variance value includes: Obtain a third gravity variance value, and use the difference between the third gravity variance value and the corresponding first gravity variance value as the variance derivative of the corresponding sampling period; the third gravity variance value is the first gravity variance value j sampling periods before the sampling period corresponding to the first gravity variance value; The first gravity variance value and the corresponding variance derivative are combined to obtain first gravity change data.

5. The method for weighing a medicine cabinet according to claim 1, characterized in that: The second gravity change data includes the first gravity variance value and the variance derivative; The first gravity change data includes a first gravity covariance value and a covariance derivative, and the preset weighing condition includes: The first gravity variance value is smaller than a preset gravity variance threshold of the reference medicine grid; The absolute value of the first gravity covariance is less than a preset covariance threshold of the reference medicine grid; The variance derivative is greater than a preset variance derivative threshold of the reference medicine grid; The covariance derivative is greater than a preset covariance derivative threshold of the reference drug grid.

6. The method for weighing a medicine cabinet according to claim 2, characterized in that: The step of determining the actual gravity value of the first medicine grid according to the gravity value in the first statistical period includes: The gravity values ​​collected in each sampling period within the first statistical period are taken as the first gravity values; Obtaining a first gravity mean value according to the n first gravity values; The first gravity average value is used as the actual gravity value of the first medicine grid.

7. The method for weighing a medicine cabinet according to claim 2, characterized in that: The first statistical period is less than 1S, and m is less than or equal to 2n.

8. A device for weighing a medicine cabinet, characterized in that: include: A communication module, the communication module is used to receive the gravity value of each medicine grid; at least one processor, a memory communicatively connected to at least one processor; wherein, The memory stores instructions, and the instructions are executed by at least one processor, so that when the at least one processor executes the instructions, the method for weighing a medicine cabinet as described in any one of claims 1 to 7 is implemented.

9. A medicine cabinet system, characterized in that: include: A medicine cabinet, wherein the medicine cabinet is provided with at least one drawer, the drawer is provided with at least two medicine compartments, each medicine compartment is provided with a corresponding gravity sensor, and the gravity sensor is used to periodically detect the gravity value of the corresponding medicine compartment; The medicine cabinet weighing device as described in claim 8, wherein the medicine cabinet weighing device is communicatively connected to the gravity sensor.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for weighing a medicine cabinet according to any one of claims 1 to 7 is implemented.