Methods, apparatuses, electronic devices, and storage media for processing drug images
By automatically recognizing text information in drug images using OCR technology, the problem of time-consuming and laborious replacement or deletion of drug instruction manual images has been solved, achieving automated processing and improving efficiency and compliance.
Patent Information
- Application Number
- CN202311127302.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-01
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-09-01
AI Technical Summary
In the current technology, changing or deleting images in drug instruction manuals requires manual operation, which is time-consuming, labor-intensive, and may be untimely, leading to regulatory non-compliance risks.
The text information on drug images is automatically identified using optical character recognition (OCR) technology to determine whether it is an image of the instruction manual, and is automatically replaced or deleted based on the number or type of keywords.
It enables automatic recognition and processing of drug images, improving efficiency, freeing up manpower, ensuring compliance, and avoiding legal risks.
Smart Images

Figure CN117152780B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a method, apparatus, electronic device, and storage medium for processing drug images. Background Technology
[0002] Currently, online drug purchases are gaining popularity, but pharmaceuticals are subject to strict regulation by relevant national departments, and regulations and measures are gradually being improved with social development. Therefore, the instructions for the same drug may become incompatible due to policy changes, requiring timely replacement or removal of the instructions from the platform. However, currently, replacing or deleting images containing drug instructions is done manually, which is very time-consuming and labor-intensive, and there may be instances of delayed image processing. Summary of the Invention
[0003] This application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for processing drug images, to solve the problem of not being able to automatically replace or delete non-compliant images when drug instruction manual images are non-compliant. The technical solution of this application is as follows:
[0004] According to a first aspect of the embodiments of this application, a method for processing drug images is provided, comprising: acquiring a target drug image to be processed; performing optical character recognition (OCR) on the target drug image to acquire text information on the drug image; determining, based on the text information, whether the target drug image is an instruction manual image for the target drug; and if the target drug image is an instruction manual image, performing abnormal image processing on the target drug image.
[0005] In one embodiment of this application, determining whether the target drug image is an instruction manual image for the target drug based on the text information includes: determining whether the text information includes a keyword of a specified type; if the text information includes the keyword of the specified type, determining that the target drug image is an instruction manual image for the target drug.
[0006] In one embodiment of this application, determining that the target drug image is an instruction manual image of the target drug if the text information includes the specified type of keyword includes: determining the number of times the text information includes the specified type of keyword; if the number is greater than or equal to a set number threshold, determining that the target drug image is an instruction manual image of the target drug.
[0007] In one embodiment of this application, the method further includes: if the quantity is less than the set quantity threshold, generating confirmation information based on the identifier of the target drug and the drug image, and feeding back the confirmation information to the front end.
[0008] In one embodiment of this application, the abnormal image processing of the target drug image includes: deleting or replacing the target drug image; and / or sending an image abnormality prompt message to the provider corresponding to the target drug.
[0009] In one embodiment of this application, the target drug image is the header image of the target drug; deleting the target drug image includes: obtaining the inventory identifier of the target drug and the URL of the target drug image; obtaining a first Uniform Resource Locator (URL) list of candidate header images of the target drug from a first database based on the inventory identifier; deleting the URL of the target drug image from the first URL list based on the URL of the target drug image to obtain a second URL list of the target drug, and updating the second URL list to the first database.
[0010] In one embodiment of this application, updating the second URL list to the first database includes: deleting the first URL list previously associated with the inventory identifier from the first database; and establishing an association between the second URL list and the inventory identifier.
[0011] In one embodiment of this application, the step of deleting the URL of the target drug image from the first URL list based on the URL of the target drug image to obtain a second URL list of the target drug includes: obtaining the URL of the target drug image, and performing string matching between the URL of the target drug image and the first URL list to obtain the position of the URL of the target drug image in the first URL list; deleting the URL at the position in the first URL list to obtain the second URL list.
[0012] In one embodiment of this application, the target drug image is a detailed drug image in the first detailed data of the target drug. Replacing the target drug image includes: obtaining the inventory identifier of the target drug and the URL of the target drug image; obtaining candidate detailed data of the target drug from a second database based on the inventory identifier, wherein the candidate detailed data includes a detailed drug image; performing string matching between the URL of the target drug image and the candidate detailed data to determine second detailed data from the candidate detailed data; and replacing the first detailed data of the target drug with the second detailed data.
[0013] In one embodiment of this application, after replacing the first details data of the target drug with the second details data, the method further includes: updating the details data log of the target drug locally; and / or deleting the first details data from the candidate details data associated with the inventory identifier in the second database.
[0014] In one embodiment of this application, the step of obtaining the target drug image to be processed includes: obtaining the storage location of the target drug image and obtaining access permissions to the storage location; and obtaining the target drug image from a third database based on the access permissions.
[0015] In one embodiment of this application, obtaining the target drug image from a third database based on the access permission includes: triggering a scheduled task to obtain the target drug image from the third server based on the access permission; or receiving a message from the remote server that the target drug image has been changed, and obtaining the target drug image from the remote database based on the access permission.
[0016] According to a second aspect of the embodiments of this application, a drug image processing apparatus is provided, comprising: a first acquisition module, configured to acquire a target drug image to be processed; a second acquisition module, configured to perform optical character recognition (OCR) on the target drug image to acquire text information on the drug image; a judgment module, configured to determine, based on the text information, whether the target drug image is an instruction manual image for the target drug; and a processing module, configured to perform abnormal image processing on the target drug image if the target drug image is an instruction manual image.
[0017] According to a third aspect of the present application, an electronic device is provided, including a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the steps of the method of the first aspect of the present application.
[0018] According to a fourth aspect of the present application, a computer-readable storage medium is provided, having stored thereon computer program instructions that, when executed by a processor, implement the steps of the method of the first aspect of the present application.
[0019] According to a fifth aspect of the present application, a computer program product is provided, comprising a computer program, characterized in that, when executed by a processor of an electronic device, the computer program implements the steps of the method of the first aspect of the present application.
[0020] The technical solution provided by the embodiments of this application brings at least the following beneficial effects: by acquiring a target drug image to be processed and performing OCR recognition on the target drug image to obtain text information on the drug image, and determining whether the target drug image is an instruction manual image based on the text information. Through OCR recognition, images containing drug instruction manual content can be automatically identified, replacing manual recognition and improving recognition efficiency. If the target drug image is determined to be an instruction manual image, abnormal image processing can be performed on the target drug image, automatically replacing or deleting the image, freeing up manpower and improving image processing efficiency.
[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0022] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of the application.
[0023] Figure 1 This is a flowchart illustrating a method for processing drug images according to an exemplary embodiment.
[0024] Figure 2 This is a flowchart illustrating a method for processing drug images according to another exemplary embodiment.
[0025] Figure 3 This is a flowchart illustrating the process of deleting a target drug image in a drug image processing method according to an exemplary embodiment.
[0026] Figure 4 This is a flowchart illustrating the process of replacing a target drug image in a drug image processing method according to an exemplary embodiment.
[0027] Figure 5 This is a flowchart illustrating the replacement or deletion of a target drug image according to an exemplary embodiment.
[0028] Figure 6 This is a flowchart illustrating a method for processing drug images according to another exemplary embodiment.
[0029] Figure 7 This is a flowchart illustrating the processing of a drug image according to an exemplary embodiment.
[0030] Figure 8 This is a flowchart illustrating a method for processing drug images according to another exemplary embodiment.
[0031] Figure 9This is a structural block diagram of a drug image processing apparatus according to an exemplary embodiment.
[0032] Figure 10 This is a block diagram of an electronic device according to an exemplary embodiment.
[0033] Figure 11 This is a structural block diagram of an electronic device according to an exemplary embodiment. Detailed Implementation
[0034] To enable those skilled in the art to better understand the technical solutions of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0035] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0036] The acquisition, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.
[0037] Figure 1 This is a flowchart illustrating a method for processing drug images according to an exemplary embodiment, such as... Figure 1 As shown, the drug image processing method of this application embodiment includes, but is not limited to, the following steps:
[0038] S101, Obtain the target drug image to be processed.
[0039] It should be noted that the execution subject of the drug image processing method provided in this application embodiment is an electronic device, which can be a terminal device or a server. Optionally, the terminal device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be network attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. The server can also be a cloud server, a distributed system server, or a server combined with blockchain, etc. This application embodiment does not impose specific limitations.
[0040] In some implementations, drugs whose instructions for use do not comply with regulatory requirements are designated as target drugs. In this case, the target drug images include images of the target drug's packaging, instructions for use, and appearance. The target drug images to be processed can be obtained by identifying the database associated with storing these images and requesting read access to that database.
[0041] For example, taking an e-commerce platform, after identifying the target drug, the database where the target drug's image is stored is determined through communication with the technical staff of the e-commerce platform.
[0042] Optionally, Java code can be written to access and connect to the database storing the target drug images, read the target drug images, and store the read target drug images in the local database to obtain the target drug images to be processed.
[0043] S102, Perform optical character recognition (OCR) on the target drug image to obtain the text information on the drug image.
[0044] In some implementations, an Optical Character Recognition (OCR) service can be used to monitor the local database. If a change is detected in the local database, OCR recognition is performed on the changed image to extract the text information from the target drug image.
[0045] Understandably, storing a target drug image in a local database implies a change to the local database. Optionally, the stored target drug image can be scanned, and character recognition technology can be used to translate the scanned characters into computer text to obtain the textual information on the drug image.
[0046] S103, Based on text information, determine whether the image of the target drug is an image of the instruction manual for the target drug.
[0047] Understandably, the instructions for use of a target drug usually have a certain structure or format, and keywords, key phrases, or sentences with specific structures can be defined as criteria for determining whether the image of the target drug is an image of the instructions for use of the target drug.
[0048] Optionally, the text information on the target drug image can be matched with keywords, key phrases, or sentences with specific structures to determine whether the text information matches successfully with the keywords, key phrases, or sentences with specific structures. If the match is successful, the target drug image can be determined to be an image of the target drug's instruction manual; if the match is unsuccessful, the target drug image can be determined to be not an image of the target drug's instruction manual.
[0049] S104. If the target drug image is a picture of the instruction manual, perform abnormal image processing on the target drug image.
[0050] In some implementations, the images in the instruction manual for a target drug consist of two parts: a header image and detailed drug images. For example, on an e-commerce platform, the header image refers to the product list image that appears when searching for the target drug, as well as the top few images on the product details page after clicking on a product. The remaining images on the product details page are the detailed drug images, which describe the drug's various functions, features, and other detailed information. These images are typically used for supplementary explanations and are what we call detailed drug images.
[0051] In some implementations, handling abnormal images of the target drug image includes replacing or deleting the target drug image. Optionally, the header image of the target drug image is deleted, and the detail image of the drug is replaced.
[0052] Simultaneously, an image anomaly alert is generated and sent to the provider of the target drug. Optionally, the provider can be notified via SMS, telephone, or other means that the image of the target drug contains a picture of the drug instruction manual, which is a prohibited image, and the system will automatically replace or delete it, recording the notification result in the database.
[0053] The drug image processing method provided in this application involves acquiring a target drug image and performing OCR recognition on it to obtain text information. Based on this text information, it is determined whether the target drug image is an instruction manual image. OCR recognition automatically identifies images containing drug instruction manual content, replacing manual recognition and improving efficiency. If the target drug image is determined to be an instruction manual image, abnormal image processing is performed, automatically replacing or deleting the image, freeing up manpower and improving image processing efficiency.
[0054] Figure 2 This is a flowchart illustrating a method for processing drug images according to an exemplary embodiment, such as... Figure 2 As shown, the drug image processing method of this application embodiment includes, but is not limited to, the following steps:
[0055] S201, Obtain the target drug image to be processed.
[0056] In the embodiments of this application, step S201 can be implemented in any of the ways described in the embodiments of this application. This is not limited here and will not be described in detail.
[0057] S202, Perform OCR recognition on the target drug image to obtain the text information on the drug image.
[0058] In the embodiments of this application, step S202 can be implemented in any of the ways described in the various embodiments of this application. This is not limited here and will not be described in detail.
[0059] S203, determine whether the text information contains keywords of a specified type.
[0060] It is understood that the specified types of keywords include, but are not limited to: instructions, ingredients, usage, dosage, adverse reactions, contraindications, precautions, specifications, properties, storage, approval number, expiration date, etc.
[0061] In some implementations, keyword matching can be performed on text information. If a matching keyword is found, it is determined that the text information contains a keyword of the specified type. If no matching keyword is found, it is determined that the text information does not contain a keyword of the specified type.
[0062] S204, if the text information includes keywords of a specified type, the target drug image is determined to be an image of the target drug's instruction manual.
[0063] In some implementations, the number of keywords of a specified type included in the text information can be used to determine whether a target drug image is an instruction manual image for the target drug. Optionally, a threshold number can be set as the basis for determining whether a target drug image is an instruction manual image for the target drug.
[0064] Optionally, the number of keywords of a specified type included in the text information is determined, and the number of keywords is compared with a quantity threshold. If the number is greater than or equal to the set quantity threshold, the target drug image is determined to be an image of the target drug's instruction manual; if the number is less than the set quantity threshold, confirmation information is generated based on the target drug's identifier and drug image, and the confirmation information is fed back to the front end.
[0065] Understandably, if the number of keywords is less than a threshold, the target drug image is considered likely to be an image of the drug's instruction manual. The target drug identifier and confirmation information generated for the drug image are then fed back to the front-end, where manual verification is performed to confirm whether the target drug image is indeed an instruction manual image.
[0066] S205, If the target drug image is a picture from the instruction manual, perform abnormal image processing on the target drug image.
[0067] In some implementations, the target drug image is identified as an instruction manual image, which is then treated as an abnormal image. Optionally, this can be achieved by deleting or replacing the target drug image, and / or by sending an image abnormality notification to the provider of the target drug.
[0068] In some implementations, the header image of the target drug is deleted, and the detailed drug image is replaced. Optionally, an image anomaly notification can be sent to the provider of the target drug via SMS, telephone, or other means, informing the provider that the target drug image contains a non-compliant drug instruction manual image, and the system will automatically replace or delete it, while recording the notification result in the database.
[0069] In some implementations, after deleting or replacing a target drug image, a result record is generated. This result can be recorded and stored in a local database to indicate that the target drug image has been successfully deleted or replaced.
[0070] The drug image processing method provided in this application involves acquiring a target drug image and performing OCR recognition on it to obtain text information. Based on keywords contained in the text information, the method determines whether the target drug image is an instruction manual image. OCR recognition automatically identifies images containing drug instruction manual content, replacing manual recognition and improving efficiency. If the target drug image is determined to be an instruction manual image, abnormal image processing is performed, automatically replacing or deleting the image, freeing up manpower and improving image processing efficiency.
[0071] Based on the above embodiments, the embodiments of this application can be used to explain and illustrate the process of deleting target drug images. For example... Figure 3 As shown, the process of deleting a target drug image includes, but is not limited to, the following steps:
[0072] S301, Obtain the inventory identifier and URL of the target drug image.
[0073] In some implementations, if the target drug image is determined to be the header image of the target drug, the header image can be deleted by obtaining the target drug's Stock Keeping Unit Identity Document (SKU ID) and the target drug image's Uniform Resource Locator (URL). A single Stock Keeping Unit Identity Document can indicate multiple candidate header images.
[0074] S302, Based on the inventory identifier, obtain a list of first Uniform Resource Locator URLs for candidate header images of the target drug from the first database.
[0075] Understandably, the database storing information is a fragmented database, with the database storing the URLs of candidate header images for the target drug serving as the primary database.
[0076] Optionally, based on the inventory identifier of the target drug, a first list of candidate header images of the target drug in the first database can be obtained via a Remote Procedure Call (RPC) protocol. This first URL list includes URLs of multiple candidate header images for a single target drug.
[0077] S303, based on the URL of the target drug image, delete the URL of the target drug image from the first URL list to obtain a second URL list of the target drug, and update the second URL list to the first database.
[0078] In some implementations, the URL of the target drug image can be determined from the first URL list, and the URL can be deleted to obtain the first URL list after deletion, which is the second URL list of the target drug. The first database can then be updated based on the second URL list.
[0079] Understandably, the target drug images are stored as URLs, while the initial list of URLs is stored as strings. By matching the URLs with the strings, the URLs to be deleted can be identified, thus enabling the deletion of the target drug images.
[0080] Optionally, the URL of the target drug image can be obtained, and then the URL of the target drug image can be matched against a first URL list to determine the position of the target drug image's URL in the first URL list. Further, the URL at that position in the first URL list is deleted, resulting in a second URL list. The second URL list contains header images of compliant target drug images.
[0081] Optionally, the second URL list can be updated in the first database via an RPC call. Optionally, the first URL list previously associated with the inventory identifier can be deleted from the first database, and an association between the second URL list and the inventory identifier can be established and stored in the first database based on the second URL list and the inventory identifier.
[0082] In some implementations, to ensure the deletion of the header image of the target drug, a compensatory timed task can be designed to periodically re-execute the deletion for target drug images that failed to be processed, thus ensuring the header image of the target drug is deleted. Figure 1 It will definitely be dealt with.
[0083] The drug image processing method provided in this application involves acquiring a target drug image to be processed and performing OCR recognition on the target drug image to obtain text information on the drug image, thereby determining whether the target drug image is an instruction manual image. If it is determined that the target drug image is the header image of an instruction manual image, the header image is deleted, freeing up manpower, improving the efficiency of image processing, and ensuring the compliance of drug images, avoiding legal risks and fines caused by failure to process images in a timely manner.
[0084] Based on the above embodiments, the embodiments of this application can be used to explain and illustrate the process of replacing the target drug image. For example... Figure 4 As shown, the process of replacing the target drug image includes, but is not limited to, the following steps:
[0085] S401, Obtain the inventory identifier and URL of the target drug image.
[0086] In some implementations, the target drug image is identified as the detailed drug image within the first detailed data of the target drug, and a replacement operation can be performed on the detailed drug image. The first detailed data includes text information, the detailed drug image, formatting information, and other data.
[0087] Optionally, the target drug image can be replaced by obtaining the inventory identifier and the URL of the target drug image.
[0088] Understandably, but since the detailed drug images in the target drug image are stored as strings, deleting the detailed drug images would cause problems with the display of drug details, so the detailed drug images are replaced.
[0089] S402, Based on the inventory identifier, retrieve candidate details data of the target drug from the second database, wherein the candidate details data includes detailed drug images.
[0090] Understandably, due to the large amount of data and the inconsistent format, the candidate details data of the target drug are stored separately from the candidate header image of the target drug in another database, that is, in the second database.
[0091] Optionally, candidate details data of the target drug in the second database can be obtained via RPC based on the inventory identifier of the target drug, wherein the candidate details data includes detailed drug images.
[0092] S403, perform string matching between the URL of the target drug image and the candidate details data to determine the second details data from the candidate details data.
[0093] Understandably, the target drug image is stored as a URL, while the candidate detail data is stored as a string. Optionally, string matching can be performed between the URL of the target drug image and the candidate detail data to determine the detail drug image that matches the URL of the target drug image from the candidate detail data, which is then used as the second detail data.
[0094] S404, replace the first detailed data of the target drug with the second detailed data.
[0095] In some implementations, the second details data is the URL of a compliant target drug image. The first details data of the target drug can be replaced with the second details data to obtain a compliant detailed drug image.
[0096] Furthermore, RPC calls can be used to update the second database. Optionally, the first detail data can be deleted by updating the local detail data log of the target drug and / or by deleting the candidate detail data associated with the inventory identifier from the second database. It is understood that if the first detail data is not deleted, users may still see non-compliant drug detail images before the first detail data becomes invalid, which may pose certain legal risks.
[0097] In some implementations, to ensure that the detailed drug image of the target drug image can be replaced, a compensatory timed task can be designed to periodically re-execute the replacement operation on the target drug image that failed to be processed, thus ensuring that the detailed drug image of the target drug image will definitely be processed.
[0098] The drug image processing method provided in this application involves acquiring a target drug image to be processed and performing OCR recognition on the target drug image to obtain text information on the drug image, thereby determining whether the target drug image is an instruction manual image. If it is determined that the target drug image is a detailed drug image of the instruction manual, the detailed drug image is replaced, which frees up manpower, improves the efficiency of image processing, and ensures the compliance of drug images, avoiding legal risks and fines caused by failure to process images in a timely manner.
[0099] like Figure 5 The flowchart shown illustrates the process of replacing or deleting target drug images. It involves obtaining the SKU ID and URL of the target drug image, then using an RPC call to the header image database (first database) to retrieve a list of header image URLs (first URL list), storing this list in a local log table, and performing string matching and deletion to obtain an updated list of header image URLs (second URL list). Finally, an RPC call is used to update the header image database and delete its cache.
[0100] The system uses RPC to call the product details database (second database) to retrieve product details data (first details data), stores it in a local log table, and performs string matching and replacement to obtain updated product details data (second details data). Then, it uses RPC to update the product details database and deletes the cached version of the product details database.
[0101] Meanwhile, to ensure that the target drug images can be deleted or replaced, a timed task based on the local log table is designed to compensate for the failure to process the target drug images. This task will periodically re-execute the deletion and replacement logic for the failed target drug images to ensure that the target drug images are always processed.
[0102] Figure 6 This is a flowchart illustrating a method for processing drug images according to an exemplary embodiment, such as... Figure 6As shown, the drug image processing method of this application embodiment includes, but is not limited to, the following steps:
[0103] S601, Obtain the storage location of the target drug image and obtain access permissions to the storage location.
[0104] S602, retrieve target drug images from a third database based on access permissions.
[0105] In some implementations, by communicating with technical personnel involved in image storage, the specific database where the target drug images are stored can be identified, and access to that database can be requested to obtain the target drug images.
[0106] Optionally, a scheduled task can be set up to periodically detect and process target drug images. Triggered by the scheduled task, the target drug image is retrieved from a third-party server based on access permissions.
[0107] Optionally, data changes in a remote database can also be monitored to obtain images of the target drug. By receiving image change messages for the target drug from a remote server, the image can be retrieved from the remote database based on access permissions. Here, the remote server is a third-party server, and the remote database is a third-party database.
[0108] S603 performs OCR recognition on the target drug image to obtain the text information on the drug image.
[0109] In the embodiments of this application, step S603 can be implemented in any of the embodiments of this application, and no limitation is made here, nor will it be described in detail.
[0110] S604, Based on text information, determine whether the image of the target drug is an image from the instruction manual of the target drug.
[0111] In the embodiments of this application, step S604 can be implemented in any of the ways described in the various embodiments of this application. This is not limited here and will not be described in detail.
[0112] S605, If the target drug image is a picture from the instruction manual, perform abnormal image processing on the target drug image.
[0113] In the embodiments of this application, step S605 can be implemented in any of the embodiments of this application, and no limitation is made here, nor will it be described in detail.
[0114] The drug image processing method provided in this application embodiment acquires target drug images to be processed by configuring a timed task, allowing for periodic image detection and processing. OCR recognition is performed on the target drug image to obtain text information, and the text information is used to determine whether the target drug image is an instruction manual image. OCR recognition automatically identifies images containing drug instruction manual content, replacing manual recognition and improving efficiency. If the target drug image is determined to be an instruction manual image, abnormal image processing is performed, automatically replacing or deleting the image, freeing up manpower and improving image processing efficiency.
[0115] like Figure 7 The flowchart shown illustrates the drug image processing procedure. A scheduled task is triggered to retrieve the target drug image from a remote database. The process can directly read the target drug image from the remote database, or it can listen for image change messages, retrieve the target drug image, and store it in the local database. An OCR service monitors changes to the image data in the local database, identifies the text information in the changed images, and determines the instruction manual image for the target drug—that is, the image that needs to be replaced or deleted. A notification is sent to the relevant provider via SMS or other means, and the notification result is stored in the local database. Finally, the target drug image is replaced or deleted, and the result is stored in the local database.
[0116] Figure 8 This is a flowchart illustrating a method for processing drug images according to an exemplary embodiment, such as... Figure 8 As shown, the drug image processing method of this application embodiment includes, but is not limited to, the following steps:
[0117] S801, obtain the storage location of the target drug image and obtain access permissions to the storage location.
[0118] S802, retrieve the target drug image from a third database based on access permissions.
[0119] S803 performs OCR recognition on the target drug image to obtain the text information on the drug image.
[0120] S804 determines whether the text information contains keywords of a specified type.
[0121] S805, if the text information includes keywords of a specified type, the image of the target drug is determined to be an image of the instruction manual for the target drug.
[0122] S806, If the image in the instruction manual of the target drug is the header image of the target drug, the image of the target drug shall be deleted.
[0123] S807, if the image in the instruction manual of the target drug is the detailed drug image in the first detailed data of the target drug, perform a replacement operation on the target drug image.
[0124] The drug image processing method provided in this application embodiment acquires target drug images to be processed by configuring a timed task, allowing for periodic image detection and processing. OCR recognition is performed on the target drug image to obtain text information, and the method determines whether the target drug image is an instruction manual image based on keywords contained in the text information. OCR recognition automatically identifies images containing drug instruction manual content, replacing manual recognition and improving efficiency. If the target drug image is determined to be an instruction manual image, abnormal image processing is performed, automatically replacing or deleting the image, freeing up manpower and improving image processing efficiency.
[0125] Figure 9 This is a structural block diagram of a drug image processing apparatus according to an exemplary embodiment. (Refer to...) Figure 9 The drug image processing device 900 of this application embodiment includes: a first acquisition module 901, a second acquisition module 902, a judgment module 903, and a processing module 904.
[0126] The first acquisition module 901 is used to acquire the target drug image to be processed.
[0127] The first acquisition module 902 is used to perform optical character recognition (OCR) on the target drug image to acquire text information on the drug image.
[0128] The judgment module 903 is used to determine, based on the text information, whether the target drug image is an instruction manual image for the target drug.
[0129] The processing module 904 is used to perform abnormal image processing on the target drug image if the target drug image is an instruction manual image.
[0130] In one embodiment of this application, the judgment module 903 is further configured to: determine whether the text information includes a keyword of a specified type; if the text information includes the keyword of the specified type, determine that the target drug image is an instruction manual image of the target drug.
[0131] In one embodiment of this application, the judgment module 903 is further configured to: determine the number of keywords of the specified type included in the text information; if the number is greater than or equal to a set number threshold, determine that the target drug image is an instruction manual image of the target drug.
[0132] In one embodiment of this application, the judgment module 903 is further configured to: if the quantity is less than the set quantity threshold, generate confirmation information based on the identifier of the target drug and the drug image, and feed back the confirmation information to the front end.
[0133] In one embodiment of this application, the processing module 904 is further configured to: delete or replace the target drug image; and / or send an image anomaly alert to the provider corresponding to the target drug.
[0134] In one embodiment of this application, the processing module 904 is further configured to: obtain the inventory identifier of the target drug and the URL of the target drug image; obtain a first Uniform Resource Locator (URL) list of candidate header images of the target drug from a first database based on the inventory identifier; delete the URL of the target drug image from the first URL list based on the URL of the target drug image to obtain a second URL list of the target drug, and update the second URL list to the first database.
[0135] In one embodiment of this application, the processing module 904 is further configured to: delete the first URL list previously associated with the inventory identifier from the first database; and establish a second URL list associated with the inventory identifier.
[0136] In one embodiment of this application, the processing module 904 is further configured to: obtain the URL of the target drug image, and perform string matching between the URL of the target drug image and the first URL list to obtain the position of the URL of the target drug image in the first URL list; delete the URL at the position in the first URL list to obtain the second URL list.
[0137] In one embodiment of this application, the processing module 904 is further configured to: obtain the inventory identifier of the target drug and the URL of the target drug image; obtain candidate detail data of the target drug from a second database based on the inventory identifier, wherein the candidate detail data includes a detailed drug image; perform string matching between the URL of the target drug image and the candidate detail data to determine second detail data from the candidate detail data; and replace the first detail data of the target drug with the second detail data.
[0138] In one embodiment of this application, the processing module 904 is further configured to: update the local details data log of the target drug; and / or delete the first details data from the candidate details data associated with the inventory identifier in the second database.
[0139] In one embodiment of this application, the acquisition module is further configured to: acquire the storage location of the target drug image and acquire access permissions to the storage location; and acquire the target drug image from a third database based on the access permissions.
[0140] In one embodiment of this application, the acquisition module is further configured to: trigger a scheduled task to acquire the target drug image from the third server based on the access permissions; or, receive a message from the remote server that the target drug image has been changed, and acquire the target drug image from the remote database based on the access permissions.
[0141] The drug image processing method provided in this application involves acquiring a target drug image and performing OCR recognition on it to obtain text information. Based on this text information, it is determined whether the target drug image is an instruction manual image. OCR recognition automatically identifies images containing drug instruction manual content, replacing manual recognition and improving efficiency. If the target drug image is determined to be an instruction manual image, abnormal image processing is performed, automatically replacing or deleting the image, freeing up manpower and improving image processing efficiency.
[0142] Figure 10 This is a block diagram of an electronic device according to an exemplary embodiment. Figure 10 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0143] like Figure 10 As shown, the electronic device 1000 includes a processor 1001, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1002 or a program loaded from memory 1006 into random access memory (RAM) 1003. The RAM 1003 also stores various programs and data required for the operation of the electronic device 1000. The processor 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0144] The following components are connected to I / O interface 1005: memory 1006 including hard disk; and communication section 1007 including network interface card such as local area network (LAN) card, modem, etc., communication section 1007 performs communication processing via a network such as the Internet; drive 1008 is also connected to I / O interface 1005 as needed.
[0145] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via the communication section 1007. When the computer program is executed by the processor 1001, it performs the functions defined in the methods of this application.
[0146] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory including instructions, which can be executed by the processor 1001 of the electronic device 1000 to perform the above-described method. Optionally, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.
[0147] In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wireline, optical fiber, RF, etc., or any suitable combination thereof.
[0148] Figure 11 This is a structural block diagram of an electronic device according to an exemplary embodiment. Figure 11 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this application. Figure 11 As shown, the electronic device 1100 includes a processor 1101 and a memory 1102. The memory 1102 is used to store program code, and the processor 1101 is connected to the memory 1102 and is used to read the program code from the memory 1102 to implement the drug image processing method in the above embodiment.
[0149] Alternatively, the number of processors 1101 can be one or more.
[0150] Optionally, the electronic device may also include an interface 1103, and there may be multiple interfaces 1103. The interface 1103 can be connected to an application and can receive data from external devices such as sensors.
[0151] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0152] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method of processing a pharmaceutical picture, characterized by, include: Obtain images of the target drug to be processed; The target drug image is subjected to optical character recognition (OCR) to obtain the text information on the drug image; Based on the text information, determining whether the target drug image is an instruction manual image for the target drug includes: determining whether the text information contains keywords of a specified type, and determining the number of keywords of the specified type contained in the text information; if the number is greater than or equal to a set number threshold, determining that the target drug image is an instruction manual image for the target drug; if the number is less than the set number threshold, generating confirmation information based on the identifier of the target drug and the drug image, and feeding back the confirmation information to the front end. If the target drug image is an instruction manual image, the target drug image is processed as an abnormal image. This abnormal image processing includes: deleting the target drug image, where the target drug image is the header image of the target drug; deleting the target drug image includes: obtaining the inventory identifier of the target drug and the URL of the target drug image; based on the inventory identifier, obtaining a first Uniform Resource Locator (URL) list of candidate header images of the target drug from a first database, wherein the database storing the information is a fragmented database, and the database storing the URLs of candidate header images of the target drug is used as the first database; based on the URL of the target drug image, deleting the URL of the target drug image from the first URL list to obtain a second URL list of the target drug, and updating the second URL list in the first database.
2. The method according to claim 1, characterized in that, The abnormal image processing of the target drug image includes: Send an image anomaly alert to the provider corresponding to the target drug.
3. The method according to claim 1, characterized in that, The step of updating the second URL list to the first database includes: Remove the first URL list previously associated with the inventory identifier from the first database; Establish the second URL list and associate it with the inventory identifier.
4. The method according to claim 1, characterized in that, The step of deleting the URL of the target drug image from the first URL list based on the URL of the target drug image to obtain a second URL list of the target drug includes: Obtain the URL of the target drug image, and perform string matching between the URL of the target drug image and the first URL list to obtain the position of the URL of the target drug image in the first URL list; Delete the URLs at the positions specified in the first URL list to obtain the second URL list.
5. The method according to claim 1, characterized in that, The process of acquiring the target drug image to be processed includes: Obtain the storage location of the target drug image and obtain access permissions for the storage location; Based on the access permissions, the target drug image is obtained from a third database.
6. The method according to claim 5, characterized in that, The step of obtaining the target drug image from the third database based on the access permissions includes: A scheduled task is triggered to retrieve the target drug image from a third server based on the access permissions; or, Receive a message from a remote server indicating an image change for the target drug, and retrieve the image of the target drug from the remote database based on the access permissions.
7. A method for processing drug images, characterized in that, include: Obtain images of the target drug to be processed; The target drug image is subjected to optical character recognition (OCR) to obtain the text information on the drug image; Based on the text information, determining whether the target drug image is an instruction manual image for the target drug includes: determining whether the text information contains keywords of a specified type, and determining the number of keywords of the specified type contained in the text information; if the number is greater than or equal to a set number threshold, determining that the target drug image is an instruction manual image for the target drug; if the number is less than the set number threshold, generating confirmation information based on the identifier of the target drug and the drug image, and feeding back the confirmation information to the front end. If the target drug image is an instruction manual image, the target drug image is processed as an abnormal image. This abnormal image processing includes: replacing the target drug image, where the target drug image is a detail drug image in the first detail data of the target drug. Replacing the target drug image includes: obtaining the inventory identifier of the target drug and the URL of the target drug image; obtaining candidate detail data of the target drug from a second database based on the inventory identifier, where the candidate detail data includes a detail drug image; performing string matching between the URL of the target drug image and the candidate detail data to determine second detail data from the candidate detail data; and replacing the first detail data of the target drug with the second detail data.
8. The method according to claim 7, characterized in that, The abnormal image processing of the target drug image includes: Send an image anomaly alert to the provider corresponding to the target drug.
9. The method according to claim 7, characterized in that, After replacing the first detailed data of the target drug with the second detailed data, the method further includes: Update the local details log of the target drug; and / or, Delete the first detail data from the candidate detail data associated with the inventory identifier from the second database.
10. The method according to claim 7, characterized in that, The process of acquiring the target drug image to be processed includes: Obtain the storage location of the target drug image and obtain access permissions for the storage location; Based on the access permissions, the target drug image is obtained from a third database.
11. The method according to claim 10, characterized in that, The step of obtaining the target drug image from the third database based on the access permissions includes: A scheduled task is triggered to retrieve the target drug image from a third server based on the access permissions; or, Receive a message from a remote server indicating an image change for the target drug, and retrieve the image of the target drug from the remote database based on the access permissions.
12. A device for processing drug images, characterized in that, include: The first acquisition module is used to acquire the target drug image to be processed. The second acquisition module is used to perform optical character recognition (OCR) on the target drug image to acquire text information on the drug image. The judgment module is used to determine whether the target drug image is an instruction manual image of the target drug based on the text information, and is also used to determine whether the text information includes keywords of a specified type; Determine the number of keywords of the specified type included in the text information; if the number is greater than or equal to a set number threshold, determine that the target drug image is the instruction manual image of the target drug; if the number is less than the set number threshold, generate confirmation information based on the identifier of the target drug and the drug image, and feed the confirmation information back to the front end; The processing module is used to perform abnormal image processing on the target drug image if the target drug image is an instruction manual image; The processing module is further configured to: delete the target drug image; The processing module is further configured to: obtain the inventory identifier of the target drug and the URL of the target drug image; and, based on the inventory identifier, obtain a list of first Uniform Resource Locator (URL) identifiers for candidate header images of the target drug from a first database, wherein the database storing the information is a fragmented database, and the database storing the URLs of candidate header images of the target drug is used as the first database. Based on the URL of the target drug image, the URL of the target drug image is deleted from the first URL list to obtain a second URL list of the target drug, and the second URL list is updated in the first database.
13. The apparatus according to claim 12, characterized in that, The processing module is further configured to: Send an image anomaly alert to the provider corresponding to the target drug.
14. The apparatus according to claim 12, characterized in that, The processing module is further configured to: Remove the first URL list previously associated with the inventory identifier from the first database; Establish the second URL list and associate it with the inventory identifier.
15. The apparatus according to claim 12, characterized in that, The processing module is further configured to: Obtain the URL of the target drug image, and perform string matching between the URL of the target drug image and the first URL list to obtain the position of the URL of the target drug image in the first URL list; Delete the URLs at the positions specified in the first URL list to obtain the second URL list.
16. The apparatus according to claim 12, characterized in that, The acquisition module is also used for: Obtain the storage location of the target drug image and obtain access permissions for the storage location; Based on the access permissions, the target drug image is obtained from a third database.
17. The apparatus according to claim 16, characterized in that, The acquisition module is also used for: A scheduled task is triggered to retrieve the target drug image from a third server based on the access permissions; or, Receive a message from a remote server indicating an image change for the target drug, and retrieve the image of the target drug from the remote database based on the access permissions.
18. A device for processing drug images, characterized in that, include: The first acquisition module is used to acquire the target drug image to be processed. The second acquisition module is used to perform optical character recognition (OCR) on the target drug image to acquire text information on the drug image. The judgment module is used to determine whether the target drug image is an instruction manual image of the target drug based on the text information, and is also used to determine whether the text information includes keywords of a specified type; Determine the number of keywords of the specified type included in the text information; if the number is greater than or equal to a set number threshold, determine that the target drug image is the instruction manual image of the target drug; if the number is less than the set number threshold, generate confirmation information based on the identifier of the target drug and the drug image, and feed the confirmation information back to the front end; The processing module is used to perform abnormal image processing on the target drug image if the target drug image is an instruction manual image; The processing module is further configured to: replace the target drug image; The processing module is further configured to: obtain the inventory identifier of the target drug and the URL of the target drug image; obtain candidate detail data of the target drug from a second database based on the inventory identifier, wherein the candidate detail data includes a detailed drug image; and perform string matching between the URL of the target drug image and the candidate detail data to determine second detail data from the candidate detail data. Replace the first details data of the target drug with the second details data.
19. The apparatus according to claim 18, characterized in that, The processing module is further configured to: Send an image anomaly alert to the provider corresponding to the target drug.
20. The apparatus according to claim 18, characterized in that, The processing module is further configured to: Update the local details log of the target drug; and / or, Delete the first detail data from the candidate detail data associated with the inventory identifier from the second database.
21. The apparatus according to claim 18, characterized in that, The acquisition module is also used for: Obtain the storage location of the target drug image and obtain access permissions for the storage location; Based on the access permissions, the target drug image is obtained from a third database.
22. The apparatus according to claim 18, characterized in that, The acquisition module is also used for: A scheduled task is triggered to retrieve the target drug image from a third server based on the access permissions; or, Receive a message from a remote server indicating an image change for the target drug, and retrieve the image of the target drug from the remote database based on the access permissions.
23. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to implement the steps of the method according to any one of claims 1-6 or 7-11.
24. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When executed by a processor, the program instructions implement the steps of the method described in any one of claims 1-6 or 7-11.
Citation Information
Patent Citations
Medicine information library building method based on network crawler
CN106777165A
Database updating method and device for medicine and electronic device
CN110263226A
