Modeling method of finished gasoline blending formula based on tank bottom batch

By integrating the conservative formula model and the jamming formula model, and using improved clustering and machine learning algorithms, the problem of insufficient jamming data and difficulty in optimization in gasoline blending is solved, and high-precision jamming production and production efficiency improvement are achieved.

CN114757100BActive Publication Date: 2024-08-23LANZHOU UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210383224.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-12
Publication Date
2024-08-23
Estimated Expiration
2042-04-12

AI Technical Summary

Technical Problem

In the existing technology, there are problems such as insufficient jamming data and difficulty in optimizing the jamming formula modeling method during the gasoline blending process, which makes it difficult to achieve high-precision jamming production, and the existing conservative batch formula model cannot meet the production efficiency of the enterprise. Increase demand.

Method used

The finished gasoline blending formula model modeling method based on the batch at the bottom of the tank is adopted. By integrating the conservative formula model and the card edge formula model, the improved MKFCM algorithm and XGBoost algorithm are used to establish a sub-formula model, and the PSO optimization and integrated learning ideas are used. Online recipe maintenance, generate mixed recipe models to improve blending success rate.

Benefits of technology

It improves the success rate of gasoline blending, meets card edge production needs, reduces enterprise production costs, and improves production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114757100B
    Figure CN114757100B
Patent Text Reader

Abstract

The present invention discloses a modeling method for a finished gasoline blending and mixing formula model based on a tank bottom batch, comprising: step 1: establishing a conservative formula model and a card edge formula model; step 2: fusing the conservative formula model with the card edge formula model to obtain a mixed formula model. The present invention uses the conservative formula model as the data for outputting the card edge formula model to supplement and complete it, optimizes the card edge formula model after combining transfer learning and model methods, and obtains the card edge formula model, so that the oil product approaches the card edge production. At the same time, the strategy of fusing the conservative formula model with the card edge formula model is adopted, which can not only ensure the one-time blending rate and approach the card edge production, but also ensure that the formula generation system can be used sustainably as the goal, reduce the production cost of the enterprise, improve the production efficiency, and meet the card edge production.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of gasoline blending, and more particularly to a modeling method for a finished gasoline blending mixing formula model based on tank bottom batches. Background Art

[0002] At present, with the increasing promotion of green environmental protection concepts, the speed of upgrading the quality standards of gasoline and diesel in my country is accelerating, which requires the continuous upgrading of oil blending technology of oil refining enterprises. In the process of online tank blending, there is usually about 1 / 6 of the residual oil in the tank bottom, and the blending components are affected by crude oil from different origins, which leads to batch phenomenon in the blending process; at the same time, the blending process presents a nonlinear state. The conservative batch formula model is used in the existing technology to ensure the success of the blending in one time.

[0003] However, in actual industry, in order to improve the production efficiency of enterprises, it is also necessary to make oil products close to card edge production. This requires the establishment of a high-precision card edge formula model. However, there are still problems in the establishment of the card edge formula model. First, there is very little card edge data in enterprise production, how to supplement it; second, the selection and optimization of the card edge formula modeling method.

[0004] Therefore, how to provide a modeling method for a finished gasoline blending formula model based on tank bottom batches is an urgent problem that technicians in this field need to solve. Summary of the invention

[0005] In view of this, the present invention provides a modeling method for a finished gasoline blending and mixing formula model based on tank bottom batches, which adopts a strategy of integrating a conservative formula model with a card-edge formula model, which can not only ensure a one-time blending rate and approach card-edge production, but also ensure that the formula generation system can be used sustainably as the goal, so as to solve the defects in the prior art.

[0006] In order to achieve the above-mentioned purpose, the present invention adopts the following technical scheme: a modeling method of a finished gasoline blending mixture formula model based on a tank bottom batch, comprising: step 1: establishing a conservative formula model and a card edge formula model; step 2: fusing the conservative formula model with the card edge formula model to obtain a mixed formula model.

[0007] Preferably, in step 1, the conservative formula model establishment process is as follows: step 1-1: clustering the historical tank bottom residual oil components based on the initialization membership matrix using the improved MKFCM algorithm to obtain each batch category and the membership matrix belonging to each batch; step 1-2: using XGBoost to establish corresponding sub-formula models for each batch category; step 1-3: clustering the current tank residual oil components based on the improved MKFCM algorithm, and using the membership obtained by clustering as the fusion coefficient of each batch sub-formula model of the current tank; inputting the current tank residual oil components and the required quality indicators into each batch sub-formula model to obtain the predicted value of the current tank for each batch sub-formula model; weighted fusion of the fusion coefficient and predicted value of each batch sub-formula model of the current tank to generate a conservative formula model.

