Box-packed medicine dispensing method and device, electronic equipment and storage medium
By setting up M rows and N columns of medicine storage grids in the medicine storage cabinet and cooperating with the conveyor belt, the problem of boxed medicine being blocked is solved, the effects of rapid medicine delivery and effective traceability are achieved, and the working efficiency of the pharmacy is improved.
Patent Information
- Application Number
- CN202510728539.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-06-03
AI Technical Summary
In hospital pharmacies, boxed medicines tend to block each other when being distributed, resulting in slow dispensing speed, and existing technologies are difficult to effectively solve this problem.
A boxed medicine dispensing method is adopted. By setting up M rows and N columns of medicine storage grids in the medicine storage cabinet, and using a conveyor belt to move from right to left, the medicine storage grids are sorted in ascending order of column numbers. The medicine storage grids whose column number differences and row number differences between adjacent medicine storage grids meet specific conditions are selected for dispensing, ensuring that the boxed medicines do not block each other. During the dispensing process, photos of the six sides and traceability codes are obtained and stored in the HIS system.
This ensures that the boxed medicines do not block each other, the medicines are dispensed quickly, and the source can be effectively traced, thus improving the efficiency of medicine distribution.
Smart Images

Figure CN120646435A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of valet parking, and in particular to a method and device for dispensing boxed medicine, an electronic device, and a storage medium. Background Art
[0002] On April 28, 2016, the China Food and Drug Administration (CFDA) issued the "Opinions on Further Improving the Food and Drug Traceability System (Draft for Comment)." The opinions state that the food and drug traceability system is an important component of the food and drug quality management system. Establishing a food and drug traceability system is the primary responsibility of enterprises.
[0003] In hospital pharmacies, drug traceability is essential. The basic principle is to use a drug traceability code, which leverages modern information technology to assign a unique identifier (i.e., a traceability code) to each box of medication. This code typically contains basic drug information and encrypted data. During the drug production process, drug-related information, such as the source of raw materials and production process parameters, is associated with the traceability code and recorded in a database. Once a drug enters the distribution chain, at each node, such as wholesalers or retailers, relevant circulation information (such as entry and exit times, handling companies, etc.) is scanned and uploaded to the database, forming a complete traceability chain. When a query is needed, consumers or regulators use a scanner to read the traceability code. Based on the information in the code, the system retrieves the corresponding drug lifecycle data from the database and displays it. Boxed medications are a common type of medication. In practice, the outer surface of the medicine box is often printed with a QR code or barcode that stores the traceability code. Furthermore, pharmacies require photographs of all outer surfaces of the medicine box.
[0004] When dispensing boxed medications from a hospital pharmacy, different boxes of medications must not block each other, which understandably slows down dispensing. Therefore, designing a method for dispensing medications quickly while preventing each box from blocking the other has become a pressing issue. Summary of the Invention
[0005] The object of the present invention is to provide a method, device, electronic equipment and storage medium for dispensing boxed medicine.
[0006] To achieve one of the above-mentioned invention purposes, an embodiment of the present invention provides a method for dispensing boxed drugs in a medicine storage cabinet. The medicine storage cabinet includes: a cabinet body, on which there are M rows and N columns of medicine storage grids for storing boxed drugs of the same type, and the rows extend along the left-right direction, and the columns extend along the vertical direction; in the left-to-right direction, the N columns are respectively marked as the 1st column, the 2nd column,..., the Nth column; in the bottom-to-top direction, the M rows are respectively marked as the 1st row, the 2nd row,..., the Mth row; in front of the cabinet body, there is a conveyor belt that extends from the 1st column to the Nth column, and the boxed drugs stored in any medicine storage grid can fall onto the conveyor belt; where M and N are both natural numbers; the method includes the following steps: receiving a medicine dispensing information, the medicine dispensing information including: multiple boxed drug types and the corresponding number of medicine taking for each boxed drug type; obtaining the medicine storage grid corresponding to each boxed drug type, as well as the row number and column number of each medicine storage grid, and generating a set S that includes all the medicine storage grids corresponding to the boxed drug types; controlling the rotation of the conveyor belt, and the upper surface of the conveyor belt moves from right to left; sorting all the medicine storage grids in the set S in ascending order of the column number to obtain a first queue; selecting a number of first to-be-processed medicine storage grids from the first queue, the number of first to-be-processed medicine storage grids including the medicine storage grid at the head of the first queue, and the absolute value of the difference in the column numbers between any adjacent first to-be-processed medicine storage grid A and first to-be-processed medicine storage grid B > a preset threshold + (the row number corresponding to the first to-be-processed medicine storage grid A - the row number of the first to-be-processed medicine storage grid B) * Num > 0, where the column number corresponding to the first to-be-processed medicine storage grid A > the column number of the first to-be-processed medicine storage grid B, -1 < Num ≤ 0, and the preset threshold > 0; controlling each first to-be-processed medicine storage grid to send out a boxed drug, and then, for all the medicine storage grids that have sent out boxed drugs, subtracting 1 from the value of the corresponding number of medicine taking for the boxed drug type; deleting the boxed drug types with zero number of medicine taking from the medicine dispensing information, and deleting the medicine storage grids with zero number of medicine taking from the set S.
[0007] As a further improvement of an embodiment of the present invention, in the left-to-right direction, the cabinet body is divided into the 1st unit, the 2nd unit,..., the Qth unit, and each unit includes P columns; where Q and P are both natural numbers, and N = Q * P; the method further includes the following steps: generating a corresponding empty set Set for any i-th unit i , obtaining the corresponding j-th unit for any medicine storage grid in the set S and putting it into the set Set j ; where i and j are natural numbers, 1 ≤ i, j ≤ Q; let K = Q, and continuously execute the following first operation until K = 0, and when one execution of the first operation is completed, the value of K is decreased by 1; the first operation is to continuously execute the following actions until the set Set kEmpty: When there is no medicine box on the conveyor belt located at the Kth unit, the set Set k Sort all the medicine storage grids in to obtain a second queue; select a number of second medicine storage grids to be processed from the second queue, wherein the number of second medicine storage grids to be processed includes the medicine storage grid at the head of the second queue, and the absolute value of the difference in column number between any adjacent second medicine storage grid to be processed C and the second medicine storage grid to be processed D is greater than the preset threshold + (row number corresponding to the second medicine storage grid to be processed C - row number of the second medicine storage grid to be processed D) * Num > 0, wherein the column number corresponding to the second medicine storage grid to be processed C is greater than the column number of the second medicine storage grid to be processed D; control each second medicine storage grid to be processed to send out a box of medicine, and then, for all medicine storage grids that send out boxed medicine, reduce the medicine taking quantity value of the corresponding boxed medicine type by one; delete the boxed medicine type with a medicine taking quantity of zero from the medicine delivery information, and remove it from the set Set k Delete the medicine storage grid with zero medicine quantity.
[0008] As a further improvement of one embodiment of the present invention, the following steps are also included: for each box of medicine sent out by the conveyor belt, photos and traceability codes of the six sides are obtained and stored in the HIS system.
[0009] As a further improvement of an embodiment of the present invention, the "selecting a number of first medicine storage cells to be processed from the first queue, the number of first medicine storage cells to be processed includes the medicine storage cell at the head of the first queue, and the absolute value of the difference in column numbers between any adjacent first medicine storage cells to be processed A and first medicine storage cells to be processed B is greater than the preset threshold + (row number corresponding to the first medicine storage cell to be processed A - row number of the first medicine storage cell to be processed B) * Num > 0" specifically includes: selecting the medicine storage cell at the head of the first queue as a first medicine storage cell to be processed, marking the medicine storage cell at the head of the first queue as a starting medicine storage cell, and continuously executing the following first operation: if the medicine storage cell E with the smallest column number that satisfies "the difference between the column number and the column number of the starting medicine storage cell is greater than the preset threshold + the difference between the row number and the row number of the starting medicine storage cell * Num > 0" is successfully selected, the medicine storage cell E is a first medicine storage cell to be processed, the medicine storage cell E is marked as the starting medicine storage cell, and the subsequent first operation is continued; otherwise, no further execution is performed. The subsequent first operation is performed; the "selecting a number of second to-be-processed medicine storage cells from the second queue, the number of second to-be-processed medicine storage cells including the medicine storage cell at the head of the second queue, and the absolute value of the difference in column numbers between any adjacent second to-be-processed medicine storage cells C and the second to-be-processed medicine storage cells D>preset threshold+(row number corresponding to the second to-be-processed medicine storage cell C-row number of the second to-be-processed medicine storage cell D)*Num>0" specifically includes: selecting the medicine storage cell at the head of the second queue as a second to-be-processed medicine storage cell, marking the medicine storage cell at the head of the second queue as the starting medicine storage cell, and continuously performing the following second operation: if the medicine storage cell F with the smallest column number that satisfies "the difference between the column number and the column number of the starting medicine storage cell>preset threshold+the difference between the row number and the row number of the starting medicine storage cell*Num>0" is successfully selected, the medicine storage cell F is a second to-be-processed medicine storage cell, the medicine storage cell F is marked as the starting medicine storage cell, and the subsequent second operation is continued; otherwise, the subsequent second operation is no longer performed.
[0010] An embodiment of the present invention further provides a boxed medicine dispensing device for a medicine storage cabinet. The medicine storage cabinet includes: a cabinet body, on which there are M rows and N columns of medicine storage grids, each medicine storage grid is used to store the same type of boxed medicine, and the rows extend along the left - right direction, and the columns extend along the vertical direction; in the left - to - right direction, the N columns are respectively marked as the 1st column, the 2nd column,..., the Nth column; in the bottom - to - top direction, the M rows are respectively marked as the 1st row, the 2nd row,..., the Mth row; in front of the cabinet body, there is a conveyor belt, which extends from the 1st column to the Nth column, and the boxed medicine stored in any medicine storage grid can fall onto the conveyor belt; where M and N are both natural numbers; it includes the following modules: an information acquisition module, which is used to receive the medicine dispensing information, and the medicine dispensing information includes: multiple boxed medicine types and the corresponding medicine - taking quantity for each boxed medicine type; obtain the medicine storage grid corresponding to each boxed medicine type, as well as the row number and column number of each medicine storage grid, and generate a set S that contains all the medicine storage grids corresponding to the boxed medicine types; control the conveyor belt to rotate, and the upper surface of the conveyor belt moves from right to left; a first medicine dispensing module, which is used to sort all the medicine storage grids in the set S in ascending order of the column number to obtain a first queue; select several first to - be - processed medicine storage grids from the first queue, and the several first to - be - processed medicine storage grids include the medicine storage grid at the head of the first queue, and the absolute value of the difference between the column numbers of any two adjacent first to - be - processed medicine storage grids A and first to - be - processed medicine storage grid B > preset threshold+(row number of the first to - be - processed medicine storage grid A - row number of the first to - be - processed medicine storage grid B)*Num>0, where the column number of the first to - be - processed medicine storage grid A>the column number of the first to - be - processed medicine storage grid B, - 1<Num≤0, and the preset threshold>0; control each first to - be - processed medicine storage grid to send out a boxed medicine, and then, for all the medicine storage grids that have sent out the boxed medicine, subtract 1 from the medicine - taking quantity value of the corresponding boxed medicine type; delete the boxed medicine types with zero medicine - taking quantity from the medicine dispensing information, and delete the medicine storage grids with zero medicine - taking quantity from the set S.
[0011] As a further improvement of an embodiment of the present invention, in the left - to - right direction, the cabinet body is divided into the 1st unit, the 2nd unit,..., the Qth unit, and each unit contains P columns; where Q and P are both natural numbers, and N = Q*P; it further includes the following module: a second medicine dispensing module, which is used to generate a corresponding empty set Set for any ith unit i , obtain the corresponding jth unit for any medicine storage grid in the set S and put it into the set Set j ; where i and j are natural numbers, 1≤i,j≤Q; let K = Q, and continuously execute the following first operation until K = 0, and when one first operation is completed, the value of K is decreased by 1; the first operation is to continuously execute the following actions until the set Set kEmpty: When there is no medicine box on the conveyor belt located at the Kth unit, the set Set k Sort all the medicine storage grids in to obtain a second queue; select a number of second medicine storage grids to be processed from the second queue, wherein the number of second medicine storage grids to be processed includes the medicine storage grid at the head of the second queue, and the absolute value of the difference in column number between any adjacent second medicine storage grid to be processed C and the second medicine storage grid to be processed D is greater than the preset threshold + (row number corresponding to the second medicine storage grid to be processed C - row number of the second medicine storage grid to be processed D) * Num > 0, wherein the column number corresponding to the second medicine storage grid to be processed C is greater than the column number of the second medicine storage grid to be processed D; control each second medicine storage grid to be processed to send out a box of medicine, and then, for all medicine storage grids that send out boxed medicine, reduce the medicine taking quantity value of the corresponding boxed medicine type by one; delete the boxed medicine type with a medicine taking quantity of zero from the medicine delivery information, and remove it from the set Set k Delete the medicine storage grid with zero medicine quantity.
[0012] As a further improvement of one embodiment of the present invention, the following modules are also included: a traceability module, which is used to obtain photos and traceability codes of six sides for each box of medicine sent out by the conveyor belt, and store them in the HIS system.
[0013] As a further improvement of an embodiment of the present invention, the first medicine discharging module is further used to: select the medicine storage grid at the head of the first queue as a first medicine storage grid to be processed, mark the medicine storage grid at the head of the first queue as the starting medicine storage grid, and continue to perform the following first operation: if the medicine storage grid E with the smallest column number that satisfies "the difference between the column number and the column number of the starting medicine storage grid > the preset threshold + the difference between the row number and the row number of the starting medicine storage grid * Num > 0" is successfully selected, the medicine storage grid E is a first medicine storage grid to be processed, the medicine storage grid E is marked as the starting medicine storage grid, and the subsequent first operation is continued; otherwise Then, the subsequent first operation will no longer be executed; the medicine storage cell at the head of the second queue will be selected as a second medicine storage cell to be processed, and the medicine storage cell at the head of the second queue will be marked as the starting medicine storage cell, and the following second operation will be continuously executed: If the medicine storage cell F that satisfies "the difference between the column number and the column number of the starting medicine storage cell > the preset threshold + the difference between the row number and the row number of the starting medicine storage cell * Num > 0" and has the smallest column number is successfully selected, the medicine storage cell F is a second medicine storage cell to be processed, the medicine storage cell F will be marked as the starting medicine storage cell, and the subsequent second operation will be continuously executed; otherwise, the subsequent second operation will no longer be executed.
[0014] An embodiment of the present invention also provides an electronic device, including a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the above-mentioned boxed medicine dispensing method.
[0015] An embodiment of the present invention further provides a storage medium storing a program or instruction. When the program or instruction is executed by a processor, the steps of the above-mentioned boxed medicine dispensing method are implemented.
[0016] Compared with the prior art, the technical effect of the present invention is as follows: the present invention provides a method, device, electronic device and storage medium for dispensing boxed medicine, the method comprising the following steps: receiving medicine dispensing information, generating a set containing all medicine storage cells, and continuously performing the following operations until the set is empty: sorting all medicine storage cells in ascending order of column number to obtain a queue; selecting a number of to-be-processed medicine storage cells containing corresponding medicine storage cells from the queue, wherein the absolute value of the difference in column numbers between adjacent to-be-processed medicine storage cells is greater than a preset threshold value + (the difference in row numbers between adjacent to-be-processed medicine storage cells) * Num> 0; controlling each to-be-processed medicine storage cell to deliver a boxed medicine, and then reducing the medicine quantity value of the medicine storage cell that delivers the boxed medicine by one; deleting the boxed medicine type with a medicine quantity of zero from the medicine dispensing information, and deleting the medicine storage cells with a medicine quantity of zero from the set. The method can prevent the boxed medicines from blocking each other and has a fast medicine dispensing speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 1 is a schematic structural diagram of a medicine storage cabinet in an embodiment of the present invention;
[0018] Figure 2 4 is a flow chart of a method for dispensing boxed medicines in an embodiment of the present invention. DETAILED DESCRIPTION
[0019] The present invention will be described in detail below with reference to the various embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional modifications made by those skilled in the art based on these embodiments are all within the scope of protection of the present invention.
[0020] As used herein, terms indicating spatial relative positions such as "upper," "above," "lower," and "below" are used for ease of explanation to describe the relationship of one unit or feature relative to another unit or feature as shown in the accompanying drawings. Terms of spatial relative position may be intended to encompass different orientations of the device in use or operation in addition to the orientation shown in the drawings. For example, if the device in the drawings were turned over, units described as being "below" or "beneath" other units or features would be "above" the other units or features. Thus, the exemplary term "below" may encompass both above and below orientations. The device may be oriented in other ways (rotated 90 degrees or in other orientations), and the spatially relative descriptors used herein interpreted accordingly.
[0021] Embodiment 1 of the present invention provides a method for dispensing boxed medicines for a medicine storage cabinet, as follows Figure 1 shown; the medicine storage cabinet includes: a cabinet body, on which there are M rows and N columns of medicine storage grids, the medicine storage grids are used to store boxed medicines of the same type, and the rows extend along the left - right direction, and the columns extend along the vertical direction; in the direction from left to right, the N columns are respectively marked as the 1st column, the 2nd column,..., the Nth column; in the direction from bottom to top, the M rows are respectively marked as the 1st row, the 2nd row,..., the Mth row; in front of the cabinet body, there is a conveyor belt, the conveyor belt extends from the 1st column to the Nth column, and the boxed medicines stored in any medicine storage grid can fall onto the conveyor belt; where M and N are both natural numbers; here, in the vertical direction, the height of the conveyor belt is lower than the lowest row, and the horizontal distance between the conveyor belt and the cabinet body is close enough, so that the boxed medicines sent out from any medicine storage grid can fall onto the conveyor belt and can be conveyed by the conveyor belt. In each medicine storage grid, multiple boxed medicines of the same type can be stored, and a mechanical device is provided to push out the boxed medicines. As Figure 2 shown, it includes the following steps:
[0022] Step 201: Receive the medicine dispensing information, the medicine dispensing information includes: multiple boxed medicine types and the dispensing quantity corresponding to each boxed medicine type; obtain the medicine storage grid corresponding to each boxed medicine type, as well as the row number and column number of each medicine storage grid, and generate a set S including all the medicine storage grids corresponding to the boxed medicine types; control the conveyor belt to rotate, and the upper surface of the conveyor belt moves from right to left; here, the medicine dispensing information can be received from the HIS (Hospital Information System).
[0023] Step 202: Sort all the medicine storage grids in the set S in ascending order of the column numbers to obtain a first queue; select several first to - be - processed medicine storage grids from the first queue, the several first to - be - processed medicine storage grids include the medicine storage grid at the head of the first queue, and the absolute value of the difference in column numbers between any adjacent first to - be - processed medicine storage grid A and first to - be - processed medicine storage grid B > preset threshold+(row number of the first to - be - processed medicine storage grid A - row number of the first to - be - processed medicine storage grid B)*Num>0, where the column number of the first to - be - processed medicine storage grid A>the column number of the first to - be - processed medicine storage grid B, - 1<Num≤0, and the preset threshold>0; control each first to - be - processed medicine storage grid to send out a boxed medicine, and then, for all the medicine storage grids that have sent out boxed medicines, subtract one from the dispensing quantity value of the corresponding boxed medicine type; delete the boxed medicine types with zero dispensing quantity from the medicine dispensing information, and delete the medicine storage grids with zero dispensing quantity from the set S.
[0024] Here, since all storage cells in the set S are sorted, several first storage cells to be processed will be selected from the set S, and these first storage cells to be processed will also be arranged in order. For example, the 1st column, the 4th column, and the 7th column are selected, then the 1st column and the 4th column can be considered adjacent, and the 4th column and the 7th column can be considered adjacent.
[0025] Here, when dispensing medicine for the first time, it is necessary to dispense as much medicine as possible, and to dispense as many boxes of medicine as possible at one time, and the distance between adjacent medicines>preset threshold+F(the difference in row numbers between adjacent medicine storage grids to be processed), so that the distance between adjacent medicines is large enough and they do not block each other, so as to facilitate the photographing of the six sides of the boxed medicines and the traceability code, etc. It is understandable that it takes time for the boxed medicines to fall from the medicine storage grid to the conveyor belt, and the higher the row number, the longer it takes. Therefore, the difference in row numbers between adjacent medicine storage grids to be processed can be obtained first. If the difference is larger, the horizontal distance between adjacent medicine storage grids to be processed can be adjusted, and two closer medicine storage grids can be selected as adjacent medicine storage grids to be processed; conversely, if the difference is smaller, two farther medicine storage grids can be selected as adjacent medicine storage grids to be processed.
[0026] Here, if the medicine storage grid A - medicine storage grid B>0, two closer medicine storage grids can be selected as adjacent medicine storage grids to be processed, and the larger the value of medicine storage grid A - medicine storage grid B, the more adjacent medicine storage grids to be processed; conversely, if the difference is smaller, two farther medicine storage grids can be selected as adjacent medicine storage grids to be processed.
[0027] In this embodiment, the cabinet is divided into Unit 1, Unit 2, ..., Unit Q, from left to right, with each unit containing P columns; where Q and P are both natural numbers, N = Q*P. It is understood that when the upper surface of the conveyor belt moves from right to left, the rightmost side of the conveyor belt becomes empty first, i.e., the rightmost side of the conveyor belt becomes empty first. Therefore, when there are no medicine boxes on the portion of the conveyor belt located at Unit Q, the medicine storage compartments in Unit Q can be used to dispense medicine. After the medicine storage compartments in Unit Q have dispensed medicine, Unit Q-1 can be used to dispense medicine. After the medicine storage compartments in Unit Q have dispensed medicine, Unit Q-2 can be used to dispense medicine, and so on, until Unit 1 is used to dispense medicine. When the medicine storage compartments in Unit 1 have dispensed medicine, the entire medicine dispensing task is completed. The conveyor belt is also divided into Q sections, each corresponding to a unit.
[0028] The following steps are also included:
[0029] Generate a corresponding empty set Set for any i-th unit i , get the corresponding j-th unit for any medicine storage grid in the set S and put it into the set Set j; Wherein, i, j are natural numbers, 1≤i,j≤Q;
[0030] Let K=Q, and continue to perform the following first operation until K=0, and when the first operation is performed once, the value of K is reduced by 1; here, in order, the operation is performed once on the Qth unit, the Q-1th unit, ..., the 1st unit.
[0031] The first operation is to continue to perform the following actions until the set Set k Empty: When there is no medicine box on the conveyor belt located at the Kth unit, the set Set k Sort all the medicine storage grids in to obtain a second queue; select a number of second medicine storage grids to be processed from the second queue, wherein the number of second medicine storage grids to be processed includes the medicine storage grid at the head of the second queue, and the absolute value of the difference in column number between any adjacent second medicine storage grid to be processed C and the second medicine storage grid to be processed D is greater than the preset threshold + (row number corresponding to the second medicine storage grid to be processed C - row number of the second medicine storage grid to be processed D) * Num > 0, wherein the column number corresponding to the second medicine storage grid to be processed C is greater than the column number of the second medicine storage grid to be processed D; control each second medicine storage grid to be processed to send out a box of medicine, and then, for all medicine storage grids that send out boxed medicine, reduce the medicine taking quantity value of the corresponding boxed medicine type by one; delete the boxed medicine type with a medicine taking quantity of zero from the medicine delivery information, and remove it from the set Set k Delete the medicine storage grid with zero medicine quantity.
[0032] This embodiment also includes the following steps: for each box of medicine sent out by the conveyor belt, photos and traceability codes of the six sides are obtained and stored in the HIS system.
[0033] In this embodiment, the "selecting a number of first medicine storage cells to be processed from the first queue, the number of first medicine storage cells to be processed includes the medicine storage cell at the head of the first queue, and the absolute value of the difference in column numbers between any adjacent first medicine storage cells to be processed A and first medicine storage cells to be processed B is greater than the preset threshold + (row number corresponding to the first medicine storage cell to be processed A - row number of the first medicine storage cell to be processed B) * Num > 0" specifically includes: selecting the medicine storage cell at the head of the first queue as a first medicine storage cell to be processed, marking the medicine storage cell at the head of the first queue as the starting medicine storage cell, and continuously executing the following first operation: if the medicine storage cell E with the smallest column number that satisfies "the difference between the column number and the column number of the starting medicine storage cell is greater than the preset threshold + the difference between the row number and the row number of the starting medicine storage cell * Num > 0" is successfully selected, the medicine storage cell E is a first medicine storage cell to be processed, the medicine storage cell E is marked as the starting medicine storage cell, and the subsequent first operation is continued; otherwise, the subsequent first operation is no longer executed.
[0034] Here, the medicine storage grid at the head of the team is first selected as a medicine storage grid to be processed. When executing the operation, you can go along the direction from the head to the tail of the team to find the first medicine storage grid that meets the condition "the difference between the column number and the column number of the starting medicine storage grid > the preset threshold + the difference between the row number and the row number of the starting medicine storage grid * Num > 0". This medicine storage grid is medicine storage grid E, so that several medicine storage grids to be processed can be selected.
[0035] The "selecting a number of second medicine storage cells to be processed from the second queue, the number of second medicine storage cells to be processed includes the medicine storage cell at the head of the second queue, and the absolute value of the difference in column numbers between any adjacent second medicine storage cells to be processed C and the second medicine storage cell to be processed D > the preset threshold + (row number corresponding to the second medicine storage cell to be processed C - the row number of the second medicine storage cell to be processed D) * Num > 0" specifically includes: selecting the medicine storage cell at the head of the second queue as a second medicine storage cell to be processed, marking the medicine storage cell at the head of the second queue as the starting medicine storage cell, and continuously performing the following second operation: if the medicine storage cell F with the smallest column number that satisfies "the difference between the column number and the column number of the starting medicine storage cell > the preset threshold + the difference between the row number and the row number of the starting medicine storage cell * Num > 0" is successfully selected, the medicine storage cell F is a second medicine storage cell to be processed, the medicine storage cell F is marked as the starting medicine storage cell, and the subsequent second operation is continued; otherwise, the subsequent second operation is no longer performed.
[0036] A second embodiment of the present invention provides a boxed medicine dispensing device for a medicine cabinet, the medicine cabinet comprising: a cabinet body, on which medicine storage compartments having M rows and N columns are provided, each medicine storage compartment being used to store boxed medicines of the same type, wherein the rows extend in the left-right direction and the columns extend in the vertical direction; in the left-to-right direction, the N columns are respectively labeled as column 1, column 2, ..., column N; in the bottom-to-top direction, the M rows are respectively labeled as row 1, row 2, ..., row M; a conveyor belt is provided in front of the cabinet body, the conveyor belt extending from column 1 to column N, and boxed medicines stored in any medicine storage compartment can fall onto the conveyor belt; wherein M and N are both natural numbers; and the cabinet comprises the following modules:
[0037] An information acquisition module is configured to receive medication dispensing information, the medication dispensing information including: multiple medication types in a box and the quantity of medication dispensed corresponding to each medication type; obtain medication storage compartments corresponding to each medication type in a box, as well as the row and column numbers of each medication storage compartment, and generate a set S of medication storage compartments corresponding to all medication types in a box; and control the conveyor belt to rotate so that the upper surface of the conveyor belt moves from right to left.
[0038] The first medicine dispensing module is used to sort all the medicine storage cells in the set S in ascending order of column numbers to obtain a first queue; select several first to-be-processed medicine storage cells from the first queue, and the several first to-be-processed medicine storage cells include the medicine storage cell at the head of the first queue, and the absolute value of the difference in column numbers between any adjacent first to-be-processed medicine storage cell A and first to-be-processed medicine storage cell B > preset threshold + (row number corresponding to the first to-be-processed medicine storage cell A - row number of the first to-be-processed medicine storage cell B) * Num > 0, where the column number corresponding to the first to-be-processed medicine storage cell A > the column number of the first to-be-processed medicine storage cell B, -1 < Num ≤ 0, and the preset threshold > 0; control each first to-be-processed medicine storage cell to send out a boxed medicine, and then, for all the medicine storage cells that have sent out boxed medicines, subtract 1 from the medicine taking quantity value of the corresponding boxed medicine type; delete the boxed medicine types with zero medicine taking quantity from the medicine dispensing information, and delete the medicine storage cells with zero medicine taking quantity from the set S.
[0039] In this embodiment, in the left-to-right direction, the cabinet body is divided into the 1st unit, the 2nd unit,..., the Qth unit, and each unit contains P columns; where Q and P are natural numbers, and N = Q * P;
[0040] It further includes the following modules:
[0041] The second medicine dispensing module is used to generate a corresponding empty set Set for any ith unit i , obtain the corresponding jth unit for any medicine storage cell in the set S and put it into the set Set j ; where i and j are natural numbers, 1 ≤ i, j ≤ Q; let K = Q, and continuously execute the following first operation until K = 0, and when one first operation is completed, the value of K decreases by 1; The first operation is to continuously execute the following actions until the set Set k is empty: when there is no medicine box on the part of the conveyor belt located in the Kth unit, sort all the medicine storage cells in the set Set k in ascending order of column numbers to obtain a second queue; select several second to-be-processed medicine storage cells from the second queue, and the several second to-be-processed medicine storage cells include the medicine storage cell at the head of the second queue, and the absolute value of the difference in column numbers between any adjacent second to-be-processed medicine storage cell C and second to-be-processed medicine storage cell D > preset threshold + (row number corresponding to the second to-be-processed medicine storage cell C - row number of the second to-be-processed medicine storage cell D) * Num > 0, where the column number corresponding to the second to-be-processed medicine storage cell C > the column number of the second to-be-processed medicine storage cell D; control each second to-be-processed medicine storage cell to send out a boxed medicine, and then, for all the medicine storage cells that have sent out boxed medicines, subtract 1 from the medicine taking quantity value of the corresponding boxed medicine type; delete the boxed medicine types with zero medicine taking quantity from the medicine dispensing information, and delete the medicine storage cells with zero medicine taking quantity from the set Set k .
[0042] In this embodiment, the following modules are also included: a traceability module, which is used to obtain photos and traceability codes of the six sides of each box of medicine sent out by the conveyor belt, and store them in the HIS system.
[0043] In this embodiment, the first drug discharging module is further used for: the first drug discharging module is further used for: selecting the drug storage grid at the head of the first queue as a first drug storage grid to be processed, marking the drug storage grid at the head of the first queue as the starting drug storage grid, and continuously performing the following first operation: if the drug storage grid E with the smallest column number that satisfies "the difference between the column number and the column number of the starting drug storage grid > the preset threshold + the difference between the row number and the row number of the starting drug storage grid * Num > 0" is successfully selected, the drug storage grid E is a first drug storage grid to be processed, the drug storage grid E is marked as the starting drug storage grid, and the subsequent first operation is continued; otherwise , the subsequent first operation will no longer be executed; the medicine storage grid at the head of the second queue will be selected as a second medicine storage grid to be processed, the medicine storage grid at the head of the second queue will be marked as the starting medicine storage grid, and the following second operation will be continuously executed: if the medicine storage grid F with the smallest column number that satisfies "the difference between the column number and the column number of the starting medicine storage grid > the preset threshold + the difference between the row number and the row number of the starting medicine storage grid * Num > 0" is successfully selected, the medicine storage grid F will be a second medicine storage grid to be processed, the medicine storage grid F will be marked as the starting medicine storage grid, and the subsequent second operation will be continuously executed; otherwise, the subsequent second operation will no longer be executed.
[0044] Embodiment 3 of the present invention provides an electronic device, including a processor, a memory, and a program or instruction stored in the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of the boxed medicine dispensing method in embodiment 1 are implemented.
[0045] A fourth embodiment of the present invention provides a storage medium storing a program or instruction. When the program or instruction is executed by a processor, the steps of the boxed medicine dispensing method in the first embodiment are implemented.
[0046] It should be understood that although this specification is described in terms of implementation methods, not every implementation method contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each implementation method can also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
[0047] The series of detailed descriptions listed above are only specific descriptions of feasible implementation methods of the present invention. They are not intended to limit the scope of protection of the present invention. Any equivalent implementation methods or changes that do not deviate from the technical spirit of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for dispensing boxed medicines from a medicine storage cabinet, the medicine storage cabinet comprising: Cabinet body, on which there are M rows and N columns of medicine storage grids for storing boxed medicines of the same type, where the rows extend along the left-right direction and the columns extend along the vertical direction; in the left-to-right direction, the N columns are respectively marked as the 1st column, the 2nd column,..., the Nth column; in the bottom-to-top direction, the M rows are respectively marked as the 1st row, the 2nd row,..., the Mth row; in front of the cabinet body, there is a conveyor belt that extends from the 1st column to the Nth column, and the boxed medicines stored in any medicine storage grid can fall onto the conveyor belt; where M and N are both natural numbers; it is characterized by including the following steps: Receiving the medicine dispensing information, the medicine dispensing information includes: multiple boxed medicine types and the corresponding medicine-taking quantities for each boxed medicine type; obtaining the medicine storage grids corresponding to each boxed medicine type, as well as the row numbers and column numbers of each medicine storage grid, and generating a set S that includes all the medicine storage grids corresponding to the boxed medicine types; controlling the rotation of the conveyor belt, and the upper surface of the conveyor belt moves from right to left; Sorting all the medicine storage grids in the set S in ascending order of the column numbers to obtain the first queue; selecting several first to-be-processed medicine storage grids from the first queue, the several first to-be-processed medicine storage grids include the medicine storage grid at the head of the first queue, and for any adjacent first to-be-processed medicine storage grid A and first to-be-processed medicine storage grid B, the absolute value of the difference in column numbers > preset threshold + (row number corresponding to the first to-be-processed medicine storage grid A - row number of the first to-be-processed medicine storage grid B) * Num > 0, where the column number corresponding to the first to-be-processed medicine storage grid A > the column number of the first to-be-processed medicine storage grid B, -1 < Num ≤ 0, and the preset threshold > 0; controlling each first to-be-processed medicine storage grid to send out a boxed medicine, and then, for all the medicine storage grids that have sent out boxed medicines, subtracting one from the medicine-taking quantity value of the corresponding boxed medicine type; deleting the boxed medicine types with zero medicine-taking quantity from the medicine dispensing information, and deleting the medicine storage grids with zero medicine-taking quantity from the set S.
2. The boxed medicine dispensing method according to claim 1, wherein In the left-to-right direction, the cabinet body is divided into the 1st unit, the 2nd unit,..., the Qth unit, and each unit contains P columns; where Q and P are both natural numbers, and N = Q * P; Generate a corresponding empty set Set for any i-th unit i , get the corresponding j-th unit for any medicine storage grid in the set S and put it into the set Set j ; Wherein, i, j are natural numbers, 1≤i,j≤Q; Let K = Q, continue to perform the following first operation until K = 0, and after completing the first operation, the value of K decreases by 1; the first operation is to continue to perform the following actions until the set Set k Empty: When there is no medicine box on the conveyor belt located at the Kth unit, the set Set k Sort all the medicine storage grids in to obtain a second queue; select a number of second medicine storage grids to be processed from the second queue, wherein the number of second medicine storage grids to be processed includes the medicine storage grid at the head of the second queue, and the absolute value of the difference in column number between any adjacent second medicine storage grid to be processed C and the second medicine storage grid to be processed D is greater than the preset threshold + (row number corresponding to the second medicine storage grid to be processed C - row number of the second medicine storage grid to be processed D) * Num > 0, wherein the column number corresponding to the second medicine storage grid to be processed C is greater than the column number of the second medicine storage grid to be processed D; control each second medicine storage grid to be processed to send out a box of medicine, and then, for all medicine storage grids that send out boxed medicine, reduce the medicine taking quantity value of the corresponding boxed medicine type by one; delete the boxed medicine type with a medicine taking quantity of zero from the medicine delivery information, and remove it from the set Set k Delete the medicine storage grid with zero medicine quantity.
3. The method for dispensing boxed medicine according to claim 1, wherein: It further includes the following steps: It further includes the following steps: For each boxed medicine sent out by the conveyor belt, photos of six faces and the traceability code are obtained and stored in the HIS system.
4. The boxed medicine dispensing method according to claim 1, wherein The step of "selecting a plurality of first medicine storage cells to be processed from the first queue, wherein the plurality of first medicine storage cells to be processed include a medicine storage cell at the head of the first queue, and the absolute value of the difference in column numbers between any adjacent first medicine storage cells to be processed A and first medicine storage cells to be processed B>preset threshold value+(row number corresponding to the first medicine storage cell to be processed A-row number of the first medicine storage cell to be processed B)*Num>0" specifically includes: selecting the medicine storage cell at the head of the first queue as a first medicine storage cell to be processed, marking the medicine storage cell at the head of the first queue as a starting medicine storage cell, and continuously performing the following first operation: if a medicine storage cell E with the smallest column number that satisfies "the difference in column number between the column number and the starting medicine storage cell>preset threshold value+the difference in row number between the row number and the starting medicine storage cell*Num>0" is successfully selected, the medicine storage cell E is a first medicine storage cell to be processed, marking the medicine storage cell E as the starting medicine storage cell, and continuously performing the subsequent first operation; otherwise, the subsequent first operation is no longer performed; The "selecting a number of second medicine storage cells to be processed from the second queue, the number of second medicine storage cells to be processed includes the medicine storage cell at the head of the second queue, and the absolute value of the difference in column numbers between any adjacent second medicine storage cells to be processed C and the second medicine storage cell to be processed D>preset threshold+(row number corresponding to the second medicine storage cell to be processed C-row number of the second medicine storage cell to be processed D)*Num>0" specifically includes: selecting the medicine storage cell at the head of the second queue as a second medicine storage cell to be processed, marking the medicine storage cell at the head of the second queue as the starting medicine storage cell, and continuously performing the following second operation: if the medicine storage cell F that satisfies "the difference between the column number and the column number of the starting medicine storage cell>preset threshold+the difference between the row number and the row number of the starting medicine storage cell*Num>0" and has the smallest column number is successfully selected, the medicine storage cell F is a second medicine storage cell to be processed, the medicine storage cell F is marked as the starting medicine storage cell, and the subsequent second operation is continued; otherwise, the subsequent second operation is no longer performed.
5. A boxed medicine dispensing device for a medicine storage cabinet, the medicine storage cabinet comprising: A cabinet is provided with M rows and N columns of medicine storage compartments, each compartment being used to store boxed medicines of the same type, with the rows extending in the left-right direction and the columns extending in the vertical direction; from left to right, the N columns are labeled as column 1, column 2, ..., column N, respectively; from bottom to top, the M rows are labeled as row 1, row 2, ..., row M, respectively; a conveyor belt is provided in front of the cabinet, extending from column 1 to column N, and boxed medicines stored in any medicine storage compartment can fall onto the conveyor belt; wherein M and N are both natural numbers; and the cabinet is characterized in that it includes the following modules: An information acquisition module is configured to receive medication dispensing information, the medication dispensing information including: multiple medication types in a box and the quantity of medication dispensed corresponding to each medication type; obtain medication storage compartments corresponding to each medication type in a box, as well as the row and column numbers of each medication storage compartment, and generate a set S of medication storage compartments corresponding to all medication types in a box; and control the conveyor belt to rotate so that the upper surface of the conveyor belt moves from right to left. The first medicine dispensing module is used to sort all the medicine storage cells in the set S in ascending order of the column numbers to obtain a first queue; select a number of first to-be-processed medicine storage cells from the first queue, and the number of first to-be-processed medicine storage cells includes the medicine storage cell at the head of the first queue, and the absolute value of the difference in column numbers between any adjacent first to-be-processed medicine storage cell A and first to-be-processed medicine storage cell B > preset threshold + (row number corresponding to the first to-be-processed medicine storage cell A - row number of the first to-be-processed medicine storage cell B) * Num > 0, where the column number corresponding to the first to-be-processed medicine storage cell A > the column number of the first to-be-processed medicine storage cell B, -1 < Num ≤ 0, and the preset threshold > 0; control each first to-be-processed medicine storage cell to send out a boxed medicine, and then, for all the medicine storage cells that have sent out boxed medicines, subtract one from the medicine taking quantity value of the corresponding boxed medicine type; delete the boxed medicine types with zero medicine taking quantity from the medicine dispensing information, and delete the medicine storage cells with zero medicine taking quantity from the set S.
6. The boxed medicine dispensing device according to claim 5, wherein In the left-to-right direction, the cabinet body is divided into the 1st unit, the 2nd unit,..., the Qth unit, and each unit contains P columns; where Q and P are both natural numbers, and N = Q * P; It further includes the following modules: The second medicine output module is used to generate a corresponding empty set Set for any i-th unit i , get the corresponding j-th unit for any medicine storage grid in the set S and put it into the set Set j ; Where i, j are natural numbers, 1≤i, j≤Q; Let K=Q, continue to perform the following first operation until K=0, and after completing the first operation once, the value of K decreases by 1; The first operation is to continue to perform the following actions until the set Set k Empty: When there is no medicine box on the conveyor belt located at the Kth unit, the set Set k Sort all the medicine storage grids in to obtain a second queue; select a number of second medicine storage grids to be processed from the second queue, wherein the number of second medicine storage grids to be processed includes the medicine storage grid at the head of the second queue, and the absolute value of the difference in column number between any adjacent second medicine storage grid to be processed C and the second medicine storage grid to be processed D is greater than the preset threshold + (row number corresponding to the second medicine storage grid to be processed C - row number of the second medicine storage grid to be processed D) * Num > 0, wherein the column number corresponding to the second medicine storage grid to be processed C is greater than the column number of the second medicine storage grid to be processed D; control each second medicine storage grid to be processed to send out a box of medicine, and then, for all medicine storage grids that send out boxed medicine, reduce the medicine taking quantity value of the corresponding boxed medicine type by one; delete the boxed medicine type with a medicine taking quantity of zero from the medicine delivery information, and remove it from the set Set k Delete the medicine storage grid with zero medicine quantity.
7. The boxed medicine dispensing device according to claim 5, characterized in that: It further includes the following modules: The traceability module is used to obtain photos of six faces and traceability codes for each boxed medicine sent out by the conveyor belt and store them in the HIS system.
8. The boxed medicine dispensing device according to claim 5, wherein The first medicine dispensing module is further used to: select the medicine storage cell at the head of the first queue as a first to-be-processed medicine storage cell, mark the medicine storage cell at the head of the first queue as the starting medicine storage cell, and continuously execute the following first operation: if a medicine storage cell E that satisfies "the difference in column numbers between it and the starting medicine storage cell > preset threshold + the difference in row numbers between it and the starting medicine storage cell * Num > 0" and has the smallest column number is successfully selected, the medicine storage cell E is a first to-be-processed medicine storage cell, mark the medicine storage cell E as the starting medicine storage cell, and continue to execute the subsequent first operation; otherwise, no longer execute the subsequent first operation; select the medicine storage cell at the head of the second queue as a second to-be-processed medicine storage cell, mark the medicine storage cell at the head of the second queue as the starting medicine storage cell, and continuously execute the following second operation: if a medicine storage cell F that satisfies "the difference in column numbers between it and the starting medicine storage cell > preset threshold + the difference in row numbers between it and the starting medicine storage cell * Num > 0" and has the smallest column number is successfully selected, the medicine storage cell F is a second to-be-processed medicine storage cell, mark the medicine storage cell F as the starting medicine storage cell, and continue to execute the subsequent second operation; otherwise, no longer execute the subsequent second operation.
9. An electronic device, characterized in that: It includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor. When the program or instruction is executed by the processor, it implements the steps of the boxed medicine dispensing method according to any one of claims 1 - 4.
10. A storage medium, characterized in that: The storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the boxed medicine dispensing method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Automated pharmacy and medicine supply method adopting pharmacy
CN102897459A
Drug storeroom for storing boxed drugs
CN111439513A
Method and device for taking medicine from medicine storage box, electronic equipment and storage medium
CN119840989A
Automated storage, working, conveying, and delivery integrated device, system, and method
WO2022213686A1