Raman spectrum identification method and device, electronic equipment, medium and program product

By extracting and matching the peak information of the Raman spectrum, the packaging interference is removed, and the problem of interference in packaging materials in liquid Raman spectrum analysis is solved, improving the accuracy of the analysis results.

CN119901720AInactive Publication Date: 2025-04-29江苏鉴知技术有限公司
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410718579.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2025-04-29
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In liquid Raman spectroscopy, packaging materials may interfere with the signal or absorb laser energy, affecting the accuracy of the analysis results.

Method used

By obtaining the first Raman spectrum of the subject to be tested, its first peak information is extracted, and matching it with the second peak information of multiple packaging spectrums in the packaging database, the most matching reference packaging spectrum is determined, and then the second Raman spectrum is obtained to accurately identify the sample.

Benefits of technology

Effectively removes packaging interference, improves the accuracy and reliability of Raman spectral recognition, and ensures the accuracy of analysis results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119901720A_ABST
    Figure CN119901720A_ABST
Patent Text Reader

Abstract

The invention discloses a Raman spectrum identification method and device, electronic equipment, a medium and a program product. The method comprises the following steps: acquiring a first Raman spectrum acquired when a detected object is subjected to Raman spectrum detection, wherein the detected object is packaged in a packaging container; extracting first peak information of the first Raman spectrum; matching the first peak information with second peak information of a plurality of packaging spectrums in a packaging database to obtain a matching degree between the first Raman spectrum and each packaging spectrum; determining the packaging spectrum corresponding to the maximum matching degree in the plurality of matching degrees as a reference packaging spectrum of the measured object; removing the reference packaging spectrum from the first Raman spectrum to obtain a second Raman spectrum; and identifying whether a standard Raman spectrum matched with the second Raman spectrum exists in the sample database or not. According to the embodiment of the invention, the problem of packaging interference in the liquid Raman spectrum identification process can be effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of Raman spectrum processing, and in particular relates to a Raman spectrum recognition method, device, electronic equipment, medium and program product. Background Art

[0002] Raman spectroscopy is a technique used to analyze materials, determining their molecular structure and chemical composition by measuring the frequency changes in light scattered when the material interacts with laser light. Raman spectroscopy is used in many fields, including chemistry, materials science, biological sciences, and drug discovery.

[0003] In liquid analysis, Raman spectroscopy can be used to determine the composition, concentration, and structure of liquid samples. By illuminating a liquid sample with laser light and measuring the frequency changes in the scattered light, a Raman spectrum corresponding to the chemical bond vibrations of the liquid sample can be obtained. This can provide detailed chemical information about the liquid sample, such as molecular structure, functional groups, and chemical bond strength and length.

[0004] Liquids often require packaging for storage and transportation to protect them from the external environment. Therefore, Raman spectroscopy of liquids typically involves passing laser light through the container to interact with the liquid sample. Therefore, Raman spectroscopy analysis of liquid samples often requires inspection through the packaging. However, some packaging materials themselves may interfere with the Raman spectroscopy signal or absorb laser energy, affecting the accuracy of the analysis results. Summary of the Invention

[0005] The embodiments of the present invention provide a Raman spectrum identification method, device, electronic device, medium and program product, which can effectively solve the problem of packaging interference in the Raman identification process of liquids.

[0006] In a first aspect, an embodiment of the present application provides a Raman spectrum recognition method, the method comprising:

[0007] Acquiring a first Raman spectrum collected when performing Raman spectrum detection on a test object, where the test object is packaged in a packaging container;

[0008] extracting first peak information of the first Raman spectrum;

[0009] Matching the first peak information with the second peak information of multiple package spectra in the package database to obtain the matching degree between the first Raman spectrum and each package spectrum;

[0010] Determine a package spectrum corresponding to a maximum matching degree among a plurality of matching degrees as a reference package spectrum of the object to be measured;

[0011] removing the reference package spectrum from the first Raman spectrum to obtain a second Raman spectrum;

[0012] Identify whether there is a standard Raman spectrum matching the second Raman spectrum in the sample database.

[0013] As a possible implementation method, the first peak information is matched with multiple package spectra in the package database to obtain a matching degree for characterizing the first Raman spectrum and each package spectrum, including:

[0014] For each package spectrum, the following operations are iteratively performed until all package spectra are completed, and the matching degree between the first Raman spectrum and each package spectrum is obtained:

[0015] For each first Raman peak in the first Raman spectrum and each second Raman peak in the current package spectrum, iteratively perform the following operations A1 to A2 until all first Raman peaks and all second Raman peaks are executed;

[0016] A1: Calculate the peak position difference between the current first Raman peak and the current second Raman peak respectively;

[0017] A2: When the peak position difference is less than the preset peak position offset threshold, the matching degree in the current iteration is calculated based on the peak height of the current second Raman peak and the matching degree in the previous iteration.

[0018] As a possible implementation method, the matching degree in the current iteration process is calculated based on the peak height of the current second Raman peak and the matching degree in the previous iteration process, including:

[0019] Determine the weight coefficient of the current second Raman peak;

[0020] determining a current peak position matching degree between the current second Raman peak and the current first Raman peak according to the weight coefficient of the current second Raman peak and the peak height of the current second Raman peak;

[0021] The matching degree of the current peak position is added to the matching degree of the previous iteration to obtain the matching degree of the current iteration.

[0022] As a possible implementation method, determining the weight coefficient of the current second Raman peak includes:

[0023] The weight coefficient of the current second Raman peak is calculated according to the peak position difference between the current first Raman peak and the current second Raman peak, and a preset peak position shift threshold.

[0024] As a possible implementation manner, before determining the package spectrum corresponding to the maximum matching degree among the multiple matching degrees as the reference package spectrum of the object to be measured, the method further includes:

[0025] determining whether a maximum matching degree among the plurality of matching degrees is greater than a preset matching degree;

[0026] Determining a package spectrum corresponding to a maximum matching degree among a plurality of matching degrees as a reference package spectrum of the object to be measured includes:

[0027] When it is determined that the maximum matching degree among the multiple matching degrees is greater than the preset matching degree, the package spectrum corresponding to the maximum matching degree is determined as the reference package spectrum of the object to be measured.

[0028] As a possible implementation, after matching the first peak information with a plurality of package spectra in the package database to obtain a degree of matching for characterizing the first Raman spectrum with each package spectrum, the method further includes:

[0029] For each package spectrum, perform the following operations B1 to B2 respectively until all package spectra in the package database are completed:

[0030] B1: determining a target total peak height of the current package spectrum according to the intensities of the respective Raman peaks of the current package spectrum, wherein the target total peak height is the sum of the intensities of the second Raman peaks in the current package spectrum whose intensities are greater than the first preset intensity;

[0031] B2: normalizing the matching degree of the current packaging container according to the target total peak height of the current packaging container to obtain a normalized matching degree result;

[0032] Determining a package spectrum corresponding to a maximum matching degree among a plurality of matching degrees as a reference package spectrum of the object to be measured includes:

[0033] determining a maximum matching degree according to normalized results of multiple matching degrees;

[0034] The package spectrum corresponding to the maximum matching degree is determined as the reference package spectrum of the object under test.

[0035] As a possible implementation manner, removing the reference package spectrum from the first Raman spectrum to obtain the second Raman spectrum includes:

[0036] constructing a first array based on first peak heights corresponding to respective peak positions of a plurality of first Raman peaks of the first Raman spectrum;

[0037] constructing a second array based on second peak heights corresponding to respective peak positions of a plurality of second Raman peaks of the reference package spectrum;

[0038] Obtain a third array based on the difference between each element in the first array and the second array;

[0039] A second Raman spectrum is constructed according to the corresponding position and element value of each element in the third array.

[0040] As a possible implementation manner, before obtaining the third array according to the difference between each element in the first array and the second array, the method further includes:

[0041] Normalizing the second array according to the strongest first peak in the reference package spectrum to obtain a normalized second array;

[0042] Normalizing the first array according to a second peak value in the first array to obtain a normalized first array, wherein the second peak value is a peak value of a first Raman peak that matches a position of the first peak value;

[0043] A third array is obtained according to the difference between each element in the first array and the second array, including:

[0044] Constructing a target expression according to the normalized first array, the normalized second array, the second array, the target coefficient, and a preset penalty factor;

[0045] Find the target coefficient when the target expression reaches the minimum;

[0046] The third array is obtained based on the difference between the first array and the product of the second array and the target coefficient. As a possible implementation, the target expression is:

[0047] ‖A′WAx-B′WA‖

[0048] Wherein, x is the target coefficient, A is the second array, A′ is the normalized second array, B′ is the normalized first array, and W is a preset penalty factor. When B′ is less than A, W is 1-σ; when B′ is not less than A, W is σ; where σ∈(0, 0.1].

[0049] On the other hand, the present application provides a Raman spectrum identification device, the device comprising:

[0050] an acquisition module, configured to acquire a first Raman spectrum collected when performing Raman spectrum detection on a test object, the test object being packaged in a packaging container;

[0051] An extraction module, configured to extract first peak information of a first Raman spectrum;

[0052] a matching module, configured to match the first peak information with the second peak information of a plurality of package spectra in the package database, respectively, to obtain a matching degree between the first Raman spectrum and each package spectrum;

[0053] A first determining module is configured to determine a package spectrum corresponding to a maximum matching degree among a plurality of matching degrees as a reference package spectrum of the object to be measured;

[0054] a removal module, configured to remove the reference package spectrum from the first Raman spectrum to obtain a second Raman spectrum;

[0055] The identification module is used to identify whether there is a standard Raman spectrum matching the second Raman spectrum in the sample database.

[0056] In another aspect, the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions;

[0057] When the processor executes the computer program instructions, it implements the Raman spectrum identification method as described in any one of the first aspects.

[0058] On the other hand, the present application provides a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the Raman spectrum identification method according to any one of the first aspects is implemented.

[0059] On the other hand, the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the Raman spectrum identification method as described in any one of the first aspects.

[0060] The Raman spectrum identification method, device, electronic device, medium and program product of the embodiments of the present application pre-create a packaging database containing multiple packaging spectra, and are able to extract the first peak information of the first Raman spectrum and multiple packaging spectra after obtaining the first Raman spectrum of the object to be measured, and then match the first peak information and multiple second peak information one by one to obtain the reference packaging spectrum in the packaging database that has the highest matching degree with the first Raman spectrum of the object to be measured, thereby realizing the identification of the packaging container packaged outside the object to be measured. After that, the identified reference packaging spectrum can be removed from the first Raman spectrum to obtain a second Raman spectrum that can accurately characterize the object to be measured. Then, the second Raman spectrum with the packaging interference removed is identified to obtain a more accurate analysis result. The solution of the present application can effectively improve the accuracy and reliability of spectral identification, and help solve the problem of interference of packaging containers on Raman spectrum identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0062] Figure 1 This is a flow chart of a Raman spectrum identification method provided by one embodiment of the present application;

[0063] Figure 2This is a flowchart of a specific implementation method of S103 provided in an embodiment of the present application;

[0064] Figure 3 This is a flowchart of a specific implementation method of S201b provided in an embodiment of the present application;

[0065] Figure 4 is a flow chart of a Raman spectrum identification method provided by another embodiment of the present application;

[0066] Figure 5 This is a flowchart of a specific implementation method of S105 provided in an embodiment of the present application;

[0067] Figure 6 A flowchart of another specific implementation of S105 provided in an embodiment of the present application;

[0068] Figure 7 This is a schematic structural diagram of a Raman spectrum identification device provided by one embodiment of the present application;

[0069] Figure 8 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0070] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is merely to provide a better understanding of the present application by illustrating the examples of the present application.

[0071] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0072] Raman spectroscopy is a type of molecular vibrational spectroscopy that detects and identifies an object by measuring the Raman spectrum generated by the Raman scattering effect of excitation light on the object. Because Raman spectroscopy has the fingerprint characteristics of molecules, it is widely used in liquid security inspection, drug detection, pharmaceutical testing, and pesticide residue detection.

[0073] When analyzing and processing Raman spectra, it is often necessary to evaluate the Raman spectrum of the object to be tested with the standard spectrum. Commonly used methods include correlation coefficient, Highest Quality Index (HQI), cosine similarity, etc. However, when performing Raman spectroscopy detection on liquids, in order to protect the object to be tested from the influence of the external environment during transportation, it is usually necessary to package the object to be tested in a packaging container. Therefore, even if the laser is focused on the liquid to be tested, the unconverged laser will excite the Raman spectrum of the packaging container itself and be received by the detector. Therefore, the Raman spectrum received by the detector contains both the spectrum of the liquid to be tested and the spectrum of the packaging container. When performing Raman spectroscopy detection, there may be problems with packaging interference, and directly comparing the detection spectrum with the standard spectrum may result in a low recognition rate.