[0008] Preferably, in step 1-1, the historical tank bottom residual oil components are clustered so that the objective function of the clustering algorithm is minimized, and the steps are as follows:

[0009] Step 1-1-1: The improved MKFCM algorithm uses a Gaussian kernel function, which is:

[0010]

[0011] Step 1-1-2: Calculate each kernel function parameter according to the overall kernel parameters and each component of the tank bottom oil. The formula of each kernel function parameter is:

[0012]

[0013] Among them, K(X,Y) is the Gaussian kernel function, min(·) is the minimum value of the distance between each component, σk is the kernel parameter of the kth sub-kernel function, x ik is the kth feature value of the i-th sample, x jk is the kth characteristic value of the jth sample, i is the i-th sample, j is the jth characteristic of the sample, X is the first independent variable of the Gaussian kernel function, which refers to the characteristic value of the sample, Y is the second independent variable of the Gaussian kernel function, which refers to the characteristic value of the sample, and σ is the overall kernel parameter of the adaptively selected sub-kernel parameter;

[0014] Step 1-1-3: Calculate the total kernel function and initialize the membership matrix according to each kernel function and the initialized kernel weight vector; Step 1-1-4: Obtain the standardized membership matrix according to the initialized membership matrix; Step 1-1-5: Calculate coefficients α, β according to the standardized membership matrix; Step 1-1-6: Calculate the kernel function fusion weight matrix according to the coefficient β; Step 1-1-7: Calculate the distance matrix according to the kernel function fusion weight matrix and the coefficient α; Step 1-1-8: Obtain an updated membership matrix according to the distance matrix; Step 1-1-9: Repeat steps 1-1-2 to 1-1-8 until the updated membership matrix meets the preset convergence conditions; Step 1-1-10: Classify the addition ratios of each component of the historical tank bottom residual oil into batch categories according to the obtained membership matrix;

[0015] In step 1-2, the process of establishing each batch of sub-recipe models includes: step 1-2-1: set the loop parameter K of the sub-recipe model, and set K=0; step 1-2-2: determine whether the loop parameter K is less than or equal to a preset value; if not or when the convergence condition is met, jump out of this loop; if so, repeat steps 1-2-3 to 1-2-6; step 1-2-3: divide each batch category data into a first training set and a first test set; step 1-2-4: train the sub-recipe model based on the first training set to obtain the trained sub-recipe model; step 1-2-5: test the trained sub-recipe model based on the first test set, and calculate the evaluation index after obtaining the test sub-recipe model result; step 1-2-6: increase the loop parameter K once, and return to step 1-2-2.

[0016] Preferably, in step 1, the process of establishing the card edge formula model is as follows: step 1-4: dividing the historical card edge data into a second training set and a second test set; step 1-5: pre-training the XGBoost model, including initializing the XGBoost model parameters; step 1-6: inputting the second training set into the conservative formula model, calculating L soft Value; Input the second training set into the XGBoost model and calculate L hard Value; where y s is the predicted value output by the XGBoost model, y T is the probability value of the conservative formula model after the improved Softmax output, y true is the true value of the improved Softmax output of the conservative formula model, L soft for y s With y T The error function, L hard for y s With y true Error function; Step 1-7: If Lhard +m value is greater than L soft value, execute L=λL soft (y s ,y T )+(1-λ)L hard (y s ,y true ); otherwise execute L=L hard (y s ,y true ), where L is the total loss value, λ is the weighting coefficient, and m is a constant; step 1-8: update the XGBoost model parameters based on the total loss value, and repeat steps 1-6 to 1-7 until the error between the predicted value output by the second training set and the true value output is less than a threshold value, at which time the XGBoost model training is completed and a card-edge formula model is obtained; step 1-9: input the second test set into the trained card-edge formula model and evaluate it.

[0017] Preferably, in step 2, the fusion method includes an online formula maintenance strategy based on PSO optimization weight update and an online formula maintenance strategy based on ensemble learning. When the online formula maintenance strategy based on PSO optimization weight update fails, the online formula maintenance strategy based on ensemble learning is adopted.

[0018] Preferably, the online recipe maintenance strategy based on PSO optimization weight update is: step 2-1-1: initialize the weights of the conservative recipe model and the card-edge recipe model; step 2-1-2: use average weighting to fuse the conservative recipe model and the card-edge recipe model, and establish a hybrid recipe model; step 2-1-3: evaluate the online samples harmonized according to the current weights; step 2-1-4: determine whether the online samples reach the expected value, if so, output the current recipe and end the modeling; if not, update the weights online and return to step 2-1-2.

