A method and system for querying information of controlled pharmaceuticals

By acquiring image data and spectral images of controlled drugs, performing preprocessing and numerical transformation, and utilizing fuzzy search and similarity calculation, the problems of low retrieval efficiency and insufficient accuracy in traditional detection methods are solved, achieving efficient and accurate detection of controlled drugs.

CN119202290BActive Publication Date: 2026-01-06中华人民共和国深圳海关
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411329760.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2026-01-06
Estimated Expiration
2044-09-24

AI Technical Summary

Technical Problem

Traditional testing methods are insufficient for rapid and accurate screening of controlled substances. The efficiency of uploading and retrieving test data during sample testing is low, the matching time is long, and the comparison results are inaccurate, leading to increased time costs.

Method used

By acquiring image data of controlled drugs, the search area of ​​the cloud database is determined, spectral image preprocessing and numerical transformation are performed, and fuzzy search and similarity calculation are used to narrow down the search range, accurately match the characteristics of controlled drugs, and send the matching results.

Benefits of technology

It significantly improves the efficiency and accuracy of controlled drug testing, enabling precise matching after rapid fuzzy screening, narrowing the search range, and improving testing efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202290B_ABST
    Figure CN119202290B_ABST
Patent Text Reader

Abstract

The application discloses a kind of controlled drug information query method and system, it is related to drug query technical field;Image data of controlled drug is acquired, and search area in cloud database is determined according to image data;Spectrum image uploaded by detection equipment is acquired, image preprocessing is carried out on spectrum image to obtain target spectrum image, numerical conversion is carried out on target spectrum image to obtain target feature set;Fuzzy search is carried out in search area according to target feature set to obtain feature sequence set;The similarity of each feature sequence in feature sequence set is calculated to obtain feature sequence intersection, and feature sequence intersection is used as accurate search direction to obtain matching result;Matching result is sent to detection equipment.Through image recognition and spectrum analysis, the above process efficiently narrows the search range, accurately extracts target features, accurately matches after fast fuzzy screening, and significantly improves the detection efficiency and accuracy of controlled drugs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of drug query technology, specifically relating to a method and system for querying information on controlled drugs. Background Technology

[0002] With the increasing variety of controlled drugs and their increasingly covert transportation methods, traditional detection methods are no longer sufficient to meet the demands for rapid and accurate screening. Therefore, significant progress has been made in drug testing technology, with advanced spectroscopic analysis technology being widely applied in customs inspection. These technologies, through non-contact, rapid, and accurate methods, can analyze the chemical properties of substances and effectively identify prohibited components in complex mixtures. The application of this technology not only simplifies the testing process and shortens testing time but also greatly improves customs efficiency, enabling customs to respond quickly and effectively manage controlled drugs.

[0003] Customs uses high-precision detection technologies, such as spectral and mass spectrometry analysis, to rapidly screen controlled drug components in inbound and outbound goods. Once a suspicious component is detected, the system immediately uploads the results to a cloud database, using advanced algorithms to match and compare them with feature information in a vast database. Once the matching result is generated, the system immediately transmits a report containing detailed information electronically to customs officers. By combining this information with professional knowledge, on-site conditions, and other relevant information, customs officials conduct further examination and assessment of the goods.

[0004] The above technologies have solved some of the problems, but some problems still exist. For example, during the process of uploading and retrieving test data when testing samples, the data retrieval efficiency is low, the matching time is long, and the comparison results are inaccurate, which leads to increased time costs. Summary of the Invention

[0005] The purpose of this invention is to solve the problem by proposing a method and system for querying information on controlled drugs.

[0006] In a first aspect of this invention, a method for querying information on controlled drugs is first proposed, the method comprising:

[0007] Acquire image data of controlled drugs, and determine the search area in the cloud database based on the image data;

[0008] The process involves acquiring a spectral image uploaded by a detection device, performing image preprocessing on the spectral image to obtain a target spectral image, and then performing numerical transformation 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 based on the target feature set; the target features of the target feature set correspond one-to-one with the target feature sequences in the feature sequence set.

[0010] The similarity of each feature sequence in the feature sequence set is calculated to obtain the feature sequence intersection, and the feature sequence intersection is used as the precise search direction to obtain the matching result;

[0011] The matching result is sent to the detection device.