[0074] In order to effectively solve the problem of packaging interference during the Raman identification process of liquids, the embodiments of the present application provide a Raman spectrum identification method, device, electronic device, medium and program product. The Raman spectrum identification method provided by the embodiments of the present application is first introduced below.

[0075] Figure 1 FIG. 1 is a flow chart of a Raman spectrum identification method 100 provided in one embodiment of the present application. Figure 1 As shown, the method may include the following steps: S101 to S106.

[0076] S101 , obtaining a first Raman spectrum collected when performing Raman spectrum detection on a test object, where the test object is packaged in a packaging container.

[0077] The object to be measured refers to the sample or substance being tested by Raman spectroscopy. In a specific implementation scenario, the object to be measured is a liquid packaged in a packaging container. By way of example, the packaging container can be a bottle, pipe, or tank used to hold the object to be measured; it can also be a lid, stopper, or sealing film used to seal the container to prevent leakage or external contamination of the object to be measured. The first Raman spectrum can provide information about the molecular structure and chemical composition of the object to be measured and the packaging container. By analyzing the first Raman spectrum, the composition, purity, and composition of the object to be measured and the packaging container can be determined.

[0078] S102, extracting first peak information of the first Raman spectrum.

[0079] The first peak information may generally include:

[0080] Peak position: the wavenumber position of the Raman peak, that is, the position where each Raman peak in the first Raman spectrum appears in the first Raman spectrum.

[0081] Peak intensity: The scattering intensity of the Raman peak, which reflects the relative intensity of the Raman peak or the vibration intensity of the Raman peak.

[0082] Peak shape: The shape characteristics of the Raman peak, such as the width and symmetry of the Raman peak.

[0083] Peak width: The half-maximum width of a Raman peak.

[0084] In a preferred embodiment, before extracting the first peak information, the raw data of the first Raman spectrum can be pre-processed by filtering, baseline removal, normalization, and other operations. Specifically, filtering generally refers to using a digital filter to smooth the raw data to remove noise and stray signals. Baseline removal refers to removing the background signal in the spectrum by fitting and subtracting the baseline signal to effectively highlight the peaks and features in the spectrum. Normalization is to normalize the raw data so that the spectral intensities between different samples are comparable. These pre-processing operations can improve the quality and reliability of the first Raman spectrum data, making subsequent analysis and interpretation more accurate and reliable.

[0085] S103 , matching the first peak information with the second peak information of multiple package spectra in the package database to obtain a matching degree between the first Raman spectrum and each package spectrum.

[0086] The packaging database, which includes multiple packaging spectra, refers to a collection of spectral data stored and managed for multiple packaging containers. For example, the packaging spectra in the packaging database can be acquired using a spectrometer or other spectral acquisition device. This spectral data can include optical signal intensities or spectral characteristics measured across different wavelength ranges.

[0087] It's worth noting that the second peak information is essentially the same as the first peak information in S102 above, but is measured and recorded for different circumstances. The second peak information represents the package spectrum, while the first peak information represents the actual first Raman spectrum detected for the measured object. Therefore, the specific content of the second peak information will not be described in detail here.

[0088] In one embodiment, when matching first peak information with multiple package spectra in a package database, the similarity between the first peak information and multiple second peak information is compared to find the second peak information most similar to the first peak information, thereby determining which package spectrum best matches the first peak information. The matching degree is used to characterize the similarity between the first and second peak information, and can be used as an indicator to measure the degree of difference between the two peak information, thereby determining the degree of match between the two.

[0089] S104 , determining a package spectrum corresponding to a maximum matching degree among a plurality of matching degrees as a reference package spectrum of the object to be measured.

[0090] For example, the degree of match can be evaluated by comparing the shape, position, and intensity of the peaks in two peak information sets to determine their similarity. Accordingly, a maximum degree of match indicates the smallest difference between the two peak information sets. Therefore, the second peak information set with the smallest difference from the first peak information set can be considered the peak information set for the package spectrum of the object being measured.

[0091] S105 , removing the reference package spectrum from the first Raman spectrum to obtain a second Raman spectrum.

[0092] Different signals have different positions in the spectrum, that is, they have different positions in frequency or wavelength. By filtering or removing the reference package spectrum signal in the first Raman spectrum, the second Raman spectrum only shows the corresponding signal of the object being measured.

[0093] S106 , identifying whether there is a standard Raman spectrum matching the second Raman spectrum in the sample database.

[0094] The sample database is a collection of spectral data stored for multiple samples. Each sample has its own corresponding spectral data. The purpose of the sample database is to provide a reference for comparison and matching of unknown samples with known samples in the database. Standard Raman spectra are Raman spectra of known substances. These spectral data have been verified and recorded and can be used as a reference to identify compounds or substances in unknown samples.

[0095] In some embodiments, when performing spectrum recognition or matching, techniques such as correlation analysis and spectrum matching algorithms are used to perform spectrum matching.

[0096] The embodiment of the present application pre-creates a packaging database containing multiple packaging spectra. After obtaining the first Raman spectrum of the object to be measured, the first peak information of the first Raman spectrum and the multiple packaging spectra can be extracted, and then the first peak information and the multiple second peak information are matched one by one to obtain the reference packaging spectrum in the packaging database that has the highest matching degree with the first Raman spectrum of the object to be measured, thereby realizing the identification of the packaging container packaged outside the object to be measured. After that, the identified reference packaging spectrum can be removed from the first Raman spectrum to obtain a second Raman spectrum that can accurately characterize the object to be measured. Then, the second Raman spectrum with the packaging interference removed is identified to obtain a more accurate analysis result. The solution of the present application can effectively improve the accuracy and reliability of spectral recognition, and help solve the problem of interference of packaging containers on Raman spectrum recognition.

[0097] In order to accurately evaluate the matching degree between the first Raman spectrum and the spectra of different packages, the present application also provides an optional implementation of S103. Figure 2 As shown, S103 may include the following steps: S103a to S103k.

[0098] S103a, calculating a peak position difference between a current first Raman peak in the first Raman spectrum and a current second Raman peak in the current packaging spectrum.

[0099] S103b, determine whether the peak difference is less than a preset peak offset threshold, and obtain a first judgment result. If the first judgment result is yes, proceed to S103c for execution; if the first judgment result is no, proceed to S103d for execution.