[0019] Preferably, in the step 2-1-4, during the online update process of the weights, the input is the expected blending quality parameters, and the output is the weights of the conservative formula model and the card-edge formula model, including the following steps: step 2-1-4-1: initialize the adjustment parameters; step 2-1-4-2: calculate the conservative formula model weights and the card-edge formula model weights; step 2-1-4-3: perform weighted average fusion of the conservative formula model and the card-edge formula model according to the calculated weights, and update the mixed formula model weights; step 2-1-4-4: determine whether the quality index after blending meets the expected value, if so, the blending of the mixed formula model is completed; if not, continue with step 2-1-4-5; step 2-1-4-5: calculate the adjustment rate; step 2-1-4-6: repeat steps 2-1-4-2 to 2-1-4-4 until the quality of the blended gasoline reaches the expected quality index.

[0020] Preferably, the process of obtaining the initial weight values ​​and the initial parameters of the card edge formula model is as follows: Step 2-1-1-1: Initialize the particle parameters in PSO; Step 2-1-1-2: Calculate the fitness function of each particle, obtain the current individual optimum of each particle and the global optimum of the entire particle swarm; Step 2-1-1-3: Update the speed and position of each particle; Step 2-1-1-4: Determine whether the maximum number of iterations has been reached. If so, output the optimal parameter solution and proceed to step 2-1-1-5; if not, return to step 2-1-1-2; Step 2-1-1-5: Assign the obtained optimal parameter solution to the initial weight values ​​and the initial parameters of the card edge formula model respectively.

[0021] Preferably, the loss function involved in the present invention adopts mean square error, that is, the loss function formula is:

[0022]

[0023] Among them, y is the original estimated quantity, is the estimator, N is the number of estimators, a positive integer, 1≤i≤N.

[0024] Preferably, the online recipe maintenance strategy process based on the idea of ​​ensemble learning is as follows: Step 2-2-1: Divide the online samples into a third training set and a third test set; Step 2-2-2: Input the third training set into the conservative recipe model and the card-edge recipe model respectively, calculate the predicted values ​​of the training set in the conservative recipe model and the card-edge recipe model, and merge them into a new training set data; Step 2-2-3: The new training set data is used for training the secondary model, thereby obtaining the secondary model; Step 2-2-4: Input the third test set into the conservative recipe model and the card-edge recipe model respectively, and calculate the predicted values ​​of the third test set in the conservative recipe model and the card-edge recipe model respectively; Step 2-2-5: Input the predicted value calculated in step 2-2-4 into the secondary model for evaluation.

[0025] Preferably, the historical tank bottom residual oil components include hydrogenated gasoline, etherified gasoline, MTBE, automotive isooctane, gasoline heavy aromatics, generated oil, ethylbenzene, toluene and xylene.

[0026] It can be seen from the above technical solution that compared with the prior art, the present invention discloses a modeling method for a finished gasoline blending and mixing formula model based on tank bottom batches, establishes a conservative formula model based on tank batches and establishes a high-precision card-edge formula model, and obtains a mixed formula model based on two fusion strategies, thereby improving the one-time blending success rate and meeting the purpose of card-edge production, thereby reducing the production cost of the enterprise and improving production efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0028] Figure 1 The accompanying drawing is a schematic diagram of the mixed formula model flow chart provided by the present invention.

[0029] Figure 2 The accompanying drawing is a schematic diagram of the conservative formulation model process provided by the present invention.

[0030] Figure 3 The accompanying figure is a schematic diagram of the process of combining the improved MKFCM algorithm of the present invention with XGBoost.

[0031] Figure 4 The accompanying drawing is a schematic diagram of the card edge formula model process based on knowledge distillation of the present invention.

[0032] Figure 5The attached figure is a flow chart of the online recipe maintenance strategy based on PSO optimization weight update.

[0033] Figure 6 The attached figure is a flow chart of the online recipe maintenance strategy based on ensemble learning ideas. DETAILED DESCRIPTION

[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0035] The embodiment of the present invention discloses a modeling method for a finished gasoline blending and mixing formula model based on tank bottom batches, step 1: establishing a conservative formula model and a card edge formula model; step 2: fusing the conservative formula model with the card edge formula model to obtain a mixed formula model. The present invention uses the conservative formula model as the data for outputting the card edge formula model to supplement and complete it, optimizes the combination of transfer learning and model methods, obtains the card edge formula model, makes the oil products approach the card edge production, and improves the production efficiency of the enterprise.