[0012] Optionally, updating the cloud database before querying drug information includes:

[0013] A drug database is obtained by periodically acquiring drug information of controlled substances, and the drug database is cleaned to obtain a preprocessed update package; the drug information includes: basic drug information, drug usage data, and drug spectral images;

[0014] The drug spectral images in the preprocessing update package are transformed to obtain a feature set, and the 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 to update the data in the cloud database.

[0016] Optionally, determining the search area in the cloud database based on the image data includes:

[0017] Extract image features from the image data; the image features include: texture features and color features;

[0018] The image data is converted into a grayscale image through binarization, and the texture features of the controlled drug are determined based on the pixel distribution in the grayscale image.

[0019] If the pixel gradient in the grayscale image is less than the pixel threshold, then 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, then the texture of the controlled drug is determined to be granular; the pixel texture is the 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, then the texture feature of the controlled drug is determined to be crystalline.

[0022] The index of the controlled drug is determined based on the texture features and the color features, and then the search area in the cloud database is determined based on the index.

[0023] Optionally, calculating the similarity of each feature sequence in the feature sequence set to obtain the feature sequence intersection includes:

[0024] Construct an undirected graph by generating nodes based on the feature sequences 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, then retain the edge to obtain the intersection of the feature sequences.

[0026] Similarity calculation formula:

[0027] F=αS1+βS2+γS3

[0028]

[0029] Where F is the similarity, S1 is the peak position in the target feature set, S2 is the peak intensity in the target feature set, S3 is the peak spacing in the target feature set, S1 also contains feature vectors a1 and b1, S2 also contains feature vectors a2 and c1, S3 also contains feature vectors c2 and b2, feature vector a is the peak intensity, feature vector b is the peak spacing, feature vector c is the peak position, α, β and γ are proportionality constants, α+β+γ=1, and α, β and γ are all non-zero.

[0030] Optionally, the intersection of the feature sequences is used as the precise search direction to obtain the matching result. The method further includes:

[0031] If the intersection of the feature sequences is used as the precise search direction and no matching result is obtained;

[0032] The image data and the spectral image are saved 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;

[0033] The analysis results are sent to the drug database for database updates.

[0034] In a second aspect of this invention, a controlled drug information query system is proposed, comprising: an image data acquisition module, a spectral image acquisition module, a fuzzy search module, a first precise search module, and a data transmission module.

[0035] The image data acquisition module is used to acquire image data of controlled drugs and determine the search area in the cloud database based on the image data;

[0036] The spectral image acquisition module is used to acquire spectral images uploaded by the detection device, perform image preprocessing on the spectral images to obtain target spectral images, and perform numerical transformation on the target spectral images to obtain target feature sets; the spectral images and the image data belong to the same controlled drug category; the target feature set includes: peak position, peak intensity, and peak spacing;

[0037] The fuzzy search module is used to perform a fuzzy search in the search area based on the target feature set to obtain a feature sequence set; the target features of the target feature set correspond one-to-one with 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 the feature sequence intersection, and use the feature sequence intersection as the precise search direction to obtain the 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 update module.

[0041] The data preprocessing module is used to periodically acquire drug information of controlled drugs to obtain a drug database, and to clean the drug database to obtain a preprocessed 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 images in the preprocessed update package into a feature set, and to classify the data according to the feature set to obtain a data update package.

[0043] The first data update module is used to add the data update package to the cloud database so that the cloud database can be updated.