[0100] S103c, calculating the matching degree in the current iteration process according to the peak height of the current second Raman peak and the matching degree in the previous iteration process.

[0101] S103d, determining whether the current first Raman peak is the last first Raman peak of the first Raman spectrum, and obtaining a second determination result. If the second determination result is negative, proceed to S103e for execution; if the second determination result is positive, proceed to S103f for execution.

[0102] S103e, updating the next first Raman peak in the first Raman spectrum as the current first Raman peak, updating the matching degree in the current iteration process as the matching degree in the previous iteration process, and returning to execute S103a.

[0103] S103f, determine whether the current second Raman peak is the last second Raman peak of the current package spectrum, and obtain a third judgment result. If the third judgment result is no, proceed to S103g for execution; if the third judgment result is yes, proceed to S103h for execution.

[0104] S103g: Update the next second Raman peak of the current package spectrum to the current second Raman peak, update the matching degree in the current iteration process to the matching degree in the previous iteration process, and return to execute S103a.

[0105] S103h: Determine the matching degree in the current iteration process as the matching degree between the first Raman spectrum and the current package spectrum, and proceed to S103i for execution.

[0106] S103i, determining whether the current package spectrum is the last package spectrum in the package database, and obtaining a fourth determination result. If the fourth determination result is negative, proceed to S103j for execution; if the fourth determination result is positive, execute S103k.

[0107] S103j, updating the next package spectrum to the current package spectrum, and returning to execute S103a.

[0108] S103k, obtaining a degree of matching between the first Raman spectrum and each package spectrum.

[0109] By using multiple package spectra for matching calculations, the characteristics and variations of different packaging containers can be considered, allowing for a more comprehensive assessment of the degree of matching between the first Raman spectrum and the spectra of different packages. Furthermore, by iteratively processing each first Raman peak and each second Raman peak, more detailed matching information can be obtained, enabling a more accurate assessment of the similarity between the first Raman spectrum and multiple package spectra.

[0110] In some embodiments, at S103a, the difference between the peak positions of the first and second Raman peaks to be compared is compared. Next, at S103b, if the peak positions of the two Raman peaks are less than a preset peak position offset threshold, this indicates a high degree of characteristic similarity between the two Raman peaks, meaning they originate from the same Raman peak or very similar Raman peaks. This also indicates that the current first Raman peak in the measured object closely matches the current second Raman peak in the package spectrum, allowing for a match calculation.

[0111] It's worth noting that during the iteration process, the calculated matching degree is only the result of the current iteration and does not represent the final matching degree. The final matching degree is obtained after the iteration is complete. Only the final matching degree obtained after the iteration is complete can accurately reflect the matching degree used to characterize the first Raman spectrum and the package spectrum.

[0112] In a specific implementation scenario, the first Raman spectrum peak information mPeakOri is matched with the package spectrum mPackage[k].mPeak in the package database to obtain the matching degree PackageScore. kCalculation. Here, the value range of k is from 1 to M, where M represents the number of packaging spectra in the current packaging database. In this implementation scenario, the value of M is 3, that is, there are three packaging spectra in the packaging database. Of course, this number is not fixed and is also applicable to other numbers.

[0113] 1: Calculate the matching degree between the first Raman spectral peak information mPeakOri and the first packaging spectral peak information mPackage[1].mPeak in the packaging database, which specifically includes 1.1 to 1.5.

[0114] 1.1: Match the m-th Raman peak in the first packaging spectral peak information mPackage[1].mPeak with the n-th Raman peak in the first Raman spectral peak information mPeakOri in sequence, where m = 0 and n = 0;

[0115] 1.2: Calculate the peak position difference between the m-th Raman peak of mPackage[1].mPeak and the n-th Raman peak of mPeakOri, and determine whether the peak position difference is less than the preset peak position offset threshold;

[0116] 1.3: When the peak position difference is less than the preset peak position offset threshold, calculate PackageScore1, otherwise n = 1;

[0117] 1.4: When n < mPeakOri.nNum, go to 1.2 for execution, where mPeakOri.nNum represents the number of the first Raman peaks of the first Raman spectrum;

[0118] When n = mPeakOri.nNum, m = 1, and go to 1.5.

[0119] 1.5: When m < mPackage[1].mPeak.nNum, go to 1.2 for execution, where mPackage[1].mPeak.nNum represents the number of the second Raman peaks of the first packaging spectrum;

[0120] When m = mPackage[1].mPeak.nNum, the current PackageScore1 is the matching degree between the first Raman spectral peak information mPeakOri and the first packaging spectral peak information mPackage[1].mPeak in the packaging database.

[0121] 2: Calculate the matching degree between the first Raman spectral peak information mPeakOri and the second packaging spectral peak information mPackage[2].mPeak in the packaging database.

[0122] 3: Calculate the matching degree between the first Raman spectrum peak information mPeakOri and the third package spectrum peak information mPackage[3].mPeak in the packaging database.

[0123] It should be emphasized here that the steps for calculating the matching degree between the second and third package spectrum peak information and the first Raman spectrum peak information are the same as those for the first package spectrum, and therefore will not be repeated.

[0124] In order to improve the accuracy of the matching degree, this application also provides an optional implementation method 300 of S103c. Figure 3 As shown, S103c may include the following steps: S103c1 to S103c3.

[0125] S103c1, determining the weight coefficient of the current second Raman peak.

[0126] The weight coefficient of the current second Raman peak refers to the relative importance or weight assigned to each second Raman peak when calculating the matching degree.

[0127] In some implementation scenarios, the weight coefficient of the Raman peak can be determined based on the characteristics, importance, or application requirements of the Raman peak. In other implementation scenarios, the weight coefficient of the Raman peak can be determined by learning the importance of the Raman peak from the data through data analysis or machine learning, and assigning a corresponding weight coefficient to the peak.

[0128] In order to further improve the accuracy of the current matching degree calculation, a corresponding weight coefficient may be determined according to the peak position difference between the current second Raman peak and the current first Raman peak, thereby achieving dynamic adjustment of the weight coefficient.

[0129] Specifically, in some embodiments, determining the weight coefficient of the current second Raman peak may be achieved by:

[0130] The weight coefficient of the current second Raman peak is calculated according to the peak position difference between the current first Raman peak and the current second Raman peak, and a preset peak position shift threshold.

[0131] As a specific example, the weight coefficient A of the current second Raman peak can be calculated by formula (1):

[0132]

