A medicine in-and-out warehouse numbering identification method and system
By using a drug entry and exit number identification system, which utilizes hardware acquisition, image processing, and error correction verification modules, the problem of misidentification of ambiguous characters by the OCR engine has been solved, enabling accurate identification of drug codes and efficient entry and exit from the warehouse.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI SHENGSHENG LOGISTICS CO LTD
- Filing Date
- 2026-05-08
- Publication Date
- 2026-07-24
AI Technical Summary
In existing technologies, when OCR engines recognize drug codes, ambiguous characters such as "0", "O", "D", "1", "I", "l", "5", and "S" are easily misrecognized, leading to errors in drug entry and exit from the warehouse.
A drug entry and exit number identification system is adopted, including a hardware acquisition module, an image processing module, an error correction and verification module, and a database module. Through preprocessing, OCR engine recognition, error correction and verification, and human-computer interaction modules, the accuracy of drug codes is ensured.
It improves the accuracy and efficiency of drug code identification, reduces the number of manual identifications, and ensures the correctness of drug entry and exit from the warehouse.
Smart Images

Figure CN122454582A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of pharmaceutical warehousing technology, specifically to a method and system for identifying pharmaceutical warehousing numbers. Background Technology
[0002] The main purpose of pharmaceutical cold chain warehousing is to ensure that the temperature, humidity, and light conditions of medicines are maintained in accordance with regulations throughout the entire transportation, storage, and sales process, thereby guaranteeing the quality and efficacy of the medicines. This is mainly achieved by comparing the drug codes on the medicine boxes with the drug information in the management system to ensure the accuracy of entry and exit.
[0003] OCR engines are often used when identifying drug codes. Staff first take a picture of the drug code, and then upload the picture to the OCR engine. The OCR engine automatically recognizes information such as the box number, batch number, expiration date, and generic name on the carton label, which replaces manual data entry and improves the efficiency of drug entry and exit.
[0004] However, when the OCR recognition engine is identifying drug codes, ambiguous characters such as "0", "O", "D", "1", "I", "l", "5", and "S" are easily misidentified by the OCR engine under conditions of poor image quality, special printed fonts, or shooting angle, resulting in errors in drug code recognition and affecting the normal entry and exit of drugs from the warehouse.
[0005] In view of this, we propose a numbering identification method and system for drug entry and exit from the warehouse. Summary of the Invention
[0006] The purpose of this invention is to provide a method and system for identifying drug codes for entry and exit from the warehouse, so as to solve the problem of drug code identification errors leading to errors in drug entry and exit from the warehouse as mentioned in the background art.
[0007] To achieve the above objectives, the present invention provides the following technical solution: A drug entry / exit identification system includes: a hardware acquisition module, an image processing module, an error correction and verification module, a human-computer interaction module, and a database module. The hardware acquisition module acquires images of the drugs, specifically images of the drug packaging boxes obtained through a smart camera. The hardware acquisition module transmits the captured drug images via a network to the subsequent image processing module. The image processing module preprocesses the images to obtain image text, using an OCR engine to process the acquired images and extract the text content within the images, thereby facilitating the extraction of drug numbers to complete the entry / exit operation. The error correction and verification module extracts, recognizes, diagnoses, and corrects errors in image text to obtain drug codes, which are then sent to the human-computer interaction module for selection. The error correction and verification module receives image text, extracts the drug codes within it, and confirms their correctness, completing the drug entry and exit from the warehouse. For drug codes that fail to be recognized, the error correction and verification module sends them to the human-computer interaction module for manual recognition and verification, completing the drug entry and exit from the warehouse. The database module provides the data foundation for the error correction and verification module, storing drug-related data to provide a data basis for the module to confirm drug codes.
[0008] Preferably, the image processing module includes a preprocessing unit and a recognition engine unit; the preprocessing unit adjusts the image clarity, levelness, and encoding area, and performs operations such as grayscale conversion, contrast enhancement, perspective correction, rotation and alignment, and specific area cropping on the original image captured by the hardware acquisition module to optimize the recognition input; the recognition engine unit connects to an OCR engine to perform image text recognition on the preprocessed image and make confidence judgments, and the recognition engine unit encapsulates and calls one or more OCR engines to extract text from the preprocessed image and judge the position and confidence level of the characters.
[0009] Preferably, the error correction and verification module includes a location extraction unit, an ambiguity diagnosis unit, an ambiguity candidate unit, and a verification unit. The location extraction unit acquires the image text recognized by the recognition engine unit and extracts the encoded string. The location extraction unit focuses on extracting key elements from the image text recognized by the engine unit, accurately extracting the target encoded string based on position or regular expressions. The ambiguity diagnosis unit connects to the database module and, in conjunction with confidence judgment, judges and classifies ambiguous characters in the encoded string. The ambiguity diagnosis unit analyzes the codes extracted by the location extraction unit and uses the database to identify and judge ambiguous characters, classifying them according to the confidence level obtained by the recognition engine unit. The ambiguity candidate unit generates a candidate code list for ambiguous characters. The ambiguity candidate unit generates multiple possible correct code candidate lists for verification and confirmation based on a preset candidate strategy within the system, such as full combination replacement or graded replacement. The verification unit verifies the candidate code list to obtain the correct code, filtering the candidate codes within the candidate code list to determine the unique correct one.
[0010] Preferably, the verification unit includes a filtering component, a verification component, and a feedback component. The filtering component quickly eliminates unqualified candidate codes based on the database module, and quickly filters candidate codes according to the coding rules in the database module, deleting candidate codes that do not conform to the coding rules. The verification component connects to the database module to verify and confirm the remaining candidate codes and sends unconfirmed codes to the human-computer interaction module for processing. The verification unit compares and verifies the remaining candidate codes with the drug codes in the database module, thereby determining a unique drug code and completing the correct entry and exit of drugs. The feedback component records the code verification process and verification results and updates the inventory records. The feedback component records the verification process and verification results to achieve overall traceability and records the entry and exit of drugs, completing the correct entry and exit of drugs.
[0011] Preferably, the database module includes a drug database, an ambiguous character mapping library, and an encoding rule library. The drug database provides a data foundation for the verification component by storing information on all the company's drugs. The drug database stores authoritative information on all the company's drugs, including at least fields such as unique drug number, name, specifications, and manufacturer, and serves as the final basis for verification operations. The ambiguous character mapping library provides a data foundation for the ambiguous diagnosis unit by dynamically updating and storing a set of easily confused characters through machine learning. The predefined or dynamically updated set of easily confused characters is used to identify ambiguous characters. The encoding rule library stores drug coding rules to facilitate rapid filtering by the filtering component. The encoding rule library stores specific rules for drug codes, thereby generating a candidate coding list for ambiguous candidate units for rapid filtering, removing candidate codes that do not conform to the coding rules, reducing candidate code verification time, and improving verification efficiency.
[0012] A method for identifying the entry and exit of pharmaceuticals using serial numbers includes the following steps: Step 1: The hardware acquisition module acquires images of the medicine; Staff members use hardware acquisition modules to photograph medicine boxes and, guided by the system, ensure that the codes are clear. The captured images are then uploaded to the edge device or cloud for storage in real time. Step 2: The image preprocessing module standardizes the image and performs image text recognition; The image preprocessing module standardizes the image to improve the recognition rate and calls the OCR engine to obtain the full-image text recognition result, including the text content, coordinates and confidence score of each character; Step 3: The error correction and verification module extracts the encoded string from the image text; The error correction and verification module locates the image and text and extracts the drug code string; Step 4: The error correction and verification module confirms the correct encoded string based on the database module and enters it into the database record; The error correction and verification module connects to the database module to identify and verify the drug code string, thereby confirming the unique drug code and ensuring the correct entry and exit from the warehouse. Step 5: The human-computer interaction module manually confirms the unconfirmed codes of the error correction and verification module and sends the results to the error correction and verification module's database record. The error correction and verification module transfers undetermined drug codes to the human-computer interaction module, allowing staff to manually verify the codes and determine the correct drug codes for proper entry and exit from the warehouse.
[0013] Furthermore, step 2 above also includes the following steps: Step 2.1: The preprocessing unit adjusts the sharpness, rotates, and segments the drug image; The preprocessing unit performs operations such as grayscale conversion, contrast enhancement, perspective correction, rotation and alignment, and cropping on the original image to optimize the recognition input. The preprocessing unit divides the image into different layouts and sends them to the recognition engine unit for recognition. Step 2.2: The recognition engine unit segments, extracts, and recognizes characters in the preprocessed image; The recognition engine unit uses a character segmentation algorithm to segment characters caused by character adhesion and broken strokes. It then performs multi-dimensional feature recognition on the segmented characters, and finally performs coarse template classification and fine template matching with the feature template library to identify the characters. Step 2.3: The recognition engine unit typeset and corrects the recognized image text; The recognition engine unit recognizes the layout of the original document and outputs the recognition results to Word or PDF documents according to the original layout format. It also corrects the recognition results based on the specific language context. Step 2.3: The recognition engine unit performs a confidence assessment on the corrected characters; The recognition engine unit determines the confidence level of a character based on the difficulty of character recognition during the recognition process.
[0014] Furthermore, step 4 above also includes the following steps; Step 4.1: The ambiguity diagnosis unit determines the location of the ambiguous character by combining the ambiguous character mapping library; The ambiguity diagnosis unit obtains the extracted drug code characters and connects them to the ambiguity character mapping library. Based on easily confused characters, it locates easily confused characters within the drug code characters and identifies them as ambiguous characters. Step 4.2: The ambiguity diagnosis unit performs hierarchical processing on ambiguous characters based on confidence levels; The ambiguity diagnosis unit simultaneously connects to the recognition engine unit to obtain the confidence level of the character, and combines the ambiguous character with the confidence level for classification; Step 4.3: The ambiguous candidate unit generates an encoding candidate list based on the ambiguous character mapping library; The ambiguity candidate unit generates multiple candidate codes for multiple ambiguous characters and combines them with easily confused characters from the ambiguous character mapping library, forming a candidate code list; Step 4.4: The verification unit verifies the candidate encoding list to determine the correct encoding; The verification unit filters the candidate code list based on the coding rule base and the drug database to determine the correct drug code, thereby correctly completing the drug entry and exit from the warehouse.
[0015] Furthermore, step 4.4 above also includes the following steps: Step 4.4.1: The filtering component eliminates and filters candidates from the encoding list according to the encoding rules; The filtering component connects to the encoding rule base to filter the candidate encoding list according to rules, thereby eliminating obviously invalid candidate encodings; Step 4.4.2: The verification component compares the retained codes based on the drug database; The verification component connects to the drug database and compares the remaining candidate codes with the drug codes in the drug database one by one for confirmation. Step 4.4.3: If the retained code list has a unique correspondence with the drug database code, then send the result to the feedback component; If there is a unique candidate code that corresponds to a drug code in the drug code database, then the code is determined to be the correct drug code, and the verification result and the drug code are sent to the feedback component. Step 4.4.4: The feedback component records the verification process and results and updates the entry record. The feedback component records the verification process and results and updates the inbound records to complete the correct inbound and outbound verification. Step 4.4.5: If the stored code list has a many-to-one or many-to-many relationship with the drug database code, then return to the recognition engine unit to obtain the remaining drug information; If, when comparing the remaining candidate codes with the codes in the drug database, one or more of the candidate codes are found to be matched successfully, the verification component connects to the recognition engine unit to obtain information such as the drug name. Step 4.4.6: If a unique code is confirmed by combining it with other information about the drug, the result will be sent to the feedback component. The verification component combines the drug name with multiple successfully matched codes in the drug database to identify the unique and correct drug code, completes the verification of the drug code, and sends the result to the feedback component. Step 4.4.7: If the unique code cannot be confirmed by combining the other information of the drug, it shall be sent to the human-computer interaction module for manual verification; If the drug code cannot be identified even after combining other drug information, the extracted drug code will be sent to the human-computer interaction module for manual verification.
[0016] Furthermore, step 5 above also includes the following steps: Step 5.1: The human-computer interaction module receives unrecognized codes and highlights ambiguous characters; The human-computer interaction module receives unrecognized drug codes and highlights ambiguous characters confirmed by the ambiguity diagnosis unit, thus facilitating staff to make key confirmations. Step 5.2: The human-computer interaction module provides character replacement options based on the ambiguous character mapping library; The human-computer interaction module accesses an ambiguous character mapping library, which lists the corresponding easily confused characters next to the highlighted ambiguous characters for staff to select. Step 5.3: Staff members select drugs using the human-computer interaction module combined with the drug images and send the results to the feedback component; Staff members use images of medicines to identify and confirm ambiguous characters, thereby determining the correct medicine code and sending it to the feedback component to confirm the medicine code, thus ensuring the accuracy of medicine entry and exit from the warehouse.
[0017] Compared with the prior art, the beneficial effects of the present invention are: 1. A method and system for identifying drug codes for entry and exit from warehouses. This system improves processing speed by correcting ambiguous characters in drug codes through an error correction and verification module, thereby determining the correct drug codes and ensuring the accuracy of drug entry and exit from warehouses.
[0018] 2. A method and system for identifying drug codes for inbound and outbound operations. This system uses an error correction and verification module to perform secondary identification of drug codes, thereby improving the accuracy of drug identification, reducing the number of manual identifications, and improving the efficiency of drug inbound and outbound verification.
[0019] 3. A method and system for identifying drug codes for entry and exit from warehouses. This system uses a database module to filter drug codes according to rules, thereby eliminating invalid drug codes and improving the efficiency of drug code identification. Attached Figure Description
[0020] Figure 1 This is a framework diagram of the number identification system of the present invention; Figure 2 This is a detailed framework diagram of the verification unit of the present invention; Figure 3 This is a flowchart of the main body of the number identification method of the present invention; Figure 4 This is a detailed flowchart of the number identification method of the present invention; Figure 5 This is a detailed flowchart of the verification unit method of the present invention.
[0021] In the picture: 1. Hardware acquisition module; 2. Image processing module; 21. Preprocessing unit; 22. Recognition engine unit; 3. Error correction and verification module; 31. Location extraction unit; 32. Ambiguity diagnosis unit; 33. Ambiguity candidate unit; 34. Verification unit; 341. Filtering component; 342. Verification component; 343. Feedback component; 4. Human-computer interaction module; 5. Database module; 51. Drug database; 52. Ambiguous character mapping library; 53. Encoding rule library. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] OCR engines are often used when identifying drug codes. Staff first take a picture of the drug code, and then upload the picture to the OCR engine. The OCR engine automatically recognizes information such as the box number, batch number, expiration date, and generic name on the carton label, which replaces manual data entry and improves the efficiency of drug entry and exit.
[0024] However, when the OCR recognition engine is identifying drug codes, ambiguous characters such as "0", "O", "D", "1", "I", "l", "5", and "S" are easily misidentified by the OCR engine under conditions of poor image quality, special printed fonts, or shooting angle, resulting in errors in drug code recognition and affecting the normal entry and exit of drugs from the warehouse.
[0025] like Figures 1 to 5 As shown, a method and system for identifying drug entry and exit numbers includes: like Figures 1 to 2 As shown, a drug entry and exit number identification system includes: a hardware acquisition module 1, an image processing module 2, an error correction and verification module 3, a human-computer interaction module 4, and a database module 5; the hardware acquisition module 1 acquires drug images; the image processing module 2 preprocesses the images to obtain image text; the error correction and verification module 3 extracts, identifies, diagnoses, and corrects errors in the image text to obtain drug codes, which are then sent to the human-computer interaction module 4 for selection; the database module 5 provides the data foundation for the error correction and verification module 3. Specifically, hardware acquisition module 1 acquires images of the medicine. It uses a smart camera device (such as a smartphone or camera) to capture images of the medicine packaging and uploads them to the cloud for storage. The hardware acquisition module 1 then transmits the captured images to the subsequent image processing module 2 via the network. Image processing module 2 preprocesses the images to obtain image text. It uses an OCR engine to process the acquired images, thereby extracting the text content within the images. This facilitates the extraction of the medicine's serial number for inventory management. Simultaneously, when acquiring the image text, image processing module 2 also obtains the position and confidence level of the text characters. The OCR engine is a core component of optical character recognition technology. Its core technology modules are encapsulated in an SDK development package, supporting application calls to achieve character recognition functions for documents, certificates, license plates, and other images. It can convert text in scanned or captured images into editable computer text. The OCR engine employs deep learning and machine learning algorithms. The update process is as follows: The error correction and verification module 3 extracts, recognizes, diagnoses, and corrects errors in the image text to obtain the drug code, and sends it to the human-computer interaction module 4 for selection. The error correction and verification module 3 receives the image text, extracts the drug code from the image text, and confirms the correctness of the drug code, completing the drug entry and exit. For drug codes that fail to be recognized, the error correction and verification module 3 sends the drug code to the human-computer interaction module 4 for manual recognition and verification, completing the drug entry and exit. The error correction and verification module 3 verifies and confirms the drug code based on the coding rules, improving the accuracy of drug code recognition and completing a flawless drug entry and exit verification operation. The human-computer interaction module also includes a task management unit, which can manage and monitor recognition tasks that are pending, in process, confirmed, or require manual review. The database module 5 provides the data foundation for the error correction and verification module 3. The database module 5 includes the storage of drug-related data, thus providing the data foundation for the error correction and verification module 3 to confirm the drug code.
[0026] In this embodiment, the image processing module 2 includes a preprocessing unit 21 and a recognition engine unit 22; the preprocessing unit 21 adjusts the image clarity, levelness, and encoding area; the recognition engine unit 22 connects to an OCR engine to perform image text recognition on the preprocessed image and make a confidence judgment. Specifically, the preprocessing unit 21 adjusts the image clarity, levelness, and encoding area. The preprocessing unit 21 performs operations such as grayscale conversion, contrast enhancement, perspective correction, rotation and alignment, and specific area cropping on the original image captured by the hardware acquisition module 1 to optimize the recognition input. The recognition engine unit 22 connects to the OCR engine to perform image text recognition on the preprocessed image and make confidence judgments. The recognition engine unit 22 encapsulates and calls one or more OCR engines to extract text from the preprocessed image and judges the position and confidence of the characters. The OCR engine performs character cutting, character feature extraction, character recognition, layout restoration, and post-processing correction on the multiple images cropped by the preprocessing unit 21, thereby completing the recognition and extraction of image problems.
[0027] In this embodiment, the error correction and verification module 3 includes a location extraction unit 31, an ambiguity diagnosis unit 32, an ambiguity candidate unit 33, and a verification unit 34. The location extraction unit 31 acquires the image text recognized by the recognition engine unit 22 and extracts the encoded string. The ambiguity diagnosis unit 32 accesses the database module 5 and combines confidence judgment to determine and classify ambiguous characters in the encoded string. The ambiguity candidate unit 33 generates an encoding candidate list for ambiguous characters. The verification unit 34 verifies the encoding candidate list to obtain the correct encoding. Specifically, the positioning and extraction unit 31 acquires the image text recognized by the recognition engine unit 22 and extracts the encoded string. The positioning and extraction unit 31 focuses on extracting the image text recognized by the engine unit, and accurately extracts the target encoded string based on position or regular expressions. The ambiguity diagnosis unit 32 accesses the database module 5 and combines confidence judgment to judge and classify ambiguous characters in the encoded string. The ambiguity diagnosis unit 32 analyzes the encoding extracted by the positioning and extraction unit 31 and identifies and judges the ambiguous characters in the database. It also classifies the ambiguous characters according to the confidence level obtained by the recognition engine unit 22. By classifying the ambiguous characters, step-by-step verification is achieved. If the lowest level ambiguous character is indeed... If the verification is successful, there is no need to verify other ambiguous characters, thereby reducing the amount of computation and improving the processing speed. The ambiguity candidate unit 33 generates a list of candidate codes for ambiguous characters. The ambiguity candidate unit 33 generates multiple possible correct code candidate lists for verification and confirmation according to the preset candidate strategy in the system, such as: full combination replacement, hierarchical replacement. The verification unit 34 verifies the code candidate list to obtain the correct code. The verification unit 34 filters the candidate codes in the code candidate list to determine the unique correct one. If the code candidate list still contains multiple candidate codes after the verification unit 34 filters, the code is sent to the manual interaction module for manual verification and confirmation, thereby ensuring the correctness of the input and output of the database.
[0028] In this embodiment, the verification unit 34 includes a filtering component 341, a verification component 342, and a feedback component 343; the filtering component 341 quickly eliminates unqualified candidate codes according to the database module 5; the verification component 342 accesses the database module 5 to verify and confirm the remaining candidate codes and sends unconfirmed codes to the human-computer interaction module 4 for processing; the feedback component 343 records the code verification process and verification results and updates the inventory record; Specifically, the filtering component 341 quickly eliminates unqualified candidate codes according to the database module 5. The filtering component 341 quickly filters candidate codes according to the coding rules in the database module 5 and deletes candidate codes that do not conform to the coding rules. The verification component 342 connects to the database module 5 to check and confirm the remaining candidate codes and sends unconfirmed codes to the human-computer interaction module 4 for processing. The verification unit compares and verifies the remaining candidate codes with the drug codes in the database module 5, thereby determining the unique drug code and completing the correct entry and exit of drugs. The feedback component 343 records the code verification process and verification results and updates the inventory records. The feedback component 343 records the verification process and verification results to achieve overall traceability and records the entry and exit of drugs to complete the correct entry and exit of drugs.
[0029] In this embodiment, the database module 5 includes a drug database 51, an ambiguous character mapping library 52, and an encoding rule library 53. The drug database 51 provides a data foundation for the verification component 342 by storing all drug information of the company. The ambiguous character mapping library 52 provides a data foundation for the ambiguity diagnosis unit 32 by dynamically updating and storing easily confused character sets through machine learning. The encoding rule library 53 is used to store drug encoding rules to facilitate rapid screening by the filtering component 341. Specifically, the drug database 51 provides a data foundation for the verification component 342 by storing all drug information of the company. The drug database 51 stores authoritative information on all drugs of the company, including at least fields such as unique drug number, name, specifications, and manufacturer, and is the final basis for verification operations. The ambiguous character mapping library 52 provides a data foundation for the ambiguous diagnosis unit 32 by dynamically updating and storing easily confused character sets through machine learning. The predefined or dynamically updated easily confused character sets are used to identify ambiguous characters. The easily confused character sets include: {0, O, D}, {1, I, l}, {5, S}, etc. The coding rule library 53 is used to store drug coding rules to facilitate quick filtering by the filtering component 341. The coding rule library 53 stores specific rules for drug codes. Then, it generates a code candidate list for the ambiguous candidate unit 33 for quick filtering, removes candidate codes that do not conform to the coding rules, reduces the verification time of candidate codes, and improves verification efficiency. Specific rules include: character sets for specific fields, check bit rules, etc.
[0030] In the application of this drug entry and exit number recognition system, when in use, staff first photograph the drug packaging using hardware acquisition module 1 to obtain drug images. Hardware acquisition module 1 transmits the acquired drug images to preprocessing unit 21. Preprocessing unit 21 performs operations such as grayscale conversion, contrast enhancement, perspective correction, rotation and alignment, and specific area cropping on the original image to optimize the recognition input. The preprocessed image is transmitted to recognition engine unit 22 for text extraction, and the position and confidence of characters are judged. Recognition engine unit 22 sends the recognized image text to positioning extraction unit 31. Positioning extraction unit 31 accurately extracts the target encoded string based on the position of the image text or regular expressions. Ambiguity diagnosis unit 32 obtains the target encoded string and connects it to the ambiguous character mapping unit to determine the ambiguous characters in the encoded string, and then determines the ambiguity characters based on the recognition... The engine unit 22 determines the confidence level of ambiguous characters and classifies them. The ambiguity candidate unit 33 generates a candidate code list for the lowest-level ambiguous characters and sends it to the filtering component 341. The filtering component 341 first performs an initial screening based on the encoding rules in the encoding rule library 53 to remove unqualified candidate codes. Then, it sends the remaining candidate codes to the verification component 342. The verification component 342 accesses the drug database 51 and compares it with the candidate codes to determine the correct drug code and sends it to the feedback component 343. The feedback component 343 stores the verification process and verification results and updates the inbound and outbound records. If the correct drug code is not determined based on the drug database 51, the code is sent to the human-computer interaction module. The human-computer interaction module determines the correct drug code based on the drug image and sends the correct drug code to the feedback component 343 to complete the inbound and outbound records.
[0031] like Figures 3 to 5 As shown, a method for identifying the entry and exit of medicines using serial numbers includes the following steps: Step 1: Hardware acquisition module 1 acquires images of the medicine; Step 2: The image preprocessing module standardizes the image and performs image text recognition; Step 3: Error correction and verification module 3 extracts the encoded string from the image text; Step 4: Error correction and verification module 3 confirms the correct encoded string based on database module 5 and enters it into the database record; Step 5: The human-computer interaction module 4 manually confirms the unconfirmed code of the error correction and verification module 3 and sends the result to the database record of the error correction and verification module 3; Specifically, staff members photograph the medicine boxes using hardware acquisition module 1, and the system guides them to ensure the codes are clear. The captured images are uploaded to the edge device or cloud for storage in real time. The image preprocessing module standardizes the images to improve the recognition rate and calls the OCR engine to obtain full-image text recognition results, including text content, coordinates, and the confidence score of each character. The error correction and verification module 3 locates the text in the image and extracts the medicine code string. The error correction and verification module 3 connects to the database module 5 to recognize and verify the medicine code string, thereby confirming the unique medicine code and ensuring the correct entry and exit from the warehouse. The error correction and verification module 3 transfers any uncertain medicine codes to the human-computer interaction module 4, allowing staff to manually verify the code and complete the correct entry and exit from the warehouse.
[0032] In this embodiment, step 2 above further includes the following step: Step 2.1: Preprocessing unit 21 adjusts the sharpness, rotates, and segments the drug image; Step 2.2: The recognition engine unit 22 cuts, extracts, and recognizes the characters in the preprocessed image; Step 2.3: The recognition engine unit 22 typesets and corrects the recognized image text; Step 2.3: The recognition engine unit 22 performs a confidence assessment on the corrected characters; Specifically, the preprocessing unit 21 performs operations such as grayscale conversion, contrast enhancement, perspective correction, rotation and alignment, and cropping on the original image to optimize the recognition input. The preprocessing unit 21 segments the image into different layouts and sends them to the recognition engine unit 22 for recognition. The recognition engine unit 22 uses a character segmentation algorithm to segment characters caused by character adhesion and broken strokes. It performs multi-dimensional feature recognition on the segmented characters, and then performs coarse template classification and fine template matching with the feature template library to recognize the characters. The recognition engine unit 22 recognizes the layout of the original document and outputs the recognition results to a Word or PDF document according to the original layout format. It corrects the recognition results based on the specific language context. The recognition engine unit 22 judges the confidence level of the characters based on the difficulty of character recognition during the recognition process.
[0033] In this embodiment, step 4 above further includes the following steps; Step 4.1: The ambiguity diagnosis unit 32, in conjunction with the ambiguous character mapping library 52, determines the position of the ambiguous character; Step 4.2: The ambiguity diagnosis unit 32 performs hierarchical processing on ambiguous characters based on confidence levels; Step 4.3: Ambiguity candidate unit 33 generates an encoding candidate list based on the ambiguous character mapping library 52; Step 4.4: Verification unit 34 verifies the candidate encoding list to determine the correct encoding; Specifically, the ambiguity diagnosis unit 32 obtains the extracted drug code characters and connects them to the ambiguity character mapping library 52. Based on easily confused characters, it locates easily confused characters within the drug code characters and identifies them as ambiguous characters. Simultaneously, the ambiguity diagnosis unit 32 connects to the recognition engine unit 22 to obtain the confidence level of the characters and classifies the ambiguous characters by combining them with the confidence level. The ambiguity candidate unit 33 generates multiple candidate codes for multiple ambiguous characters by combining them with easily confused characters from the ambiguity character mapping library 52, forming a candidate code list. When generating candidate codes for ambiguous characters, the ambiguity candidate unit 33 first replaces and verifies the lowest-level ambiguous characters. If the verification passes, other ambiguous characters with higher confidence are no longer processed, thereby reducing the amount of computation and the number of candidate sets, and improving the processing speed. The verification unit 34 filters the code candidate list according to the coding rule library 53 and the drug database 51, thereby determining the correct drug code and correctly completing the drug entry and exit from the warehouse.
[0034] In this embodiment, step 4.4 above further includes the following steps: Step 4.4.1: Filtering component 341 filters and eliminates candidates from the encoding candidate list according to the encoding rules; Step 4.4.2: Verification component 342 compares the retained codes based on the drug database 51; Step 4.4.3: If the retained code list has a unique correspondence with the drug database code 51, then send the result to the feedback component 343; Step 4.4.4: Feedback component 343 records the verification process and verification results and updates the entry record; Step 4.4.5: If the stored code list has a many-to-one or many-to-many relationship with the code in the drug database 51, then return to the recognition engine unit 22 to obtain the remaining drug information; Step 4.4.6: If a unique code is confirmed by combining the other information of the drug, the result is sent to feedback component 343; Step 4.4.7: If the unique code cannot be confirmed by combining the other information of the drug, it shall be sent to the human-computer interaction module 4 for manual verification; Specifically, the filtering component 341 connects to the coding rule base 53 to filter the candidate coding list according to rules, thereby eliminating obviously invalid candidate codes; the verification component 342 connects to the drug database 51 and compares the remaining candidate codes with the drug codes in the drug database 51 one by one; if there is a unique code in the candidate list that corresponds uniquely to a drug code in the drug coding database, then the code is determined to be the correct drug code, and the verification result and the drug code are sent to the feedback component 343; the feedback component 343 records the verification process and verification result and updates the entry record, completing the correct entry and exit verification; If, when comparing the remaining candidate codes with the codes in the drug database 51, one or more of the candidate codes match successfully, the verification component 342 accesses the recognition engine unit 22 to obtain information such as the drug name. The verification component 342 then filters the multiple successful codes in the drug database 51 in conjunction with the drug name to confirm the unique correct drug code, complete the verification of the drug code, and send the result to the feedback component 343. If the drug code cannot be identified even with the other drug information, the extracted drug code is sent to the human-computer interaction module 4 for manual verification.
[0035] In this embodiment, step 5 above further includes the following step: Step 5.1: The human-computer interaction module 4 receives the unrecognized code and highlights the ambiguous characters; Step 5.2: The human-computer interaction module 4 provides character replacement options based on the ambiguous mapping character library; Step 5.3: Staff members select drugs using the human-computer interaction module 4 in conjunction with the drug image and send the results to the feedback component 343; Specifically, the human-computer interaction module 4 receives unrecognized drug codes and highlights the ambiguous characters confirmed by the ambiguity diagnosis unit 32, making it easier for staff to confirm them. The human-computer interaction module 4 accesses the ambiguity mapping character library and lists the corresponding easily confused characters next to the highlighted ambiguous characters for staff to select. Staff select and confirm the ambiguous characters in conjunction with the drug image, thereby determining the correct drug code and sending it to the feedback component 343 to complete the confirmation of the drug code, thus ensuring the correctness of drug entry and exit from the warehouse.
[0036] Figure 3This is a flowchart of the main process of the number recognition method of the present invention. The flowchart introduces the main usage method of the system. The staff takes pictures of the medicine boxes through the hardware acquisition module 1, and ensures that the code is clear through system guidance. The captured image is uploaded to the edge terminal or cloud for storage in real time. The image preprocessing module receives the medicine image, performs image standardization processing to improve the recognition rate, and calls the OCR engine to obtain the full-image text recognition result, including text content, coordinates, and confidence of each character. The error correction and verification module 3 locates the image and text and extracts the medicine code string. The error correction and verification module 3 connects to the database module 5 to recognize and verify the medicine code string, thereby confirming the unique medicine code and ensuring the correct entry and exit of the warehouse. The error correction and verification module 3 transfers the medicine code that cannot be determined to the human-computer interaction module 4, so that the staff can manually verify it through the human-computer interaction module 4, thereby determining the correct medicine code and completing the correct entry and exit of the warehouse.
[0037] Figure 4 This is a detailed flowchart of the number recognition method of the present invention, which introduces the detailed usage of the system. The staff takes a picture of the medicine box using the hardware acquisition module 1, and ensures the code is clear through system guidance before sending it to the preprocessing unit 21. The preprocessing unit 21 performs operations such as grayscale conversion, contrast enhancement, perspective correction, rotation and alignment, and cropping on the original image to optimize the recognition input. The recognition engine unit 22 uses a character segmentation algorithm to segment characters caused by character adhesion and broken strokes. It performs multi-dimensional feature recognition on the segmented characters, then performs coarse template classification and fine template matching with the feature template library to identify the character. Finally, it typesets the character and... Based on the specific linguistic context, the recognition results are corrected. The ambiguity diagnosis unit 32 obtains the extracted drug code characters and connects them to the ambiguity character mapping library 52. Based on easily confused characters, it locates easily confused characters within the drug code characters and identifies them as ambiguous characters. Simultaneously, the ambiguity diagnosis unit 32 connects to the recognition engine unit 22 to obtain the confidence level of the characters and combines the ambiguous characters with the confidence level for classification. The ambiguity candidate unit 33 generates multiple candidate codes for multiple ambiguous characters in combination with the easily confused characters in the ambiguity character mapping library 52, forming a candidate code list. The verification unit 34 filters the code candidate list according to the coding rule library 53 and the drug database 51, thereby determining the correct drug code.
[0038] Figure 5This is a detailed flowchart of the verification unit 34 method of the present invention. The filtering component 341 receives the candidate code list and connects it to the coding rule library 53 to perform rule filtering on the candidate code list, thereby eliminating obviously invalid candidate codes. The verification component 342 connects to the drug database 51 and compares the remaining candidate codes with the drug codes in the drug database 51 one by one. If there is a unique code in the candidate list that corresponds uniquely to a drug code in the drug code library, then the code is determined to be the correct drug code, and the verification result and the drug code are sent to the feedback component 343. The feedback component 343 records the verification process and verification result and updates the entry record, completing the correct entry and exit verification. If, when comparing the remaining candidate code list with the codes in the drug database 51, one or more of the multiple candidate codes are successfully matched, the verification component 342 connects to the recognition engine unit 22 to obtain the drug code. The verification component 342 combines the drug name with multiple successfully matched codes in the drug database 51 to identify the unique and correct drug code, thus completing the drug code verification and sending the result to the feedback component 343. If the drug code cannot be identified even with the other drug information, the extracted drug code is sent to the human-computer interaction module 4 for manual verification. The human-computer interaction module 4 receives the unrecognized drug code and highlights the ambiguous characters confirmed by the ambiguity diagnosis unit 32, making it easier for staff to focus on confirming them. The human-computer interaction module 4 accesses the ambiguity mapping character library and lists the corresponding easily confused characters next to the highlighted ambiguous characters for staff to select. Staff select and confirm the ambiguous characters in conjunction with the drug image, thereby determining the correct drug code and sending it to the feedback component 343 to complete the confirmation of the drug code, thus ensuring the correctness of drug entry and exit from the warehouse.
[0039] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A numbering identification system for pharmaceuticals entering and leaving a warehouse, characterized in that, include: Hardware acquisition module (1), image processing module (2), error correction and verification module (3), human-computer interaction module (4) and database module (5); The hardware acquisition module (1) acquires images of the medicine; The image processing module (2) preprocesses the image to obtain image text; The error correction and verification module (3) extracts, recognizes, diagnoses, and corrects errors in the image text to obtain the drug code, and sends it to the human-computer interaction module (4) for selection; The database module (5) provides the data foundation for the error correction and verification module (3).
2. The number identification system according to claim 1, characterized in that: The image processing module (2) includes a preprocessing unit (21) and a recognition engine unit (22); The preprocessing unit (21) adjusts the image sharpness, levelness, and encoding area; The recognition engine unit (22) connects to the OCR engine to perform image text recognition and confidence judgment on the preprocessed image.
3. The number identification system according to claim 2, characterized in that: The error correction and verification module (3) includes a localization and extraction unit (31), an ambiguity diagnosis unit (32), an ambiguity candidate unit (33), and a verification unit (34). The positioning extraction unit (31) acquires the image text recognized by the recognition engine unit (22) and extracts the encoded string; The ambiguity diagnosis unit (32) connects to the database module (5) and combines confidence judgment to judge and classify ambiguous characters in the encoded string; The ambiguous candidate unit (33) generates a list of encoding candidates for ambiguous characters; The verification unit (34) verifies the candidate encoding list to obtain the correct encoding.
4. The number identification system according to claim 3, characterized in that: The verification unit (34) includes a filtering component (341), a verification component (342), and a feedback component (343). The filtering component (341) quickly eliminates unqualified candidate codes according to the database module (5); The verification component (342) accesses the database module (5) to verify and confirm the remaining candidate codes and sends the unconfirmed codes to the human-computer interaction module (4) for processing; The feedback component (343) records the coding verification process and verification results and updates the inventory records.
5. The number identification system according to claim 4, characterized in that: The database module (5) includes a drug database (51), an ambiguous character mapping library (52), and an encoding rule library (53). The drug database (51) provides a data foundation for the verification component (342) by storing all drug information of the company; The ambiguous character mapping library (52) dynamically updates and stores the set of easily confused characters through machine learning, providing a data foundation for the ambiguous diagnosis unit (32); The coding rule library (53) is used to store drug coding rules to facilitate rapid screening by the filtering component (341).
6. A method for identifying drug entry and exit numbers, used in the number identification system according to any one of claims 1-5, characterized in that, Includes the following steps: Step 1: Hardware acquisition module (1) acquires images of the medicine; Step 2: The image preprocessing module standardizes the image and performs image text recognition; Step 3: The error correction and verification module (3) extracts the encoded string from the image text; Step 4: The error correction and verification module (3) confirms the correct encoded string based on the database module (5) and enters it into the database record; Step 5: The human-computer interaction module (4) manually confirms the unconfirmed code of the error correction verification module (3) and sends the result to the error correction verification module (3) for entry record.
7. The number identification method according to claim 6, characterized in that: Step 2 above also includes the following steps: Step 2.1: The preprocessing unit (21) adjusts the sharpness, rotates, and segments the drug image; Step 2.2: The recognition engine unit (22) cuts, extracts, and recognizes the characters in the preprocessed image; Step 2.3: The recognition engine unit (22) typesets and corrects the recognized image text; Step 2.3: The recognition engine unit (22) performs a confidence assessment on the corrected characters.
8. The number identification method according to claim 6, characterized in that: Step 4 above also includes the following steps; Step 4.1: The ambiguity diagnosis unit (32) determines the position of the ambiguous character by combining the ambiguous character mapping library (52); Step 4.2, the ambiguity diagnosis unit (32) performs hierarchical processing on ambiguous characters based on confidence level; Step 4.3: The ambiguous candidate unit (33) generates an encoding candidate list based on the ambiguous character mapping library (52); Step 4.4: The verification unit (34) verifies the candidate encoding list to determine the correct encoding.
9. The number identification method according to claim 8, characterized in that: Step 4.4 above also includes the following steps: Step 4.4.1: The filtering component (341) filters and eliminates candidates from the encoding list according to the encoding rules; Step 4.4.2: The verification component (342) compares the retained codes based on the drug database (51); Step 4.4.3: If the retained code has a unique correspondence with the code in the drug database (51), then the result is sent to the feedback component (343). Step 4.4.4: The feedback component (343) records the verification process and verification results and updates the entry record; Step 4.4.5: If the stored code is many-to-one or many-to-many with the code in the drug database (51), then return to the identification engine unit (22) to obtain the remaining drug information; Step 4.4.6: If a unique code is confirmed by combining the other information of the drug, the result is sent to the feedback component (343). Step 4.4.7: If the unique code cannot be confirmed by combining the other information of the drug, it shall be sent to the human-computer interaction module (4) for manual verification.
10. The number identification method according to claim 6, characterized in that: Step 5 above also includes the following steps: Step 5.1, the human-computer interaction module (4) receives the unrecognized code and highlights the ambiguous characters; Step 5.2, Human-computer interaction module (4) provides character replacement options based on the ambiguous mapping character library; Step 5.3: Staff members select drugs by combining the drug images with the human-computer interaction module (4) and send the results to the feedback component (343).