Gasoline/diesel oil detection and analysis method and device based on near infrared modeling

文档序号:1919784 发布日期:2021-12-03 浏览:16次 中文

阅读说明:本技术 基于近红外建模的汽油/柴油检测分析方法及装置 (Gasoline/diesel oil detection and analysis method and device based on near infrared modeling ) 是由 杜彪 丁焰 朱云鹏 尹航 鲁冰 吉喆 裴修尧 周玉山 于 2021-07-29 设计创作,主要内容包括:本公开提供一种基于近红外建模的汽油/柴油检测分析方法及装置,能够根据汽油/柴油样品的近红外检测值以及各个成分的湿化学值进行结合关联,进而构建对应的数据库,形成近红外分析模型,这样,就可以利用近红外分析模型对待检测的汽油/柴油的各项成分含量数据进行检测分析,使得检测得到的各成分含量的准确度得到有效提高。(The invention provides a gasoline/diesel detection and analysis method and device based on near-infrared modeling, which can be used for performing combination and association according to near-infrared detection values of gasoline/diesel samples and the wet chemical values of all components, further constructing a corresponding database and forming a near-infrared analysis model, so that the near-infrared analysis model can be used for performing detection and analysis on content data of all components of gasoline/diesel to be detected, and the accuracy of the content of all the components obtained through detection is effectively improved.)

1. A gasoline/diesel detection analysis method based on near infrared modeling is characterized by comprising the following steps:

s1, obtaining n gasoline/diesel oil samples;

s2, extracting sulfur components, octane components, aromatic hydrocarbon components, olefin components and other components in each gasoline/diesel oil sample;

s3, acquiring the near infrared spectrum of each gasoline/diesel oil sample by using near infrared equipment;

s4, detecting each component of each gasoline/diesel oil sample by using a wet chemical method, and obtaining a first wet chemical value of the sulfur component, a second wet chemical value of the octane component, a third wet chemical value of the aromatic hydrocarbon component, a fourth wet chemical value of the olefin component and a fifth wet chemical value of the other components of each gasoline/diesel oil sample;

s5, selecting a region with the largest correlation of information quantity from the near infrared spectrum of each gasoline/diesel oil sample as a near infrared spectrum region;

s6, performing first derivative treatment on the near infrared spectrum region of each gasoline/diesel oil sample, and performing multiple linear regression treatment to obtain a near infrared detection value;

s7, correlating the near infrared detection value of each gasoline/diesel sample with the first wet chemical value, the second wet chemical value, the third wet chemical value, the fourth wet chemical value and the fifth wet chemical value by utilizing partial least square operation processing;

s8, calculating the root mean square error between the near infrared detection value after each component of each gasoline/diesel oil sample is associated and the corresponding wet chemical value, and deleting the associated data of the gasoline/diesel oil sample of which the root mean square error is greater than the error threshold;

s9, constructing a database by using the correlated data of the rest gasoline/diesel oil samples, and taking the database as a near infrared analysis initial model;

s10, performing cross inspection on the near-infrared analysis initial model by using n gasoline/diesel oil samples to obtain a near-infrared analysis model;

s11, acquiring a near infrared spectrum to be analyzed by using infrared equipment for gasoline/diesel oil to be detected, and processing the gasoline/diesel oil to be detected by using a humidification method to obtain wet chemical values to be analyzed corresponding to various components;

and S12, inputting the near infrared spectrum to be analyzed of the gasoline/diesel oil to be detected and the wet chemical value to be analyzed corresponding to each component into the near infrared analysis model, and processing by using the near infrared model to determine the content data of each component of the gasoline/diesel oil to be detected.

2. The method according to claim 1, wherein step S10 specifically comprises:

s10-1, ranking N gasoline/diesel samples N1,N2……NnSelecting N from N gasoline/diesel oil samples1Taking a gasoline/diesel sample as a test sample, and taking the rest gasoline/diesel sample as a modeling sample;

s10-2, utilizing the modeling sample to construct a near infrared analysis initial model again on the constructed near infrared analysis initial model according to the scheme of the steps S2 to S9;

s10-3, acquiring near infrared spectra corresponding to various components of a test sample by using infrared equipment, processing the test sample by using a humidification method to obtain test wet chemical values corresponding to the various components, inputting the test wet chemical values into a near infrared analysis initial model for processing, outputting content data of the various components of the test sample, comparing the output content data of the various components of the test sample with real data of the test sample, and outputting the accuracy of the test;

s10-4, selecting the next gasoline/diesel oil sample as a test sample in sequence according to the sequence, taking the rest gasoline/diesel oil samples as modeling samples, repeating the schemes of the steps S10-2 and S10-3 until the n gasoline/diesel oil samples are respectively taken as test samples to obtain the accuracy rate p of corresponding test1,p2……pn

S10-5, calculating the accuracy rate p of the test1,p2……pnAnd judging whether P is larger than or equal to P, if so, taking the finally obtained near-infrared analysis initial model as a near-infrared model, otherwise, obtaining a new gasoline/diesel sample again, repeating the processes from S10-1 to S10-4 by using the new gasoline/diesel sample until the obtained P is larger than or equal to P, and taking the finally obtained near-infrared analysis initial model as the near-infrared model, wherein P is an accuracy threshold value.

3. The method according to claim 1 or 2, wherein after step S10, the method further comprises:

s10', acquiring a gasoline/diesel oil samples as a correction set, acquiring b gasoline/diesel oil samples as a verification set, re-constructing a near-infrared analysis verification model on the constructed near-infrared analysis model by using the gasoline/diesel oil samples in the correction set according to the scheme of the steps S2 to S9, sequentially inputting the gasoline/diesel oil samples in the verification set into the near-infrared analysis verification model to output verification results, comparing the verification results with the real results of the gasoline/diesel oil samples in the verification set, and determining the verification accuracy;

