Disclosure of Invention
In order to solve the defects and shortcomings in the prior art, the invention provides a pipeline compensation method for oil product online blending, which can feed back the characteristics in the blending process based on the oil product flow at the inlet and the outlet of a pipeline and can compensate steady-state errors caused by pipeline residue.
Specifically, the pipeline compensation method for oil on-line blending is used for compensating the quality of oil output to a product tank, and comprises the following steps:
determining the type of online sampling data corresponding to the pipeline of the blended oil product, and initializing the online sampling data;
acquiring a first oil parameter set flowing into a pipeline in a preset sampling period through an oil sampling device at an inlet of the pipeline, and acquiring a second oil parameter set flowing out of the pipeline in the preset sampling period through data records in the pipeline;
acquiring an oil product flow difference value of the second oil product parameter set relative to the first oil product parameter set, and updating data of elements in the second oil product parameter set based on the oil product flow difference value;
and finishing the overall estimation of the oil product in the pipeline according to the updated second oil product parameter set.
Optionally, the determining the type of the online sampling data corresponding to the blended oil product pipeline, and performing initialization processing on the online sampling data includes:
determining online sampling data types including oil density and various distillation range parameters aiming at the related parameter types of the current oil online blending;
constructing an online sampling data structure as shown in formula one based on the determined online sampling data type,
in the formula, F0Is the volume flow or mass flow at time 0, [ q10,q20,...qn0]TThe method comprises the following steps of (1) taking various parameters corresponding to oil product density and distillation range, wherein n is the type number of online data in a pipeline, the online sampling starting time is b, the online sampling finishing time is T + b, and T represents the number of sampling periods in the pipeline;
according to the validity of the data in the pipeline at this time, initialization processing for deleting invalid data is performed.
Optionally, the oil sampling device through the pipeline entrance obtains the first oil parameter set that flows into the pipeline in presetting the sampling cycle, obtains the second oil parameter set that flows out the pipeline in presetting the sampling cycle through the data record in the pipeline simultaneously, includes:
acquiring a first oil product parameter set at a pipeline inlet in a sampling period as shown in a formula two and a second oil product parameter set at a pipeline outlet as shown in a formula three based on a preset online sampling data type;
in the formula, FbIs the volume flow or mass flow at time b, [ q1b,q2b,...qnb]TAnd (b) corresponding to various parameters of oil product density and distillation range at the moment b, wherein n is the type number of online data in the pipeline, the online sampling starting time is b, the online sampling ending time is T + b, and T represents the number of sampling periods in the pipeline.
Optionally, the obtaining of the oil product flow difference value of the second oil product parameter set relative to the first oil product parameter set, and performing data update on elements in the second oil product parameter set based on the oil product flow difference value includes:
if the oil product flow difference value is zero, data updating is carried out on the second oil product parameter set by referring to the data at the outlet of the pipeline;
if the oil product flow difference value is a positive number, performing data splitting treatment on the second oil product parameter set;
and if the oil flow difference value is negative, continuously acquiring a second oil parameter set representing the oil quantity at the outlet of the pipeline.
Optionally, if the oil flow difference is a positive number, performing data splitting processing on the second oil parameter set, including:
performing data splitting on the second oil product parameter set according to the oil product flow difference value, so that the split oil product parameters and the combined oil product flow are equal to the oil product flow of the first oil product parameter set;
and acquiring the flow of the split residual oil product, and updating the data of the second oil product parameter set.
Optionally, if the oil flow difference is a negative number, a second oil parameter set representing the outlet oil amount of the pipeline needs to be continuously obtained, including:
determining the flow of the oil product needing to be continuously obtained according to the flow difference value of the oil product;
and updating data of the second oil product parameter set based on the obtained oil product flow.
Optionally, the performing the overall estimation on the oil product in the pipeline according to the updated second oil product parameter set includes:
determining the weight value of each parameter in the second oil product parameter set by referring to the volume flow or the mass flow of the oil product;
and calling a weighting and averaging mode to calculate the quality parameters of the oil product in the pipeline based on the determined weight value, and finishing the integral estimation of the oil product.
The technical scheme provided by the invention has the beneficial effects that:
the pipeline in the oil product on-line blending is simulated by using the first-in first-out queue, so that the problems of calculation error, lag and the like caused by overlong pipeline are compensated; the mode of recording data by unit sampling time can reflect the change of flow in the blending process, the dynamic characteristic is better and more accurate, and the whole blending process becomes more stable and reliable.
Example one
In order to compensate for errors caused by external factors including the length of a pipeline in an oil blending process, the embodiment of the application provides a pipeline compensation method, which can reduce the influence of overlong pipelines on a blending result and compensate errors caused by long pipelines.
Specifically, the pipeline compensation method for oil product online blending is used for compensating the quality of oil products output to a product tank, as shown in fig. 1, and comprises the following steps:
11. determining the type of online sampling data corresponding to the pipeline of the blended oil product, and initializing the online sampling data;
12. acquiring a first oil parameter set flowing into a pipeline in a preset sampling period through an oil sampling device at an inlet of the pipeline, and acquiring a second oil parameter set flowing out of the pipeline in the preset sampling period through data records in the pipeline;
13. acquiring an oil product flow difference value of the second oil product parameter set relative to the first oil product parameter set, and updating data of elements in the second oil product parameter set based on the oil product flow difference value;
14. and finishing the overall estimation of the oil product in the pipeline according to the updated second oil product parameter set.
In the implementation, in order to reduce the influence of the length of a pipeline for oil blending on the blending precision, the processing idea of the compensation method provided by the application takes the pipeline as a queue concept in a data structure, oil entering and exiting the pipeline is sampled in real time, and the oil in the pipeline is evaluated based on the sampling result. If the oil quantity at the inlet and the outlet is unbalanced, the sampling result needs to be subjected to data processing, so that the blended oil can be accurately evaluated based on the processed data.
In the step of obtaining the second oil parameter set in step 12, the data record in the pipeline, i.e. the historical data, is used, because the oil enters the pipeline from the inlet, and the historical data of the oil at the inlet can be obtained by the sampling device. If these data are missing or invalid, the tank bottom data are used to represent the pipeline average. The interior and outlet of the pipe are free of instrumentation. The reason for adopting the tank bottom data is that the blending of the oil product is a slow and stable process, the quality data of the oil product entering the tank bottom from the pipeline has little change, and the oil product can be approximately replaced under the condition of no better data source.
According to the processing idea, the steps of firstly carrying out sampling data type construction and sampling data initialization processing comprise:
111. determining online sampling data types including oil density and various distillation range parameters aiming at the related parameter types of the current oil online blending;
112. constructing an online sampling data structure as shown in formula one based on the determined online sampling data type,
in the formula, F0Is the volume flow or mass flow at time 0, [ q10,q20,...qn0]TThe parameters corresponding to the density and distillation range of the oil product, and n is the type and quantity of the online data in the pipeline.
113. According to the validity of the data in the pipeline at this time, initialization processing for deleting invalid data is performed. In practice, the specific parameters of the parameters include density, motor octane number, research octane number, benzene content, olefin content, aromatic hydrocarbon content, distillation range (10% evaporation temperature, 50% evaporation temperature, 90% evaporation temperature), sulfur content, oxygen content, manganese content, methanol content, lead content, etc. Reference is made to table 1 of GB 17930-2016 motor gasoline standard, column "item".
The pipeline is regarded as a complete whole when the pipeline is initialized, and the inside of the pipeline is uniform. If invalid data exists in the pipeline, discarding the invalid data, and taking historical data or last blended tank bottom data as the average property of the whole pipeline, wherein the parameters comprise volume, mass, density, distillation range and the like according to different specific blended oil products. The meaning of initialization is to obtain data information of the oil inside the pipe. The data can reflect the actual situation. In the actual blending operation process, data may have problems of missing, omission and the like. Initialization ensures that the oil quality data in the pipeline has a relatively reliable value at the beginning.
A step 12 of obtaining oil product parameter sets at the inlet and outlet of the pipeline respectively based on the data format determined in step 11, specifically including:
121. acquiring a first oil product parameter set at a pipeline inlet in a sampling period as shown in a formula two and a second oil product parameter set at a pipeline outlet as shown in a formula three based on a preset online sampling data type;
in the formula, FbIs the volume flow or mass flow at time b, [ q1b,q2b,...qnb]TAnd (b) corresponding to various parameters of oil product density and distillation range at the moment b, wherein n is the type number of online data in the pipeline, the online sampling starting time is b, the online sampling ending time is T + b, and T represents the number of sampling periods in the pipeline.
In the implementation, "→" in the formula two represents that the currently sampled oil parameter at the time T + b +1 is included in the first oil parameter set representing the pipeline, and "→" in the formula three represents that the acquired oil parameter at the time b is taken out from the second oil parameter set representing the pipeline and is also the oldest stored oil parameter, wherein the inclusion and the taking out correspond to the concept of the "queue" described above.
The contents of b, b +1 … T + b, T + b +1, etc. in the subscript of each data element stored in equation two and equation are all references to the time at which the element was sampled.
After the first oil product parameter set and the second oil product parameter set are obtained and combined, the two sets need to be combined to determine whether element updating operation needs to be performed, that is, step 13 includes:
131. if the oil product flow difference value is zero, data updating is carried out on the second oil product parameter set by referring to the data at the outlet of the pipeline;
132. if the oil product flow difference value is a positive number, performing data splitting treatment on the second oil product parameter set;
133. and if the oil flow difference value is negative, continuously acquiring a second oil parameter set representing the oil quantity at the outlet of the pipeline.
In the implementation, the difference operation corresponds to the three types of results in steps 131, 132, and 133, and specifically, since the content corresponding to step 131 is relatively simple, it is not described herein again, and the content corresponding to steps 132 and 133 is:
132. and if the oil product flow difference value is a positive number, performing data splitting treatment on a second oil product parameter set, wherein the data splitting treatment comprises the following steps:
1321. performing data splitting on the second oil product parameter set according to the oil product flow difference value, so that the split oil product parameters and the combined oil product flow are equal to the oil product flow of the first oil product parameter set;
1322. and acquiring the flow of the split residual oil product, and updating the data of the second oil product parameter set.
If the flow difference value is a positive number, the flow difference value represents that the oil quantity flowing out of the outlet of the pipeline is larger than the flow quantity flowing in the inlet of the pipeline in a specified sampling period, the purpose of ensuring the flow of the oil product in the pipeline to be stable is achieved, and the oil product parameter set collected at the outlet of the current pipeline needs to be split.
The purpose of splitting needs to offset the oil flow difference, so the precondition of the splitting operation is to split the data stored earliest in the second oil parameter set on the basis of offsetting the flow difference, and the splitting mode refers to the following formula. The following equation is the case where the flow at the outlet end for one sampling period is greater than the flow at the inlet end, Fb>FT+b+1。
Since the volume of the pipe itself is not changed, the pipe enters and leavesThe flow of the pipes is equal, wherein the flow F of the outlet end at the right side leaving the pipesT+b+1Equal to the flow F of the left inlet end entering the pipelineT+b+1FT+b+1The remaining flow at the outlet end in the main body of the pipe train is Fb-FT+b+1. Thereby the original F at the outlet end is reducedbIs broken into FT+b+1And Fb-FT+b+1Two items. After splitting, the total flow of the pipeline queue main body is equal to the total flow of the pipeline queue main body of the previous formula two. Namely, it is
FT+b+1+FT+b+...+(Fb-FT+b+1)=FT+b+...+Fb
133. If the oil flow difference value is a negative number, a second oil parameter set representing the outlet oil quantity of the pipeline needs to be continuously obtained, and the method comprises the following steps:
1331. determining the flow of the oil product needing to be continuously obtained according to the flow difference value of the oil product;
1332. and updating data of the second oil product parameter set based on the obtained oil product flow.
If the flow difference value is a negative number, the flow difference value represents that the oil quantity flowing out of the outlet of the pipeline is smaller than the flow quantity flowing in the inlet of the pipeline in a specified sampling period, the purpose of ensuring the flow of the oil product in the pipeline to be stable is achieved, and the parameter set of the oil product collected at the outlet of the current pipeline needs to be reintegrated.
The reintegration method refers to the following formula, and uses
The splitting is accomplished in a manner described in (1).
The flow at each outlet of the pipeline is small, a plurality of pipelines are combined to be equal to the inlet input flow, and the number of the combined time points is represented by tau. The following is the case where the flow at the outlet end for one sampling period is less than the flow at the inlet end, Fb<FT+b+1。
Due to the pipe itselfThe volume is constant and the flow into and out of the pipe is equal. Total flow leaving the duct at the right-hand outlet end in the formula
Equal to the flow F of the left inlet end entering the pipeline
T+b+1The flow left at the outlet end in the main body of the pipeline queue is
Thereby the original items of the outlet end are separated
Integrated together and leave the pipeline. After integration, the total flow of the pipe queue body is equal to the total flow of the pipe queue body of the previous formula two. Namely, it is
Optionally, the step 14 of completing the overall estimation of the oil product in the pipeline according to the updated second oil product parameter set includes:
141. determining the weight value of each parameter in the second oil product parameter set by referring to the volume flow or the mass flow of the oil product;
142. and calling a weighting and averaging mode to calculate the quality parameters of the oil product in the pipeline based on the determined weight value, and finishing the integral estimation of the oil product.
In implementation, after the updating of the inlet and the outlet of the pipeline is completed, a plurality of data objects for describing oil products from different times exist in the pipeline. And taking the volume or the mass of each section of oil product in the pipeline as a weight, and calculating the estimation of the quality index property of the whole by combining different blending rules and weighted average. The overall average properties of the pipeline can be used as part of the tank bottom oil for the estimation of the product tank.
The initial indicators include various types, such as parameters including density, motor octane number, research octane number, benzene content, olefin content, aromatic content, distillation range (10% evaporation temperature, 50% evaporation temperature, 90% evaporation temperature), sulfur content, oxygen content, manganese content, methanol content, lead content, and the like.
In the formula, q represents a general index of the oil, the middle numbers 1, 2, 3.. n represent that the oil has n indexes, such as 1 represents density, 2 represents motor octane number, etc. (for example only, the index numbers do not necessarily correspond to the sequence), and the subscript on the right represents the time point. For example q1T+b+1Data representing the first indicator at time point b + τ + 1.
The method for calculating the quality parameters of the oil product in the pipeline by calling the weighting and averaging based on the determined weight value comprises the following steps of:
in the formula (I), the compound is shown in the specification,
represents the overall average of the nth quality parameter tube at time T + b + 1. F
tIndicating the flow (or mass flow or volume flow) at some time t. qn
tIndicates the nth quality parameter at a certain time t.
The sequence numbers in the above embodiments are merely for description, and do not represent the sequence of the assembly or the use of the components.
The above description is only exemplary of the present invention and should not be taken as limiting the invention, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.