[0036] In this embodiment, if Figure 2 , the conservative formula model establishment process is as follows: Step 1-1: Based on the initialization membership matrix, the improved MKFCM algorithm is used to cluster the historical tank bottom residual oil components to obtain the batch categories and the membership matrix belonging to each batch; Step 1-2: XGBoost is used to establish the corresponding batch sub-formula model for each batch category; Step 1-3: The current tank residual oil components are clustered based on the improved MKFCM algorithm, and the membership obtained by clustering is used as the fusion coefficient of each sub-formula model of the current tank; The current tank residual oil components and the quality indicators to be achieved are input into the sub-formula model of each batch to obtain the predicted value of the sub-formula model of each batch of the current tank; The fusion coefficient and predicted value of each sub-formula model of the current tank are weighted and fused to generate a conservative formula model. The present invention first proposes a method for adaptively selecting kernel parameters for the kernel parameter selection in the MKFCM algorithm. Secondly, by adopting the idea of ​​multi-model integrated modeling, a precise formula model for finished gasoline blending based on tank batches is established, thereby reducing the production cost of the enterprise, improving production efficiency, and improving the success rate of one-time blending.

[0037] In this embodiment, if Figure 3The present invention adopts an improved MKFCM algorithm for batch classification, and adopts a nonlinear XGBoost algorithm to establish a nonlinear formula sub-model. The improved MKFCM algorithm adopts a Gaussian kernel function, and only one parameter (sub-Gaussian kernel parameter) needs to be determined to be constructed. The selection of the sub-Gaussian kernel parameter reflects the position of the feature data mapping in the Hilbert space, which has a certain impact on the clustering effect. For the residual oil at the bottom of the tank of the blended oil, the sample is composed of the addition ratio of 9 components, and its data is not only a sample difference, but a sample vector difference. Considering that the components of the tank bottom oil may obey different kernel probability distributions, in order to make the kernel parameters simple and convenient, and to reflect the differences of the components, the present invention first sets an overall kernel parameter, then calculates the minimum value of the distance between each component, and finally calculates the parameter value of the Gaussian kernel function of the component, so that it has the ability to adaptively select the characteristic kernel parameters of each tank bottom component. The kernel parameters of each sub-kernel function can be calculated by an adaptive formula, thereby avoiding the manual input of the kernel parameters of each sub-kernel function, thereby realizing adaptive selection.

[0038] Step 1-1-1: The present invention adopts a Gaussian kernel function, which is in the form of:

[0039]

[0040] Step 1-1-2: According to the overall kernel parameters and the components of the tank bottom oil, calculate the kernel parameters of each component for adaptive selection. The formula of the kernel parameters is:

[0041]

[0042] Among them, K(X,Y) is the Gaussian kernel function, min(·) is the minimum value of the distance between each component, σk is the kernel parameter of the kth sub-kernel function, x ik is the kth feature value of the i-th sample, x jk is the kth eigenvalue of the jth sample, i is the i-th sample, j is the jth feature of the sample, X is the first independent variable of the Gaussian kernel function, here refers to the eigenvalue of the sample, Y is the second independent variable of the Gaussian kernel function, here refers to the eigenvalue of the sample, and σ is the overall kernel parameter of the adaptively selected sub-kernel parameter.

[0043] Secondly, batch clustering is performed on the tank bottom oil. The purpose is to minimize the objective function of the clustering algorithm.

[0044]

[0045]

[0046] in, is the function mapping of the jth sample, c is the cth cluster center, i is the ith sample, u ijis the weight of the j-th sample in the i-th sub-model, that is, the fusion coefficient of each sub-formula model of the current tank, and m is the weighted index.

[0047] Step 1-1-3: Initialize the kernel weight vector:

[0048] Input the overall kernel parameters and the proportion of each component added to the tank bottom oil, and calculate each kernel function. The formula is:

[0049]

[0050]

[0051] Among them, ω M is the Mth feature map, M is the number of feature maps and the number of kernel functions, is the weight value of the Mth kernel function.

[0052] Step 1-1-4: Initialize the membership matrix so that all internal elements are The membership matrix can be standardized according to the following formula:

[0053]

[0054] in, is the mth power of the membership value of the ith sample to the Cth cluster center, where m is the weighted index, N is the number of samples, and c is the cth cluster center;

[0055] Step 1-1-5: The calculation formula of coefficient α is:

[0056]

[0057] Among them, K k (x i ,x j ) is the i-th sample x i With the jth sample x j The mapping value on the kth kernel function, K k (x i ,x i ) is the i-th sample x i With the i-th sample x i The mapping value on the kth kernel function, K k (x j ,x j ) is the jth sample x j With the jth sample x j The mapping value on the kth kernel function, u jc is the membership value of the jth sample to the Cth cluster center, j is the jth sample, j 'For thej ' samples;

[0058] The coefficient β calculation formula is:

[0059] Among them, k is the kth kernel function, c is the cth cluster center, i is the i-th sample, β k is the kth β coefficient.

[0060] Step 1-1-6: The kernel function fusion weight matrix is:

[0061]

[0062] Among them, ω k is the kth kernel function fusion weight matrix.

[0063] Step 1-1-7: The distance matrix D is:

[0064]

[0065] Among them, M is the number of sample features.