[0133] In formula (1), mPackage[k].mPeak[i package ].fpos is the i-th spectrum of the k-th package in the package database package The peak positions of the Raman peaks, where i packageis a positive integer greater than or equal to 0, k = 0, 1, 2, ..., M-1, where M represents the number of package spectra in the current package database;

[0134] mPeakOri[i peak ].fpos is the i-th Raman spectrum of the object being measured peak The peak positions of the Raman peaks, where i peak is a positive integer greater than or equal to 0; fBiasPos is the preset peak position offset threshold.

[0135] S103c2, determining a current peak position matching degree between the current second Raman peak and the current first Raman peak according to the weight coefficient of the current second Raman peak and the peak height of the current second Raman peak.

[0136] Among them, peak height can provide information about the intensity or importance of Raman peaks. Weight coefficients can be used to adjust the contribution of different Raman peaks to the peak position matching degree. The weight coefficients can reflect the importance of certain Raman peaks to the matching degree. When calculating the peak position matching degree, both the peak position and peak height of the second Raman peak are taken into account, and the importance of the peak position difference is adjusted by the weight coefficient. This can more accurately assess the peak position matching degree between the current second Raman peak and the current first Raman peak, further improving the accuracy and applicability of the matching degree.

[0137] S103c3, adding the current peak position matching degree and the matching degree in the previous iteration process to obtain the matching degree in the current iteration process.

[0138] As a specific example, the matching degree PackageScore in the current iteration can be calculated by formula (2): k :

[0139] PackageScore a =PackageScore (a-1) +mPackage[k].mPeak[i package ].fHeight×A(2)

[0140] In formula (2), PackageScore a is the matching degree in the a-th iteration process;

[0141] PackageScore (a-1) is the matching degree during the (a-1)th iteration;

[0142] mPackage[k].mPeak[i package ].fHeight is the i-th spectrum of the k-th package in the package database packageThe peak height of the Raman peak; A is the i-th Raman peak of the k-th package spectrum in the packaging database. package The weight coefficient of each Raman peak.

[0143] In some embodiments, before the aforementioned S104, the aforementioned method may include:

[0144] It is determined whether a maximum matching degree among the plurality of matching degrees is greater than a preset matching degree.

[0145] Based on this, in some embodiments, the aforementioned S104 may specifically include:

[0146] When it is determined that the maximum matching degree among the multiple matching degrees is greater than the preset matching degree, the package spectrum corresponding to the maximum matching degree is determined as the reference package spectrum of the object to be measured.

[0147] The preset matching degree is a pre-set threshold used during spectral matching to determine whether the matching result meets preset requirements. In one implementation scenario, the preset matching degree can be determined based on actual needs and application scenarios and can be a fixed value derived from historical data or experience. By setting the preset matching degree, matching results that meet the requirements can be screened out, effectively improving the accuracy and reliability of the matching results and reducing the possibility of mismatches.

[0148] In order to improve the accuracy and reliability of the reference package spectrum data, the present application also provides an optional implementation method 400 of the Raman spectrum identification method. Figure 4 As shown, after the above S103, the above method may further include:

[0149] S401: determining a target total peak height of the current package spectrum according to the intensities of the second Raman peaks of the current package spectrum, wherein the target total peak height is the sum of the intensities of the second Raman peaks in the current package spectrum whose intensities are greater than a first preset intensity.

[0150] The first preset intensity is a baseline value, pre-set based on empirical data or multiple experimental results, used to determine whether the intensity of the second Raman peak meets the expected requirement. In specific implementation, the second Raman peaks in the current package spectrum are traversed to obtain their intensity values. The intensity value of each second Raman peak is compared with the first preset intensity value. If the intensity of the second Raman peak is greater than the first preset intensity, its intensity value is added to the calculation of the target total peak height. The intensity values ​​of all qualified Raman peaks are summed to obtain the target total peak height for the current packaging container.

[0151] S402: performing normalization processing on the matching degree of the current packaging container according to the target total peak height of the current packaging container to obtain a normalized result of the matching degree.

[0152] The normalized result of the matching degree can be obtained by calculating the matching degree of the current package spectrum and dividing it by the target total peak height in the current package spectrum. The value is used to measure the similarity between the current package spectrum and the package spectrum outside the measured object.

[0153] In some embodiments, the normalized result of the matching degree is a value between 0 and 1, indicating the degree of similarity between the positions of the Raman peaks in the two spectra. A closer normalized result of the matching degree is to 1, the more similar the positions of the Raman peaks in the two spectra are; a closer normalized result of the matching degree is to 0, the more different the positions of the Raman peaks in the two spectra are.

[0154] S403: Determine whether the current package spectrum is the last package spectrum in the package database, and obtain a fifth determination result.

[0155] If the result of the fifth judgment is negative, the process returns to step S401; if the result of the fifth judgment is positive, the process proceeds to step S104. Based on this, the aforementioned S104 may specifically include:

[0156] S1041: Determine the maximum matching degree according to the normalized results of the multiple matching degrees.

[0157] S1042: Determine the package spectrum corresponding to the maximum matching degree as the reference package spectrum of the object to be measured.

[0158] In some embodiments, normalization can convert the matching degrees of different package spectra into a unified scale factor, effectively eliminating scale differences between different package spectra and making the matching degrees of different package spectra comparable. By normalizing the matching degrees, embodiments of the present application can ensure that the spectral data of the reference packaging container is more accurate and reliable, thereby improving the accuracy of analysis and comparison.

[0159] In order to accurately remove the reference package spectrum of the object being measured, the present application also provides an optional implementation method 500 of S105. Figure 5 As shown, the aforementioned S105 may specifically include the following steps: S501 to S504.

[0160] S501 : Constructing a first array based on first peak heights corresponding to respective peak positions of a plurality of first Raman peaks of a first Raman spectrum.

[0161] The first array is an array consisting of first peak heights corresponding to respective peak positions of a plurality of first Raman peaks in the first Raman spectrum. Each element position in the first array corresponds to a different peak position, and each element in the first array represents a first peak height corresponding to the peak position of the first Raman peak.

[0162] S502 : Constructing a second array based on second peak heights corresponding to respective peak positions of a plurality of second Raman peaks of a reference package spectrum.

[0163] The second array is an array consisting of second peak heights corresponding to respective peak positions of a plurality of second Raman peaks in the reference package spectrum. Each element position in the second array corresponds to a different peak position, and each element in the second array represents a second peak height corresponding to the peak position of the second Raman peak.

[0164] S503: Obtain a third array according to the difference between each element in the first array and the second array.