and S10 ', judging whether the verification accuracy exceeds a verification threshold value, if so, taking the obtained near-infrared analysis verification model as a final near-infrared analysis model, otherwise, obtaining a new correction set and a new verification set, repeating the scheme of the step S10' until the obtained verification accuracy exceeds the verification threshold value, and taking the obtained near-infrared analysis verification model as the final near-infrared analysis model.

4. The method according to claim 1, wherein the multiple linear regression processing procedure in step S6 specifically includes:

multiplying at least one principal component spectrum in the near-infrared spectrum region after the first derivative processing by the corresponding principal component score coefficient to obtain corresponding principal component spectrum data, and constructing at least one principal component matrix according to the at least one principal component spectrum data;

and constructing at least one main linear function according to the at least one principal component matrix, and performing linear regression processing on the at least one main linear function to obtain a corresponding near-infrared detection value.

5. The method according to claim 4, wherein the operation processing procedure of the partial least squares method in step S7 specifically includes:

constructing a corresponding spectrum matrix according to near infrared detection values, screening main wet chemical values corresponding to main components from the first wet chemical value, the second wet chemical value, the third wet chemical value, the fourth wet chemical value and the fifth wet chemical value corresponding to each component, constructing a main wet chemical matrix according to the main wet chemical values, correlating the spectrum matrix with the main wet chemical matrix, and calculating a predicted linear relation function of the two matrixes;

step S9, specifically, it is: and (3) constructing a database by utilizing the predicted linear relation function obtained by each gasoline/diesel oil sample, and taking the database as a near infrared analysis initial model.

6. The method of claim 1, wherein the other components comprise at least one of:

a benzene component, a silicon component, a toluene component, a phosphorus component, a chlorine component, a manganese component, a lead component, an iron component, an oxygen component, a colloid component, an ethanol component, a residual carbon component, a ash component, a hexadecane component, a fatty acid methyl ester component, and a pollutant component.

7. The method according to claim 1, wherein after step S3, the method further comprises:

s3', spectral regions in which the absorbance in the obtained near infrared spectrum exceeds the absorption threshold are deleted, and noise regions in the respective near infrared spectra are deleted.

8. A gasoline/diesel oil detection and analysis device based on near infrared modeling is characterized by comprising:

the acquisition module is used for acquiring n gasoline/diesel oil samples;

the extraction module is used for extracting sulfur components, octane components, aromatic hydrocarbon components, olefin components and other components in each gasoline/diesel oil sample;

the near-infrared acquisition module is used for acquiring the near-infrared spectrum of each gasoline/diesel oil sample by using near-infrared equipment;

the wet chemical processing module is used for detecting each component of each gasoline/diesel oil sample by using a wet chemical method to obtain a first wet chemical value of the sulfur component, a second wet chemical value of the octane component, a third wet chemical value of the aromatic hydrocarbon component, a fourth wet chemical value of the olefin component and a fifth wet chemical value of the other components of each gasoline/diesel oil sample;

a selection module for selecting a region of maximum correlation of information content from the near infrared spectrum of each of the gasoline/diesel samples as a near infrared spectrum region;

the mathematical processing module is used for carrying out first derivative processing on the near infrared spectrum region of each gasoline/diesel oil sample and then carrying out multiple linear regression processing to obtain a near infrared detection value;

a correlation processing module for correlating the near infrared detection value of each gasoline/diesel sample with the first wet-chemical value, the second wet-chemical value, the third wet-chemical value, the fourth wet-chemical value and the fifth wet-chemical value by using partial least squares operation;

the deleting module is used for calculating the root mean square error between the near infrared detection value after each component of each gasoline/diesel oil sample is associated and the corresponding wet chemical value, and deleting the associated data of the gasoline/diesel oil sample of which the root mean square error is greater than the error threshold;

the building module is used for building a database by utilizing the correlated data of the rest gasoline/diesel oil samples, and taking the database as a near infrared analysis initial model;

the cross inspection module is used for carrying out cross inspection on the near-infrared analysis initial model by using n gasoline/diesel oil samples to obtain a near-infrared analysis model;

the pretreatment module to be detected is used for acquiring a near infrared spectrum to be analyzed of the gasoline/diesel oil to be detected by using infrared equipment and processing the gasoline/diesel oil to be detected by using a humidification method to obtain wet chemical values to be analyzed corresponding to various components;

and the detection analysis module is used for inputting the near infrared spectrum to be analyzed of the gasoline/diesel oil to be detected and the wet chemical value to be analyzed corresponding to each component into the near infrared analysis model, and processing and determining the content data of each component of the gasoline/diesel oil to be detected by using the near infrared analysis model.

9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of claims 1 to 7 when executing the program.

10. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1 to 7.

Technical Field

The disclosure relates to the technical field of oil product detection, in particular to a gasoline/diesel oil detection and analysis method and device based on near-infrared modeling.

Background

The near infrared spectrum analysis method is widely applied to oil property analysis, and compared with the traditional laboratory test method, the method has the advantages of high analysis speed, high precision, low consumption and the like.

However, in the near infrared spectrum analysis in the prior art, only the near infrared spectrum of the gasoline/diesel oil is generally analyzed, and the content of each component of the gasoline/diesel oil or the corresponding data index is determined according to the near infrared spectrum. The single near infrared spectrum analysis may cause inaccurate detection of various indexes of gasoline/diesel oil, and the detection precision is not high.

Disclosure of Invention

In view of the above, the present disclosure is directed to a method and an apparatus for detecting and analyzing gasoline/diesel based on near infrared modeling, which can solve or partially solve the above technical problems.

In view of the above, the disclosure provides, in a first aspect, a method for detecting and analyzing gasoline/diesel based on near infrared modeling, including:

s1, obtaining n gasoline/diesel oil samples;

s2, extracting sulfur components, octane components, aromatic hydrocarbon components, olefin components and other components in each gasoline/diesel oil sample;

s3, acquiring the near infrared spectrum of each gasoline/diesel oil sample by using near infrared equipment;

s4, detecting each component of each gasoline/diesel oil sample by using a wetting method, and obtaining a first wet chemical value of the sulfur component, a second wet chemical value of the octane component, a third wet chemical value of the aromatic hydrocarbon component, a fourth wet chemical value of the olefin component and a fifth wet chemical value of the other components of each gasoline/diesel oil sample;

s5, selecting a region with the largest correlation of information quantity from the near infrared spectrum of each gasoline/diesel oil sample as a near infrared spectrum region;

s6, performing first derivative treatment on the near infrared spectrum region of each gasoline/diesel oil sample, and performing multiple linear regression treatment to obtain a near infrared detection value;

s7, correlating the near infrared detection value of each gasoline/diesel sample with the first wet chemical value, the second wet chemical value, the third wet chemical value, the fourth wet chemical value and the fifth wet chemical value by utilizing partial least square operation processing;

s8, calculating the root mean square error between the near infrared detection value after each component of each gasoline/diesel oil sample is associated and the corresponding wet chemical value, and deleting the associated data of the gasoline/diesel oil sample of which the root mean square error is greater than the error threshold;

s9, constructing a database by using the correlated data of the rest gasoline/diesel oil samples, and taking the database as a near infrared analysis initial model;

s10, performing cross inspection on the near-infrared analysis initial model by using n gasoline/diesel oil samples to obtain a near-infrared analysis model;

s11, acquiring a near infrared spectrum to be analyzed by using infrared equipment for gasoline/diesel oil to be detected, and processing the gasoline/diesel oil to be detected by using a humidification method to obtain wet chemical values to be analyzed corresponding to various components;

and S12, inputting the near infrared spectrum to be analyzed of the gasoline/diesel oil to be detected and the wet chemical value to be analyzed corresponding to each component into the near infrared analysis model, and processing by using the near infrared model to determine the content data of each component of the gasoline/diesel oil to be detected.

Further, step S10 specifically includes:

s10-1, ranking N gasoline/diesel samples N1,N2……NnSelecting N from N gasoline/diesel oil samples1Taking a gasoline/diesel sample as a test sample, and taking the rest gasoline/diesel sample as a modeling sample;

s10-2, utilizing the modeling sample to construct a near infrared analysis initial model again on the constructed near infrared analysis initial model according to the scheme of the steps S2 to S9;

s10-3, acquiring near infrared spectra corresponding to various components of a test sample by using infrared equipment, processing the test sample by using a humidification method to obtain test wet chemical values corresponding to the various components, inputting the test wet chemical values into a near infrared analysis initial model for processing, outputting content data of the various components of the test sample, comparing the output content data of the various components of the test sample with real data of the test sample, and outputting the accuracy of the test;

s10-4, selecting the next gasoline/diesel oil sample as a test sample in sequence according to the sequence, taking the rest gasoline/diesel oil samples as modeling samples, repeating the schemes of the steps S10-2 and S10-3 until the n gasoline/diesel oil samples are respectively taken as test samples to obtain the accuracy rate p of corresponding test1,p2……pn

S10-5, calculating the accuracy rate p of the test1,p2……pnAnd judging whether P is larger than or equal to P, if so, taking the finally obtained near-infrared analysis initial model as a near-infrared model, otherwise, obtaining a new gasoline/diesel sample again, repeating the processes from S10-1 to S10-4 by using the new gasoline/diesel sample until the obtained P is larger than or equal to P, and taking the finally obtained near-infrared analysis initial model as the near-infrared model, wherein P is an accuracy threshold value.

Further, after step S10, the method further includes:

s10', acquiring a gasoline/diesel oil samples as a correction set, acquiring b gasoline/diesel oil samples as a verification set, re-constructing a near-infrared analysis verification model on the constructed near-infrared analysis model by using the gasoline/diesel oil samples in the correction set according to the scheme of the steps S2 to S9, sequentially inputting the gasoline/diesel oil samples in the verification set into the near-infrared analysis verification model to output verification results, comparing the verification results with the real results of the gasoline/diesel oil samples in the verification set, and determining the verification accuracy;

and S10 ', judging whether the verification accuracy exceeds a verification threshold value, if so, taking the obtained near-infrared analysis verification model as a final near-infrared analysis model, otherwise, obtaining a new correction set and a new verification set, repeating the scheme of the step S10' until the obtained verification accuracy exceeds the verification threshold value, and taking the obtained near-infrared analysis verification model as the final near-infrared analysis model.

Further, the multiple linear regression processing procedure in step S6 specifically includes:

multiplying at least one principal component spectrum in the near-infrared spectrum region after the first derivative processing by the corresponding principal component score coefficient to obtain corresponding principal component spectrum data, and constructing at least one principal component matrix according to the at least one principal component spectrum data;

and constructing at least one main linear function according to the at least one principal component matrix, and performing linear regression processing on the at least one main linear function to obtain a corresponding near-infrared detection value.

Further, the operation processing procedure of the partial least squares method in step S7 specifically includes:

constructing a corresponding spectrum matrix according to near infrared detection values, screening main wet chemical values corresponding to main components from the first wet chemical value, the second wet chemical value, the third wet chemical value, the fourth wet chemical value and the fifth wet chemical value corresponding to each component, constructing a main wet chemical matrix according to the main wet chemical values, correlating the spectrum matrix with the main wet chemical matrix, and calculating a predicted linear relation function of the two matrixes;

step S9, specifically, it is: and (3) constructing a database by utilizing the predicted linear relation function obtained by each gasoline/diesel oil sample, and taking the database as a near infrared analysis initial model.

