An on-line detection method for replacing off-line sample injection spectrum scanning of finished oil in gasoline blending
Patent Information
- Application Number
- CN202610743430.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-27
- Publication Date
- 2026-08-18
AI Technical Summary
该传统模式流程冗长、人力成本高,涵盖采样、转运、人工操作、数据归档等多个环节;单次分析周期长,无法快速反馈调合实时状态,严重滞后模型更新效率,制约整体调合生产效能
[0027] This invention proposes an online detection method to replace offline sample injection and spectral scanning during gasoline blending. Addressing the drawbacks of time-consuming and costly offline sample injection and spectral scanning, the final spectrum S is calculated using a weighted average formula based on the flow rate and near-infrared spectrum collected after the blending head during gasoline blending. F It is used for the calibration and updating of the near-infrared model for online detection of gasoline blending, improving analysis efficiency and real-time performance while reducing manual intervention.
Smart Images

Figure CN122591604A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of online gasoline blending and near-infrared spectral analysis, specifically relating to a method for real-time monitoring of the gasoline blending process using near-infrared spectral analysis. Background Technology
[0002] Gasoline blending is the final step in oil refining and a core aspect of product quality control. This process involves precisely blending various components, such as catalytic cracking gasoline, reformed gasoline, and alkylated gasoline, in specific proportions to produce gasoline that meets national standards. The key to gasoline quality control lies in accurate analysis of the blending components and subsequent proportion control to ensure that key indicators such as octane number, distillation range, and olefin content consistently meet standards. Currently, the industry widely uses near-infrared spectroscopy for online real-time analysis of gasoline blending components.
[0003] Due to variations in the near-infrared spectrometer itself (such as baseline drift) or fluctuations in oil properties, near-infrared property analysis models require periodic calibration. Taking baseline drift as an example, although the drift amplitude may be small in a short period of time, if the drift time is long, such as more than a week, the drift may lead to an increase in baseline deviation, affecting the accuracy of subsequent models.
[0004] The calibration process relies on high-quality standard spectra and accurate analytical properties. The primary method for acquiring spectra is offline sample injection and scanning: manual on-site sampling, transportation to the laboratory, manual sample injection and scanning, followed by inputting the spectra and corresponding analytical values into the system for on-site model updates and maintenance. This traditional approach is lengthy, labor-intensive, and involves multiple steps including sampling, transportation, manual operation, and data archiving. The long analysis cycle prevents rapid feedback on the real-time status of the calibration process, severely hindering model update efficiency and limiting overall calibration production efficiency. Summary of the Invention
[0005] To address the problems existing in the prior art, this invention provides a method to replace offline sampling and spectral scanning of refined oil. This method calculates the final spectrum S by weighted averaging the near-infrared spectra of the refined oil based on the flow rates collected during gasoline blending. F This method simplifies the testing process, improves testing efficiency, and ensures the accuracy of component analysis and index control during gasoline blending, while meeting the real-time monitoring requirements of online gasoline blending. Specifically, it includes the following steps:
[0006] 1) Collect the near-infrared spectrum and flow rate of the finished oil after blending at the blending head during the gasoline blending process;
[0007] 2) Determine whether the blending is complete. If complete, proceed to step 3; otherwise, return to step 1.
[0008] 3) Determine if the current adjustment has timed out. If not, proceed to step 4; otherwise, issue an alarm.
[0009] 4) Baseline correction preprocessing is performed on the acquired near-infrared spectra. The wavenumber of a single point without characteristic absorption is selected as the baseline reference. The absorbance of each wavelength point is uniformly subtracted from the baseline value to eliminate the spectral baseline shift. The formula is shown in (1):
[0010]
[0011] In the formula, λ is the wavenumber point of the spectrum, A(λ) is the absorbance of the original spectrum at wavenumber λ, and b is the absorbance of the selected baseline reference point. corr (λ) represents the absorbance at wavenumber λ after spectral correction;
[0012] 5) Anomaly detection of the acquired near-infrared spectra: First, calculate the mean spectrum of the acquired near-infrared spectra. Next, calculate the Euclidean distance D from each individual spectrum to the mean spectrum. i Then calculate all Euclidean distances D. i The mean μ and standard deviation σ; if D i If the value is greater than μ+3σ, it is determined to be an abnormal spectrum and removed; otherwise, it is determined to be a valid spectrum. The above discrimination process is repeated for the remaining valid spectra until there are no abnormal spectra and then the process ends.
[0013] (1) The calculation formula is shown in (2):
[0014]
[0015] In the formula, n is the total number of spectra. It is the mean spectrum, A ij This refers to the absorbance at the j-th wavenumber point of the i-th spectrum;
[0016] (2) D i The calculation formula is shown in (3):
[0017]
[0018] In the formula, D i It is the Euclidean distance from a single spectrum to the mean spectrum, where n is the total number of spectra. It is the mean spectrum, A ij This refers to the absorbance at the j-th wavenumber point of the i-th spectrum;
[0019] (3) The formulas for calculating the mean μ and standard deviation σ are shown in (4) and (5):
[0020]
[0021]
[0022] In the formula, μ is the average Euclidean distance, σ is the standard deviation of the Euclidean distance, n is the total number of spectra, and D is the mean value of the distance. i It is the Euclidean distance from a single spectrum to the mean spectrum;
[0023] 6) Calculate the final spectrum S according to the weighted average formula. F First, calculate the mean near-infrared spectrum collected hourly during the blending process. Then, based on the traffic q for the corresponding time period i The final spectrum S is obtained by weighting the mean spectrum of each hour. F S F The calculation formula is shown in (6):
[0024]
[0025] In the formula, q1 is the percentage of traffic flow in the first hour during the adjustment period. is the mean spectrum of the first hour during the blending period, and n is the total number of hours during the blending period.
[0026] Beneficial effects:
[0027] This invention proposes an online detection method to replace offline sample injection and spectral scanning during gasoline blending. Addressing the drawbacks of time-consuming and costly offline sample injection and spectral scanning, the final spectrum S is calculated using a weighted average formula based on the flow rate and near-infrared spectrum collected after the blending head during gasoline blending. F It is used for the calibration and updating of the near-infrared model for online detection of gasoline blending, improving analysis efficiency and real-time performance while reducing manual intervention. Attached Figure Description
[0028] Figure 1 It is a calculation-based spectral step that replaces offline sample injection and scanning. Detailed Implementation
[0029] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0030] The following detailed calculation process is presented based on the actual implementation of this invention in a refining and chemical enterprise, combined with a specific calculation example. The enterprise's gasoline blending process involves six blending components (S-Zorb gasoline, cracked light stone, reformed gasoline, alkylate oil, raffinate oil, and METB), producing four finished oil products: 92# gasoline, 92# ethanol gasoline, 95# gasoline, and 95# ethanol gasoline. Currently, the enterprise uses near-infrared spectroscopy to detect the properties of the component oils and blended gasoline, while the finished gasoline is sampled from storage tanks and sent to the laboratory for conventional experimental analysis. Initially, after completing the laboratory analysis, the enterprise sent the sample back to the near-infrared spectrometer for spectral scanning, using the spectrum and laboratory test results for periodic model updates and maintenance. However, offline sample injection and spectral scanning are time-consuming and costly, affecting the real-time performance and accuracy of the near-infrared model updates.
[0031] This patent uses the online detection of gasoline blending at this company as an example to introduce an online detection method that replaces offline sample injection and spectral scanning. The specific steps are as follows:
[0032] Step 1: Collect the near-infrared spectrum and flow rate of the finished oil after the blending head of the company's gasoline blending process;
[0033] Step 2: Determine if the blending time has ended. If it has, proceed to Step 3; otherwise, return to Step 1.
[0034] Step 3: Determine if the blending time has exceeded the limit. In this case, the gasoline blending cycle was within 24 hours, so it did not exceed the limit. Near-infrared spectra collected during gasoline blending exhibit drift. When the blending cycle is too long (exceeding one week), the near-infrared spectrum will drift significantly, resulting in a large baseline deviation. Therefore, it is necessary to determine if the blending cycle has exceeded the limit. If it has not exceeded the limit, proceed to Step 4; if it has, an alarm will be issued, and no calculations will be performed.
[0035] Step 4: Baseline correction preprocessing is performed on the collected near-infrared spectra. Since the near-infrared spectra collected during gasoline blending exhibit drift, baseline correction preprocessing is performed to eliminate the spectral baseline shift. The calculation formula is shown in (1):
[0036]
[0037] In the formula, λ is the wavenumber point of the spectrum, A(λ) is the absorbance of the original spectrum at wavenumber λ, and b is the absorbance of the selected baseline reference point. corr (λ) represents the absorbance at wavenumber λ after spectral correction;
[0038] Step 5: Anomaly detection of the acquired near-infrared spectra: First, calculate the mean spectrum of the acquired near-infrared spectra. Next, calculate the Euclidean distance D from each individual spectrum to the mean spectrum. iThen calculate all Euclidean distances D. i The mean μ and standard deviation σ; if D i If the value is greater than μ+3σ, it is considered an abnormal spectrum and discarded; otherwise, it is considered a valid spectrum. The above discrimination process is repeated for the remaining valid spectra until no abnormal spectra are found, at which point the process terminates.
[0039] (1) The calculation formula is shown in (2):
[0040]
[0041] In the formula, n is the total number of spectra. It is the mean spectrum, A ij This refers to the absorbance of the i-th spectrum at the j-th wavenumber;
[0042] (2) D i The calculation formula is shown in (3):
[0043]
[0044] In the formula, Di is the Euclidean distance between each spectrum and the mean spectrum, and n is the total number of spectra. It is the mean spectrum, A ij This refers to the absorbance of the i-th spectrum at the j-th wavenumber;
[0045] (3) The formulas for calculating the mean μ and standard deviation σ are shown in (4) and (5):
[0046]
[0047]
[0048] In the formula, μ is the mean of the Euclidean distance, σ is the standard deviation of the Euclidean distance, and D... i It is the Euclidean distance between each spectrum and the mean spectrum, where n is the total number of spectra;
[0049] Step 6: After removing outlier spectra, calculate the final spectrum S using the weighted average formula. F First, calculate the mean near-infrared spectrum collected hourly during the blending process. Then, based on the traffic q for the corresponding time period i The final spectrum S is obtained by weighting the mean spectrum of each hour. F S F The calculation formula is shown in (6):
[0050]
[0051] In the formula, q1 is the percentage of traffic flow in the first hour during the adjustment period. is the mean spectrum of the first hour during the harmonization period, and n is the total number of hours during the harmonization period.
[0052] The final spectra with and without tank bottoms were calculated separately to analyze the influence of tank bottom oil on the results. Tank bottom oil refers to the oil sample remaining in the storage tank from the end of the previous blending cycle to the start of the current blending cycle.
[0053] The spectrum without the tank bottom is calculated based solely on the near-infrared spectrum collected during the current blending cycle, combined with the corresponding flow rate weighting. The spectrum with the tank bottom is calculated by first weighting the spectrum collected during the current blending cycle according to the flow rate, and then superimposing the spectrum calculated in the previous blending cycle based on the proportion of oil flow rate at the tank bottom, finally obtaining the spectrum with the tank bottom.
[0054] After the calculation is completed, the final spectrum S of the online weighted average is verified using two methods. F The feasibility of replacing offline sample injection and spectral scanning. One aspect is spectral similarity analysis: selecting 5600-6200 cm⁻¹. -1 Wavenumber band, for the final weighted spectrum S F The first derivative and normalization preprocessing was performed on both the offline and injected spectra. The Euclidean distance between the two sets of spectra was then calculated; the smaller the distance, the higher the similarity. The results are shown in Table 1.
[0055] Table 1 Final Spectrum S F Euclidean distance between offline sample injection and spectral scanning
[0056]
[0057] As shown in Table 1, the Euclidean distance between the spectra with and without the bottom of the tank and the offline injection spectra is significantly reduced compared to the spectra without the bottom of the tank. This indicates that incorporating the bottom of the tank into the calculation can effectively improve the similarity between the online calculated spectra and the offline injection spectra.
[0058] Second, property prediction deviation analysis: Using the same model, key indicators (octane number, olefins, final boiling point, etc.) of the two sets of spectra were predicted separately, and the deviation of the predicted values was compared. The smaller the deviation, the better the substitution effect. The property deviation indicators were (octane number 0.3, olefins 1.5, final boiling point 4). The difference is the difference between the predicted values of the offline injection spectrum and the spectrum with the bottom of the tank. The prediction results are shown in Table 2.
[0059] Table 2 Model Prediction Results
[0060]
[0061] The model prediction results in Table 2 show that the predicted spectra of the tank bottom and the offline injection spectra are highly similar. The pass rate of the prediction deviation between the spectra is better than the pass rate of the deviation between the prediction results and the test values, which further verifies that the predicted values are consistent.
[0062] The above steps have verified that the final spectrum S obtained by calculating the near-infrared spectrum collected after the blending head in gasoline blending is based on the flow rate-weighted average. F It can effectively replace offline sample injection and spectral scanning for online prediction.
Claims
1. An online detection method that replaces offline sampling and spectral scanning of refined oil products in gasoline blending, characterized in that... Includes the following steps: 1) Collect the near-infrared spectrum and flow rate of the finished oil after blending at the blending head during the gasoline blending process; 2) Determine whether the gasoline blending process is complete. If complete, proceed to step 3; otherwise, return to step 1. 3) Determine if the gasoline blending process has exceeded the time limit. If it has not, proceed to step 4; otherwise, issue an alarm. 4) Perform baseline correction preprocessing on the acquired near-infrared spectra; 5) Eliminate abnormal spectra; 6) Calculate the final spectrum S according to the weighted average formula. F First, calculate the mean near-infrared spectrum collected hourly during the blending process. Then, based on the traffic q for the corresponding time period i The final spectrum S is obtained by weighting the mean spectrum of each hour. F S F The calculation formula is as follows: In the formula, q1 is the percentage of traffic flow in the first hour during the adjustment period. is the mean spectrum of the first hour during the blending period, and n is the total number of hours during the blending period.
2. The method according to claim 1, characterized in that... In step 3, determine whether the current adjustment cycle has timed out. If it has not timed out, proceed to step 4. If it has timed out, an alarm should be issued.
3. The method according to claim 1, characterized in that... In step 4, baseline correction preprocessing is performed on the acquired near-infrared spectra: a single-point wavenumber with no characteristic absorption is selected as the baseline reference, and the absorbance at each wavenumber point is uniformly subtracted from this baseline value to eliminate spectral baseline shift. The correction formula is as follows: A corr (λ)=A(λ)-b In the formula, λ is the wavenumber point of the spectrum, A(λ) is the absorbance of the original spectrum at wavenumber λ, and b is the absorbance of the selected baseline reference point. corr (λ) represents the absorbance at wavenumber λ after spectral correction.
4. The method according to claim 1, characterized in that... In step 5, anomaly detection is performed on the acquired near-infrared spectra: first, the mean spectrum of the acquired near-infrared spectra is calculated. Next, calculate the Euclidean distance D from each individual spectrum to the mean spectrum. i Then calculate all Euclidean distances D. i The mean μ and standard deviation σ; if D i If the value is greater than μ+3σ, it is determined to be an abnormal spectrum and removed; otherwise, it is determined to be a valid spectrum. The above discrimination process is repeated for the remaining valid spectra until there are no abnormal spectra and then the process is terminated.
5. The method according to claim 4, characterized in that: (1) The calculation formula is as follows: In the formula, It is the mean spectrum, where n is the total number of spectra, and A ij This refers to the absorbance of the i-th spectrum at the j-th wavenumber; (2) D i The calculation formula is as follows: In the formula, Di is the Euclidean distance from a single spectrum to the mean spectrum, n is the total number of spectra, and A ij This refers to the absorbance of the i-th spectrum at the j-th wavenumber; (3) The formulas for calculating the mean μ and standard deviation σ are as follows: In the formula, Di is the Euclidean distance from a single spectrum to the mean spectrum, μ is the mean of the Euclidean distance, σ is the standard deviation of the Euclidean distance, and n is the total number of spectra.