[0165] S504 : Construct a second Raman spectrum according to the corresponding position and element value of each element in the third array.

[0166] The purpose of constructing the second Raman spectrum based on the corresponding position and element value of each element in the third array is to convert the difference information of the third array into a corresponding spectral signal. In specific implementation, the first and second arrays are traversed, and the element differences at corresponding element positions in the first and second arrays are calculated to obtain the third array. For each element position in the third array, it can be used as a peak position value, and the element value corresponding to each element position can be used as a peak height value. Using the third array to construct the second Raman spectrum can enhance the accuracy of the spectral data, thereby effectively improving the accuracy of the spectrum after removing the reference packaging, thereby further improving the accuracy of Raman spectral recognition.

[0167] In order to effectively identify interference signals and further improve the accuracy of Raman spectrum recognition, this application also provides another optional implementation method 600 of S105. Figure 6 As shown, before S503, the above method may include the following steps: S601-S602.

[0168] S601 , performing normalization processing on the second array according to the strongest first peak in the reference package spectrum to obtain a normalized second array.

[0169] S602 , normalizing the first array according to the second peak value in the first array to obtain a normalized first array, wherein the second peak value is a peak value of the first Raman peak that matches the position of the first peak value.

[0170] In some embodiments, the normalized result of the first array can be obtained by dividing the first array by the strong peak height. Normalization can simplify and make data processing and analysis more consistent. By normalizing the individual first peak heights to a uniform range, data processing and analysis can be facilitated, reducing the need for processing individual first peak heights.

[0171] Based on this, the aforementioned S503 may specifically include the following steps: S5031 to S5033.

[0172] S5031, constructing a target expression according to the normalized first array, the normalized second array, the second array, the target coefficient and the preset penalty factor.

[0173] In some embodiments, the target expression may be:

[0174] ‖A′WAx-B′WA‖

[0175] Where x is the target coefficient, A is the second array, A′ is the normalized second array, B′ is the normalized first array, and W is a preset penalty factor. When B′ is less than A, W is 1-σ; when B′ is not less than A, W is σ; where σ∈(0, 0.1].

[0176] In some embodiments, when the value of an element in the normalized first array is less than the value of the element at the corresponding position in the second array, the penalty factor is one value; when the value of an element in the first array is greater than or equal to the value of the element at the corresponding position in the second array, the penalty factor is another value. Dynamically determining the size of the penalty factor based on the value of each element at each position in the first and second arrays allows for better processing of spectral signals with varying Raman peak intensities, effectively identifying and processing interference and packaging signals, and thereby improving the accuracy of Raman spectral recognition.

[0177] S5032, find the target coefficient when the target expression reaches the minimum.

[0178] It is worth noting that the target coefficients of the second array corresponding to the minimum of the target expression can be calculated by gradient descent method and fitting algorithm (interpolation method, least squares method). In one embodiment, a fitting algorithm can be selected, such as least squares method, to obtain a more accurate target coefficient.

[0179] S5033: Obtain a third array according to the first array and the difference between the product of the second array and the target coefficient.

[0180] The target coefficient adjusts the strength and direction of the linear relationship between the first and second arrays. Adjusting the target coefficient can reduce the influence of noise between the first and second arrays. This, in turn, helps improve the signal-to-noise ratio of the second Raman spectrum, making Raman spectrum identification more accurate and reliable.

[0181] Based on the Raman spectrum recognition method provided in the above embodiment, the present application also provides a specific implementation of the Raman spectrum recognition device.

[0182] See the following examples.

[0183] See first Figure 7 The Raman spectrum identification device 700 provided in the embodiment of the present application may include:

[0184] An acquisition module 701 is configured to acquire a first Raman spectrum collected when performing Raman spectrum detection on a test object, where the test object is packaged in a packaging container;

[0185] An extraction module 702 is configured to extract first peak information of a first Raman spectrum;

[0186] A matching module 703 is configured to match the first peak information with the second peak information of multiple package spectra in the package database to obtain a matching degree between the first Raman spectrum and each package spectrum;

[0187] A first determining module 704 is configured to determine a package spectrum corresponding to a maximum matching degree among a plurality of matching degrees as a reference package spectrum of the object under test;

[0188] a removal module 705 , configured to remove the reference package spectrum from the first Raman spectrum to obtain a second Raman spectrum;

[0189] The identification module 706 is configured to identify whether there is a standard Raman spectrum matching the second Raman spectrum in the sample database.

[0190] The Raman spectrum recognition device 700 provided in the embodiment of the present application can, after the acquisition module 701 acquires the first Raman spectrum of the object to be measured, extract the first peak information of the first Raman spectrum and multiple packaging spectra through the extraction module 702. Then, the first peak information and the multiple second peak information are matched one by one through the matching module 703, so as to use the first determination module 704 to obtain the reference packaging spectrum with the highest matching degree with the first Raman spectrum of the object to be measured in the packaging database, thereby realizing the recognition of the packaging container packaged outside the object to be measured. After that, the identified reference packaging spectrum is removed from the first Raman spectrum through the removal module 705 to obtain a second Raman spectrum that can accurately characterize the object to be measured. Then, the second Raman spectrum with the packaging interference removed is identified through the identification module 706 to obtain a more accurate analysis result. The solution of the present application can effectively improve the accuracy and reliability of spectral recognition, and help solve the problem of interference of packaging containers on Raman spectrum recognition.

[0191] In order to increase the accuracy of the matching degree calculation, as an implementation of the present application, in the Raman spectrum recognition device provided in the present application, the aforementioned matching module 703 may specifically include:

[0192] The first iterative submodule iteratively performs the following operations for each package spectrum until all package spectra are executed, and obtains the degree of matching between the first Raman spectrum and each package spectrum:

[0193] Iteration unit: for each first Raman peak in the first Raman spectrum and each second Raman peak in the current package spectrum, iteratively perform the following operations until all first Raman peaks and all second Raman peaks are executed, and the current package spectrum is any one of the multiple package spectra in the package database:

[0194] The first calculation subunit is used to calculate the peak position difference between the current first Raman peak and the current second Raman peak respectively;

[0195] The second calculation subunit calculates the matching degree in the current iteration process according to the peak height of the current second Raman peak and the matching degree in the previous iteration process when the peak position difference is less than the preset peak position offset threshold.

[0196] In order to further improve the accuracy and applicability of the matching degree calculation, as an implementation of the present application, in the Raman spectrum recognition device provided in the present application, the aforementioned second calculation subunit may specifically include:

[0197] A first determining component, configured to determine a weight coefficient of the current second Raman peak;

[0198] A second determining component is used to determine a current peak position matching degree between the current second Raman peak and the current first Raman peak according to the weight coefficient of the current second Raman peak and the peak height of the current second Raman peak;

[0199] The third determining component is configured to add the current peak position matching degree and the matching degree in the previous iteration process to obtain the matching degree in the current iteration process.

[0200] The aforementioned first determination component may specifically include:

[0201] The calculation subcomponent is used to calculate the weight coefficient of the current second Raman peak according to the peak position difference between the current first Raman peak and the current second Raman peak, and a preset peak position offset threshold.

[0202] In order to improve the accuracy and reliability of the matching results of the packaging spectrum and reduce the possibility of mismatching, as an implementation of the present application, in the Raman spectrum recognition device provided in the present application, the aforementioned Raman spectrum recognition device may specifically include:

[0203] The second determining module is configured to determine whether a maximum matching degree among a plurality of matching degrees is greater than a preset matching degree.

[0204] The first determining module 704 may specifically include:

[0205] The first determining submodule is configured to, when it is determined that a maximum matching degree among a plurality of matching degrees is greater than a preset matching degree, determine a package spectrum corresponding to the maximum matching degree as a reference package spectrum of the object to be measured.

[0206] In order to more accurately determine the maximum matching degree and improve the accuracy of identifying the object being measured, as an implementation of the present application, in the Raman spectrum recognition device provided in the present application, the aforementioned Raman spectrum recognition device may specifically include:

[0207] For each package spectrum, it is transferred to the statistics module and the first processing module for processing respectively until all the package spectra in the package database are processed:

[0208] a statistical module, configured to determine a target total peak height of the current package spectrum based on the intensities of the second Raman peaks of the current package spectrum, wherein the target total peak height is the sum of the intensities of the second Raman peaks in the current package spectrum whose intensities are greater than a first preset intensity;

[0209] The first processing module is configured to perform normalization processing on the matching degree of the current package spectrum according to the target total peak height of the current package spectrum to obtain a normalized result of the matching degree.

[0210] Based on this, the first determining module 704 further includes:

[0211] A second determining submodule is configured to determine a maximum matching degree based on the normalized results of the multiple matching degrees;

[0212] The third determining submodule is configured to determine the package spectrum corresponding to the maximum matching degree as the reference package spectrum of the object to be measured.

[0213] In order to further improve the accuracy of Raman spectrum recognition, as an implementation of the present application, in the Raman spectrum recognition device provided in the present application, the aforementioned Raman spectrum recognition device may specifically include:

[0214] A first constructing module is configured to construct a first array based on first peak heights corresponding to respective peak positions of a plurality of first Raman peaks of the first Raman spectrum;

[0215] A second building module is used to build a second array based on second peak heights corresponding to respective peak positions of a plurality of second Raman peaks of the reference package spectrum;

[0216] A third determining module, configured to obtain a third array according to the difference between each element in the first array and the second array;

[0217] The third constructing module is used to construct a second Raman spectrum according to the corresponding position and element value of each element in the third array.

[0218] In order to improve the accuracy of constructing the second Raman spectrum, as an implementation of the present application, in the Raman spectrum recognition device provided in the present application, the aforementioned Raman spectrum recognition device may specifically include:

[0219] a second processing module, configured to perform normalization processing on the second array according to the strongest first peak in the reference package spectrum to obtain a normalized second array;

[0220] The third processing module is configured to perform normalization processing on the first array according to the second peak value in the first array to obtain a normalized first array, wherein the second peak value is a peak value of the first Raman peak that matches the position of the first peak value.

[0221] Based on this, the aforementioned third determination module may specifically include:

[0222] A construction submodule, configured to construct a target expression according to the normalized first array, the normalized second array, the second array, the target coefficient, and a preset penalty factor;

[0223] The solving submodule is used to solve the target coefficient when the target expression reaches the minimum;

[0224] The fourth determining submodule is configured to obtain a third array according to the first array and a difference between the product of the second array and the target coefficient.

[0225] Based on the Raman spectrum identification method provided in the above embodiment, the present application also provides a specific implementation method of the electronic device.

[0226] See the following examples.

[0227] See first Figure 8 , an electronic device 800 may include: a processor 801 and a memory 802 storing computer program instructions.

[0228] Specifically, the processor 801 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0229] The memory 802 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 802 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 802 may include removable or non-removable (or fixed) media. Where appropriate, the memory 802 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 802 is a non-volatile solid-state memory.

[0230] The memory 802 may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.

[0231] The processor 801 reads and executes computer program instructions stored in the memory 802 to implement any one of the Raman spectrum identification methods in the above embodiments.

[0232] In one example, the electronic device may further include a communication interface 803 and a bus 810. Figure 8 As shown, the processor 801, the memory 802, and the communication interface 803 are connected via a bus 810 and communicate with each other.

[0233] The communication interface 803 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0234] Bus 810 includes hardware, software or both, and the components of online data flow metering equipment are coupled to each other. For example, but not limitation, bus can include accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industry standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 810 can include one or more buses. Although the present application embodiment describes and shows specific bus, the application considers any suitable bus or interconnection.

[0235] In addition, in conjunction with the Raman spectrum identification method in the above embodiments, embodiments of the present application may provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any of the Raman spectrum identification methods in the above embodiments is implemented.

[0236] In addition, in combination with the Raman spectrum identification method in the above embodiments, an embodiment of the present invention may provide a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes any one of the Raman spectrum identification methods in the above embodiments.

[0237] It should be understood that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated. Those skilled in the art can make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present application.

[0238] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. Programs or code segments can be stored in machine-readable media, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable media" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0239] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps. In other words, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0240] Aspects of the present disclosure have been described above with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit. It is also understood that each box in the block diagram and / or flowchart and the combination of the boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0241] The above is only a specific implementation method of the present application. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the scope of protection of the present application is not limited to this. Any technician familiar with this technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the scope of protection of this application.

Claims

1. A Raman spectrum identification method, characterized in that: include: Acquiring a first Raman spectrum collected when performing Raman spectrum detection on a measured object, wherein the measured object is packaged in a packaging container; extracting first peak information of the first Raman spectrum; Matching the first peak information with the second peak information of a plurality of package spectra in the package database respectively to obtain the matching degree between the first Raman spectrum and each of the package spectra; Determine a packaging spectrum corresponding to a maximum matching degree among a plurality of matching degrees as a reference packaging spectrum of the object to be measured; removing the reference package spectrum from the first Raman spectrum to obtain a second Raman spectrum; It is identified whether there is a standard Raman spectrum matching the second Raman spectrum in the sample database.