[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 region determination module.

[0045] The image feature extraction module is used to extract image features from the image data; the image features include: texture features and color features;

[0046] The binarization module is used to convert the image data into a grayscale image through binarization, and to determine the texture features of the controlled drug based on the pixel distribution in the grayscale image.

[0047] The first judgment module is used to determine the texture of the controlled drug as powder if the pixel gradient in the grayscale image is less than the pixel threshold.

[0048] The second judgment module is used to determine 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 the line segment texture in the grayscale image.

[0049] The third judgment module is used to determine the texture features 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 drug based on the texture features and the color features, and then determine the search area in the cloud database based on the index.

[0051] Optionally, the precise search module includes: an undirected graph construction module and a similarity calculation module.

[0052] The undirected graph construction module is used to construct an undirected graph, generate nodes based on the feature sequences 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 intersection of the feature sequences.

[0054] Similarity calculation formula:

[0055] F=αS1+βS2+γS3

[0056]

[0057] Where F is the similarity, S1 is the peak position in the target feature set, S2 is the peak intensity in the target feature set, S3 is the peak spacing in the target feature set, S1 also contains feature vectors a1 and b1, S2 also contains feature vectors a2 and c1, S3 also contains feature vectors c2 and b2, feature vector a is the peak intensity, feature vector b is the peak spacing, feature vector c is the peak position, α, β and γ are proportionality constants, α+β+γ=1, and α, β and γ are all non-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 if no matching result is obtained when the intersection of the feature sequences is used as the 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 update module is used to send the analysis results to the drug database for database update.

[0062] The beneficial effects of this invention are:

[0063] This invention proposes a method for querying information on controlled drugs. The method involves acquiring image data of controlled drugs and determining a search area in a cloud database based on this data; acquiring spectral images uploaded by a detection device and performing image preprocessing to obtain a target spectral image; numerically transforming the target spectral image to obtain a target feature set; performing a fuzzy search within the search area based on the target feature set to obtain a feature sequence set; calculating the similarity of each feature sequence in the feature sequence set to obtain the feature sequence intersection; using the feature sequence intersection as the precise search direction to obtain the matching result; and sending the matching result to the detection device. Through image recognition and spectral analysis, this process efficiently narrows the search range, accurately extracts target features, and achieves precise matching after rapid fuzzy filtering, significantly improving the efficiency and accuracy of controlled drug detection. Attached Figure Description

[0064] The invention will now be further described with reference to the accompanying drawings.

[0065] Figure 1 A flowchart of a method for querying information on controlled drugs is provided in this embodiment of the invention;

[0066] Figure 2 This invention provides a schematic diagram of the structure of a controlled drug information query system. Detailed Implementation

[0067] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and B can represent: A alone, A and B simultaneously, and B alone. Furthermore, descriptions involving "first," "second," etc., in this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" can explicitly or implicitly include at least one of those features. Additionally, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. 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 claimed by the present invention.

[0068] Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0069] This invention provides a method for querying information on controlled substances. See also... Figure 1 , Figure 1 A flowchart illustrating a method for querying information on controlled substances provided in an embodiment of the present invention. The method includes the following steps:

[0070] S101, Obtain image data of controlled drugs and determine the search area in the cloud database based on the image data;

[0071] S102, 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 transformation on the target spectral image to obtain the target feature set;

[0072] S103, perform a fuzzy search in the search area based on the target feature set to obtain the feature sequence set;

[0073] S104, 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;

[0074] S105, send the matching result to the detection device.

[0075] The spectral image and image data belong to the same controlled drug category; the target feature set includes: peak position, peak intensity, and peak spacing; the target features in the target feature set correspond one-to-one with the target feature sequences in the feature sequence set;

[0076] Based on the method for querying information on controlled drugs provided in this embodiment of the invention, the above process efficiently narrows the search range, accurately extracts target features, and performs precise matching after rapid fuzzy filtering, significantly improving the efficiency and accuracy of controlled drug detection.

[0077] In one implementation, information on controlled substances is collected: to build a comprehensive database of controlled substances, the project collects detailed information on controlled substances from reliable resources to ensure the timeliness and comprehensiveness of the database information.

[0078] In one implementation, the spectral images of controlled drugs can be obtained using a Raman spectrometer. Numericalizing the spectral images is faster and more accurate than directly analyzing the images because numerical calculations can directly use mathematical algorithms to quantify the differences between spectra, while image calculations may be affected by various factors such as image resolution and noise. Training models for images requires a lot of time and is relatively costly.

[0079] In one implementation, the target spectral image is obtained by image preprocessing of the spectral image. 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 abscissa and intensity (such as count or relative intensity) as the ordinate. The wavenumber and the corresponding intensity value are extracted from the spectral data to form a series of numerical pairs, thus completing the numerical conversion.

[0080] In one implementation, the database also supports active queries, enabling drug information retrieval / query functions. The system allows users to quickly find the required drug data using key information such as chemical name, CAS number, and usage. Queries can also quickly obtain information on drug control levels in various regions. CAS Number: A compound's CAS number is a unique numerical sequence assigned to a chemical substance by the Chemical Abstracts Service (CAS). Each chemical substance is given a unique CAS number, which is an internationally recognized standard used to accurately identify chemical substances.