Further, the other ingredients include at least one of:

a benzene component, a silicon component, a toluene component, a phosphorus component, a chlorine component, a manganese component, a lead component, an iron component, an oxygen component, a colloid component, an ethanol component, a residual carbon component, a ash component, a hexadecane component, a fatty acid methyl ester component, and a pollutant component.

Further, after step S3, the method further includes:

s3', spectral regions in which the absorbance in the obtained near infrared spectrum exceeds the absorption threshold are deleted, and noise regions in the respective near infrared spectra are deleted.

A second aspect of the present disclosure provides a gasoline/diesel detection and analysis device based on near-infrared modeling, including:

the acquisition module is used for acquiring n gasoline/diesel oil samples;

the extraction module is used for extracting sulfur components, octane components, aromatic hydrocarbon components, olefin components and other components in each gasoline/diesel oil sample;

the near-infrared acquisition module is used for acquiring the near-infrared spectrum of each gasoline/diesel oil sample by using near-infrared equipment;

the wet chemical processing module is used for detecting each component of each gasoline/diesel oil sample by using a wetting method to obtain a first wet chemical value of the sulfur component, a second wet chemical value of the octane component, a third wet chemical value of the aromatic hydrocarbon component, a fourth wet chemical value of the olefin component and a fifth wet chemical value of the other components of each gasoline/diesel oil sample;

the selecting module is used for selecting a region with the largest correlation between the information amount and the corresponding components from the near infrared spectrum of each gasoline/diesel oil sample as a near infrared spectrum region;

the mathematical processing module is used for carrying out first derivative processing on the near infrared spectrum region of each gasoline/diesel oil sample and then carrying out multiple linear regression processing to obtain a near infrared detection value;

a correlation processing module for correlating the near infrared detection value of each gasoline/diesel sample with the first wet-chemical value, the second wet-chemical value, the third wet-chemical value, the fourth wet-chemical value and the fifth wet-chemical value by using partial least squares operation;

the deleting module is used for calculating the root mean square error between the near infrared detection value after each component of each gasoline/diesel oil sample is associated and the corresponding wet chemical value, and deleting the associated data of the gasoline/diesel oil sample of which the root mean square error is greater than the error threshold;

the building module is used for building a database by utilizing the correlated data of the rest gasoline/diesel oil samples, and taking the database as a near infrared analysis initial model;

the cross inspection module is used for carrying out cross inspection on the near-infrared analysis initial model by using n gasoline/diesel oil samples to obtain a near-infrared analysis model;

the pretreatment module to be detected is used for acquiring a near infrared spectrum to be analyzed of the gasoline/diesel oil to be detected by using infrared equipment and processing the gasoline/diesel oil to be detected by using a humidification method to obtain wet chemical values to be analyzed corresponding to various components;

and the detection analysis module is used for inputting the near infrared spectrum to be analyzed of the gasoline/diesel oil to be detected and the wet chemical value to be analyzed corresponding to each component into the near infrared analysis model, and processing and determining the content data of each component of the gasoline/diesel oil to be detected by using the near infrared analysis model.

A third aspect of the present disclosure proposes an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of the first aspect when executing the program.

A fourth aspect of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method of the first aspect.

From the above, the near-infrared modeling-based gasoline/diesel detection and analysis method and device provided by the disclosure can combine and correlate the near-infrared detection value of the gasoline/diesel sample and the wet chemical value of each component, and further construct the corresponding database to form the near-infrared analysis model, so that the near-infrared analysis model can be used for detecting and analyzing the content data of each component of the gasoline/diesel to be detected, and the accuracy of the content of each component obtained through detection is effectively improved.

Drawings

In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings needed to be used in the description of the embodiments or related technologies are briefly introduced below, and it is obvious that the drawings in the following description are only embodiments of the present disclosure, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.

FIG. 1 is a schematic flow chart of a gasoline/diesel detection analysis method based on near infrared modeling according to an embodiment of the disclosure;

FIG. 2 is a schematic structural diagram of a gasoline/diesel detection and analysis device based on near infrared modeling according to an embodiment of the disclosure;

fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.

Detailed Description

For the purpose of promoting a better understanding of the objects, aspects and advantages of the present disclosure, reference is made to the following detailed description taken in conjunction with the accompanying drawings.

It is to be noted that technical terms or scientific terms used in the embodiments of the present disclosure should have a general meaning as understood by those having ordinary skill in the art to which the present disclosure belongs, unless otherwise defined. The use of "first," "second," and similar terms in the embodiments of the disclosure is not intended to indicate any order, quantity, or importance, but rather to distinguish one element from another. The word "comprising" or "comprises", and the like, means that the element or item listed before the word covers the element or item listed after the word and its equivalents, but does not exclude other elements or items. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect.

As shown in fig. 1, the method for detecting and analyzing gasoline/diesel based on near-infrared modeling provided by this embodiment specifically includes the following steps:

s1, obtaining n gasoline/diesel oil samples.

And S2, extracting sulfur components, octane components, aromatic hydrocarbon components, olefin components and other components in each gasoline/diesel oil sample.

And S3, acquiring the near infrared spectrum of each gasoline/diesel oil sample by using near infrared equipment.

S4, detecting each component of each gasoline/diesel oil sample by a wetting method, and obtaining a first wet chemical value of the sulfur component, a second wet chemical value of the octane component, a third wet chemical value of the aromatic hydrocarbon component, a fourth wet chemical value of the olefin component and a fifth wet chemical value of the other components of each gasoline/diesel oil sample.