[0066] Step 1-1-8: The updated membership matrix is:

[0067]

[0068] Where c = 1, 2...C, C represents the number of categories, i, j = 1, 2...N, i≠j, u ij is the weight of the j-th sample in the i-th sub-model, that is, the fusion coefficient of each sub-formula model of the current tank, and m is the weighted index.

[0069] Step 1-1-9: Repeat steps 1-1-2-1-1-8 until the updated membership matrix satisfies the following preset condition: |U(i)-U(i-1)|<0.0001 (12), then the iteration can be stopped; Step 1-1-10: According to the obtained membership matrix, the addition ratio of each component of the historical tank bottom residual oil is divided into batch categories.

[0070] The present invention establishes a sub-formula model for each batch according to each batch of data obtained by the above clustering. In step 1-2, the present invention uses XGBoost to establish each batch of sub-formula models, and the establishment process includes, step 1-2-1: set the loop parameter K of the sub-formula model, and set K=0; step 1-2-2: determine whether the loop parameter K is less than or equal to 10; if not or when the convergence condition |U(i)-U(i-1)|<0.0001 is met, jump out of this loop; if so, repeat steps 1-2-3 to 1-2-6; step 1-2-3: divide each batch of category data into a training set and a test set; step 1-2-4: train the sub-formula model based on the training set to obtain the trained sub-formula model; step 1-2-5: test the trained sub-formula model based on the test set, and calculate the evaluation index after obtaining the test sub-formula model result; step 1-2-6: the loop parameter K is increased by 1 time, and returns to step 1-2-2. In addition, the present invention adopts 10-fold cross validation to make the test result more accurate. The advantage of this verification method is that it repeatedly uses randomly generated subsamples for training and verification, and the results are verified each time. The first time: use the last 9 samples as the training data set to train the model; use the first sample as the test data set to test the model, and record the test results of the model in the test data set. The second time: use the second sample as the test data set to test the model; use the remaining 9 samples as the training data set to train the model, and record the test results of the model in the test data set. And so on, until the end of 10 times. Summarize all test results.

[0071] In this embodiment, if Figure 4 The input and output data features of the card-edge formula model based on knowledge distillation are the same as those of the conservative formula model, which are quality indicators and the addition ratio of tank bottom components. Only the amount of data and the data value have changed. The conservative formula model is used as the teacher model, and the card-edge formula model is used as the student model, and then a tank batch card-edge formula model based on the combination of knowledge distillation and XGBoost algorithm is obtained. The establishment process of the card-edge formula model in step 1 is: Step 1-4: Divide the historical card-edge data into the second training set and the second test set; Step 1-5: Pre-train the XGBoost model, including initializing the XGBoost model parameters and setting the objective function. The objective function is:

[0072]

[0073] Among them, y s is the predicted value output by the XGBoost model, y T is the probability value of the conservative formula model after the improved Softmax output, y true is the true value of the improved Softmax output of the conservative formula model, L soft for ys With y T The error function, L hard for y s With y true The error function is λ, where λ is the weighting coefficient and m is a constant; Step 1-6: Input the second training set into the conservative formula model and calculate L soft Value; Input the second training set into the XGBoost model and calculate L hard Value; Step 1-7: If L hard +m value is greater than L soft value, execute L=λL soft (y s ,y T )+(1-λ)L hard (y s ,y true ); otherwise execute L=L hard (y s ,y true ), where L is the total loss value, λ is the weighting coefficient, and m is a constant; Step 1-8: Update the XGBoost model parameters, repeat steps 1-6 to 1-7 until the error between the predicted value output by the second training set and the true value output is less than the threshold, at which point the XGBoost model training is completed, thereby obtaining the card-edge formula model; Step 1-9: Input the second test set into the card-edge formula model and evaluate it. The invention introduces knowledge distillation to greatly improve the performance of the card-edge formula model.

[0074] In this embodiment, in step 2, the fusion method includes an online recipe maintenance strategy based on PSO optimization weight update and an online recipe maintenance strategy based on ensemble learning. When the online recipe maintenance strategy based on PSO optimization weight update fails, the online recipe maintenance strategy based on ensemble learning is adopted.

[0075] In this embodiment, if Figure 5 The online recipe maintenance strategy based on PSO optimization weight update is as follows: Step 2-1-1: Initialize the weights of the conservative recipe model and the card-edge recipe model; Step 2-1-2: Use average weighting to fuse the conservative recipe model and the card-edge recipe model, and establish a hybrid recipe model; Step 2-1-3: Online evaluation of samples blended according to the current weights; Step 2-1-4: Determine whether the online sample reaches the expected value. If so, output the current recipe and end the modeling; if not, update the weights online and return to step 2-1-2.