[0081] In one implementation, the search area in the cloud database is determined based on the image data, which can narrow down the retrieval scope in advance. Fuzzy search is used to reduce the search scope, that is, to reduce the number of traversals and improve the retrieval efficiency. A feature sequence set is obtained by performing a fuzzy search in the search area based on the target feature set. For example, the target feature set contains features a, b, and c, and features a, b, and c are related. The feature sequence set contains bc data sequences of b and c related to feature a, ac data sequences of a and c related to feature b, and ab data sequences of b and a related to feature c. The bc data sequence, ac data sequence, and ab data sequence are the feature sequences.

[0082] In one implementation, image data of controlled drugs is acquired, that is, images of controlled drugs are captured by a camera. The general search direction can be determined based on the appearance of the image. For example, if the sample is powdery and blue, the search range can be determined first. The matching results are sent to the detection equipment of customs officers so that they can make subsequent judgments.

[0083] In one implementation, the drug's appearance describes the compound's physical form and visible characteristics, such as color, shape, or physical state (solid, liquid, powder, crystal, etc.); the maximum absorption wavelength of ultraviolet light (UVmax (nm)) is the wavelength corresponding to the strongest intensity of light absorbed by the compound in the ultraviolet spectrum. This is an important spectral feature, often used for the identification and analysis of chemical substances, because different chemical structures will show unique absorption peaks at specific wavelengths.

[0084] In one embodiment, updating the cloud database before querying drug information includes:

[0085] The drug database is obtained by periodically acquiring drug information of controlled substances, and the drug database is cleaned to obtain a preprocessed update package; the drug information includes: basic drug information, drug usage data and drug spectral images;

[0086] The drug spectral images in the preprocessed update package are transformed to obtain a feature set, and the 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 enable the cloud database to update the data.

[0088] In one implementation, periodic updates help reduce data redundancy and outdated information, ensuring the database remains up-to-date. Drug information includes basic drug information, drug usage data, and drug spectral images. When users query, relevant information, such as drug dosage, can be provided for informed decisions. To ensure the accuracy and usability of information in the controlled drug database, the collected data undergoes a rigorous cleaning process. This process includes removing duplicate data, correcting errors, standardizing formats, and validating data. These meticulous cleaning measures improve data quality and consistency, ensuring all data is accurate and reliable.

[0089] In one implementation, the drug spectral images in the preprocessed update package are transformed to obtain a feature set, and the data is classified according to the feature set to obtain a data update package. The pre-transformation of the update package helps to ensure data consistency and reduce the amount of computation in subsequent retrieval.

[0090] In one embodiment, step S101 includes:

[0091] Extracting image features from image data; image features include: texture features and color features;

[0092] Image data is converted into grayscale images through binarization, and the texture features of controlled drugs are determined based on the pixel distribution in the grayscale images;

[0093] If the pixel gradient in the grayscale image is less than the pixel threshold, the texture of the controlled drug will be determined as powder.