Wherein the wet-chemical process used comprises at least one of: liquid phase deposition, electrochemical deposition, sol-gel. The wet chemical method can be used for accurately determining the numerical values of various components in gasoline or diesel oil, and specifically comprises the following steps: a first wet-chemical value of the sulfur component, a second wet-chemical value of the octane component, a third wet-chemical value of the aromatic component, a fourth wet-chemical value of the olefin component, and a fifth wet-chemical value of the other component are obtained.

S5, selecting the region with the largest correlation of information quantity from the near infrared spectrum of each gasoline/diesel oil sample as a near infrared spectrum region.

The near infrared spectrum can be selected by utilizing a pre-trained neural network model, the near infrared spectrum is input into the neural network model for processing, and a corresponding near infrared spectrum region is output.

The corresponding neural network model includes: the gasoline neural network model can screen the near infrared spectrum of gasoline and select a gasoline near infrared spectrum region with the maximum correlation with each index of the gasoline; and the diesel neural network model can screen the near infrared spectrum of the diesel to select the diesel near infrared spectrum region with the maximum correlation with each index of the diesel.

The training process of the gasoline neural network comprises the following steps:

and S51, constructing a first deep neural network initial model in advance. Wherein, include: the device comprises an input layer, a plurality of hidden layers and an output layer, wherein the number of the hidden layers can be set according to actual needs.

S52, near infrared spectra of a predetermined number of gasoline samples are acquired, and target region labeling is performed for the spectral region of maximum correlation for each spectrum.

S53, inputting the first gasoline sample into the first deep neural network initial model for training, if the spectral region output by training is different from the target region mark, adjusting the parameters in the first deep neural network initial model until the spectral region output by training is the same as the target region mark, and then inputting the next gasoline sample into the first deep neural network initial model for training.

And S54, when all the gasoline samples are completely trained, taking the trained first deep neural network initial model as a gasoline neural network model.

The training process of the diesel neural network comprises the following steps:

s51', a second deep neural network initial model is constructed in advance. Wherein, include: the device comprises an input layer, a plurality of hidden layers and an output layer, wherein the number of the hidden layers can be set according to actual needs.

S52', acquiring near infrared spectra of a predetermined number of diesel oil samples, and performing target region labeling for the spectral region having the greatest correlation for each spectrum. The number of the diesel oil samples can be the same as or different from that of the gasoline samples, and the diesel oil samples can be selected independently according to actual conditions.

S53', inputting the first diesel sample into the second deep neural network initial model for training, if the spectral region output by training is different from the target region mark, adjusting the parameters in the second deep neural network initial model until the spectral region output by training is the same as the target region mark, and then inputting the next diesel sample into the second deep neural network initial model for training.

And S54', when all the diesel samples are completely trained, taking the trained second deep neural network initial model as a diesel neural network model.

After the gasoline neural network model and/or the diesel neural network model are obtained, corresponding gasoline inspection samples and/or diesel inspection samples can be correspondingly obtained to inspect the accuracy of the gasoline neural network model and/or the diesel neural network model. When the accuracy obtained by the inspection result is greater than or equal to a preset threshold value, a gasoline neural network model and/or a diesel neural network model can be finally determined; if the accuracy rate of the test result is smaller than the preset threshold value, the gasoline test sample and/or the diesel test sample are/is used as a training sample to continue training the gasoline neural network model and/or the diesel neural network model, and the process is continuously repeated until the accuracy rate of the obtained test result is larger than or equal to the preset threshold value.

And identifying the corresponding near infrared spectrum by using the obtained gasoline neural network model and/or diesel neural network model, and further more accurately screening out the spectral region with the maximum correlation of the information quantity. The screening precision and accuracy are effectively improved.

And S6, performing first derivative treatment on the near infrared spectrum region of each gasoline/diesel oil sample, and performing multiple linear regression treatment to obtain a near infrared detection value.

The first derivative processing is carried out for the purposes of reducing the influence of low-frequency noise and drift of the near-infrared spectrogram, improving the resolution, facilitating accurate positioning of the peak position and amplifying high-frequency noise.

S7, correlating the near infrared detection value of each gasoline/diesel oil sample with the first wet chemical value, the second wet chemical value, the third wet chemical value, the fourth wet chemical value and the fifth wet chemical value by utilizing partial least square operation processing.

And S8, calculating the root mean square error between the near infrared detection value after each component of each gasoline/diesel oil sample is associated and the corresponding wet chemical value, and deleting the data after the root mean square error is greater than the error threshold value.

And S9, constructing a database by using the correlated data of the rest gasoline/diesel oil samples, and taking the database as a near infrared analysis initial model.

And S10, performing cross inspection on the near-infrared analysis initial model by using n gasoline/diesel oil samples to obtain a near-infrared analysis model.

And S11, acquiring the near infrared spectrum to be analyzed of the gasoline/diesel oil to be detected by using infrared equipment, and processing the gasoline/diesel oil to be detected by using a humidification method to obtain the wet chemical value to be analyzed corresponding to each component.

And S12, inputting the near infrared spectrum to be analyzed of the gasoline/diesel oil to be detected and the wet chemical value to be analyzed corresponding to each component into the near infrared analysis model, and processing by using the near infrared model to determine the content data of each component of the gasoline/diesel oil to be detected.

In the above scheme, if a gasoline sample is selected, the correspondingly obtained near-infrared analysis model is a gasoline near-infrared analysis model, and if a diesel sample is selected, the correspondingly obtained near-infrared analysis model is a diesel infrared analysis model.

By the scheme, the near-infrared detection value of the gasoline/diesel sample and the wet chemical value of each component can be combined and associated, and then the corresponding database is constructed to form the near-infrared analysis model, so that the content data of each component of the gasoline/diesel to be detected can be detected and analyzed by using the near-infrared analysis model, and the accuracy of the content of each component obtained by detection is effectively improved.

In some embodiments, after step S3, the method further comprises:

s3', spectral regions in which the absorbance in the obtained near infrared spectrum exceeds the absorption threshold are deleted, and noise regions in the respective near infrared spectra are deleted.

To avoid interference in the near infrared spectrum in regions of the spectrum where absorbance exceeds the absorbance threshold, they are deleted. And spectral regions that are noisy, are also removed. This makes the near infrared spectrum more distinctive.

Since the absorption threshold corresponding to the absorbance of each spectrum may change continuously, however, one absorption threshold cannot be set every time a near infrared spectrum is acquired, which wastes time and reduces the overall efficiency.

Therefore, a large number of labeled near infrared spectrums with corresponding light absorption threshold values and noise threshold values are selected, the labeled near infrared spectrums are used for training the deep neural network, and after the training is finished, the deep neural network can be used for performing drying removal treatment on various near infrared spectrums. Because the deep neural network has the function of relearning, the identification precision can be continuously improved in the process of denoising treatment.

In some embodiments, the multiple linear regression processing procedure in step S6 specifically includes:

and S61, multiplying at least one principal component spectrum in the near-infrared spectrum region after the first derivative processing by the corresponding principal component score coefficient to obtain corresponding principal component spectrum data, and constructing at least one principal component matrix according to the at least one principal component spectrum data.

S62, at least one main linear function is constructed according to the at least one principal component matrix, and linear regression processing is carried out on the at least one main linear function to obtain a corresponding near-infrared detection value.

In the scheme, effective information of a sample spectrum is fully extracted by analyzing main components of a near infrared spectrum, the problem of linear correlation is solved, and the internal relation between a spectrum matrix and a sample component matrix is considered, so that a near infrared analysis model constructed based on the method is more stable, and the method is suitable for a complex analysis system.

In some embodiments, the operation process of the partial least squares method in step S7 specifically includes:

constructing a corresponding spectrum matrix according to near infrared detection values, screening main wet chemical values corresponding to main components from the first wet chemical value, the second wet chemical value, the third wet chemical value, the fourth wet chemical value and the fifth wet chemical value corresponding to each component, constructing a main wet chemical matrix according to the main wet chemical values, correlating the spectrum matrix with the main wet chemical matrix, and calculating a predicted linear relation function of the two matrixes;

step S9, specifically, it is: and (3) constructing a database by utilizing the predicted linear relation function obtained by each gasoline/diesel oil sample, and taking the database as a near infrared analysis initial model.

In some embodiments, the other ingredients include at least one of:

a benzene component, a silicon component, a toluene component, a phosphorus component, a chlorine component, a manganese component, a lead component, an iron component, an oxygen component, a colloid component, an ethanol component, a residual carbon component, a ash component, a hexadecane component, a fatty acid methyl ester component, and a pollutant component.

In some embodiments, step S10 specifically includes:

s10-1, ranking N gasoline/diesel samples N1,N2……NnSelecting N from N gasoline/diesel oil samples1The gasoline/diesel sample was used as the test sample and the remaining gasoline/diesel sample was used as the modeling sample.

And S10-2, utilizing the modeling sample to construct the near infrared analysis initial model again on the constructed near infrared analysis initial model according to the scheme of the steps S2 to S9.

S10-3, acquiring near infrared spectra corresponding to each component of the test sample by using infrared equipment, processing the test sample by using a humidification method to obtain wet chemical values corresponding to each component, inputting the wet chemical values into a near infrared analysis initial model for processing, outputting content data of each component of the test sample, comparing the output content data of each component of the test sample with real data of the test sample, and outputting the accuracy of the test.

S10-4, selecting the next gasoline/diesel oil sample as a test sample in sequence according to the sequence, taking the rest gasoline/diesel oil samples as modeling samples, repeating the schemes of the steps S10-2 and S10-3 until the n gasoline/diesel oil samples are respectively taken as test samples to obtain the accuracy rate p of corresponding test1,p2……pn

S10-5, calculating the accuracy rate p of the test1,p2……pnAnd judging whether P is larger than or equal to P, if so, taking the finally obtained near-infrared analysis initial model as a near-infrared model, otherwise, obtaining a new gasoline/diesel sample again, repeating the processes from S10-1 to S10-4 by using the new gasoline/diesel sample until the obtained P is larger than or equal to P, and taking the finally obtained near-infrared analysis initial model as the near-infrared model, wherein P is an accuracy threshold value.

In the scheme, the obtained near-infrared analysis initial model is tested in a cross-testing mode, and each gasoline/diesel sample can be guaranteed to be used for testing and modeling, so that a model with relatively high accuracy can be constructed even if the number of samples is limited, and the modeling efficiency is improved.

In some embodiments, after step S10, the method further comprises:

s10', acquiring a gasoline/diesel oil samples as a correction set, acquiring b gasoline/diesel oil samples as a verification set, re-constructing a near-infrared analysis verification model on the constructed near-infrared analysis model by using the gasoline/diesel oil samples in the correction set according to the scheme of the steps S2 to S9, sequentially inputting the gasoline/diesel oil samples in the verification set into the near-infrared analysis verification model to output verification results, comparing the verification results with the real results of the gasoline/diesel oil samples in the verification set, and determining the verification accuracy;

and S10 ', judging whether the verification accuracy exceeds a verification threshold value, if so, taking the obtained near-infrared analysis verification model as a final near-infrared analysis model, otherwise, obtaining a new correction set and a new verification set, repeating the scheme of the step S10' until the obtained verification accuracy exceeds the verification threshold value, and taking the obtained near-infrared analysis verification model as the final near-infrared analysis model.

In the above scheme, in order to further ensure the accuracy of the near-infrared model, the correction set is used to construct a corresponding near-infrared verification model on the basis of the near-infrared verification model obtained in the above step 10-5, and then the sample in the verification set is used to verify the near-infrared verification model.