[0076] In this embodiment, if Figure 5, the process of obtaining the initial value of the weight and the initial parameters of the card edge recipe model (XGBoost model parameters and knowledge distillation parameters) is as follows: Step 2-1-1-1: Initialize the particle parameters in PSO, the particle parameters include the inertia weight coefficient ω, the number of particle population N, the number of parameters to be optimized (particle length) D, the maximum speed Vmax, the acceleration factors c1 and c2, the number of iterations G, select the fitness function, and encode the parameters to be optimized as particle information; Step 2-1-1-2: Calculate the fitness function of each particle, obtain the current individual optimal value of each particle and the global optimal value of the entire particle swarm; Step 2-1-1-3: Update the speed and position of each particle; the update formula is as follows:

[0077] V id =ωV id +c1random(0,1)(P id -Xid)+c2random(0,1)(P gd -X id )

[0078] X id =X id +V id (14)

[0079] Among them, P id represents the dth dimension of the individual optimality of the ith variable, P gd represents the dth dimension of the global optimum, X id represents the d-th dimension position vector of the optimal individual of the i-th variable, V id Represents the optimal velocity vector of the dth dimension of the i-th variable individual; Step 2-1-1-4: Determine whether the maximum number of iterations has been reached, if so, output the optimal parameter solution and enter step 2-1-1-5; if not, return to step 2-1-1-2; Step 2-1-1-5: Assign the obtained optimal parameter solution the initial value of the weight and the initial parameters of the card edge formula model. The present invention adopts the PSO algorithm to optimize the parameters of the conservative formula model and the card edge formula model respectively. Experimental simulation proves that the two formula models after the optimization of parameters can meet the performance quality indicators. The card edge formula model that introduces knowledge distillation and is optimized by PSO improves the prediction accuracy and reduces the generalization error.

[0080] In this embodiment, during the online update of weights, the input is the desired blending quality parameter, and the output is the weights of the conservative recipe model and the card edge recipe model, which includes the following steps: Step 2-1-4-1: Initialize the adjustment parameters, the adjustment parameters include: the initial conservative recipe model weight θ0, the initial card edge recipe model weight ρ0, the step coefficient C and the adjustment rate η; Step 2-1-4-2: Calculate the conservative recipe model weight and the card edge recipe model weight, the calculation formula is:

[0081] θ k =θ k-1 ±Δ k

[0082]

[0083] Δ k =η k C

[0084] stθ k +ρ k ≡1 (15)

[0085] Among them, θ,ρ∈[0,1], Δ∈[0,min(θ k-1 ,ρ k-1 )],θ k ,ρ k They represent the weight coefficients of the conservative formulation model and the card edge formulation model at the kth moment, C is the step constant, η k is the adjustment rate, k represents the number of adjustments;

[0086] Step 2-1-4-3: Perform weighted average fusion of the conservative formula model and the card edge formula model according to the calculated weights, and update the hybrid formula model. The fusion formula is:

[0087]

[0088] stθ+ρ=1 (16)

[0089] Among them, θ and ρ parameters represent the weights of the conservative formulation model and the card edge formulation model respectively, and Y 保 Y is the predicted value of the test set input into the conservative formula model established above, 卡 is the predicted value of the test set input into the card edge recipe model established above, and Y is the predicted value of the mixed recipe model;

[0090] Step 2-1-4-4: Determine whether the quality index after blending meets the expected value. If so, the blending of the mixed formula model is completed; if not, proceed to step 2-1-4-5;

[0091] Step 2-1-4-5: Calculate the adjustment rate, the formula is:

[0092]

[0093]

[0094] η0=η max (17)

[0095] Where k represents the number of adjustments, η max ,η min Respectively represent the maximum and minimum values ​​of the regulation rate, ν k is the value of η reduced for the kth time. It can be clearly seen from formula (17) that with the increase of the number of adjustments k, η gradually decreases, and the rate of decrease becomes slower and slower, so that at the beginning of the optimization, the values ​​of θ and ρ change relatively large. With the increase of the number of adjustments, the fluctuations of θ and ρ gradually become smaller, so that the optimal point can be found better.

[0096] Step 2-1-4-6: Repeat steps 2-1-4-2 to 2-1-4-4 until the quality of the blended gasoline reaches the expected quality index. The present invention balances the relationship between the successful blending of gasoline and the marginal production by online evaluation of the quality of the gasoline product during the blending process and then adjusting the weight. If the quality of the blended product is too conservative, the product quality can be made to approach the marginal production by reducing θ and increasing ρ.