2. The method according to claim 1, characterized in that: The matching of the first peak information with the second peak information of a plurality of package spectra in the package database to obtain a matching degree for characterizing the first Raman spectrum and each of the package spectra includes: For each package spectrum, the following operations are iteratively performed respectively until all package spectra are executed, and the matching degree for characterizing the first Raman spectrum and each package spectrum is obtained: For each first Raman peak in the first Raman spectrum and each second Raman peak in the current package spectrum, iteratively perform the following operations A1 to A2 until all first Raman peaks and all second Raman peaks are executed; A1: Calculate the peak position difference between the current first Raman peak and the current second Raman peak respectively; A2: When the peak position difference is less than a preset peak position shift threshold, the matching degree in the current iteration process is calculated according to the peak height of the current second Raman peak and the matching degree in the previous iteration process.

3. The method according to claim 2, characterized in that The calculating the matching degree in the current iteration process according to the peak height of the current second Raman peak and the matching degree in the previous iteration process includes: Determining a weight coefficient of the current second Raman peak; Determining a current peak position matching degree between the current second Raman peak and the current first Raman peak according to a weight coefficient of the current second Raman peak and a peak height of the current second Raman peak; The current peak position matching degree and the matching degree in the previous iteration process are added to obtain the matching degree in the current iteration process.

4. The method according to claim 3, characterized in that: The determining of the weight coefficient of the current second Raman peak comprises: The weight coefficient of the current second Raman peak is calculated according to the peak position difference between the current first Raman peak and the current second Raman peak, and a preset peak position shift threshold.

5. The method according to claim 1, characterized in that Before determining the package spectrum corresponding to the maximum matching degree among the multiple matching degrees as the reference package spectrum of the object to be measured, the method further includes: Determining whether a maximum matching degree among the multiple matching degrees is greater than a preset matching degree; The step of determining a packaging spectrum corresponding to a maximum matching degree among the multiple matching degrees as a reference packaging spectrum of the object to be measured comprises: When it is determined that the maximum matching degree among the multiple matching degrees is greater than the preset matching degree, the package spectrum corresponding to the maximum matching degree is determined as the reference package spectrum of the object to be measured.

6. The method according to claim 1, characterized in that After matching the first peak information with a plurality of package spectra in the package database to obtain a degree of matching for characterizing the first Raman spectrum with each of the package spectra, the method further includes: For each of the packaging spectra, the following operations B1 to B2 are performed respectively until the multiple packaging spectra in the packaging database are all executed: B1: determining a target total peak height of the current package spectrum according to the intensity of each second Raman peak of the current package spectrum, wherein the target total peak height is the sum of the intensities of the second Raman peaks in the current package spectrum whose intensity is greater than the first preset intensity; B2: normalizing the matching degree of the current package spectrum according to the target total peak height of the current package spectrum to obtain a normalized result of the matching degree; The step of determining a packaging spectrum corresponding to a maximum matching degree among the multiple matching degrees as a reference packaging spectrum of the object to be measured comprises: Determining the maximum matching degree according to the normalized results of the multiple matching degrees; The packaging spectrum corresponding to the maximum matching degree is determined as the reference packaging spectrum of the object to be measured.

7. The method according to any one of claims 1 to 6, characterized in that: The step of removing the reference package spectrum from the first Raman spectrum to obtain a second Raman spectrum comprises: constructing a first array based on first peak heights corresponding to respective peak positions of a plurality of first Raman peaks of the first Raman spectrum; constructing a second array based on second peak heights corresponding to respective peak positions of a plurality of second Raman peaks of the reference packaging spectrum; Obtain a third array according to the difference between each element in the first array and the second array; The second Raman spectrum is constructed according to the corresponding position and element value of each element in the third array.

8. The method according to claim 7, characterized in that Before obtaining the third array according to the difference between each element in the first array and the second array, the method further includes: Normalizing the second array according to the strongest first peak in the reference package spectrum to obtain a normalized second array; Normalizing the first array according to a second peak value in the first array to obtain a normalized first array, wherein the second peak value is a peak value of a first Raman peak that matches a position of the first peak value; The step of obtaining a third array according to the difference between each element in the first array and the second array comprises: Constructing a target expression according to the normalized first array, the normalized second array, the second array, a target coefficient and a preset penalty factor; Find the target coefficient when the target expression is minimized; A third array is obtained according to the difference between the first array and the product of the second array and the target coefficient.

9. The method according to claim 8, characterized in that The target expression is: ‖A ′ WAx-B ′ "W.A." In the formula, x is the target coefficient, A is the second array, and A ′ is the normalized second array, B ′ is the normalized first array, W is the preset penalty factor, when B ′ When it is less than A, W is 1-σ; when B ′ When it is not less than A, W is σ, where σ∈(0, 0.1].

10. A Raman spectrum identification device, characterized in that: The device comprises: An acquisition module, used for acquiring a first Raman spectrum collected when performing Raman spectrum detection on a measured object, wherein the measured object is packaged in a packaging container; An extraction module, used for extracting first peak information of the first Raman spectrum; A matching module, used for matching the first peak information with the second peak information of a plurality of package spectra in a package database, respectively, to obtain a matching degree between the first Raman spectrum and each of the package spectra; A first determination module is used to determine a packaging spectrum corresponding to a maximum matching degree among the multiple matching degrees as a reference packaging spectrum of the object to be measured; a removal module, configured to remove the reference package spectrum from the first Raman spectrum to obtain a second Raman spectrum; The identification module is used to identify whether there is a standard Raman spectrum matching the second Raman spectrum in the sample database.

11. An electronic device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the Raman spectrum identification method according to any one of claims 1 to 9 is implemented.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the Raman spectrum identification method according to any one of claims 1 to 9 is implemented.

13. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the Raman spectrum identification method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Raman spectrum detection method for detecting sample in container

    CN104749155A

  • Raman spectrum matching method

    CN106198485A

  • A Raman spectrum detection method used for deducting package interferences

    CN108169201A

  • Method for identifying Raman spectrogram

    CN108241846A

  • Raman spectrum characteristic peak positioning method, electronic equipment and storage medium

    CN115541021A