Further, the near-infrared verification model may be further verified by performing the above-described steps S10' to S10 "with the calibration set as the verification set and the verification set as the correction set.

And the near-infrared verification model after verification is used as a final near-infrared analysis model, so that the analysis precision of the finally obtained near-infrared analysis model is further improved.

In conclusion, the constructed gasoline near-infrared analysis model can detect the component content of gasoline, and can also analyze and obtain information such as distillation range, MTBE (methyl tert-butyl ether), saturated vapor pressure, anti-knock index, density and the like of the gasoline based on the component content. And analyzing the cold filter plugging point, distillation range, density, condensation point lubricity, flash point, acidity, oxidation safety, kinematic viscosity and other information of the diesel according to the content of each component of the diesel by using a diesel near-infrared analysis model.

It should be noted that the method of the embodiments of the present disclosure may be executed by a single device, such as a computer or a server. The method of the embodiment can also be applied to a distributed scene and completed by the mutual cooperation of a plurality of devices. In such a distributed scenario, one of the devices may only perform one or more steps of the method of the embodiments of the present disclosure, and the devices may interact with each other to complete the method.

It should be noted that the above describes some embodiments of the disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments described above and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.

Based on the same inventive concept, corresponding to the method of any embodiment, the disclosure also provides a gasoline/diesel detection and analysis device based on near infrared modeling.

Referring to fig. 2, the near infrared modeling-based gasoline/diesel detection and analysis device includes:

an obtaining module 201, configured to obtain n gasoline/diesel samples;

an extraction module 202, configured to extract a sulfur component, an octane component, an aromatic hydrocarbon component, an olefin component, and other components in each gasoline/diesel sample;

a near-infrared obtaining module 203, configured to obtain a near-infrared spectrum of each gasoline/diesel sample by using a near-infrared device;

a wet chemistry processing module 204, configured to detect each component of each gasoline/diesel sample by using a wet chemistry method, and obtain a first wet chemistry value of the sulfur component, a second wet chemistry value of the octane component, a third wet chemistry value of the aromatic hydrocarbon component, a fourth wet chemistry value of the olefin component, and a fifth wet chemistry value of the other component of each gasoline/diesel sample;

a selecting module 205 for selecting a region of maximum correlation of information content from the near infrared spectrum of each of the gasoline/diesel samples as a near infrared spectrum region;

the mathematical processing module 206 is configured to perform first derivative processing on the near infrared spectrum region of each gasoline/diesel sample, and then perform multiple linear regression processing to obtain a near infrared detection value;

a correlation processing module 207, configured to correlate the near-infrared detection value of each gasoline/diesel sample with the first wet-chemical value, the second wet-chemical value, the third wet-chemical value, the fourth wet-chemical value, and the fifth wet-chemical value by using a partial least squares operation;

a deleting module 208, configured to calculate a root mean square error between the near-infrared detection value associated with each component of each gasoline/diesel sample and the corresponding wet chemical value, and delete the associated data of the gasoline/diesel sample of which the root mean square error is greater than an error threshold;

a construction module 209 for constructing a database using the correlated data of the remaining gasoline/diesel samples, the database being used as an initial model of near-infrared analysis;

the cross inspection module 210 is configured to perform cross inspection on the near-infrared analysis initial model by using n gasoline/diesel oil samples to obtain a near-infrared analysis model;

the pretreatment module to be detected 211 is used for acquiring near infrared spectrum to be analyzed of gasoline/diesel oil to be detected by using infrared equipment, and processing the gasoline/diesel oil to be detected by using a humidification method to obtain wet chemical values to be analyzed corresponding to various components;

and the detection analysis module 212 is configured to input the near-infrared spectrum to be analyzed of the gasoline/diesel to be detected and the wet chemical value to be analyzed corresponding to each component into the near-infrared analysis model, and process and determine content data of each component of the gasoline/diesel to be detected by using the near-infrared analysis model.

In some embodiments, cross-checking module 210 is specifically configured to:

ranking N gasoline/diesel samples N1,N2……NnSelecting N from N gasoline/diesel oil samples1The gasoline/diesel sample was used as the test sample and the remaining gasoline/diesel sample was used as the modeling sample.

And building the near infrared analysis initial model again on the near infrared analysis initial model.

The method comprises the steps of acquiring near infrared spectra corresponding to various components of a test sample by using infrared equipment, processing the test sample by using a humidification method to obtain test wet chemical values corresponding to the various components, inputting the test wet chemical values into a near infrared analysis initial model for processing, outputting content data of the various components of the test sample, comparing the output content data of the various components of the test sample with real data of the test sample, and outputting test.

Sequentially selecting the next gasoline/diesel oil sample as a test sample according to the sequence, taking the rest gasoline/diesel oil samples as modeling samples, and repeating the schemes of the steps S10-2 and S10-3 until the n gasoline/diesel oil samples are respectively taken as test samples to obtain the accuracy rate p of corresponding test1,p2……pn

Calculating the accuracy p of the test1,p2……pnAnd judging whether P is larger than or equal to P, if so, taking the finally obtained near-infrared analysis initial model as a near-infrared model, otherwise, obtaining a new gasoline/diesel sample again, repeating the processes from S10-1 to S10-4 by using the new gasoline/diesel sample until the obtained P is larger than or equal to P, and taking the finally obtained near-infrared analysis initial model as the near-infrared model, wherein P is an accuracy threshold value.

In some embodiments, the apparatus further comprises:

the verification module is used for obtaining a gasoline/diesel oil samples as a correction set, obtaining b gasoline/diesel oil samples as a verification set, utilizing the gasoline/diesel oil samples in the correction set to construct a near-infrared analysis verification model again on the constructed near-infrared analysis model according to the scheme of the steps S2 to S9, sequentially inputting the gasoline/diesel oil samples in the verification set into the near-infrared analysis verification model to output verification results, comparing the verification results with the real results of the gasoline/diesel oil samples in the verification set, and determining the verification accuracy;