[0097] In this embodiment, if Figure 6 The process of online formula maintenance strategy based on ensemble learning is as follows: Step 2-2-1: Divide the online samples into the third training set and the third test set according to the ratio of 7:3, wherein the third training set is used to train the mixed formula model, and the third test set is used to test and evaluate the mixed formula model; Step 2-2-2: Input the third training set into the conservative formula model and the card-edge formula model respectively, calculate the predicted values ​​of the training set in the conservative formula model and the card-edge formula model, and merge them into a new training set data; Step 2-2-3: Train the secondary model according to the new training set data to obtain the secondary model; Step 2-2-4: Input the third test set into the conservative formula model and the card-edge formula model respectively, calculate the predicted values ​​of the third test set in the conservative formula model and the card-edge formula model respectively; Step 2-2-5: Input the predicted value calculated in step 2-2-4 into the secondary model for evaluation. The present invention re-divides online samples into a training set and a test set, re-trains the results predicted by the established conservative formula model and the card edge formula model using a nonlinear model, and then verifies them using the test set data. The hybrid formula model has accurate prediction and good fitting effect.

[0098] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0099] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A modeling method for a finished gasoline blending formula model based on a tank bottom batch, characterized in that: include: Step 1: Establish conservative formula model and card edge formula model; Step 2: Fusing the conservative formula model with the card edge formula model to obtain a hybrid formula model; In step 1, the process of establishing the card edge formula model is as follows: Step 1-4: Divide the historical card edge data into a second training set and a second test set; Step 1-5: Pre-train the XGBoost model, including initializing the XGBoost model parameters; Step 1-6: Input the second training set into the conservative formula model and calculate L soft Value; Input the second training set into the XGBoost model and calculate L hard value; Among them, L soft for y s With y T The error function, L hard for y s With y true The error function, y s is the predicted value output by the XGBoost model, y T is the probability value of the conservative formula model after the improved Softmax output, y true is the true value of the conservative formula model after the improved Softmax output, Step 1-7: If L hard +m value is greater than L soft Value, Execution L = λL soft (y s , y T ) + (1 - λ)L hard (y s , y true );Otherwise, execute L = L hard (y s , y true ); Among them, L is the total loss value, λ is the weighting coefficient, and m is a constant; Step 1-8: Update the XGBoost model parameters based on the total loss value, and repeat steps 1-6 to 1-7 until the error between the predicted value output by the second training set and the true value output is less than a threshold value. At this time, the XGBoost model training is completed, and the card edge formula model is obtained; Step 1-9: Input the second test set into the trained card-edge recipe model and evaluate it.

2. The modeling method of finished gasoline blending formula model based on tank bottom batch according to claim 1 is characterized in that: In step 1, the conservative formula model establishment process is: Step 1-1: Based on the initial membership matrix, the improved MKFCM algorithm is used to cluster the historical tank bottom residual oil components to obtain the categories of each batch and the membership matrix belonging to each batch; Step 1-2: Use XGBoost to establish corresponding sub-formula models for each batch category; Step 1-3: Cluster the residual oil components of the current tank based on the improved MKFCM algorithm, and use the membership degree obtained by clustering as the fusion coefficient of each batch sub-formula model of the current tank; Input the components of the residual oil in the current tank and the quality index to be achieved into the sub-formula model of each batch, and obtain the predicted value of the current tank with respect to the sub-formula model of each batch; The fusion coefficients and predicted values ​​of the sub-formula models of each batch of the current tank are weighted and fused to generate the conservative formula model; In step 1-1, the historical tank bottom residual oil components are clustered to minimize the objective function of the clustering algorithm. The steps are as follows: Step 1-1-1: The improved MKFCM algorithm uses a Gaussian kernel function, which is: Step 1-1-2: Calculate each kernel function parameter according to the overall kernel parameters and each component of the tank bottom oil. The formula of each kernel function parameter is: Among them, K(X,Y) is the Gaussian kernel function, min(·) is the minimum value of the distance between each component, σk is the kernel parameter of the kth sub-kernel function, x ik is the kth feature value of the i-th sample, x jk is the kth characteristic value of the jth sample, i is the i-th sample, j is the jth characteristic of the sample, X is the first independent variable of the Gaussian kernel function, which refers to the characteristic value of the sample, Y is the second independent variable of the Gaussian kernel function, which refers to the characteristic value of the sample, and σ is the overall kernel parameter of the adaptively selected sub-kernel parameter; Step 1-1-3: Calculate the total kernel function and initialize the membership matrix according to each kernel function and the initialization kernel weight vector; Step 1-1-4: Obtain a standardized membership matrix based on the initialized membership matrix; Step 1-1-5: Calculate coefficients α, β according to the standardized membership matrix; Step 1-1-6: Calculate the kernel function fusion weight matrix according to the coefficient β; Step 1-1-7: Calculate the distance matrix according to the kernel function fusion weight matrix and the coefficient α; Step 1-1-8: Obtain an updated membership matrix based on the distance matrix; Step 1-1-9: Repeat steps 1-1-2-1-1-8 until the updated membership matrix meets the preset convergence conditions; Step 1-1-10: Divide the addition ratio of each component of the historical tank bottom residual oil into batch categories according to the obtained membership matrix; In step 1-2, the process of establishing each batch of sub-formula models includes: Step 1-2-1: Set the cycle parameter K of each batch sub-recipe model and set K=0; Step 1-2-2: Determine whether the loop parameter K is less than or equal to the preset value; if not or the convergence condition is met, exit this loop; if so, repeat steps 1-2-3 to 1-2-6; Step 1-2-3: Divide each batch of category data into the first training set and the first test set; Step 1-2-4: training a sub-formula model based on the first training set to obtain a trained sub-formula model; Step 1-2-5: testing the trained sub-formula model based on the first test set, obtaining the test sub-formula model result and calculating the evaluation index; Step 1-2-6: Increase the loop parameter K once and return to step 1-2-2.

