CN-121997686-A - Fuzzy real-time prediction method for accumulated liquid volume of gathering and conveying pipeline based on KNN algorithm
Abstract
The invention provides a fuzzy real-time prediction method for accumulated liquid volume of a collecting and transporting pipeline based on a KNN algorithm, which utilizes a FLAT model to calculate the accumulated liquid volume to perform first dead point rejection, utilizes a given production time (h) and a gas-water ratio (G/L) range to perform second dead point rejection, finally utilizes an average value plus-minus twice standard value of oil pressure to determine a section to be used as a standard for judging the dead point to perform third dead point rejection, calculates the accumulated liquid volume of the collecting and transporting pipeline in real time through the KNN algorithm, and obtains the accumulated liquid volume of the collecting and transporting pipeline through iteration of the algorithm, thereby solving the problem that the accumulated liquid volume is difficult to predict in the prior art, realizing intellectualization and automation in a design optimization flow, and providing a certain technical support for energy conservation and synergy of the collecting and transporting system.
Inventors
- JI XIAOKE
- JING SIYU
- LI MAO
- HE SHUNAN
- MAO YONG
- CHEN XIAOGANG
- LIU PENG
- ZHAO XINSHENG
- LI GUOMING
- CHEN NENG
Assignees
- 中国石油天然气股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241101
Claims (6)
- 1. A fuzzy real-time prediction method for accumulated liquid volume of a gathering and transporting pipeline based on a KNN algorithm is characterized by comprising the following steps of: calculating the accumulated liquid quantity of the gathering and transportation pipeline through a FLAT model, Setting KNN algorithm parameters, wherein the KNN algorithm parameters comprise production time, oil pressure, casing pressure, accumulated liquid volume of a gathering and transportation pipeline, annual water production, accumulated gas production, gas-water ratio, horizon, production time, wellhead temperature, geographic position and accumulated liquid volume change degree as labels; acquiring well site historical data corresponding to algorithm parameters, and dividing the algorithm parameters corresponding to a certain moment into a group; determining the range of partial algorithm parameters through historical data, so as to remove dead pixels in the algorithm parameter data; determining an oil pressure interval by adding and subtracting twice standard values from the oil pressure average value, removing bad points in algorithm parameter data, and removing all data in the same group simultaneously when removing the bad points; Data preprocessing, namely normalizing each characteristic value, namely each data, and drawing a full attribute corresponding scattered matrix graph to obtain the relation among all attributes and the trend of the data; Dividing the data group into a training set and a testing set by a K-fold cross validation method; Training a KNN model by using a K nearest neighbor algorithm and training set data, sorting the distances from small to large by calculating the distances between the training data, selecting K points with the smallest distances, determining the occurrence frequency of K point categories, and finally taking the category with the highest occurrence frequency as a prediction category; and (3) predicting the accumulated liquid amount of the gathering and conveying pipeline, namely acquiring algorithm parameter data of the gathering and conveying pipeline to be predicted, and inputting the algorithm parameter data into a trained model to obtain a predicted value of the accumulated liquid amount of the gathering and conveying pipeline.
- 2. The fuzzy real-time prediction method for the accumulated liquid volume of the gathering and transportation pipeline based on the KNN algorithm of claim 1 is characterized in that the accumulated liquid volume of the gathering and transportation pipeline is predicted by a FLAT model, The gas speed, the liquid speed and the inlet pressure of the pipelines in the gathering and transportation pipeline are obtained, The accumulated liquid in the pipeline is calculated according to the momentum equation, A L =Aε (3) Wherein A l is the cross-sectional area of the pipeline occupied by liquid phase, A g is the cross-sectional area of the pipeline occupied by gas phase, S i is the perimeter of the gas-liquid phase interface, S l is the perimeter of the liquid wall surface, S g is the perimeter of the gas wall surface, τ i is the shear stress of the gas-liquid phase interface, τ wl is the shear stress of the liquid wall surface, τ wg is the shear stress of the gas wall surface, In the form of a pressure drop in the gas phase, Is the pressure drop of liquid phase, epsilon is the liquid holdup, Liquid accumulation = liquid holdup epsilon x line mileage x line cross-sectional area, Ρg, g, β are the gas phase density, the gravitational acceleration, the tilt angle, ρ 1 are the liquid phase density, A L , A is the liquid phase flow passage area and the total flow passage area respectively.
- 3. The fuzzy real-time prediction method of the accumulated liquid volume of the gathering and transportation pipeline based on the KNN algorithm of claim 1 is characterized in that the normalization is specifically that, α=2*(x i -x min )/(x max -x min )-1 (5) Wherein, α is the characteristic value after normalization, x i is the characteristic value before normalization, x max 、x min is the maximum value and the minimum value of the characteristic value before normalization, i is the characteristic value serial number, and i is the i-th characteristic value, i is e 1.
- 4. The fuzzy real-time prediction method of the accumulated liquid volume of the gathering and transportation pipeline based on the KNN algorithm of claim 1 is characterized in that a training formula of the KNN model is that, Wherein, two points are respectively X= (X 1 ,x 2 ,...,x n ),Y=(y 1 ,y 2 ,...,y n ); Setting the sample weight as distance, performing tuning determination on the parameter n_neighbors, adopting Lp distance, when p=2, namely Euclidean distance, and normalizing the value of each attribute before measurement; and introducing a KNeighborsClassifier model from a sklearn learning library by using a K nearest neighbor algorithm, and comparing the AUC values of the models under different K by adopting a cross-validation method to finally obtain an optimal K value.
- 5. The fuzzy real-time prediction method of the fluid accumulation volume of the fluid accumulation pipeline based on the KNN algorithm of claim 1, wherein after model training is completed, model testing is further included, non-fluid accumulation volume data of a test set are input into a trained model to obtain prediction data, if the prediction data meets the requirements of errors of the fluid accumulation volume of the actual fluid accumulation pipeline, the model training is completed, and otherwise, training is repeated.
- 6. The fuzzy real-time prediction method of the accumulated liquid volume of the gathering and transporting pipeline based on the KNN algorithm of claim 1 is characterized in that the actual liquid holdup is taken as a constraint condition, wherein the actual liquid holdup is not less than 0, and the accumulated liquid holdup is not more than 0, and the accumulated liquid holdup is calculated through a FLAT model, so that a data set with large accumulated liquid volume error in historical data of a well site is eliminated, and the accumulated liquid volume = the liquid holdup epsilon multiplied by pipeline mileage multiplied by the pipeline cross-sectional area.
Description
Fuzzy real-time prediction method for accumulated liquid volume of gathering and conveying pipeline based on KNN algorithm Technical Field The invention belongs to the field of oil and gas storage and transportation, and particularly relates to a fuzzy real-time prediction method for accumulated liquid volume of a gathering and transportation pipeline based on a KNN algorithm. Background Most of the gas fields enter the later development stage, the formation pressure is reduced, the gas production is reduced, the water production is increased, the low-yield and low-pressure wells are increased, and the overall benefit of the gas fields is seriously influenced. The gathering and transportation system is affected by the reduction of the output of a gas well, the reduction of the pressure of a wellhead, the rise of back pressure caused by the increase of produced liquid, the long gathering and transportation radius, the fluctuation of a pipeline along the way and the like, so that the gas flow rate of a pipe network is reduced, the liquid carrying capacity is poor, if the liquid carrying capacity cannot be found and treated in time, the pipeline is easy to be frozen and blocked, and the gathering and transportation pipe network is required to be emptied with liquid, so that the back pressure is reduced, the flow rate is increased, and the accumulated liquid in a shaft and a ground pipeline is discharged. However, the accumulated liquid amount at the present stage is difficult to predict, and the judgment of whether to perform the emptying operation is largely made by human. Therefore, the establishment of the accumulated liquid state of the collecting and conveying pipeline, the fuzzy real-time calculation model, algorithm and single-well intelligent rotation and fixed-point suction pressurization energization process device for accumulated liquid amount is significant in realizing energy saving and efficiency improvement. The current calculation of the accumulation state of the collection and transportation pipeline generally requires a large amount of trial calculation, and the method requires a large amount of labor time and cost. Disclosure of Invention The invention aims to provide a fuzzy real-time prediction method for accumulated liquid volume of a collecting and conveying pipeline based on a KNN algorithm, so as to solve the problem that the existing accumulated liquid volume is difficult to predict. The invention aims at realizing the technical means that a fuzzy real-time prediction method for the accumulated liquid volume of a collecting and transporting pipeline based on a KNN algorithm, Calculating the accumulated liquid quantity of the gathering and transportation pipeline through a FLAT model; Setting KNN algorithm parameters, wherein the KNN algorithm parameters comprise production time, oil pressure, casing pressure, accumulated liquid volume of a gathering and transportation pipeline, annual water production, accumulated gas production, gas-water ratio, horizon, production time, wellhead temperature, geographic position and accumulated liquid volume change degree as labels; acquiring well site historical data corresponding to algorithm parameters, and dividing the algorithm parameters corresponding to a certain moment into a group; determining the range of partial algorithm parameters through historical data, so as to remove dead pixels in the algorithm parameter data; determining an oil pressure interval by adding and subtracting twice standard values from the oil pressure average value, removing bad points in algorithm parameter data, and removing all data in the same group simultaneously when removing the bad points; Data preprocessing, namely normalizing each characteristic value, namely each data, and drawing a full attribute corresponding scattered matrix graph to obtain the relation among all attributes and the trend of the data; Dividing the data group into a training set and a testing set by a K-fold cross validation method; Training a KNN model by using a K nearest neighbor algorithm and training set data, sorting the distances from small to large by calculating the distances between the training data, selecting K points with the smallest distances, determining the occurrence frequency of K point categories, and finally taking the category with the highest occurrence frequency as a prediction category; and (3) predicting the accumulated liquid amount of the gathering and conveying pipeline, namely acquiring algorithm parameter data of the gathering and conveying pipeline to be predicted, and inputting the algorithm parameter data into a trained model to obtain a predicted value of the accumulated liquid amount of the gathering and conveying pipeline. The method for predicting the accumulated liquid volume of the gathering and transportation pipeline by the FLAT model specifically comprises the following steps of, The gas speed, the liquid speed and the inlet pressure of the pipelin