and the judging module is used for judging whether the verification accuracy exceeds a verification threshold value, if so, taking the obtained near-infrared analysis verification model as a final near-infrared analysis model, otherwise, obtaining a new correction set and a new verification set, repeating the scheme of the step S10' until the obtained verification accuracy exceeds the verification threshold value, and taking the obtained near-infrared analysis verification model as the final near-infrared analysis model.

In some embodiments, the math processing module 206 is specifically configured to:

multiplying at least one principal component spectrum in the near-infrared spectrum region after the first derivative processing by the corresponding principal component score coefficient to obtain corresponding principal component spectrum data, and constructing at least one principal component matrix according to the at least one principal component spectrum data; and constructing at least one main linear function according to the at least one principal component matrix, and performing linear regression processing on the at least one main linear function to obtain a corresponding near-infrared detection value.

In some embodiments, the association processing module 207 is specifically configured to:

constructing a corresponding spectrum matrix according to near infrared detection values, screening main wet chemical values corresponding to main components from the first wet chemical value, the second wet chemical value, the third wet chemical value, the fourth wet chemical value and the fifth wet chemical value corresponding to each component, constructing a main wet chemical matrix according to the main wet chemical values, correlating the spectrum matrix with the main wet chemical matrix, and calculating a predicted linear relation function of the two matrixes;

the construction module 209 is further configured to construct a database using the predicted linear relationship function obtained for each gasoline/diesel sample, and the database is used as an initial model for near-infrared analysis.

In some embodiments, the other ingredients include at least one of:

a benzene component, a silicon component, a toluene component, a phosphorus component, a chlorine component, a manganese component, a lead component, an iron component, an oxygen component, a colloid component, an ethanol component, a residual carbon component, a ash component, a hexadecane component, a fatty acid methyl ester component, and a pollutant component.

In some embodiments, the apparatus further comprises:

and the drying module is used for deleting the spectrum region of which the absorbance in the obtained near infrared spectrum exceeds the light absorption threshold value and deleting the noise region in each near infrared spectrum.

For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, the functionality of the various modules may be implemented in the same one or more software and/or hardware implementations of the present disclosure.

The device of the above embodiment is used for implementing the gasoline/diesel detection and analysis method based on near infrared modeling in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.

Based on the same inventive concept, corresponding to the method of any embodiment, the present disclosure further provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and operable on the processor, and when the processor executes the program, the method for detecting and analyzing gasoline/diesel oil based on near-infrared modeling according to any embodiment is implemented.

Fig. 3 is a schematic diagram illustrating a more specific hardware structure of an electronic device according to this embodiment, where the electronic device may include: a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. Wherein the processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 are communicatively coupled to each other within the device via bus 1050.

The processor 1010 may be implemented by a general-purpose CPU (central processing unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits, and is configured to execute related programs to implement the technical solutions provided in the embodiments of the present specification.

The memory 1020 may be implemented in the form of a ROM (read only memory), a RAM (random access memory), a static storage device, a dynamic storage device, or the like. The memory 1020 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present specification is implemented by software or firmware, the relevant program codes are stored in the memory 1020 and called to be executed by the processor 1010.

The input/output interface 1030 is used for connecting an input/output module to input and output information. The i/o module may be configured as a component in a device (not shown) or may be external to the device to provide a corresponding function. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.

The communication interface 1040 is used for connecting a communication module (not shown in the drawings) to implement communication interaction between the present apparatus and other apparatuses. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, Bluetooth and the like).

Bus 1050 includes a path that transfers information between various components of the device, such as processor 1010, memory 1020, input/output interface 1030, and communication interface 1040.

It should be noted that although the above-mentioned device only shows the processor 1010, the memory 1020, the input/output interface 1030, the communication interface 1040 and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, those skilled in the art will appreciate that the above-described apparatus may also include only those components necessary to implement the embodiments of the present description, and not necessarily all of the components shown in the figures.

The electronic device of the above embodiment is used for implementing the gasoline/diesel detection and analysis method based on near-infrared modeling in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.

Based on the same inventive concept, corresponding to any of the above-described embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the near-infrared modeling-based gasoline/diesel detection analysis method according to any of the above embodiments.

Computer-readable media of the present embodiments, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the method for detecting and analyzing gasoline/diesel oil based on near infrared modeling according to any of the above embodiments, and have the beneficial effects of corresponding method embodiments, which are not described herein again.

Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, is limited to these examples; within the idea of the present disclosure, also technical features in the above embodiments or in different embodiments may be combined, steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of brevity.

In addition, well-known power/ground connections to Integrated Circuit (IC) chips and other components may or may not be shown in the provided figures for simplicity of illustration and discussion, and so as not to obscure the embodiments of the disclosure. Furthermore, devices may be shown in block diagram form in order to avoid obscuring embodiments of the present disclosure, and this also takes into account the fact that specifics with respect to implementation of such block diagram devices are highly dependent upon the platform within which the embodiments of the present disclosure are to be implemented (i.e., specifics should be well within purview of one skilled in the art). Where specific details (e.g., circuits) are set forth in order to describe example embodiments of the disclosure, it should be apparent to one skilled in the art that the embodiments of the disclosure can be practiced without, or with variation of, these specific details. Accordingly, the description is to be regarded as illustrative instead of restrictive.

While the present disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic ram (dram)) may use the discussed embodiments.

The disclosed embodiments are intended to embrace all such alternatives, modifications and variances which fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalents, improvements, and the like that may be made within the spirit and principles of the embodiments of the disclosure are intended to be included within the scope of the disclosure.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于近红外建模的成品油添加剂检测分析方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!