3. The modeling method of finished gasoline blending formula model based on tank bottom batch according to claim 1 is characterized in that: In step 2, the fusion method includes an online formula maintenance strategy based on PSO optimization weight update and an online formula maintenance strategy based on ensemble learning. When the online formula maintenance strategy based on PSO optimization weight update fails, the online formula maintenance strategy based on ensemble learning is adopted.

4. The modeling method of the finished gasoline blending formula model based on tank bottom batch according to claim 3 is characterized in that: The online recipe maintenance strategy based on PSO optimization weight update is: Step 2-1-1: Initialize the weights of the conservative formulation model and the card edge formulation model; Step 2-1-2: Use average weighting to fuse the conservative formula model and the card edge formula model, and establish a hybrid formula model; Step 2-1-3: Evaluate the online samples reconciled according to the current weights; Step 2-1-4: Determine whether the online sample reaches the expected value. If so, output the current recipe and end the modeling; if not, update the weight online and return to step 2-1-2.

5. The modeling method of finished gasoline blending formula model based on tank bottom batch according to claim 4 is characterized in that: In step 2-1-4, during the online updating of the weights, the input is the desired blending quality parameter, and the output is the weights of the conservative recipe model and the card edge recipe model, including the following steps: Step 2-1-4-1: Initialize adjustment parameters; Step 2-1-4-2: Calculate the weights of the conservative formula model and the card edge formula model; Step 2-1-4-3: Perform weighted average fusion of the conservative formula model and the card edge formula model according to the calculated weights, and update the weights of the hybrid formula model; Step 2-1-4-4: Determine whether the quality index after blending meets the expected value. If so, the blending of the mixed formula model is completed; if not, proceed to step 2-1-4-5; Step 2-1-4-5: Calculate the adjustment rate; Step 2-1-4-6: Repeat steps 2-1-4-2 to 2-1-4-4 until the quality of the blended gasoline reaches the expected quality index.

6. The modeling method of finished gasoline blending formula based on tank bottom batch according to claim 4 is characterized in that: The process of obtaining the initial weight value and the initial parameters of the card edge formula model is as follows: Step 2-1-1-1: Initialize the particle parameters in PSO; Step 2-1-1-2: Calculate the fitness function of each particle to obtain the current individual optimum of each particle and the global optimum of the entire particle swarm; Step 2-1-1-3: Update the speed and position of each particle; Step 2-1-1-4: Determine whether the maximum number of iterations has been reached. If so, output the optimal parameter solution and proceed to step 2-1-1-5; if not, return to step 2-1-1-2; Step 2-1-1-5: assign the obtained optimal parameter solution to the initial value of the weight and the initial parameters of the card edge formula model respectively.

7. The modeling method of finished gasoline blending formula model based on tank bottom batch according to claim 4 is characterized in that: The online formula maintenance strategy process based on ensemble learning is as follows: Step 2-2-1: Divide the online samples into a third training set and a third test set; Step 2-2-2: input the third training set into the conservative formulation model and the card edge formulation model respectively, calculate the predicted values ​​of the training set in the conservative formulation model and the card edge formulation model, and merge them into a new training set data; Step 2-2-3: The new training set data is used for training the secondary model, thereby obtaining the secondary model; Step 2-2-4: inputting the third test set into the conservative formulation model and the card edge formulation model respectively, and calculating the predicted values ​​of the third test set in the conservative formulation model and the card edge formulation model respectively; Step 2-2-5: Input the predicted value calculated in step 2-2-4 into the secondary model for evaluation.

8. The modeling method of finished gasoline blending formula model based on tank bottom batch according to claim 2 is characterized in that: The components of the historical tank bottom residual oil include hydrogenated gasoline, etherified gasoline, MTBE, automotive isooctane, gasoline heavy aromatics, generated oil, ethylbenzene, toluene and xylene.