Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, some embodiments of the present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. However, it will be appreciated by those of ordinary skill in the art that in the various embodiments of the present application, numerous technical details are set forth in order to provide a better understanding of the present application. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments.
The first embodiment of the application relates to a method for detecting the composition of a substance, which is used for detecting the composition of an unknown substance and is suitable for the situations of sharp peak shape and narrow peak width in a spectrum, such as Raman spectrum and Libs spectrum. The specific process is shown in fig. 1, and comprises the following steps:
step 101: and (3) disassembling the original spectral data of the substance to be detected according to different disassembling modes to obtain a sub-spectrum set, wherein the sub-spectrum set comprises sub-spectrum data obtained by each disassembling mode.
Specifically, raw spectral data of the substance to be detected is obtained by a spectrometer, wherein the spectrometer can be a raman spectrometer or a Libs spectrometer. Of course, it should be noted that, before the original spectral data of the substance to be detected is disassembled, the original spectral data may be analyzed and detected by the spectrometer, if the substance component corresponding to the original spectral data is detected by the spectrometer, the method for detecting the substance component is ended, and the detection result of the substance to be detected is displayed by the spectrometer; otherwise, the original spectral data is disassembled.
It is worth mentioning that the spectrometer determines the composition of the substance by matching it with standard spectral data of known samples stored in a database when detecting the composition of the substance.
In addition, it should be noted that the raw spectral data in this embodiment at least includes a spectrogram of the substance to be detected. Of course, the raw spectral data may also include other relevant parameters, which will not be specifically enumerated here.
In a specific implementation, the disassembling the original spectral data specifically includes: determining the number M of characteristic peaks contained in the original spectrum data, wherein M is a positive integer greater than 1; and combining the M characteristic peaks according to N different combination modes to obtain sub-spectrum data corresponding to each combination mode, wherein each sub-spectrum data at least comprises one characteristic peak, and N is an integer greater than 1.
Specifically, each characteristic peak in the original spectral data is read, so as to determine the number M of characteristic peaks included in the original spectral data. The different characteristic peaks are combined to correspond to the spectral data of different substances, for example, the original spectral data includes 5 characteristic peaks, which are X1, X2, X3, X4 and X5, assuming that the spectral data formed by two characteristic peaks X1 and X3 corresponds to the spectral data of substance 1, and the spectral data formed by three characteristic peaks X2+ X4+ X5 corresponds to the spectral data of substance 2. Thus, combining different characteristic peaks may result in different sub-spectral data. In this embodiment, the sub-spectrum data corresponding to each combination method may be obtained by removing the characteristic peaks and combining the remaining characteristic peaks. For example, the original spectral data includes 3 characteristic peaks, which are X1, X2, and X3, and if N is 3, and a de-characterization peak mode is adopted, then X2+ X3 combination is obtained to form corresponding sub-spectral data, X3+ X1 combination is obtained to form corresponding sub-spectral data, and X1+ X2 combination is obtained to form corresponding sub-spectral data, and at this time, the obtained sub-spectral set is { X2+ X3, X3+ X1, X1+ X2 }. Of course, in this embodiment, the value of N may be the number of all possible combinations.
It should be noted that, in this embodiment, the sub-spectrum data obtained by the N combination methods are combined into one sub-spectrum set, that is, the original spectrum data is decomposed to obtain one sub-spectrum set.
Step 102: and respectively matching the sub-spectrum data contained in the sub-spectrum set with the standard spectrum data of the known sample in the database to obtain a matching result set corresponding to the sub-spectrum set, wherein the matching result set comprises the matching result of each successfully matched sub-spectrum data in the sub-spectrum set.
Specifically, the sub-spectrum set comprises a plurality of sub-spectrum data, and each sub-spectrum data is matched one by one, wherein the process of matching one sub-spectrum data with the standard spectrum data of the known sample in the database comprises the following steps: matching the sub-spectrum data with standard spectrum data of a known sample in a database, if the sub-spectrum data is successfully matched with the standard spectrum data, recording the successful matching in the matching result of the sub-spectrum data, and recording the identification of the known sample successfully matched with the sub-spectrum data; and if the sub-spectrum data fails to be matched with the standard spectrum data of the known sample in the database, recording the matching failure in the matching result of the sub-spectrum data, and putting the matching result of each successfully matched sub-spectrum data into the matching result set corresponding to the sub-spectrum set.
It should be noted that the matching result of each successfully matched sub-spectrum data includes the identifier of the known sample successfully matched with the sub-spectrum data, but other data included in the matching result of each successfully matched sub-spectrum data is not limited and may be set according to actual situations.
In addition, the sub-spectrum data which fails to be matched may not record the matching result, and the application does not limit this.
Step 103: and determining the detection result of the substance component to be detected according to the matching result set.
In one specific implementation, whether the matching result set is empty or not is judged, and if the matching result set is empty, it is determined that the composition of the substance to be detected is not detected; and if not, determining each mother set and the respective subsets of each mother set according to the identifiers of the known samples contained in the matching result set, deleting the subsets of each mother set, and taking the identifiers of the known samples contained in the reserved mother sets as the identifiers of the composition components of the substances to be detected, wherein the mother sets contain the identifiers of all the known samples in the subsets.
Specifically, according to the matching result set, the detection results of the substance component to be detected can be obtained in N disassembling modes. If the matching result set is empty, which indicates that each sub-spectrum data obtained in each of the decomposition modes cannot be identified, it can be determined that the composition of the detection substance is not detected. And if the matching solution result set is not empty, analyzing according to the matching result set. The process of this analysis will be described in detail below:
it can be understood that the matching result set includes a matching result of each successfully matched sub-spectrum data in the corresponding sub-spectrum set, a known sample identifier included in each matching result in the matching result set is obtained, each matching result is judged, whether the identifier of the known sample included in the current matching result includes all known sample identifiers included in other matching results is judged, if yes, the current matching result is judged to be a parent set, and the matching result to which the known sample identifier included in the parent set belongs is judged to be the subset. And after each mother set and the respective subsets of each mother set are determined, deleting the subsets of each mother set, reserving each mother set, and taking the identification of the known sample contained in the mother set as the identification of the composition component of the substance to be detected. The following examples will illustrate in detail:
for example, assume that there are 3 matching results in the matching result set, which are respectively a matching result a (substance 1), a matching result B (substance 1+ substance 2), and a matching result C (substance 1+ substance 2+ substance 3), the identifier of the known sample included in each matching result is obtained, and the matching results A, B and C are respectively determined, where the substance 1+ substance 2+ substance 3 in the matching result C includes the identifiers of all the known samples in the matching result a and the matching result B, so that the matching result C is determined to be the mother set, the matching results a and B are subsets of the matching result C, the matching results a and B are deleted, and the matching result C is retained. Then substance 1+ substance 2+ substance 3 is the identity of the constituent component of the substance to be detected.
After the detection result of the component to be detected is determined, the detection result may be output. In one particular implementation, the identity of the known samples contained in each parent set is displayed.
It will be appreciated that the constituents of the substance to be detected may be the identity and unidentified substances of known samples contained in a master set. When the detection result is displayed, the identification of the known sample and the unidentified identification contained in each of the reserved mother sets may be displayed in a bar, for example, assuming that 2 mother sets are reserved, the mother set a (substance 1+ substance 3), the mother set B (substance 5), and the unidentified identification as "unidentified substance" are respectively reserved. Then the following is shown:
(a) substance 1+ substance 3+ unidentified substance;
(b) substance 5+ unidentified substance;
of course, other display means may be used to display the identity of the known sample contained in the retained mother set.
In addition, in order to obtain more effective information for the user, the identification of the known samples contained in each parent set and the unidentified spectral data corresponding to the parent set can be displayed. Specifically, the original spectral data is disassembled to obtain each sub-spectral data, and each mother set is the sub-spectral data successfully matched with the standard spectral data, so that each mother set has corresponding unidentified spectral data. For example, the original spectral data includes five characteristic peaks X1, X2, X3, X4 and X5, the retained parent set a is (substance 1+ substance 3), the parent set B is (substance 5), and if the characteristic peak in the spectral data of the substance 1+ substance 3 is (X1+ X2+ X3) and the characteristic peak in the spectral data of the substance 5 is (X2+ X3+ X5), the characteristic peak in the unidentified spectral data corresponding to the parent set a is (X4+ X5), and the characteristic peak in the unidentified spectral data corresponding to the parent set B is (X1+ X4).
In this embodiment, the identifier included in each parent set and the unidentified spectrum data corresponding to the parent set may also be displayed in a manner of bar display, and of course, because the unidentified spectrum data is, the unidentified spectrum data may be directly displayed during display.
It should be noted that, in this embodiment, if it is determined that the composition of the substance to be detected is not detected, the possible reason may be that the substance to be detected is a single molecule, and the database does not store the standard spectrum data corresponding to the substance to be detected. Possible reasons may also be: the substance is a mixture, but standard spectral data corresponding to each component in the mixture is not stored in the database. Of course, there is also a possibility: that is, the substance to be detected is a mixture, but two or more substances in the components of the substance to be detected have peaks with completely consistent peak position abscissas, or peaks from two or more substances at certain positions are superposed to form a characteristic peak which cannot be normally separated, so that the residual characteristic peak position after the characteristic peak is removed cannot represent correct spectral data (the reason is that the probability in the Libs spectrum is 0).
Compared with the prior art, in the process of detecting the substance components, the original spectrum data of the substance to be detected are disassembled in different disassembling modes to obtain a sub-spectrum set, and the sub-spectrum set comprises the sub-spectrum data obtained in each disassembling mode, so that the original spectrum data are refined, and the matching result can be accurately obtained when the original spectrum data are matched; for an unknown substance, due to the fact that multiple disassembling modes exist, sub-spectrum data obtained by each disassembling mode are subjected to matching analysis, so that a user can obtain multiple effective component analysis results from detection results, and accuracy of component analysis of the substance to be detected is improved.
A second embodiment of the present application relates to a method for detecting a substance component, and is substantially the same as the first embodiment, and mainly differs therefrom in that this embodiment specifically describes an implementation manner in which M characteristic peaks are combined in N different combination manners to obtain sub-spectrum data corresponding to each combination manner.
Specifically, in this embodiment, N is the number of combination modes including all the possibilities. That is, in this embodiment, N is the number of all possible combinations obtained by disassembling the original spectral data.
It is understood that the original spectral data is decomposed according to the principle of de-characterizing the number of peaks in the present embodiment. That is, each time of the disassembly, all possible combination modes of the remaining characteristic wave crests are obtained after the preset number of characteristic wave crests are removed. The specific flow is shown in fig. 2.
Step 201: the number i of the de-characterized peaks is set as an initial value 1.
Step 202: and selecting M-i characteristic wave peaks from the M characteristic wave peaks according to all possible modes to obtain C (M, M-i) sub-spectrum data, wherein C (M, M-i) is a combination number formula.
It is understood that the combination is denoted by the symbol "C" in the mathematics, and the combination number may be denoted by "C (M, M-i)" in the present embodiment, and for the convenience of understanding, the step 202 will be described in the following with a detailed example.
For example, as shown in fig. 3, the number M of characteristic peaks of a substance to be detected is 6, and X1 to X6 respectively represent 6 characteristic peaks, where the number i of the characteristic peaks is 1, then 5 characteristic peaks are selected from the 6 characteristic peaks, at this time, the selected 5 characteristic peaks are combined in all possible combination manners to obtain sub-spectrum data corresponding to all possible manners when i is 1, and it can be known by using a mathematical combination formula that when i is 1, the number of all possible sub-spectrum data obtained is C (M, M-i), that is, C (6, 5), and the specific sub-spectrum data respectively is: (X2+ X3+ X4+ X5+ X6) (X1+ X3+ X4+ X5+ X6), (X1+ X2+ X4+ X5+ X6), (X1+ X2+ X4+ X5+ X6), (X1+ X2+ X3+ X5+ X6) (X1+ X2+ X3+ X4+ X6), (X1+ X2+ X3+ X4+ X5).
Step 203: and updating the number i of the de-characterized peaks to be i + 1.
It can be understood that after i characteristic peaks are removed to obtain all possible sub-spectrum data, the number of the de-characteristic peaks is updated, and the number of the de-characteristic peaks is updated to i + 1. For example, initial i is 1, and updated i is 2.
Step 204: and judging whether i is smaller than M, if so, executing the step 202, otherwise, executing the step 205.
Specifically, since the number of de-characterized peaks cannot be increased randomly and cannot be equal to or greater than the number M of the characteristic peaks, it is determined whether the updated i is less than M, if so, step 202 is performed, otherwise, step 205 is performed.
Step 205: determining to obtain sub-spectrum data containing all the possibilities.
Specifically, when i ═ M, no characteristic peaks can be combined, and it can be determined that all possibilities of sub-spectrum data have been obtained at this time.
It should be noted that the sub-spectrum data determined to contain all the possibilities are put into the same sub-spectrum set.
Compared with the prior art, the method for detecting the substance components provided by the embodiment exhaustively disassembles all possible sub-spectrum data obtained after the original spectrum data through the number of the characteristic wave crests, refines the original spectrum data to the greatest extent, and further ensures the accuracy of analysis of the substance to be detected.
A third embodiment of the present application relates to a substance component detection apparatus 40 including: a disassembling module 401, a matching module 402 and a detection result determining module 403, which are shown in fig. 4.
The disassembling module 401 is configured to disassemble the original spectral data of the substance to be detected according to different disassembling manners to obtain sub-spectral data, where the sub-spectral data obtained by each disassembling manner is included in the sub-spectral set.
A matching module 402, configured to match the sub-spectrum data included in each sub-spectrum set with the standard spectrum data of a known sample in the database, respectively, to obtain a matching result set corresponding to the sub-spectrum set, where the matching result set includes a matching result of each successfully matched sub-spectrum data in the sub-spectrum set.
A detection result determining module 403, configured to determine a detection result of the substance component to be detected according to the matching result set.
The substance component detection device 40 further includes: a display module 404, the display module 404 is configured to display the identifier of the known sample contained in each parent set after determining the detection result of the substance component to be detected.
The present embodiment is a virtual device embodiment corresponding to the method for detecting a substance component, and the technical details in the method embodiment are still applicable in the present embodiment, and are not described herein again.
It should be noted that the above-mentioned embodiments of the apparatus are merely illustrative, and do not limit the scope of the present application, and in practical applications, a person skilled in the art may select some or all of the modules to achieve the purpose of the embodiments according to actual needs, and the present invention is not limited herein.
A fourth embodiment of the present application relates to an electronic apparatus 50, the structure of which is shown in fig. 5. The method comprises the following steps: at least one processor 501; and a memory 502 communicatively coupled to the at least one processor 501. The memory 502 stores instructions executable by the at least one processor 501. The instructions are executable by the at least one processor 501 to enable the at least one processor 501 to perform the method of detecting a composition of matter as described above.
The memory 502 and the processor 501 are connected by a bus, which may include any number of interconnected buses and bridges that link one or more of the various circuits of the processor 501 and the memory 502 together. The bus may also link various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 501 is transmitted over a wireless medium through an antenna, which further receives the data and transmits the data to the processor 501.
The processor 501 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And memory 502 may be used to store data used by the processor in performing operations.
It should be noted that, the processor in this embodiment can execute the implementation steps in the foregoing method embodiments, and specific execution functions are not described in detail, which refer to technical details in the method embodiments and are not described herein again.
A fifth embodiment of the present application relates to a computer-readable storage medium, which is a computer-readable storage medium having computer instructions stored therein, the computer instructions enabling a computer to execute the method for shot detection as described in the first or second method embodiment of the present application.
It should be noted that, as can be understood by those skilled in the art, the display method in the foregoing embodiments is implemented by instructing, by a program, related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random-Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the present application, and that various changes in form and details may be made therein without departing from the spirit and scope of the present application in practice.