Anti-interference detection method and system for methane gas sensor in complex environment, storage medium and program product
Through the methane gas sensor and multi-wavelength spectroscopy analyzer combined with the interference coefficient library, interfering gases in complex environments are identified and stripped away, solving the problem of the impact of interfering gases in methane gas detection, achieving high-precision and reliable methane concentration detection, avoiding the cost and workload of material replacement.
Patent Information
- Application Number
- CN202510666892.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-09-02
AI Technical Summary
In complex environments, the presence of interfering gas in methane gas detection leads to inaccurate detection results. Existing filtered or adsorbed materials need to be replaced regularly, which increases maintenance costs and workloads, and it is difficult for a single material to completely remove all interfering gases.
The mixed spectrum is obtained through a methane gas sensor and a multi-wavelength spectrum analyzer, combined with the interference coefficient library, identify and strip away the most contributing interference gas, use spectral feature matching and interference coefficient to calculate interference values, update the residual spectrum, and realize high-precision methane concentration detection, avoiding dependence on consumable materials.
It realizes high-precision and high-reliability methane gas concentration detection at low cost, reducing the cost and workload caused by material replacement, while effectively responding to interfering gases in complex environments, improving the accuracy of detection.
Smart Images

Figure CN120577244A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of gas detection technology, and in particular to a method, system, storage medium, and program product for anti-interference detection of a methane gas sensor in a complex environment. Background Art
[0002] In industrial production, such as coal mining, natural gas processing, and chemical manufacturing, as well as in daily life-related gas supply, methane is a flammable gas that can cause explosions and other dangerous conditions within a certain concentration range. Accurate detection of its concentration plays a decisive role in protecting personnel safety, preventing disasters and accidents, and ensuring stable production operations. At the same time, as the application scenarios of gas detection continue to expand, especially in complex environments such as underground coal mines and natural gas pipelines, real-time and accurate monitoring of methane concentration has become one of the core requirements for ensuring safety. However, these complex environments often contain a large number of interfering gases with complex compositions, such as carbon dioxide, hydrogen sulfide, and water vapor. Their presence poses a huge challenge to the accurate detection of methane concentration.
[0003] At present, in order to deal with the influence of interfering gases in methane gas detection in complex environments, the more commonly used technical solution is: using chemical filtration or physical adsorption methods to remove or enrich the interfering gases through specific chemical filtration materials or physical adsorption media before the gas enters the sensor, so as to reduce the impact of interfering gases on the sensor's detection of methane concentration.
[0004] However, the performance of filter materials or adsorption media will decline with the increase of usage time and needs to be replaced regularly, which increases maintenance costs and workload. At the same time, in some extremely complex environments, there are many types of interfering gases with different properties. A single filter or adsorption material is difficult to completely remove all interfering gases. Some interfering gases will still enter the sensor and affect the detection results.
[0005] Therefore, at present, achieving high-precision and high-reliability detection of methane gas concentration at a low cost has become a technical problem that needs to be solved urgently. Summary of the Invention
[0006] The present application provides an anti-interference detection method for a methane gas sensor in a complex environment, which is used to achieve high-precision and high-reliability detection of methane gas concentration at a low cost.
[0007] In a first aspect, the present application provides an anti-interference detection method for a methane gas sensor in a complex environment, comprising: obtaining a methane concentration value through a methane gas sensor and obtaining a mixed spectrum through a multi-wavelength spectrum analyzer; using the mixed spectrum as input, combining it with an interference coefficient library, and outputting a total interference value and a residual spectrum; the interference coefficient library includes the interference coefficient of each interfering gas on the methane sensor and the standard multi-wavelength spectrum of each interfering gas; wherein: the mixed spectrum is assigned to the residual spectrum, and the total interference value is initialized, the residual spectrum is the spectrum remaining after stripping the interfering gas, and the total interference value is the sum of the interference values of the interfering gases on the methane gas; the residual spectrum is feature-matched with the standard multi-wavelength spectrum to identify the interfering gas with the largest contribution; it is determined whether the interfering gas with the largest contribution is methane; if it is not methane, the concentration of the interfering gas with the largest contribution is determined based on the spectral characteristic intensity of the interfering gas with the largest contribution in the residual spectrum and the standard multi-wavelength spectrum; the concentration is multiplied by the corresponding interference coefficient to obtain an interference value; the interference value is accumulated to the total interference value; the residual spectrum is subtracted from the standard multi-wavelength spectrum corresponding to the largest interfering gas after concentration scaling to update the residual spectrum; the methane concentration value is subtracted from the total interference value to obtain a target methane concentration value.
[0008] By adopting the above technical solution, a methane gas sensor is used to obtain the original methane concentration value, and a multi-wavelength spectrum analyzer is used to obtain a mixed spectrum containing information about methane and interfering gases. These two basic data acquisition methods provide the basis for subsequent analysis. The mixed spectrum is assigned to the residual spectrum and the total interference value is initialized, establishing the starting state for processing. Utilizing an interference coefficient library, which contains the interference coefficients of each interfering gas for the methane sensor and standard multi-wavelength spectra, the interfering gas with the greatest contribution can be matched and identified based on its spectral characteristics. After determining its concentration, the interference value is multiplied by the interference coefficient and accumulated. The corresponding scaled standard multi-wavelength spectrum is then subtracted from the residual spectrum to update the residual spectrum, and the influence of the interfering gas is removed in this cycle. The entire process does not rely on easily consumable filtering or adsorption materials, avoiding the cost and workload associated with regular replacement due to material performance degradation. At the same time, it can effectively cope with interfering gases in complex environments and achieve high-precision and reliable methane concentration detection.
[0009] In combination with some embodiments of the first aspect, in some embodiments, after the step of determining whether the interfering gas with the largest contribution is methane, the method also includes: merging the residual spectra in the residual spectrum based on the wavelength difference to obtain multiple spectral region groups, and using the wavelength difference as the basis for determining the merging priority. The larger the wavelength difference, the smaller the corresponding merging priority; for each spectral region group, calculating the spectral residual ratio with the mixed spectrum; the spectral residual ratio refers to the ratio of the amount of data contained in the residual spectrum and the mixed spectrum respectively; multiplying the spectral residual ratio with the methane concentration value to obtain a combined concentration; multiplying the combined concentration with the average interference coefficient to obtain a combined interference value; and adding the combined interference value to the total interference value.
[0010] By adopting the above technical solution, after the step of determining the maximum interfering gas, the residual spectra are merged based on the wavelength difference. The wavelength difference is used as the basis for merging priority because the wavelength difference reflects the degree of difference between the spectral regions. Regions with small wavelength differences are more likely to have similar characteristics. Prioritizing merging can reduce data redundancy. After obtaining multiple spectral region groups, the spectral residual ratio with the mixed spectrum is calculated. This ratio is determined by the ratio of the residual spectrum to the mixed spectrum data volume, which can reflect the degree of influence of each region group on the overall spectrum. Multiply it with the methane concentration value to obtain the combined concentration, and then multiply it with the average interference coefficient to obtain the combined interference value and add it to the total interference value. This process takes into account many small-contribution interfering gases that were originally ignored. By comprehensively processing them, the impact of their cumulative interference on the accuracy of the target methane concentration is avoided, thereby improving the detection accuracy.
[0011] In combination with some embodiments of the first aspect, in some embodiments, the residual spectrum is feature matched with the standard multi-wavelength spectrum to identify the interfering gas with the greatest contribution, specifically including: discretizing the residual spectrum according to a preset wavelength interval to generate a continuous and non-overlapping sub-spectrum sequence, wherein each sub-spectrum contains a spectral data vector of a preset number of sampling points; performing a feature extraction operation on each sub-spectrum to generate a multidimensional feature vector; judging the similarity between the multidimensional feature vector and the feature vector of the standard multi-wavelength spectrum; if the similarity is greater than a threshold, judging that the sub-spectrum belongs to the corresponding interfering gas; merging adjacent sub-spectra that belong to the same interfering gas; and determining the interfering gas corresponding to the sub-spectrum with the largest intensity as the interfering gas with the greatest contribution.
[0012] By adopting the above technical solution, the residual spectrum is discretized according to the preset wavelength interval to generate a sub-spectrum sequence. This discretization makes the spectral data easier to analyze and process. Each sub-spectrum contains a spectral data vector of a preset number of sampling points, which provides a standardized data unit for subsequent feature extraction. Feature extraction operations are performed on each sub-spectrum to generate a multi-dimensional feature vector, enriching the spectral feature information. By judging the similarity between the multi-dimensional feature vector and the feature vector of the standard multi-wavelength spectrum, the interfering gas to which the sub-spectrum belongs can be accurately identified. The adjacent sub-spectra belonging to the same interfering gas are merged to reduce the confusion in the identification of interfering gases. Finally, the interfering gas corresponding to the sub-spectrum with the largest intensity is determined as the interfering gas with the greatest contribution, which improves the accuracy and efficiency of the identification of the maximum interfering gas, laying the foundation for accurately calculating the interference value and improving the reliability of methane concentration detection.
[0013] In conjunction with some embodiments of the first aspect, in some embodiments, the step of determining similarity between the multidimensional feature vector and the feature vector of the standard multi-wavelength spectrum specifically includes: Sim(S i ,R j )=α·DTW(S i ,R j)+β·PCM(S i ,R j )+γ·COS(S i ,R j ) where Sim(S i ,R j ) is the similarity, S i is the eigenvector of the sub-spectrum, R j is the characteristic vector of the standard multi-wavelength spectrum, DTW(S i ,R j ) is the dynamic time warping distance, PCM(S i ,R j ) is the Pearson correlation coefficient, COS(S i ,R j ) is the cosine similarity, and α, β, and γ are weights.
[0014] By adopting the above technical solution, a formula including dynamic time warping distance, Pearson correlation coefficient and cosine similarity is used when judging similarity. Dynamic time warping distance can measure the similarity of spectral curve shape and adapt to the nonlinear changes of spectral curve on the time (wavelength) axis; Pearson correlation coefficient evaluates the linear correlation of eigenvectors and reflects the degree of linear association between features; cosine similarity calculates the matching degree of frequency domain features and considers the similarity of frequency domain features. By setting weights reasonably, the importance of each factor in similarity judgment can be flexibly adjusted according to different application scenarios and data characteristics, and the similarity between the sub-spectrum and the standard multi-wavelength spectrum can be comprehensively and accurately measured from multiple dimensions, thereby more accurately identifying interfering gases and providing strong support for accurately calculating interference values and obtaining target methane concentrations.
[0015] In combination with some embodiments of the first aspect, in some embodiments, the multidimensional feature vector includes: spectral peak intensity, half-width, and peak center wavelength. The spectral peak intensity is determined by a Gaussian fitting algorithm, the half-width is determined by the zero crossing point of the second-order derivative, and the peak center wavelength is accurately measured by a centroid algorithm.
[0016] By employing the above technical solution, the multidimensional feature vector contains spectral peak intensity, half-width at half maximum, and peak center wavelength. The spectral peak intensity is determined by a Gaussian fitting algorithm, which accurately fits the spectral peak and reflects the key characteristics of spectral intensity. The half-width at half maximum is determined by the zero-crossing point of the second-order derivative, which accurately describes the width characteristics of the spectral peak. The peak center wavelength is precisely determined by the centroid algorithm, which accurately locates the center of the spectral peak. These precise measurement methods ensure that the multidimensional feature vector contains rich and accurate spectral feature information, providing a comprehensive basis for interfering gas feature extraction.
[0017] In combination with some embodiments of the first aspect, in some embodiments, the step of determining the concentration of the interfering gas with the greatest contribution based on the spectral characteristic intensity of the interfering gas with the greatest contribution in the residual spectrum and the standard multi-wavelength spectrum specifically includes: obtaining the concentration of the interfering gas with the greatest contribution based on the ratio of the spectral characteristic intensity of the interfering gas with the greatest contribution in the residual spectrum to the reference intensity value at the same characteristic wavelength in the standard multi-wavelength spectrum multiplied by the reference concentration corresponding to the standard spectrum.
[0018] By adopting the above technical solution, the concentration of the interfering gas with the largest contribution is determined by multiplying the ratio of the spectral characteristic intensity of the residual spectrum to the reference intensity value at the same characteristic wavelength in the standard multi-wavelength spectrum by the reference concentration corresponding to the standard spectrum. This calculation method utilizes the corresponding characteristic information of the residual spectrum and the standard multi-wavelength spectrum. The ratio reflects the difference between the actual detection spectral characteristic intensity and the standard situation. Multiplying it by the reference concentration can accurately determine the actual concentration. Accurate concentration calculation is crucial for the subsequent precise calculation of the interference value, because the interference value is obtained by multiplying the concentration by the interference coefficient. Accurate interference value calculation can effectively eliminate the impact of interfering gases on methane concentration detection and help obtain a true and reliable target methane concentration value.
[0019] In combination with some embodiments of the first aspect, in some embodiments, after the step of determining whether the interference gas with the largest contribution is methane, the method further includes: if it is methane, outputting a total interference value.
[0020] By employing this technical solution, once methane is identified as the most interfering gas during the determination phase, the interference situation is relatively simple, eliminating the need for subsequent complex concentration calculations, interference value calculations, and residual spectrum updates for other interfering gases. Directly outputting the total interference value reduces unnecessary calculation steps.
[0021] In the second aspect, the present application provides an anti-interference detection system for a methane gas sensor in a complex environment. The anti-interference detection system for a methane gas sensor in a complex environment includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and one or more processors call the computer instructions to enable the anti-interference detection system for a methane gas sensor in a complex environment to execute the method described in the first aspect and any possible implementation method of the first aspect.
[0022] In a third aspect, the present application provides a computer program product comprising instructions. When the computer program product is run on an anti-interference detection system for a methane gas sensor in a complex environment, the anti-interference detection system for a methane gas sensor in a complex environment executes the method described in the first aspect and any possible implementation method of the first aspect.
[0023] In a fourth aspect, the present application provides a computer-readable storage medium comprising instructions. When the instructions are executed on an anti-interference detection system for a methane gas sensor in a complex environment, the anti-interference detection system for a methane gas sensor in a complex environment executes the method described in the first aspect and any possible implementation method of the first aspect.
[0024] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. A methane gas sensor is used to obtain the raw methane concentration value, and a multi-wavelength spectrum analyzer is used to obtain a mixed spectrum containing information about methane and interfering gases. These two basic data acquisition methods provide the basis for subsequent analysis. The mixed spectrum is assigned to the residual spectrum and the total interference value is initialized, establishing the starting state for processing. Utilizing an interference coefficient library, which contains the interference coefficients of each interfering gas for the methane sensor and standard multi-wavelength spectra, the interfering gas with the greatest contribution can be matched and identified based on its spectral characteristics. After determining its concentration, the interference value is multiplied by the interference coefficient and accumulated. The corresponding scaled standard multi-wavelength spectrum is then subtracted from the residual spectrum to update the residual spectrum, and the influence of the interfering gas is removed in this cycle. The entire process does not rely on easily consumable filter or adsorbent materials, avoiding the cost and workload associated with periodic replacement due to material degradation. It can also effectively handle interfering gases in complex environments, achieving highly accurate and reliable methane concentration detection.
[0025] 2. After determining the maximum interfering gas, the residual spectra are merged based on the wavelength difference. The wavelength difference is used as the basis for merging priority because the wavelength difference reflects the degree of difference between the spectral regions. Regions with small wavelength differences are more likely to have similar characteristics. Prioritizing merging can reduce data redundancy. After obtaining multiple spectral region groups, the spectral residual ratio with the mixed spectrum is calculated. This ratio is determined by the ratio of the residual spectrum to the mixed spectrum data volume, which can reflect the degree of influence of each region group on the overall spectrum. This ratio is multiplied by the methane concentration value to obtain the combined concentration, and then multiplied by the average interference coefficient to obtain the combined interference value and accumulated to the total interference value. This process takes into account the many small-contribution interfering gases that were originally ignored. By comprehensively processing them, the impact of their cumulative interference on the accuracy of the target methane concentration is avoided, thereby improving detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 This is a flow chart of the anti-interference detection method of a methane gas sensor under a complex environment in an embodiment of the present application; Figure 2 This is another flow chart of the anti-interference detection method for a methane gas sensor under a complex environment in an embodiment of the present application; Figure 3 This is an exemplary hardware structure diagram of the anti-interference detection system for a methane gas sensor in a complex environment in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The terms used in the following examples of the present application are for the purpose of describing specific embodiments only and are not intended to limit the present application. As used in the specification and appended claims of the present application, the singular expressions "a," "an," "said," "above," "the," and "this" are intended to include plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in the present application refers to and encompasses any or all possible combinations of one or more of the listed items.
[0028] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.
[0029] S110. Obtain a methane concentration value using a methane gas sensor and a mixed spectrum using a multi-wavelength spectrum analyzer. A methane gas sensor is a device used to detect methane gas concentration. Based on specific physical or chemical principles, it converts methane gas concentration information into a measurable electrical or optical signal. A multi-wavelength spectrum analyzer is an instrument that emits light of multiple wavelengths and detects spectral changes resulting from the interaction of light with gas. Information about the various gases in the mixed gas is obtained by analyzing the spectra. A mixed spectrum is used to represent spectral data detected by the multi-wavelength spectrum analyzer that contains information about methane and other interfering gases.
[0030] S120, taking the mixed spectrum as input, combining it with the interference coefficient library, and outputting a total interference value and a residual spectrum; the interference coefficient library includes the interference coefficient of each interfering gas on the methane sensor and the standard multi-wavelength spectrum of each interfering gas; wherein: The interference coefficient library stores the interference coefficients of various interfering gases on the methane sensor, as well as the standard multi-wavelength spectra of each interfering gas. The total interference value represents the sum of the interference values of all interfering gases on methane detection. The residual spectrum represents the spectrum remaining after removing the interference gas's influence. It reflects the methane gas spectral information after removing the interfering gas's spectral characteristics.
[0031] S121, assigning the mixed spectrum to the residual spectrum and initializing the total interference value, where the residual spectrum is the spectrum remaining after stripping the interfering gas, and the total interference value is the sum of the interference values of the interfering gas on the methane gas; Here, assigning means copying or transferring the data content of the mixed spectrum to the residual spectrum, so that the residual spectrum is initialized to the state of the mixed spectrum. Initializing the total interference value means setting the total interference value to an initial value, generally 0, as the starting point for subsequent accumulation of interference values.
[0032] S122, feature matching the residual spectrum with the standard multi-wavelength spectrum to identify the interfering gas with the largest contribution; Feature matching involves comparing the residual spectrum with the standard multi-wavelength spectrum, such as peaks, valleys, wavelength positions, and intensities, to identify similarities and correspondences between the two. The standard multi-wavelength spectrum refers to the multi-wavelength spectral data of each interfering gas under standard conditions stored in the interference coefficient library, serving as a reference spectrum for comparative analysis. The interfering gas with the greatest contribution indicates the interfering gas that has the greatest impact on methane concentration detection results.
[0033] After completing spectrum initialization and preparing to start interfering gas analysis, this step is used to find the interfering gas that has the greatest impact on detection from the residual spectrum.
[0034] Specifically, the standard multi-wavelength spectrum of each interfering gas is sequentially read from the interference coefficient library and its features are compared with the residual spectrum point by point or segment by segment. The similarity between the residual spectrum and each standard multi-wavelength spectrum is evaluated by calculating similarity metrics between the spectral features, such as peak similarity and wavelength matching. Based on the level of similarity, the most likely corresponding interfering gas in the residual spectrum is determined. Further analysis of factors such as the characteristic intensity of the interfering gas is used to identify the interfering gas that contributes most to methane concentration detection.
[0035] In some embodiments, an algorithm based on spectral feature extraction and matching is used. First, key features such as the wavelength, intensity, and half-height width of the characteristic peak are extracted from the residual spectrum and the standard multi-wavelength spectrum. Metrics such as the Euclidean distance or cosine similarity between the residual spectral features and the features of each standard multi-wavelength spectrum are calculated. The interfering gas corresponding to the standard multi-wavelength spectrum with the smallest metric value (or the largest similarity) is determined as the interfering gas with the greatest contribution, which is not limited here.
[0036] Step S122 specifically includes: S1221, discretizing the residual spectrum according to a preset wavelength interval to generate a continuous and non-overlapping sub-spectrum sequence, wherein each sub-spectrum includes a spectral data vector of a preset number of sampling points; Discretization involves dividing the continuous residual spectrum into discrete, discontinuous parts at preset wavelength intervals. A subspectral sequence is a sequence of multiple subspectra obtained after discretization, arranged in a specific order. A spectral data vector represents the spectral data of each subspectrum at each sampling point. It contains a preset number of sampling points, and the spectral data at these sampling points reflects the characteristic information of the subspectrum at different wavelengths.
[0037] Specifically, the residual spectrum is scanned according to predetermined wavelength intervals. Starting from the starting wavelength of the residual spectrum, the residual spectrum is sequentially divided according to the preset wavelength intervals into multiple continuous and non-overlapping sections, each of which is a sub-spectrum. During the division process, each sub-spectrum is ensured to contain a preset number of sampling points, which are evenly distributed within the wavelength range of the sub-spectrum. These sub-spectra are organized into a sub-spectrum sequence according to the division order, and the spectral data of each sub-spectrum is formed into a spectral data vector according to the sampling point order.
[0038] In some embodiments, a preset wavelength interval and a preset number of sampling points for each sub-spectrum are determined. Spectral analysis software is used to import the residual spectral data into the software. Discretization parameters, namely the preset wavelength interval and number of sampling points, are set in the software. The software automatically discretizes the residual spectrum according to the settings, generates a sub-spectrum sequence and corresponding spectral data vectors, and outputs and saves the results.
[0039] S1222, performing a feature extraction operation on each sub-spectrum to generate a multi-dimensional feature vector; Feature extraction is the process of extracting key information from a sub-spectrum that reflects its characteristics and essence. A multidimensional feature vector is a vector containing multidimensional feature information. This feature information describes the characteristics of the sub-spectrum from different aspects, such as spectral peak intensity, half-width, and peak center wavelength.
[0040] Specifically, for each sub-spectrum in the sub-spectral sequence, specific algorithms and mathematical methods are used to extract its key features. For spectral peak intensity, a Gaussian fitting algorithm is used to fit the spectral data to find the peak position in the spectrum and determine its intensity value. For the half-width at half maximum, the second-order derivative zero-crossing point method is used to calculate the second-order derivative of the spectrum and find the point where the derivative is zero, thereby determining the half-width at half maximum of the spectral peak. For the peak center wavelength, a centroid algorithm is used to calculate the center wavelength position of the spectral peak based on the intensity distribution of the spectral data at different wavelength positions. These extracted eigenvalues are combined to form a multidimensional feature vector, which is used to comprehensively describe the characteristics of the sub-spectrum.
[0041] In some embodiments, a professional spectral analysis tool is used. The sub-spectral data is imported into the tool, which integrates various feature extraction algorithms. In the tool interface, the corresponding feature extraction function is selected, such as the Gaussian fitting algorithm for calculating spectral peak intensity, the second-order derivative method for calculating half-width, and the centroid algorithm for calculating peak center wavelength. The tool automatically executes these algorithms to generate a multidimensional feature vector for each sub-spectrum and displays or outputs the results, which are not limited here.
[0042] In some embodiments, the multidimensional feature vector includes: spectral peak intensity, half-width, and peak center wavelength. The spectral peak intensity is determined by a Gaussian fitting algorithm, the half-width is determined by the second-order derivative zero crossing point, and the peak center wavelength is accurately measured by a centroid algorithm.
[0043] Among them, the spectral peak intensity represents the intensity value corresponding to the point with the highest intensity in the spectrum. It is an important parameter reflecting the spectral characteristics. When analyzing gas spectra, changes in the spectral peak intensity can indicate changes in gas concentration, composition and other information.
[0044] The Gaussian fitting algorithm is a mathematical method used to fit data to a Gaussian function. In spectral analysis, obtaining precise peak intensities directly from raw spectral data is difficult due to the presence of noise and other interfering factors. The Gaussian fitting algorithm fits spectral data to find the Gaussian function that best fits the data distribution, allowing for more accurate determination of spectral peak intensities.
[0045] Specifically, the spectral data of the sub-spectra is first acquired. This data contains information about the spectral intensities at different wavelengths. Then, a suitable Gaussian function model is selected and, using a Gaussian fitting algorithm, the spectral data of the sub-spectra is fitted into the model. The algorithm continuously adjusts the parameters of the Gaussian function to minimize the error between the fitted curve and the actual spectral data. After multiple iterative calculations, the final parameter values are the spectral peak intensities obtained by the Gaussian fitting algorithm.
[0046] Among them, half-width refers to the width at half the height of the spectral peak. It is used to describe the width of the spectral peak. Different gases may have different half-widths of their spectral peaks. Therefore, half-width is also one of the important parameters for identifying gas spectral characteristics.
[0047] Second-order derivative zero-crossing points: Mathematically, the second-order derivative of a function reflects the change in its curvature. For spectral data, by calculating its second-order derivative, we can find points where the second-order derivative is zero. These points are closely related to the characteristics of the spectral peak. When determining the half-height width (FWHM), using the second-order derivative zero-crossing points can more accurately locate the position at half the height of the spectral peak, thereby determining the FWHM.
[0048] Specifically, the first-order derivative of the acquired sub-spectral spectral data is first calculated to obtain the rate of change of the spectral intensity with wavelength. Next, the first-order derivative result is further differentiated to obtain the second-order derivative of the spectral data. Then, the second-order derivative data is traversed to find the points where the second-order derivative changes from positive to negative or from negative to positive. These points are the second-order derivative zero-crossing points. After finding the second-order derivative zero-crossing point associated with the spectral peak, the position of half the height is determined based on the spectral peak height. Then, combined with the position information of the zero-crossing point, the two wavelength values corresponding to half the height of the spectral peak are calculated. The difference between these two wavelength values is the half-height width.
[0049] Among them, the peak center wavelength refers to the wavelength corresponding to the center position of the spectral peak. It is a key characteristic parameter of the spectrum. The spectral peaks of different gases have different positions on the wavelength axis. The accurate measurement of the peak center wavelength helps to identify the type of interfering gas.
[0050] The centroid algorithm is a method for calculating the center of a data distribution. In spectral analysis, the spectral intensity is considered the "mass" distributed along the wavelength axis. The centroid algorithm can be used to calculate the center of the spectral peak along the wavelength axis, that is, the peak center wavelength.
[0051] Specifically, first obtain the spectral data of the sub-spectrum, including wavelength data and corresponding intensity data. Think of the wavelength data as position information on the coordinate axis, and the intensity data as the "mass" at the corresponding position. According to the centroid algorithm formula, the peak center wavelength is obtained by taking a weighted sum of each wavelength value and its corresponding intensity value in the spectral data and dividing it by the total intensity sum.
[0052] As can be seen, the multidimensional feature vector contains the spectral peak intensity, half-width at half maximum, and peak center wavelength. The spectral peak intensity is determined by the Gaussian fitting algorithm, which accurately fits the spectral peak and reflects the key characteristics of spectral intensity. The half-width at half maximum is determined by the zero-crossing point of the second-order derivative, which accurately describes the width characteristics of the spectral peak. The peak center wavelength is precisely determined by the centroid algorithm, which accurately locates the center of the spectral peak. These precise measurement methods ensure that the multidimensional feature vector contains rich and accurate spectral feature information, providing a comprehensive basis for interfering gas feature extraction.
[0053] S1223, determining similarity between the multidimensional feature vector and the feature vector of the standard multi-wavelength spectrum; In some embodiments, functions are defined to calculate dynamic time warping distance, Pearson correlation coefficient, and cosine similarity. In the code, based on preset weights, the multidimensional feature vector of each sub-spectrum is calculated against the feature vector of a standard multi-wavelength spectrum to obtain a similarity value. These similarity values are stored in an array or data table, facilitating subsequent determination of the interfering gas category to which the sub-spectrum belongs based on the similarity.
[0054] Step S1223 specifically includes: Sim(S i ,R j )=α·DTW(S i ,R j )+β·PCM(S i ,R j )+γ·COS(S i ,R j ) Where, Sim(S i ,R j ) is the similarity, S i is the eigenvector of the sub-spectrum, R j is the characteristic vector of the standard multi-wavelength spectrum, DTW(S i ,R j ) is the dynamic time warping distance, PCM(S i ,R j ) is the Pearson correlation coefficient, COS(S i ,R j ) is the cosine similarity, and α, β, and γ are weights.
[0055] As can be seen, when judging similarity, a formula including dynamic time warping distance, Pearson correlation coefficient, and cosine similarity is used. Dynamic time warping distance can measure the similarity of spectral curve shapes and adapt to the nonlinear changes of spectral curves on the time (wavelength) axis; the Pearson correlation coefficient evaluates the linear correlation of eigenvectors and reflects the degree of linear association between features; cosine similarity calculates the matching degree of frequency domain features and considers the similarity of frequency domain features. By reasonably setting weights, the importance of each factor in similarity judgment can be flexibly adjusted according to different application scenarios and data characteristics, and the similarity between the sub-spectrum and the standard multi-wavelength spectrum can be comprehensively and accurately measured from multiple dimensions, thereby more accurately identifying interfering gases and providing strong support for accurately calculating interference values and obtaining target methane concentrations.
[0056] S1224. If the similarity is greater than the threshold, it is determined that the sub-spectrum belongs to the corresponding interfering gas; Specifically, the similarity values between the sub-spectra calculated in step S1223 and each standard multi-wavelength spectrum are sequentially compared with pre-set thresholds. If the similarity between a sub-spectrum and a standard multi-wavelength spectrum exceeds the threshold, the sub-spectrum is determined to belong to the interfering gas corresponding to that standard multi-wavelength spectrum. For example, if the similarity between a sub-spectrum and the standard multi-wavelength spectrum of carbon dioxide exceeds the threshold, the sub-spectrum is determined to belong to the interfering gas of carbon dioxide. Through such judgments, the interfering gas categories corresponding to different sub-spectra in the residual spectrum can be preliminarily determined.
[0057] S1225, merging adjacent sub-spectra that belong to the same interfering gas; Here, "belonging to the same interfering gas" refers to those sub-spectra determined to belong to the same interfering gas based on the results of step S1224. Adjacent sub-spectra are those closely connected in the sub-spectral sequence. Merging refers to integrating these adjacent sub-spectra belonging to the same interfering gas to form a more continuous and complete spectral region.
[0058] Specifically, all sub-spectra that have been determined to belong to the interfering gas are traversed. For each interfering gas, the position of its corresponding sub-spectrum in the sub-spectrum sequence is checked. If adjacent sub-spectra are found to belong to the same interfering gas, they are merged. When merging, the spectral data of adjacent sub-spectra can be spliced, for example, the spectral data vectors of adjacent sub-spectra are connected in sequence to form a new, longer spectral data vector representing the merged sub-spectra. In this way, through the merging operation, the scattered sub-spectra belonging to the same interfering gas are integrated into a larger spectral region, reducing the complexity of interfering gas identification and making the subsequent analysis of the interfering gas more focused and accurate.
[0059] S1226. Determine the interfering gas corresponding to the sub-spectrum with the greatest intensity as the interfering gas with the greatest contribution.
[0060] The sub-spectrum with the highest intensity is the one with the highest spectral intensity among all sub-spectra after merging. The interfering gas with the highest contribution is the one with the greatest impact on the methane concentration detection results among all interfering gases. By identifying the sub-spectrum with the highest intensity, the corresponding interfering gas is determined as the interfering gas with the highest contribution. This is because a sub-spectrum with a high intensity often indicates that the interfering gas is relatively present in the residual spectrum or has a more significant impact on the spectral characteristics, thus causing greater interference with the methane concentration detection.
[0061] Specifically, all merged sub-spectra are traversed to obtain the spectral intensity value of each sub-spectrum. The spectral intensity can be determined by calculating the sum of the intensities of all sampling points in the spectral data vector or using other calculation methods that can represent the spectral intensity. The intensity values of these sub-spectra are compared to find the sub-spectra with the largest intensity. The interference gas category to which this sub-spectra with the largest intensity belongs is determined, and the interference gas is determined to be the interference gas with the greatest contribution to methane concentration detection. For example, if the sub-spectra with the largest intensity is determined to belong to carbon dioxide interference gas, then carbon dioxide is determined to be the interference gas with the greatest contribution to methane concentration detection.
[0062] It can be seen that the residual spectrum is discretized according to the preset wavelength interval to generate a sub-spectrum sequence. This discretization makes the spectral data easier to analyze and process. Each sub-spectrum contains a spectral data vector of a preset number of sampling points, which provides a standardized data unit for subsequent feature extraction. Feature extraction operations are performed on each sub-spectrum to generate a multi-dimensional feature vector, which enriches the spectral feature information. By judging the similarity between the multi-dimensional feature vector and the feature vector of the standard multi-wavelength spectrum, the interfering gas to which the sub-spectrum belongs can be accurately identified. Merging adjacent sub-spectra belonging to the same interfering gas reduces the confusion in interfering gas identification. Finally, the interfering gas corresponding to the sub-spectrum with the largest intensity is determined as the interfering gas with the greatest contribution, which improves the accuracy and efficiency of the identification of the maximum interfering gas, laying the foundation for accurately calculating the interference value and improving the reliability of methane concentration detection.
[0063] S123, determining whether the interfering gas with the greatest contribution is methane; It should be noted that the interference gas with the largest contribution has been identified through feature matching. Here, it is only necessary to determine whether the interference gas with the largest contribution is methane.
[0064] S128. If it is methane, output the total interference value.
[0065] Clearly, once methane is identified as the most interfering gas, the interference situation is relatively simple, eliminating the need for subsequent complex concentration calculations, interference value calculations, and residual spectrum updates for other interfering gases. Directly outputting the total interference value reduces unnecessary calculation steps.
[0066] S124. If it is not methane, determining the concentration of the interfering gas that contributes the most based on the spectral characteristic intensity of the interfering gas that contributes the most in the residual spectrum and the standard multi-wavelength spectrum; The spectral characteristic intensity refers to the intensity value of the characteristic peak or characteristic region in the residual spectrum that is associated with the interfering gas with the largest contribution, and it reflects the relative content of the interfering gas in the residual spectrum.
[0067] When it is determined that the interfering gas with the greatest contribution is not methane, in order to calculate the interference value of the interfering gas on the methane concentration detection, its concentration needs to be determined. In this case, this step is performed.
[0068] Specifically, the spectral characteristic intensity value corresponding to the most contributing interfering gas is extracted from the residual spectrum. Simultaneously, a standard multi-wavelength spectrum of the interfering gas is obtained from the interference coefficient library, and a reference intensity value at the same characteristic wavelength is found. The concentration of the most contributing interfering gas is determined by calculating the ratio of the residual spectrum characteristic intensity to the reference intensity value of the standard multi-wavelength spectrum and multiplying it by the reference concentration corresponding to the standard spectrum.
[0069] In some embodiments, a characteristic wavelength range is first determined based on the previously identified spectral characteristics of the interfering gas. Within the residual spectrum, the spectral data within this wavelength range is integrated or peaked to obtain a spectral characteristic intensity value. Standard multi-wavelength spectral data is read from the interference coefficient library to obtain corresponding reference intensity values and reference concentrations. The interfering gas concentration is then calculated using the formula.
[0070] In other embodiments, specialized spectral analysis software is used to import data from the residual spectrum and interference coefficient library. The software's built-in functions automatically identify the spectral characteristics of the interfering gas, extract intensity values, and calculate concentration based on the standard spectral data. The software can provide a visual interface to facilitate operator monitoring and adjustment of the calculation process.
[0071] In some embodiments, S124 specifically includes: obtaining the concentration of the interfering gas with the greatest contribution based on multiplying the ratio of the spectral characteristic intensity of the interfering gas with the greatest contribution in the residual spectrum to the reference intensity value at the same characteristic wavelength in the standard multi-wavelength spectrum by the reference concentration corresponding to the standard spectrum.
[0072] Specifically, the spectral features associated with the interfering gas with the greatest contribution must first be accurately extracted from the residual spectrum, and the corresponding spectral feature intensity must be determined. This requires finding a matching spectral feature region in the residual spectrum based on the previous identification results of the interfering gas, and then obtaining the intensity value of this region. Next, the standard multi-wavelength spectrum corresponding to the interfering gas is found from the interference coefficient library. The wavelength position in the standard spectrum that matches the spectral feature of the interfering gas in the residual spectrum is located, and the reference intensity value at this position is obtained. The ratio of the spectral feature intensity of the interfering gas in the residual spectrum to the reference intensity value at the same characteristic wavelength in the standard multi-wavelength spectrum is then calculated. This ratio reflects the difference between the relative intensity of the interfering gas in the current detection environment and that in the standard state. Finally, the calculated ratio is multiplied by the reference concentration corresponding to the standard spectrum to obtain the actual concentration of the interfering gas with the greatest contribution in the current complex environment. In this way, the concentration of the interfering gas can be more accurately determined by combining the standard spectrum with the spectral information from the actual detection.
[0073] It can be seen that the concentration of the interfering gas with the largest contribution is determined by multiplying the ratio of the spectral characteristic intensity of the residual spectrum to the reference intensity value at the same characteristic wavelength in the standard multi-wavelength spectrum by the reference concentration corresponding to the standard spectrum. This calculation method utilizes the corresponding characteristic information of the residual spectrum and the standard multi-wavelength spectrum. The ratio reflects the difference between the actual detection spectral characteristic intensity and the standard situation. Multiplying it by the reference concentration can accurately determine the actual concentration. Accurate concentration calculation is crucial for the subsequent precise calculation of the interference value, because the interference value is obtained by multiplying the concentration by the interference coefficient. Accurate interference value calculation can effectively eliminate the impact of interfering gases on methane concentration detection and help obtain a true and reliable target methane concentration value.
[0074] S125, multiplying the concentration by the corresponding interference coefficient to obtain an interference value; The interference coefficient refers to the coefficient of the interference effect of the interference gas stored in the interference coefficient library on the methane sensor detecting the methane concentration, which reflects the interference ability of the interference gas.
[0075] Specifically, the interference coefficient corresponding to the interfering gas with the largest contribution is obtained from the interference coefficient library. The interference gas concentration calculated in the previous step is multiplied by the interference coefficient to obtain a value, which is the interference value caused by the interfering gas on the methane concentration detection.
[0076] S126, adding the interference value to the total interference value; Specifically, the interference value calculated in the previous step is added to the total interference value accumulated previously to obtain a new total interference value. This new total interference value includes the interference values of all interference gases calculated previously and the interference value calculated this time.
[0077] S127, subtracting the standard multi-wavelength spectrum after concentration scaling corresponding to the largest interfering gas from the residual spectrum to update the residual spectrum; The concentration-scaled standard multi-wavelength spectrum is the spectrum that has been scaled based on the concentration of the interfering gas with the highest contribution. The purpose of scaling is to ensure that the standard multi-wavelength spectrum accurately reflects the spectral characteristics of the interfering gas at its current concentration.
[0078] After the interference values are calculated and accumulated, this step is performed to further remove the influence of the interfering gas that contributes the most to the residual spectrum and make the residual spectrum closer to the true spectrum of methane gas.
[0079] Specifically, the standard multi-wavelength spectrum is scaled according to the concentration of the interfering gas with the highest contribution. For example, if the interfering gas concentration is twice the standard concentration, the intensity of the standard multi-wavelength spectrum is amplified by two times. The scaled standard multi-wavelength spectrum is then subtracted point by point from the residual spectrum to produce an updated residual spectrum that reduces the spectral signature of the highest-contributing interfering gas.
[0080] In some embodiments, a scaling factor is first calculated based on the interfering gas concentration to scale the standard multi-wavelength spectrum. Then, a loop statement is used to subtract each data point of the residual spectrum from the scaled standard multi-wavelength spectrum to obtain updated residual spectrum data.
[0081] S130. Subtract the total interference value from the methane concentration value to obtain a target methane concentration value.
[0082] Specifically, a subtraction operation is performed using the initial methane concentration value obtained by the methane gas sensor as the minuend and the total interference value obtained through a series of calculations as the subtrahend. This subtraction eliminates the influence of the interfering gas on the methane concentration detection. The resulting difference is the target methane concentration value, that is, the accurate concentration of methane gas in the real environment.
[0083] As can be seen, the methane gas sensor acquires the raw methane concentration value, while the multi-wavelength spectrum analyzer generates a mixed spectrum containing information about methane and interfering gases. These two basic data acquisition methods provide the basis for subsequent analysis. The mixed spectrum is assigned to the residual spectrum and the total interference value is initialized, establishing the starting state for processing. Using an interference coefficient library containing the interference coefficients of each interfering gas for the methane sensor and standard multi-wavelength spectra, the interfering gas with the greatest contribution can be identified based on its spectral characteristics. After determining its concentration, the interference value is multiplied by the interference coefficient and accumulated. The corresponding scaled standard multi-wavelength spectrum is then subtracted from the residual spectrum to update the residual spectrum, and the influence of the interfering gas is removed in this cycle. The entire process eliminates the need for easily consumable filtering or adsorption materials, avoiding the cost and workload associated with periodic replacement due to material degradation. It also effectively handles interfering gases in complex environments, achieving highly accurate and reliable methane concentration detection.
[0084] The aforementioned anti-interference detection method for methane gas sensors in complex environments presents a significant technical limitation. During its execution, the method's core logic focuses on identifying and eliminating the interfering gases with the largest contributions in the residual spectrum. While this design allows for targeted treatment of primary interfering factors, in complex real-world applications, numerous interfering gases often exist. Individually, these gases contribute relatively little to methane concentration detection and are therefore of secondary importance. However, as the number of these smaller interfering gases increases and their respective concentrations accumulate in the gas mixture, their combined impact cannot be ignored. The resulting total interference effect can reach considerable levels, significantly interfering with the ultimate accuracy of the target methane concentration. Existing technical solutions, while focusing on addressing the most significant interfering gases, lack an effective holistic approach and coordinated processing mechanism for these smaller interfering gases. Consequently, even if the primary interfering gas is successfully eliminated, the cumulative interference from these smaller interfering gases can still hinder accurate methane concentration measurement.
[0085] Therefore, in some embodiments, After step S123, the method further includes: S201, performing a merging operation on the residual spectra according to the wavelength difference in the residual spectra to obtain a plurality of spectral region groups, and using the wavelength difference as a basis for determining a merging priority, wherein a larger wavelength difference corresponds to a smaller merging priority; The wavelength difference represents the difference in wavelength between different parts of the residual spectrum and is used to measure the degree of spectral dispersion. A spectral region group is formed by combining residual spectrum parts with a certain wavelength difference relationship. The spectra within each group have similar wavelength characteristics.
[0086] Specifically, the residual spectrum is scanned point by point or segment by segment, and the wavelength differences between adjacent segments are calculated. Based on a pre-set wavelength difference threshold or rule, segments with smaller wavelength differences are merged into a spectral region group. This merging operation divides the residual spectrum into multiple region groups with different wavelength characteristics, allowing each region group to be analyzed separately.
[0087] In some embodiments, a sliding window approach is employed. A fixed-length window is set and slid across the residual spectrum. At each window position, the average wavelength difference of the spectral portion within the window is calculated. If the average wavelength difference meets certain conditions (e.g., less than a threshold or within a certain range), the spectral portion within the window is merged into a region group. The window is moved and the above process is repeated until the entire residual spectrum is processed, which is not limited here.
[0088] S202. For each spectral region group, calculate a spectrum residual ratio with respect to the mixed spectrum; the spectrum residual ratio refers to a ratio of the amount of data contained in the residual spectrum to the amount of data contained in the mixed spectrum; Preprocess the residual and mixed spectrum data. Sort the spectral data by wavelength and check for outliers. If any, remove or correct them. For example, if the spectral intensity at a particular wavelength shows a significant deviation (largely different from adjacent wavelengths), correct it using interpolation.
[0089] Next, count the data volume of the residual spectrum and the mixed spectrum separately. This can be done by traversing the spectral data and using a counter to record the number of data points. Finally, calculate the spectral residual ratio. Divide the data volume of the residual spectrum by the data volume of the mixed spectrum to obtain the spectral residual ratio.
[0090] S203, multiplying the spectrum residual ratio by the methane concentration value to obtain a combined concentration; S204, multiplying the combined concentration by the average interference coefficient to obtain a combined interference value; S205: Add the combined interference value to the total interference value.
[0091] It can be seen that after the step of determining the maximum interfering gas, the residual spectra are merged based on the wavelength difference. The wavelength difference is used as the basis for merging priority because the wavelength difference reflects the degree of difference in the spectral region. Regions with small wavelength differences are more likely to have similar characteristics. Prioritizing merging can reduce data redundancy. After obtaining multiple spectral region groups, the spectral residual ratio with the mixed spectrum is calculated. This ratio is determined by the ratio of the residual spectrum to the mixed spectrum data volume, which can reflect the degree of influence of each region group on the overall spectrum. It is multiplied by the methane concentration value to obtain the combined concentration, and then multiplied by the average interference coefficient to obtain the combined interference value and accumulated to the total interference value. This process takes into account many small-contribution interfering gases that were originally ignored. By comprehensively processing them, the impact of their cumulative interference on the accuracy of the target methane concentration is avoided, thereby improving the detection accuracy.
[0092] The following describes an exemplary anti-interference detection system 300 for a methane gas sensor in a complex environment provided by an embodiment of the present application. Figure 3 3 is a schematic diagram of an exemplary hardware structure of a methane gas sensor anti-interference detection system 300 in a complex environment provided by an embodiment of the present application.
[0093] In some embodiments, the anti-interference detection system 300 for a methane gas sensor in a complex environment is a computer device, or the anti-interference detection system 300 for a methane gas sensor in a complex environment includes a computer device. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with other external terminals or servers via a network connection. In some embodiments, the network interface can be a wired network interface, or in some embodiments, a wireless network interface. When the computer program is executed by the processor, the method in the embodiments of the present application is implemented.
[0094] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0095] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0096] As used in the above embodiments, the term “when…” may be interpreted to mean “if…” or “after…” or “in response to determining…” or “in response to detecting…”, depending on the context. Similarly, the phrases “upon determining…” or “if (stated condition or event) is detected” may be interpreted to mean “if determining…” or “in response to determining…” or “upon detecting (stated condition or event)” or “in response to detecting (stated condition or event)”, depending on the context.
[0097] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk).
[0098] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A methane gas sensor anti-interference detection method in a complex environment, characterized in that: include: The methane concentration value is obtained by a methane gas sensor, and the mixed spectrum is obtained by a multi-wavelength spectrum analyzer; The mixed spectrum is used as input and combined with the interference coefficient library to output the total interference value and the residual spectrum; the interference coefficient library includes the interference coefficient of each interference gas on the methane sensor and the standard multi-wavelength spectrum of each interference gas; wherein: Assigning the mixed spectrum to the residual spectrum and initializing the total interference value, wherein the residual spectrum is the spectrum remaining after stripping the interfering gas, and the total interference value is the sum of the interference values of the interfering gas on the methane gas; Performing feature matching on the residual spectrum and the standard multi-wavelength spectrum to identify the interfering gas with the largest contribution; Determine whether the interfering gas with the greatest contribution is methane; If it is not methane, determining the concentration of the interfering gas that contributes the most based on the spectral characteristic intensity of the interfering gas that contributes the most in the residual spectrum and the standard multi-wavelength spectrum; Multiplying the concentration by the corresponding interference coefficient to obtain an interference value; Adding the interference value to the total interference value; Subtracting the standard multi-wavelength spectrum scaled by the concentration of the largest interfering gas from the residual spectrum to update the residual spectrum; The target methane concentration value is obtained by subtracting the total interference value from the methane concentration value.
2. The method according to claim 1, characterized in that After the step of determining whether the interfering gas with the greatest contribution is methane, the method further includes: performing a merging operation on the residual spectrum according to the wavelength difference in the residual spectrum to obtain a plurality of spectral region groups, and using the wavelength difference as a basis for determining a merging priority, wherein a larger wavelength difference corresponds to a smaller merging priority; For each of the spectral region groups, calculating a spectrum residual ratio with the mixed spectrum; the spectrum residual ratio refers to a ratio of the amount of data contained in the residual spectrum and the amount of data contained in the mixed spectrum; Multiplying the spectral residual ratio by the methane concentration value to obtain a combined concentration; Multiplying the combined concentration by the average interference coefficient to obtain a combined interference value; The combined interference value is accumulated to the total interference value.
3. The method according to claim 1, characterized in that The step of performing feature matching on the residual spectrum and the standard multi-wavelength spectrum to identify the interfering gas with the greatest contribution specifically includes: Discretizing the residual spectrum at preset wavelength intervals to generate a continuous and non-overlapping sub-spectrum sequence, wherein each sub-spectrum includes a spectral data vector of a preset number of sampling points; Perform feature extraction on each sub-spectrum to generate a multi-dimensional feature vector; Determining similarity between the multidimensional feature vector and a feature vector of a standard multi-wavelength spectrum; If the similarity is greater than the threshold, the sub-spectrum is judged to belong to the corresponding interfering gas; Merge adjacent sub-spectra that belong to the same interfering gas; The interfering gas corresponding to the sub-spectrum with the largest intensity is determined as the interfering gas with the greatest contribution.
4. The method according to claim 3, characterized in that The step of determining the similarity between the multidimensional feature vector and the feature vector of the standard multi-wavelength spectrum specifically includes: Sim(S i ,R j )=α·DTW(S i ,R j )+β·PCM(S i ,R j )+γ·COS(S i ,R j ) Where, Sim(S i ,R j ) is the similarity, S i is the eigenvector of the sub-spectrum, R j is the characteristic vector of the standard multi-wavelength spectrum, DTW(S i ,R j ) is the dynamic time warping distance, PCM(S i ,R j ) is the Pearson correlation coefficient, COS(S i ,R j ) is the cosine similarity, and α, β, and γ are weights.
5. The method according to claim 3, characterized in that The multidimensional feature vector includes: spectral peak intensity, half-height width, and peak center wavelength. The spectral peak intensity is determined by a Gaussian fitting algorithm, the half-height width is determined by the second-order derivative zero crossing point, and the peak center wavelength is accurately measured by a centroid algorithm.
6. The method according to claim 1, wherein The step of determining the concentration of the interfering gas with the greatest contribution based on the spectral characteristic intensity of the interfering gas with the greatest contribution in the residual spectrum and the standard multi-wavelength spectrum specifically includes: The concentration of the interfering gas with the greatest contribution is obtained by multiplying the ratio of the spectral characteristic intensity of the interfering gas with the greatest contribution in the residual spectrum to the reference intensity value at the same characteristic wavelength in the standard multi-wavelength spectrum by the reference concentration corresponding to the standard spectrum.
7. The method according to claim 1, characterized in that After the step of determining whether the interfering gas with the greatest contribution is methane, the method further includes: If it is methane, the total interference value is output.
8. A methane gas sensor anti-interference detection system in a complex environment, characterized by: The anti-interference detection system for methane gas sensors under complex environments includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the anti-interference detection system for methane gas sensors under complex environments to execute the method described in any one of claims 1 to 7.
9. A computer program product comprising instructions, characterized in that When the computer program product is run on an anti-interference detection system for a methane gas sensor under a complex environment, the anti-interference detection system for a methane gas sensor under a complex environment is enabled to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium comprising instructions, characterized in that: When the instruction is executed on the anti-interference detection system for a methane gas sensor under a complex environment, the anti-interference detection system for a methane gas sensor under a complex environment executes the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Laser methane concentration measuring method based on double-spectrum absorption line and waveform matching
CN105044026A
Three-channel infrared methane detector capable of resisting water vapor interference
CN111929269A
Signal control method and system of laser gas sensor
CN118032711A
Tunnel multi-component high-risk harmful gas detection system and method based on spectrum technology
CN118518614A
VOCs online monitoring system
CN118688144A
Cited By
Method and equipment for measuring density of organic carbon in soil
CN121068588A