[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, then 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, then the texture features of the controlled drug are determined to be crystalline.

[0096] The index of controlled drugs is determined based on texture 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. Specifically, this means setting the grayscale value of each pixel in the image to 0 or 255, thereby presenting the entire image with a clear visual effect of only black and white. Pixel gradient is a term used to describe the changes in pixel values ​​within a grayscale image. For example, some pixels are evenly distributed and have a relatively small pixel gradient, which appears as a relatively uniform color block. Other pixels are unevenly distributed and have a relatively large pixel gradient, which appears as a strong change in brightness.

[0098] In one implementation, the type of sample can be determined based on the pixel gradient. Powder appears as a uniform color block in a grayscale image, while crystals and particles have strong variations in brightness. When the pixel gradient is large and continuous, it appears as a line visually, which is the line segment texture of the pixel texture in the grayscale image. The 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 more curved and irregular.

[0099] In one embodiment, step S104 includes:

[0100] Construct an undirected graph by generating nodes based on the feature sequences in the feature sequence set and connecting the nodes.

[0101] Calculate the edge similarity between each node. If the edge similarity is greater than the similarity threshold, then retain the edge to obtain the intersection of the feature sequences.

[0102] Similarity calculation formula:

[0103] F=αS1+βS2+γS3

[0104]

[0105] Where F is the similarity, S1 is the peak position in the target feature set, S2 is the peak intensity in the target feature set, S3 is the peak spacing in the target feature set, S1 also contains feature vectors a1 and b1, S2 also contains feature vectors a2 and c1, S3 also contains feature vectors c2 and b2, feature vector a is the peak intensity, feature vector b is the peak spacing, feature vector c is the peak position, α, β and γ are proportionality constants, α+β+γ=1, and α, β and γ are all non-zero.

[0106] In one implementation, an undirected graph is constructed, and nodes are generated using feature sequences from a feature sequence set. For example, the feature sequence set has three feature sequences: a, b, and c. The similarity between each feature in a feature sequence and its corresponding feature is calculated. That is, feature sequence a corresponds to feature vectors c2 and b2, feature sequence c corresponds to feature vectors a1 and b1, and feature sequence b corresponds to feature vectors a2 and c1. The three nodes (feature sequences) are interconnected. For example, feature sequence a and feature sequence b are connected through c1 and c2. The feature sequences a and c are connected via b1 and b2, and the feature sequences b and c are connected via a1 and a2. Therefore, the similarity between feature sequences a and b with respect to connection c can be calculated. The values ​​of S1, S2, and S3 are between 0 and 1. A value of 0 represents complete dissimilarity, and a value of 1 represents complete similarity. The value of F is also between 0 and 1. S1, S2, and S3 are scaled down to the range of 0 and 1 using scaling factors. Similarly, 0 represents complete dissimilarity, and 1 represents complete similarity. This represents the magnitude of the eigenvector a1, and similarly, the others also represent the magnitudes of their corresponding eigenvectors. The magnitude of the eigenvector b1 is represented by the eigenvector b1. The modulus of feature vector c1 is represented; the nodes, i.e., the feature sequences, will be changed according to the feature sequence set. This can ensure a certain level of accuracy while maintaining the speed of fuzzy search, and prevent the search results from being too small to be found.

[0107] In one embodiment, step S105 further includes:

[0108] If the intersection of feature sequences is used as the precise search direction and no matching result is obtained;

[0109] Image data and spectral images are saved to a detection library in a cloud database to enable component analysis of the controlled drug and obtain analysis results;

[0110] The analysis results are sent to the drug database for database updates.

[0111] In one implementation, exact search is a search method that precisely locates a given feature in a database. This method requires that the search terms and the search fields of the returned results have exactly the same character count and length. Compared to fuzzy search, exact search has a higher precision rate.

[0112] In one implementation, if no matching result is obtained for a drug sample, it indicates that the sample is a novel drug. The image data and spectral image are saved to the detection library in the cloud database, allowing researchers to perform chemical analysis 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, embodiments of the present invention also provide a controlled drug information query system. See also Figure 2 , Figure 2 A schematic diagram of a controlled drug information query system provided in 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 transmission module.

[0114] The image data acquisition module is used to acquire image data of controlled drugs and determine the search area in the cloud database based on the image data;

[0115] The spectral image acquisition module is used to acquire spectral images uploaded by the detection equipment, perform image preprocessing on the spectral images to obtain the target spectral image, and perform numerical transformation on the target spectral image to obtain the target feature set; the spectral image and image data belong to the same controlled drug category; the target feature set includes: peak position, peak intensity, and peak spacing;

[0116] The fuzzy search module is used to perform a fuzzy search in the search area based on the target feature set to obtain a feature sequence set; there is a one-to-one correspondence between the target features in the target feature set and the target feature sequences in the feature sequence set.

[0117] The first precise search module is used to calculate the similarity of each feature sequence in the feature sequence set to obtain the intersection of the feature sequences, and use the intersection of the feature sequences as the precise search direction to obtain the matching result;

[0118] The data sending module is used to send the matching results to the detection device.

[0119] Based on the controlled drug information query system provided by the embodiments of the present invention, the above process efficiently narrows the search range, accurately extracts target features, and performs precise matching after rapid fuzzy screening through image recognition and spectral analysis, 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 update module.

[0121] The data preprocessing module is used to periodically acquire drug information of controlled drugs to obtain a drug database, and to clean the drug database to obtain a preprocessed update package; the drug information includes: basic drug information, drug usage data and drug spectral images;

[0122] The data classification module is used to convert the drug spectral images in the preprocessed update package into feature sets, and then classify the data according to the feature sets to obtain the data update package.

[0123] The first data update module is used to add data update packages to the cloud database so that the cloud database can update the data.

[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 region determination module.

[0125] The image feature extraction module is used to extract image features from image data; image features include: texture features and color features.

[0126] The binarization module is used to convert image data into grayscale images through binarization, and to determine the texture features of controlled drugs based on the pixel distribution in the grayscale image.

[0127] The first judgment module is used to determine the texture of the controlled drug as powder if the pixel gradient in the grayscale image is less than the pixel threshold.

[0128] The second judgment module is used to determine 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 the line segment texture in the grayscale image.

[0129] The third judgment module is used to determine the texture features 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 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 construction module and a similarity calculation module.

[0132] The undirected graph construction module is used to construct undirected graphs, generate nodes based on feature sequences 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 intersection of the feature sequences.

[0134] Similarity calculation formula:

[0135] F=αS1+βS2+γS3

[0136]

[0137] Where F is the similarity, S1 is the peak position in the target feature set, S2 is the peak intensity in the target feature set, S3 is the peak spacing in the target feature set, S1 also contains feature vectors a1 and b1, S2 also contains feature vectors a2 and c1, S3 also contains feature vectors c2 and b2, feature vector a is the peak intensity, feature vector b is the peak spacing, feature vector c is the peak position, α, β and γ are proportionality constants, α+β+γ=1, and α, β and γ are all non-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 when the intersection of feature sequences is used as the precise search direction;

[0140] The data backup module is used to save image data and spectral images to the detection library in the cloud database so that the controlled drug can be analyzed for components and the analysis results can be obtained.

[0141] The second data update module is used to send the analysis results to the drug database for database updates.

[0142] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.

Claims

1. A method of searching for information on a controlled drug, characterized by, The method comprises: acquiring image data of a controlled drug, and determining a search area in a cloud database according to the image data; acquiring 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; the spectral image and the image data belong to the same controlled drug; the target feature set comprises a peak position, a peak intensity, and a peak interval; performing 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 target feature sequences in the feature sequence set in a one-to-one manner; calculating the similarity of each feature sequence in the feature sequence set to obtain a feature sequence intersection, taking the feature sequence intersection as an accurate search direction to obtain a matching result; sending the matching result to the detection device; calculating the similarity of each feature sequence in the feature sequence set to obtain a feature sequence intersection comprises: constructing an undirected graph, generating nodes according to the feature sequences in the feature sequence set, and connecting each node; calculating the edge similarity between each node, if the edge similarity is greater than a similarity threshold, the edge is retained to obtain the feature sequence intersection; the similarity calculation formula is: F = αS1 + βS2 + γS3 wherein, F is the similarity, S1 is the peak position in the target feature set, S2 is the peak intensity in the target feature set, S3 is the peak interval in the target feature set, S1 further comprises feature vectors a1 and b1, S2 further comprises feature vectors a2 and c1, S3 further comprises feature vectors c2 and b2, the feature vector a is the peak intensity, the feature vector b is the peak interval, the feature vector c is the peak position, α, β and γ are proportional constants, α + β + γ = 1, and α, β and γ are not zero.

2. The method of claim 1, wherein the method comprises, Before querying the drug information, updating the cloud database comprises: periodically acquiring drug information of a controlled drug to obtain a drug database, and performing data cleaning on the drug database to obtain a preprocessing update package; the drug information comprises drug basic information, drug use data, and drug spectral images; transforming the drug spectral images in the preprocessing update package to obtain a feature set, and classifying the data according to the feature set to obtain a data update package; adding the data update package to the cloud database to update the data in the cloud database.

3. The method of claim 1, wherein the method further comprises: determining a search area in a cloud database according to image data comprises: extracting image features of the image data; the image features comprise texture features and color features; converting the image data into a gray image through binaryzation, and determining the texture features of the controlled drug according to the pixel distribution in the gray image; if the pixel gradient in the gray image is < a pixel threshold, the texture of the controlled drug is determined to be powdery; if the pixel gradient in the gray image is > a pixel threshold, and the curvature of the pixel texture is > a curvature threshold, the texture of the controlled drug is determined to be granular; the pixel texture is a line segment texture in the gray image; If the pixel gradient in the gray image is greater than a pixel threshold value, and the curvature of the pixel texture is less than a curvature threshold value, the texture feature of the controlled drug is determined as crystal-like; An index of the controlled drug is determined according to the texture feature and the color feature, and a search area in a cloud database is determined according to the index.

4. The method of claim 2, wherein the method further comprises: The feature sequence intersection is taken as an accurate search direction to obtain a matching result, and the method further comprises: If the feature sequence intersection is taken as the accurate search direction, no matching result is obtained; The image data and the spectral image are saved to a detection library in the cloud database, so that the controlled drug is subjected to component analysis and detection to obtain an analysis result; The analysis result is sent to the drug database for database updating.

5. A controlled drug information query system, characterized in that, The system comprises an image data acquisition module, a spectral image acquisition module, a fuzzy search module, a first accurate search module and a data sending module: The image data acquisition module is configured to acquire image data of a controlled drug, and determine a search area in a cloud database according to the image data; The spectral image acquisition module is configured to 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; the target feature set comprises a peak position, a peak intensity and a peak interval; The fuzzy search module is configured 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 target feature sequences in the feature sequence set in one-to-one manner; The first accurate search module is configured to calculate the similarity of each feature sequence in the feature sequence set to obtain a feature sequence intersection, and take the feature sequence intersection as an accurate search direction to obtain a matching result; The data sending module is configured to send the matching result to the detection device; The accurate search module comprises an undirected graph establishment module and a similarity calculation module: The undirected graph establishment module is configured to construct an undirected graph, generate nodes according to the feature sequences in the feature sequence set, and connect the nodes; The similarity calculation module is configured to calculate the edge similarity between the nodes, and if the edge similarity is greater than a similarity threshold value, the edge is reserved to obtain the feature sequence intersection; The similarity calculation formula is: F = αS1 + βS2 + γS3 wherein, F is the similarity, S1 is the peak position in the target feature set, S2 is the peak intensity in the target feature set, and S3 is the peak interval in the target feature set; S1 further comprises feature vectors a1 and b1, S2 further comprises feature vectors a2 and c1, and S3 further comprises feature vectors c2 and b2; the feature vector a is the peak intensity, the feature vector b is the peak interval, the feature vector c is the peak position, α, β and γ are proportional constants, α + β + γ = 1, and α, β and γ are not zero.

6. The system according to claim 5, wherein The system further comprises a data preprocessing module, a data classification module and a first data updating module: The data preprocessing module is configured to periodically acquire drug information of the controlled medicine 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 use data, and drug spectral images. The data classification module is configured to convert the drug spectral images in the preprocessing update package to obtain a feature set, and to perform data classification according to the feature set to obtain a data update package. The first data update module is configured to add the data update package to the cloud database to update the cloud database.

7. The system according to claim 5, wherein the system is characterized by: 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 region determination module. The image feature extraction module is configured to extract image features of the image data; the image features include texture features and color features. The binary conversion module is configured to convert the image data into a grayscale image through binary conversion, and to determine the texture features of the controlled medicine according to the pixel distribution in the grayscale image. The first judgment module is configured to determine the texture of the controlled medicine as powder-shaped if the pixel gradient in the grayscale image is less than a pixel threshold. The second judgment module is configured to determine the texture of the controlled medicine 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 a curvature threshold; the pixel texture is a line segment texture in the grayscale image. The third judgment module is configured to determine the texture features of the controlled medicine as crystal-shaped 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 region determination module is configured to determine the index of the controlled medicine according to the texture features and the color features, and to determine a search region in the cloud database according to the index.

8. The system according to claim 6, wherein The data sending module includes a second accurate search module, a data backup module, and a second data update module. The second accurate search module is configured to obtain no matching result if the feature sequence intersection is used as an accurate search direction. The data backup module is configured to save the image data and the spectral image to a detection library in the cloud database to perform component analysis and detection on the controlled medicine, and to obtain an analysis result. The second data update module is configured to send the analysis result to the drug database for database update.

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