Control type medicine information query method and system
By obtaining image data and spectral images of controlled drugs, and calculating the similarity of feature sequences, the problems of low upload and search efficiency and inaccurate matching results in the prior art are solved, and efficient and accurate matching of controlled drugs are achieved. .
Patent Information
- Application Number
- CN202411329760.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-24
AI Technical Summary
In the prior art, the upload and search efficiency of inspection data when testing samples of controlled drugs is low, the matching time is long, and the comparison results are inaccurate, resulting in an increase in time cost.
By obtaining image data of controlled drugs, determining the search area of the cloud database, obtaining spectral images uploaded by the detection device for preprocessing and numerical conversion, calculating the similarity of the characteristic sequence for fuzzy search and precise matching, and sending matching results to the detection device.
It significantly improves the efficiency and accuracy of the detection of controlled drugs, narrows the search range, and accurately matches after rapid fuzzy screening, improving detection efficiency and accuracy.
Smart Images

Figure CN119202290A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of drug query, and in particular relates to a method and system for querying controlled drug information. Background Art
[0002] With the increase in the types of controlled drugs and the increasingly covert transportation methods, traditional detection methods can no longer meet the needs of fast and accurate screening. To this end, drug detection technology has made significant progress, among which advanced spectral analysis technology is widely used in customs detection. These technologies can analyze the chemical properties of substances in a non-contact, fast and accurate manner, and effectively identify prohibited ingredients in complex mixtures. The application of this technology not only simplifies the detection process and shortens the detection time, but also greatly improves the efficiency of customs work, allowing customs to respond quickly and effectively manage controlled drugs.
[0003] Customs uses high-precision detection technologies, such as spectroscopy and mass spectrometry, to quickly screen controlled drug components in inbound and outbound goods. Once a suspicious component is detected, the system will immediately upload the test results to the cloud database and use advanced algorithms to match and compare with the feature information in the huge database. Once the matching results are generated, the system will immediately send a report containing detailed information electronically to customs personnel, who will conduct further review and judgment on the goods by combining professional knowledge, on-site conditions and other relevant information.
[0004] The above technology solves some problems, but there are still some problems. For example, during the upload and retrieval process of the inspection data when testing samples, the data retrieval efficiency is low, the matching time is long, and the comparison results are inaccurate, which increases the time cost. Summary of the invention
[0005] The purpose of the present invention is to solve the problem and to propose a method and system for querying information on controlled drugs.
[0006] In a first aspect of the present invention, a method for querying controlled drug information is first proposed, the method comprising:
[0007] Obtaining image data of controlled drugs, and determining a search area in a cloud database based on the image data;
[0008] Acquire a spectral image uploaded by a detection device, perform image preprocessing on the spectral image to obtain a target spectral image, and perform numerical conversion on the target spectral image to obtain a target feature set; the spectral image and the image data belong to the same controlled drug category; the target feature set includes: peak position, peak intensity, and peak spacing;
[0009] A feature sequence set is obtained by performing a fuzzy search in the search area according to the target feature set; the target features of the target feature set correspond one-to-one to the target feature sequences in the feature sequence set;
[0010] Calculating the similarity of each feature sequence in the feature sequence set to obtain a feature sequence intersection, and using the feature sequence intersection as an accurate search direction to obtain a matching result;
[0011] The matching result is sent to the detection device.
[0012] Optionally, before querying drug information, updating the cloud database includes:
[0013] Periodically acquiring drug information of controlled drugs to obtain a drug database, and performing data cleaning on the drug database to obtain a preprocessing update package; the drug information includes: basic drug information, drug usage data, and drug spectral images;
[0014] The drug spectral image in the preprocessing update package is converted into a feature set, and data is classified according to the feature set to obtain a data update package;
[0015] The data update package is added to the cloud database so that the cloud database is updated.
[0016] Optionally, determining a search area in a cloud database according to the image data includes:
[0017] Extracting image features of the image data; the image features include: texture features and color features;
[0018] Converting the image data into a grayscale image through binarization, and determining the texture features of controlled drugs according to pixel distribution in the grayscale image;
[0019] If the pixel gradient in the grayscale image is less than the pixel threshold, the texture of the controlled drug is determined to be powdery;
[0020] If the pixel gradient in the grayscale image is greater than the pixel threshold, and the curvature of the pixel texture is greater than the curvature threshold, the texture of the controlled drug is determined to be granular; the pixel texture is a line segment texture in the grayscale image;
[0021] If the pixel gradient in the grayscale image is greater than the pixel threshold, and the curvature of the pixel texture is less than the curvature threshold, the texture feature of the controlled drug is determined to be crystalline;
[0022] The index of the controlled drugs is determined according to the texture features and the color features, and then the search area in the cloud database is determined according to the index.
[0023] Optionally, calculating the similarity of each feature sequence in the feature sequence set to obtain the feature sequence intersection includes:
[0024] Constructing an undirected graph, generating nodes according to the feature sequence in the feature sequence set and connecting the nodes;
[0025] Calculate the edge similarity between each node. If the edge similarity is greater than the similarity threshold, retain the edge to obtain the feature sequence intersection;
[0026] Similarity calculation formula:
[0027] F=αS 1 +βS 2 +γS 3
[0028]
[0029] Among them, F is the similarity, S 1 is the peak position in the target feature set, S 2 is the peak intensity in the target feature set, S 3 is the peak spacing in the target feature set, S 1 It also contains the feature vector a 1 and b 1 , S 2 It also contains the feature vector a 2 and c 1 , S 3 It also contains the eigenvector c 2 and b 2 , eigenvector a is the peak intensity, eigenvector b is the peak spacing, eigenvector c is the peak position, α, β and γ are proportional constants, α+β+γ=1, α, β and γ are not zero.
[0030] Optionally, the intersection of the feature sequences is used as an accurate search direction to obtain a matching result, and the method further includes:
[0031] If no matching result is obtained by using the intersection of the feature sequences as the precise search direction;
[0032] The image data and the spectral image are saved in a detection library in a cloud database, so that the controlled drug is subjected to component analysis and detection to obtain analysis results;
[0033] The analysis results are sent to the drug database for database updating.
[0034] In a second aspect of the present invention, a controlled drug information query system is proposed, including: an image data acquisition module, a spectral image acquisition module, a fuzzy search module, a first precise search module and a data sending module:
[0035] The image data acquisition module is used to acquire image data of controlled drugs and determine a search area in a cloud database based on the image data;
[0036] The spectral image acquisition module is used to acquire the spectral image uploaded by the detection device, perform image preprocessing on the spectral image to obtain a target spectral image, and perform numerical conversion on the target spectral image to obtain a target feature set; the spectral image and the image data belong to the same controlled drug; the target feature set includes: peak position, peak intensity and peak spacing;
[0037] The fuzzy search module is used to perform fuzzy search in the search area according to the target feature set to obtain a feature sequence set; the target features of the target feature set correspond one-to-one to the target feature sequences in the feature sequence set;
[0038] The first precise search module is used to calculate the similarity of each feature sequence in the feature sequence set to obtain a feature sequence intersection, and use the feature sequence intersection as a precise search direction to obtain a matching result;
[0039] The data sending module is used to send the matching result to the detection device.
[0040] Optionally, the system further includes: a data preprocessing module, a data classification module and a first data updating module:
[0041] The data preprocessing module is used to periodically obtain drug information of controlled drugs to obtain a drug database, and perform data cleaning on the drug database to obtain a preprocessing update package; the drug information includes: basic drug information, drug usage data and drug spectral images;
[0042] The data classification module is used to convert the drug spectral image in the pre-processing update package to obtain a feature set, and perform data classification according to the feature set to obtain a data update package;
[0043] The first data updating module is used to add the data updating package to the cloud database so as to update the data in the cloud database.
[0044] Optionally, the image data acquisition module includes: an image feature extraction module, a binary conversion module, a first judgment module, a second judgment module, a third judgment module and a search area determination module:
[0045] The image feature extraction module is used to extract image features of the image data; the image features include: texture features and color features;
[0046] The binary conversion module is used to convert the image data into a grayscale image through binarization, and determine the texture features of controlled drugs according to the pixel distribution in the grayscale image;
[0047] The first judgment module is used to judge the texture of the controlled drug as powdery if the pixel gradient in the grayscale image is less than the pixel threshold;
[0048] The second judgment module is used to judge the texture of the controlled drug as granular if the pixel gradient in the grayscale image is greater than the pixel threshold and the curvature of the pixel texture is greater than the curvature threshold; the pixel texture is a line segment texture in the grayscale image;
[0049] The third judgment module is used to judge the texture feature of the controlled drug as crystalline if the pixel gradient in the grayscale image is greater than the pixel threshold and the curvature of the pixel texture is less than the curvature threshold;
[0050] The search area determination module is used to determine the index of the controlled drugs according to the texture feature and the color feature, and then determine the search area in the cloud database according to the index.
[0051] Optionally, the precise search module includes: an undirected graph building module and a similarity calculation module:
[0052] The undirected graph building module is used to build an undirected graph, generate nodes according to the feature sequence in the feature sequence set and connect the nodes;
[0053] The similarity calculation module is used to calculate the edge similarity between each node. If the edge similarity is greater than the similarity threshold, the edge is retained to obtain the feature sequence intersection;
[0054] Similarity calculation formula:
[0055] F=αS 1 +βS 2 +γS 3
[0056]
[0057] Among them, F is the similarity, S 1 is the peak position in the target feature set, S 2 is the peak intensity in the target feature set, S 3 is the peak spacing in the target feature set, S 1 It also contains the feature vector a 1 and b 1 , S 2 It also contains the feature vector a 2 and c 1 , S3 It also contains the eigenvector c 2 and b 2 , eigenvector a is the peak intensity, eigenvector b is the peak spacing, eigenvector c is the peak position, α, β and γ are proportional constants, α+β+γ=1, α, β and γ are not zero.
[0058] Optionally, the data sending module includes: a second precise search module, a data backup module and a second data update module:
[0059] The second precise search module is used for obtaining no matching result when the intersection of the feature sequences is used as a precise search direction;
[0060] The data backup module is used to save the image data and the spectral image to the detection library in the cloud database, so that the controlled drug can be subjected to component analysis and detection to obtain analysis results;
[0061] The second data updating module is used to send the analysis result to the drug database for database updating.
[0062] Beneficial effects of the present invention:
[0063] The present invention proposes a method for querying information on controlled drugs, which obtains image data of controlled drugs, determines the search area in the cloud database according to the image data; obtains the spectral image uploaded by the detection device, performs image preprocessing on the spectral image to obtain the target spectral image, performs numerical conversion on the target spectral image to obtain the target feature set; performs fuzzy search in the search area according to the target feature set to obtain the feature sequence set; calculates the similarity of each feature sequence in the feature sequence set to obtain the feature sequence intersection, uses the feature sequence intersection as the precise search direction to obtain the matching result; and sends the matching result to the detection device. Through image recognition and spectral analysis, the above process effectively narrows the search range, accurately extracts the target features, and accurately matches after rapid fuzzy screening, which significantly improves the efficiency and accuracy of controlled drug detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] The present invention will be further described below in conjunction with the accompanying drawings.
[0065] Figure 1 A flowchart of a method for querying controlled drug information is provided for an embodiment of the present invention;
[0066] Figure 2 A structural schematic diagram of a controlled drug information query system is provided for an embodiment of the present invention. DETAILED DESCRIPTION
[0067] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the present invention, the description of "first", "second", etc. is only used for descriptive purposes, and cannot be understood as indicating or implying its relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" can explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in the field to implement. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0068] Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative work shall fall within the scope of protection of the present invention.
[0069] The embodiment of the present invention provides a method for querying controlled drug information. Figure 1 , Figure 1 A flowchart of a method for querying controlled drug information provided by an embodiment of the present invention. The method comprises the following steps:
[0070] S101, obtaining image data of controlled drugs, and determining a search area in a cloud database according to the image data;
[0071] S102, obtaining a spectral image uploaded by a detection device, performing image preprocessing on the spectral image to obtain a target spectral image, and performing numerical conversion on the target spectral image to obtain a target feature set;
[0072] S103, performing fuzzy search in the search area according to the target feature set to obtain a feature sequence set;
[0073] S104, calculating the similarity of each feature sequence in the feature sequence set to obtain a feature sequence intersection, and using the feature sequence intersection as an accurate search direction to obtain a matching result;
[0074] S105, sending the matching result to the detection device.
[0075] The spectral image and the image data belong to the same controlled drug; the target feature set includes: peak position, peak intensity and peak spacing; the target features of the target feature set correspond one to one with the target feature sequences in the feature sequence set;
[0076] Based on a controlled drug information query method provided by an embodiment of the present invention, through image recognition and spectral analysis, the above process effectively narrows the search scope, accurately extracts target features, and accurately matches after rapid fuzzy screening, thereby significantly improving the efficiency and accuracy of controlled drug detection.
[0077] In one implementation, information on controlled drugs is collected: To build a comprehensive controlled drug database, the project collects detailed information on controlled drugs from reliable resources to ensure the timeliness and comprehensiveness of the database information.
[0078] In one implementation, spectral images of controlled drugs can be obtained through a Raman spectrometer. Digitizing the spectral image is faster and more accurate than directly analyzing the image, because numerical calculations can directly use mathematical algorithms to quantify the differences between spectra, while graphic calculations may be affected by multiple factors such as image resolution and noise. Training models for images takes a lot of time and is relatively costly.
[0079] In one implementation, the spectral image is preprocessed to obtain the target spectral image, and the original spectral data is preprocessed, including steps such as background noise removal, baseline correction, and spectral smoothing to improve the quality and comparability of the data; the spectral data is stored in the form of wavenumber (cm^-1) as the horizontal axis and intensity (such as counts or relative intensity) as the vertical axis. The wavenumber and the corresponding intensity value are extracted from the spectral data to form a series of value pairs, thereby completing the numerical conversion.
[0080] In one implementation, the database also supports active query to realize drug information retrieval / query function. The system allows users to quickly find the required drug data through key information such as chemical name, CAS number, use, etc.; through query, information on drug control levels in various regions can be quickly obtained; CAS number (CAS): The CAS number (CAS Number) of a compound is a unique digital sequence, which is assigned to the registration number of a chemical substance by the Chemical Abstracts Service (CAS for short). Each chemical substance is assigned a unique CAS number, which is an internationally recognized standard for accurately identifying chemical substances.
[0081] In one implementation, the search area in the cloud database is determined based on the image data, so that the search scope can be narrowed down in advance; the fuzzy search is to reduce the search scope, that is, to reduce the number of traversals and improve the efficiency of the search; a fuzzy search is performed in the search area according to the target feature set to obtain a feature sequence set, for example: the target feature set includes feature a, feature b and feature c, and features a, feature b and feature c are associated, the feature sequence set includes the bc data sequence of b and c related to feature a, the ac data sequence of a and c related to feature b, the ab data sequence of b and a related to feature c, and the bc data sequence, the ac data sequence and the ab data sequence are the feature sequence.
[0082] In one implementation, image data of controlled drugs is obtained, that is, images of controlled drugs are taken by a camera, and a general search direction can be determined based on the appearance of the image. For example, if the appearance of the sample is powdery and blue, the search range can be determined first; the matching results are sent to the detection equipment, and the matching results are sent to the detection equipment of the customs personnel for the customs personnel to make subsequent judgments.
[0083] In one implementation, drug appearance: describes the physical form and visible characteristics of the compound, such as color, shape or physical state (solid, liquid, powder, crystal, etc.); UV maximum absorption wavelength (UVmax (nm)): the wavelength corresponding to the strongest intensity of light absorption by the compound in the ultraviolet spectrum. This is an important spectral feature and is often used in the identification and analysis of chemical substances, because different chemical structures will show unique absorption peaks at specific wavelengths.
[0084] In one embodiment, before querying drug information, updating the cloud database includes:
[0085] Periodically obtain drug information of controlled drugs to obtain a drug database, and perform data cleaning on the drug database to obtain a pre-processing update package; drug information includes: basic drug information, drug use data, and drug spectral images;
[0086] The drug spectral image in the preprocessing update package is transformed to obtain a feature set, and data is classified according to the feature set to obtain a data update package;
[0087] Add the data update package to the cloud database to update the data in the cloud database.
[0088] In one implementation, periodic updates help reduce data redundancy and outdated information, and the database can keep the data up to date; drug information includes basic drug information, drug usage data, and drug spectral images. When users make inquiries, they can provide relevant information, such as drug dosage, to facilitate judgment; to ensure the accuracy and practicality of information in the controlled drug database, the collected data will undergo a strict cleaning process. This process includes steps such as removing duplicate data, correcting erroneous information, unifying formats, and verifying data. Through these meticulous cleaning measures, the quality and consistency of the data are improved to ensure that all data are accurate and reliable.
[0089] In one implementation, the drug spectral images in the preprocessed update package are converted to obtain a feature set, and data is classified according to the feature set to obtain a data update package. The early conversion in the update package helps to ensure data consistency and reduce the amount of calculation in subsequent retrieval.
[0090] In one embodiment, step S101 includes:
[0091] Extract image features of image data; image features include: texture features and color features;
[0092] The image data is converted into a grayscale image through binarization, and the texture features of controlled drugs are determined according to the pixel distribution in the grayscale image;
[0093] If the pixel gradient in the grayscale image is less than the pixel threshold, the texture of the controlled drug is judged to be powdery;
[0094] If the pixel gradient in the grayscale image is greater than the pixel threshold, and the curvature of the pixel texture is greater than the curvature threshold, the texture of the controlled drug is determined to be granular; the pixel texture is the line segment texture in the grayscale image;
[0095] If the pixel gradient in the grayscale image is greater than the pixel threshold, and the curvature of the pixel texture is less than the curvature threshold, the texture feature of the controlled drug is determined to be crystalline;
[0096] The index of controlled drugs is determined based on texture features and color features, and then the search area in the cloud database is determined based on the index.
[0097] In one implementation, image data can be converted into a grayscale image through binarization, which specifically refers to setting the grayscale value of the pixel points on the image to 0 or 255, so that the entire image presents an obvious visual effect of only black and white; pixel gradient is a way to describe the change of pixel values in a grayscale image, for example: some pixels are evenly distributed and the pixel gradient is relatively small, which visually appears to be a relatively uniform color block, and some pixels are unevenly distributed and the pixel gradient is relatively large, which visually appears to have a strong change in light and dark.
[0098] In one implementation, the type of sample can be determined based on the pixel gradient. Powders appear as uniform blocks of color in grayscale images, while crystals and particles have strong changes in light and dark. When the pixel gradient is large and continuous, it visually appears as a line, that is, the line segment texture of the pixel texture in the grayscale image. Its type is determined based on the curvature of the line segment. The line segments in crystals are relatively straight, while the curvature of particles is relatively curved and irregular.
[0099] In one embodiment, step S104 includes:
[0100] Construct an undirected graph, generate nodes according to the feature sequence in the feature sequence set and connect the nodes;
[0101] Calculate the edge similarity between each node. If the edge similarity is greater than the similarity threshold, retain the edge to obtain the feature sequence intersection;
[0102] Similarity calculation formula:
[0103] F=αS 1 +βS 2 +γS 3
[0104]
[0105] Among them, F is the similarity, S 1 is the peak position in the target feature set, S 2 is the peak intensity in the target feature set, S 3 is the peak spacing in the target feature set, S 1 It also contains the feature vector a 1 and b 1 , S 2 It also contains the feature vector a 2 and c 1 , S 3 It also contains the eigenvector c 2 and b 2 , eigenvector a is the peak intensity, eigenvector b is the peak spacing, eigenvector c is the peak position, α, β and γ are proportional constants, α+β+γ=1, α, β and γ are not zero.
[0106] In one implementation, an undirected graph is constructed, and then nodes are generated using feature sequences in a feature sequence set. For example, the feature sequence set has three feature sequences: a, b, and c. The similarity between each feature in the feature sequence and its corresponding feature is calculated, that is, feature sequence a corresponds to feature vector c. 2 and b 2 , c feature sequence corresponds to feature vector a 1 and b 1, b feature sequence corresponds to feature vector a 2 and c 1 ; The three nodes (feature sequences) are interconnected, for example: feature sequence a and feature sequence b are connected through c 1 and c 2 Connection, feature sequence a and feature sequence c through b 1 and b 2 Connect, b feature sequence and c feature sequence through a 1 and a 2 connection, so the similarity between feature sequence a and feature sequence b about connection c can be calculated; S 1 , S 2 and S 3 The value of is between 0 and 1. When the value is 0, it means that it is completely dissimilar, and when the value is 1, it means that it is completely similar. The value of F is also between 0 and 1. 1 , S 2 and S 3 The value of F is scaled to between 0 and 1 by the proportional coefficient. Similarly, 0 represents complete dissimilarity and 1 represents complete similarity. Represents the feature vector a 1 The modulus of , and similarly the rest also represent the modulus of the corresponding eigenvectors, Represents the eigenvector b 1 The model, Represents the eigenvector c 1 The node, that is, the feature sequence, will be replaced according to the feature sequence set. This can ensure a certain accuracy while ensuring the fuzzy search speed, and prevent no search results due to a small range.
[0107] In one embodiment, step S105 further includes:
[0108] If the intersection of feature sequences is used as the exact search direction and no matching results are obtained;
[0109] The image data and the spectral image are saved in the detection library in the cloud database, so that the controlled drug can be subjected to component analysis and detection to obtain analysis results;
[0110] The analysis results are sent to the drug database for database update.
[0111] In one implementation, precise search is a search method for accurately finding and locating a given feature in a database. This method requires that the characters and length of the search terms and search fields of the returned results are completely consistent. Compared with fuzzy search, precise search has a higher precision rate.
[0112] In one implementation, if a drug sample does not obtain a matching result, it indicates that the sample is a new drug. The image data and spectral image are saved in the detection library in the cloud database, allowing the experimenter to conduct chemical testing on the sample to determine the specific components. Once the components are determined, the results can be uploaded to the cloud database for updating.
[0113] Based on the same inventive concept, the present invention also provides a controlled drug information query system. Figure 2 , Figure 2 A schematic diagram of the structure of a controlled drug information query system provided by an embodiment of the present invention includes: an image data acquisition module, a spectral image acquisition module, a fuzzy search module, a first precise search module and a data sending module:
[0114] An image data acquisition module, used to acquire image data of controlled drugs and determine a search area in a cloud database based on the image data;
[0115] The spectral image acquisition module is used to acquire the spectral image uploaded by the detection device, perform image preprocessing on the spectral image to obtain the target spectral image, and perform numerical conversion on the target spectral image to obtain the target feature set; the spectral image and the image data belong to the same controlled drug; the target feature set includes: peak position, peak intensity and peak spacing;
[0116] A fuzzy search module is used to perform fuzzy search in the search area according to the target feature set to obtain a feature sequence set; the target features of the target feature set correspond to the target feature sequences in the feature sequence set one by one;
[0117] The first precise search module is used to calculate the similarity of each feature sequence in the feature sequence set to obtain the feature sequence intersection, and use the feature sequence intersection as the precise search direction to obtain the matching result;
[0118] The data sending module is used to send the matching result to the detection device.
[0119] Based on a controlled drug information query system provided by an embodiment of the present invention, through image recognition and spectral analysis, the above process effectively narrows the search scope, accurately extracts target features, and accurately matches after rapid fuzzy screening, thereby significantly improving the efficiency and accuracy of controlled drug detection.
[0120] In one embodiment, the system further includes: a data preprocessing module, a data classification module and a first data updating module:
[0121] The data preprocessing module is used to periodically obtain drug information of controlled drugs to obtain a drug database, and to perform data cleaning on the drug database to obtain a preprocessing update package; the drug information includes: basic drug information, drug usage data, and drug spectral images;
[0122] A data classification module, used for converting the drug spectral image in the preprocessing update package to obtain a feature set, and performing data classification according to the feature set to obtain a data update package;
[0123] The first data updating module is used to add the data updating package to the cloud database so as to update the data in the cloud database.
[0124] In one embodiment, the image data acquisition module includes: an image feature extraction module, a binary conversion module, a first judgment module, a second judgment module, a third judgment module and a search area determination module:
[0125] An image feature extraction module is used to extract image features of image data; image features include: texture features and color features;
[0126] A binary conversion module, used to convert image data into a grayscale image through binary conversion, and determine the texture features of controlled drugs according to the pixel distribution in the grayscale image;
[0127] The first judgment module is used to judge the texture of the controlled drug as powdery if the pixel gradient in the grayscale image is less than the pixel threshold;
[0128] The second judgment module is used to judge the texture of the controlled drug as granular if the pixel gradient in the grayscale image is greater than the pixel threshold and the curvature of the pixel texture is greater than the curvature threshold; the pixel texture is a line segment texture in the grayscale image;
[0129] The third judgment module is used to judge the texture feature of the controlled drug as crystalline if the pixel gradient in the grayscale image is greater than the pixel threshold and the curvature of the pixel texture is less than the curvature threshold;
[0130] The search area determination module is used to determine the index of controlled drugs based on texture features and color features, and then determine the search area in the cloud database based on the index.
[0131] In one embodiment, the precise search module includes: an undirected graph building module and a similarity calculation module:
[0132] An undirected graph building module is used to build an undirected graph, generate nodes according to the feature sequence in the feature sequence set and connect the nodes;
[0133] The similarity calculation module is used to calculate the edge similarity between each node. If the edge similarity is greater than the similarity threshold, the edge is retained to obtain the feature sequence intersection;
[0134] Similarity calculation formula:
[0135] F=αS 1 +βS 2 +γS3
[0136]
[0137] Among them, F is the similarity, S 1 is the peak position in the target feature set, S 2 is the peak intensity in the target feature set, S 3 is the peak spacing in the target feature set, S 1 It also contains the feature vector a 1 and b 1 , S 2 It also contains the feature vector a 2 and c 1 , S 3 It also contains the eigenvector c 2 and b 2 , eigenvector a is the peak intensity, eigenvector b is the peak spacing, eigenvector c is the peak position, α, β and γ are proportional constants, α+β+γ=1, α, β and γ are not zero.
[0138] In one embodiment, the data sending module includes: a second precise search module, a data backup module and a second data update module:
[0139] The second precise search module is used if no matching result is obtained by taking the intersection of the feature sequences as the precise search direction;
[0140] A data backup module is used to save the image data and spectral images to the detection library in the cloud database, so that the controlled drugs can be analyzed and tested for components to obtain analysis results;
[0141] The second data updating module is used to send the analysis results to the drug database for database updating.
[0142] The above is a detailed description of an embodiment of the present invention, but the content is only a preferred embodiment of the present invention and cannot be considered to limit the scope of implementation of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.
Claims
1. A method for querying controlled drug information, characterized in that: The method comprises: Obtaining image data of controlled drugs, and determining a search area in a cloud database based on the image data; Acquire a spectral image uploaded by a detection device, perform image preprocessing on the spectral image to obtain a target spectral image, and perform numerical conversion on the target spectral image to obtain a target feature set; The spectral image and the image data belong to the same controlled drug category; The target feature set includes: peak position, peak intensity and peak spacing; A feature sequence set is obtained by performing a fuzzy search in the search area according to the target feature set; the target features of the target feature set correspond one-to-one to the target feature sequences in the feature sequence set; Calculating the similarity of each feature sequence in the feature sequence set to obtain a feature sequence intersection, and using the feature sequence intersection as an accurate search direction to obtain a matching result; The matching result is sent to the detection device.
2. A method for querying controlled drug information according to claim 1, characterized in that: Before querying drug information, updating the cloud database includes: Periodically acquiring drug information of controlled drugs to obtain a drug database, and performing data cleaning on the drug database to obtain a preprocessing update package; the drug information includes: basic drug information, drug usage data, and drug spectral images; The drug spectral image in the preprocessing update package is converted into a feature set, and data is classified according to the feature set to obtain a data update package; The data update package is added to the cloud database so that the cloud database is updated.
3. A method for querying controlled drug information according to claim 1, characterized in that: Determining the search area in the cloud database according to the image data includes: Extracting image features of the image data; the image features include: texture features and color features; Converting the image data into a grayscale image through binarization, and determining the texture features of controlled drugs according to pixel distribution in the grayscale image; If the pixel gradient in the grayscale image is less than the pixel threshold, the texture of the controlled drug is determined to be powdery; If the pixel gradient in the grayscale image is greater than the pixel threshold, and the curvature of the pixel texture is greater than the curvature threshold, the texture of the controlled drug is determined to be granular; the pixel texture is a line segment texture in the grayscale image; If the pixel gradient in the grayscale image is greater than the pixel threshold, and the curvature of the pixel texture is less than the curvature threshold, the texture feature of the controlled drug is determined to be crystalline; The index of the controlled drugs is determined according to the texture feature and the color feature, and then the search area in the cloud database is determined according to the index.
4. A method for querying controlled drug information according to claim 1, characterized in that: Calculating the similarity of each feature sequence in the feature sequence set to obtain the feature sequence intersection includes: Constructing an undirected graph, generating nodes according to the feature sequence in the feature sequence set and connecting the nodes; Calculate the edge similarity between each node. If the edge similarity is greater than the similarity threshold, retain the edge to obtain the feature sequence intersection; Similarity calculation formula: Among them, F is the similarity, is the peak position in the target feature set, is the peak intensity in the target feature set, is the peak spacing in the target feature set, It also contains the feature vector and , It also contains the feature vector and , It also contains the feature vector and , eigenvector a is the peak intensity, eigenvector b is the peak spacing, eigenvector c is the peak position, α, β and γ are proportional constants, α+β+γ=1, and α, β and γ are not zero.
5. A method for querying controlled drug information according to claim 1, characterized in that: Using the intersection of the feature sequences as an accurate search direction to obtain a matching result, the method further includes: If no matching result is obtained by using the intersection of the feature sequences as the precise search direction; The image data and the spectral image are saved in a detection library in a cloud database, so that the controlled drug is subjected to component analysis and detection to obtain analysis results; The analysis results are sent to the drug database for database updating.
6. A controlled drug information query system, characterized in that: The system includes: an image data acquisition module, a spectrum image acquisition module, a fuzzy search module, a first precise search module and a data sending module: The image data acquisition module is used to acquire image data of controlled drugs and determine a search area in a cloud database based on the image data; The spectral image acquisition module is used to acquire the spectral image uploaded by the detection device, perform image preprocessing on the spectral image to obtain a target spectral image, and perform numerical conversion on the target spectral image to obtain a target feature set; the spectral image and the image data belong to the same controlled drug; the target feature set includes: peak position, peak intensity and peak spacing; The fuzzy search module is used to perform fuzzy search in the search area according to the target feature set to obtain a feature sequence set; the target features of the target feature set correspond one-to-one to the target feature sequences in the feature sequence set; The first precise search module is used to calculate the similarity of each feature sequence in the feature sequence set to obtain a feature sequence intersection, and use the feature sequence intersection as a precise search direction to obtain a matching result; The data sending module is used to send the matching result to the detection device.
7. A controlled drug information query system according to claim 6, characterized in that: The system further comprises: a data preprocessing module, a data classification module and a first data updating module: The data preprocessing module is used to periodically obtain drug information of controlled drugs to obtain a drug database, and perform data cleaning on the drug database to obtain a preprocessing update package; the drug information includes: basic drug information, drug usage data and drug spectral images; The data classification module is used to convert the drug spectral image in the pre-processing update package to obtain a feature set, and perform data classification according to the feature set to obtain a data update package; The first data updating module is used to add the data updating package to the cloud database so as to update the data in the cloud database.
8. A controlled drug information query system according to claim 6, characterized in that: The image data acquisition module includes: an image feature extraction module, a binary conversion module, a first judgment module, a second judgment module, a third judgment module and a search area determination module: The image feature extraction module is used to extract image features of the image data; the image features include: texture features and color features; The binary conversion module is used to convert the image data into a grayscale image through binarization, and determine the texture features of controlled drugs according to the pixel distribution in the grayscale image; The first judgment module is used to judge the texture of the controlled drug as powdery if the pixel gradient in the grayscale image is less than the pixel threshold; The second judgment module is used to judge the texture of the controlled drug as granular if the pixel gradient in the grayscale image is greater than the pixel threshold and the curvature of the pixel texture is greater than the curvature threshold; the pixel texture is a line segment texture in the grayscale image; The third judgment module is used to judge the texture feature of the controlled drug as crystalline if the pixel gradient in the grayscale image is greater than the pixel threshold and the curvature of the pixel texture is less than the curvature threshold; The search area determination module is used to determine the index of the controlled drugs according to the texture feature and the color feature, and then determine the search area in the cloud database according to the index.
9. A controlled drug information query system according to claim 6, characterized in that: The precise search module includes: an undirected graph building module and a similarity calculation module: The undirected graph building module is used to build an undirected graph, generate nodes according to the feature sequence in the feature sequence set and connect the nodes; The similarity calculation module is used to calculate the edge similarity between each node. If the edge similarity is greater than the similarity threshold, the edge is retained to obtain the feature sequence intersection; Similarity calculation formula: Among them, F is the similarity, is the peak position in the target feature set, is the peak intensity in the target feature set, is the peak spacing in the target feature set, It also contains the feature vector and , It also contains the feature vector and , It also contains the feature vector and , eigenvector a is the peak intensity, eigenvector b is the peak spacing, eigenvector c is the peak position, α, β and γ are proportional constants, α+β+γ=1, and α, β and γ are not zero.
10. A controlled drug information query system according to claim 6, characterized in that: The data sending module includes: a second precise search module, a data backup module and a second data update module: The second precise search module is used for obtaining no matching result when the intersection of the feature sequences is used as a precise search direction; The data backup module is used to save the image data and the spectral image to the detection library in the cloud database, so that the controlled drug can be subjected to component analysis and detection to obtain analysis results; The second data updating module is used to send the analysis result to the drug database for database updating.
Citation Information
Patent Citations
Entity alignment method for customs import and export commodity knowledge graph
CN115641599A
Text retrieval type question and answer method and application thereof
CN116680359A
Visual image positioning method based on coarse and fine feature screening
CN116935073A
Information retrieving device, information retrieving method, and information retrieving program
JP2004259061A
Image search apparatus, image search method, program, and storage medium
US20060120627A1
