Dynamic prediction method for water content of oil well
By constructing a parallel prediction model based on LSTM and KAN models and introducing a weight attention module, the problems of limited sampling frequency, insufficient data accuracy, high cost and poor real-time performance in oil well moisture content measurement are solved, and dynamic prediction and real-time monitoring of oil well moisture content are realized, measuring costs are reduced, and supporting intelligent oil field production is provided.
Patent Information
- Application Number
- CN202510299732.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-04-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing oil well moisture content measurement methods have problems such as limited sampling frequency, insufficient data accuracy, high cost and poor real-time performance, and it is difficult to effectively monitor and early warning of dynamic changes in moisture content.
The multi-data ensemble learning-driven oil well moisture content trend prediction method is adopted. By constructing a parallel prediction model based on LSTM and KAN models, and introducing a weight attention module, the weight of the model prediction probability is determined, the optimal weight assignment model and ensemble learning are realized, and the final prediction results are output.
The dynamic prediction of the moisture content of the oil well is achieved, the frequency of manual sampling is reduced, the cost of water content is reduced, and the cost of water content is reduced, providing important support for oil field efficiency development and intelligent production.
Smart Images

Figure CN119831109A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of oil fields, and in particular to a method for dynamically predicting the water content of an oil well. Background Art
[0002] The water content of oil wells is an important indicator reflecting the development status of oil fields. Accurately predicting the trend of water content changes is of great significance for formulating development plans and optimizing production parameters. At present, oil fields generally use manual sampling and testing methods to obtain water content data. This method has the following limitations: (1) Limited sampling frequency: The conventional sampling period is 3-5 days, which makes it difficult to reflect the dynamic changes of moisture content in a timely manner; (2) Insufficient data accuracy: Manual sampling is subject to accidental errors and is affected by factors such as sampling location and operation method; (3) High cost: Frequent sampling leads to increased labor costs and poses safety and environmental risks; (4) Poor real-time performance: Real-time monitoring and early warning of moisture content cannot be achieved.
[0003] In summary, manual sampling for testing the water content at the wellhead of oil wells has high errors and high costs, and needs to be improved. Summary of the invention
[0004] The purpose of the present invention is to provide a method for dynamically predicting the water content of an oil well to solve the problems raised in the above-mentioned background technology.
[0005] To achieve the above object, the present invention provides the following technical solutions: A method for dynamically predicting water content in an oil well comprises the following steps: Step S1, analyzing the main influencing factors of the water content of the oil well; Step S2, constructing a multi-data integrated learning-driven oil well water content change trend prediction model; The oil well water content prediction models based on the LSTM model and the KAN model are connected in parallel, and the optimal weight assignment model is established by introducing the weight attention module. The weights of the prediction probabilities of the two models are determined, and integrated learning is performed to output the final prediction results.
[0006] As a further solution of the present invention: in step S1, the factors affecting the water cut of oil wells are analyzed. Through the calculation method of the water cut of oil wells and the analysis of historical production data, four major factors affecting the water cut of oil wells are determined: the source of produced water, engineering exploitation, reservoir properties and fluid properties. At the same time, a total of 22 influencing factors are obtained by combining the reservoir type, development stage and lifting method.
[0007] As a further solution of the present invention: step S2 specifically includes: Step S21, using the LSTM model and the KAN model to calculate the moisture content change value and its prediction probability respectively; Step S22, determine the weights of the two models; establish the optimal weight assignment model by introducing the weight attention module, determine the weights of the prediction probabilities of each model, and perform integrated learning on the calculation results of the two models; and output the final prediction result.
[0008] As a further solution of the present invention: in step S22, the influencing factors are used for training the LSTM model and the KAN model, by taking the influencing factor parameters and the influencing factor importance matrix as inputs, and adjusting the contribution of the influencing factor parameters and the influencing factor importance matrix in the model, and using a cross-validation method to determine the model parameter combination with the best training effect, and obtaining the prediction probability of each model; In the prediction stage, the prediction results of the two models will be integrated, and the prediction probabilities of the two models will be combined to output the final prediction results through algorithm optimization. The calculation results of the two models will be integrated and learned through the optimal weight assignment model; Based on the LSTM+KAN prediction data model, a multi-data driven water cut change trend prediction model is established to realize the prediction of the water cut change trend of oil wells.
[0009] As a further solution of the present invention: the step S2 also includes: step S23, setting an early warning value for water content change of the oil well according to the empirical value of water content test fluctuation of the oil well. When the water content change exceeds the early warning value, it is determined that the water content change of the well is large and manual inspection is required.
[0010] Compared with the prior art, the beneficial effects of the present invention are: the present invention establishes a multi-data integrated learning-driven oil well water content change trend prediction model based on the oil field production Internet of Things, reduces the frequency of manual sampling and testing of oil wells, reduces the cost of water content testing, and provides important support for oil field efficient development and intelligent production. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A schematic diagram of the influencing factors.
[0012] Figure 2 Schematic diagram of the oil well water cut trend prediction model driven by multi-data ensemble learning.
[0013] Figure 3 Schematic diagram of the weight mechanism based on the classifier loss function. DETAILED DESCRIPTION
[0014] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0015] A method for dynamically predicting water content in an oil well comprises the following steps: Step S1, analyzing the main influencing factors of the water content of the oil well; Step S2, constructing a multi-data integrated learning-driven oil well water content change trend prediction model; The oil well water content prediction models based on the LSTM model and the KAN model are connected in parallel, and the optimal weight assignment model is established by introducing the weight attention module. The weights of the prediction probabilities of the two models are determined, and integrated learning is performed to output the final prediction results.
[0016] In this embodiment: Step S1 includes: Step S11, analyzing the factors affecting the water content of oil wells. Through the calculation method of the water content of oil wells and the analysis of historical production data, four major factors affecting the water content of oil wells are determined: the source of produced water, engineering exploitation, reservoir properties and fluid properties. At the same time, a total of 22 influencing factors are obtained by combining the reservoir type, development stage and lifting method; Figure 1 shown.
[0017] By merging and organizing the oil well production data, water injection well data and power map acquisition data, each well has 15 production data including water cut: daily liquid production, pump depth, casing pressure, oil well oil pressure, stroke, stroke frequency, daily water injection volume, water injection pressure, maximum load, minimum load, load difference, active power, wellhead temperature, dynamic liquid level, water cut. The data before June 2023 are selected as training data, and the data from June 2023 to date are selected as test data to train the model.
[0018] Data screening was performed to remove data rows where more than half of the 15 data items were missing; oil wells with less than 2 water content tests were removed; and missing values were filled with neighboring data.
[0019] Step S2 specifically includes: Step S21, using the LSTM model and the KAN model to calculate the moisture content change value and its prediction probability respectively; The Long Short-Term Memory (LSTM) model is good at processing time series data and is specially designed for processing time series data and sequence modeling tasks. By introducing memory cells and gating mechanisms, LSTM solves the gradient vanishing and gradient exploding problems that are prone to occur in traditional RNNs when processing long sequence data. It can effectively capture long-term dependencies in time series and is suitable for natural language processing, speech recognition and other fields. It avoids the gradient vanishing problem through the gating mechanism. At each time step, LSTM receives the current input and the hidden state of the previous time step. Through the calculation of the forget gate, input gate and output gate, the memory cell is updated and the output of the current time step is generated. The memory cell and the hidden state are passed to the next time step. However, the computational complexity is high and the training time is long.
[0020] The specific steps of the LSTM model are as follows: (1) Input data processing: Input Data ,in Represents the time step t The input vector is , and d is the dimension of the input feature.
[0021] The input data is normalized so that the data is distributed between 0 and 1.
[0022] (2) Initialization: Initialize memory cell state and hidden state , usually initialized to the zero vector.
[0023] (3) Time step calculation: For each time step t, the LSTM model performs the following computation: Calculate the forget gate output : (1); in is the sigmoid function, is the weight matrix of the forget gate, is the bias term.
[0024] Calculate input gate output : (2); in is the weight matrix of the input gate, is the bias term.
[0025] Calculate candidate memory cell states : (3); in is the weight matrix of the candidate memory unit, is the bias term.
[0026] Update memory cell status : (4); in is the memory unit information retained by the forget gate, is the new information introduced by the input gate.
[0027] Calculate the output gate output : (5); in is the weight matrix of the output gate, is the bias term.
[0028] Update hidden state : (6); in Controlling the state of memory cells For hidden state contribution.
[0029] (4) Model training The LSTM model is trained using the back-propagation algorithm. The model parameters are updated by minimizing the loss function.
[0030] (5) Model prediction: In the prediction phase, the trained LSTM model is used to predict new data.
[0031] Generate hidden states by time step calculation , and input it into the fully connected layer or other neural network layers for further processing to generate prediction results.
[0032] The KAN model (Kernel Attention Network) is a neural network model based on kernel functions and attention mechanisms, which is mainly used to deal with complex nonlinear relationships and multi-source data fusion problems. The core idea of the KAN model is to calculate the similarity between data through kernel functions and use the attention mechanism to weight key features, thereby improving the prediction accuracy and generalization ability of the model. For the input data, KAN first calculates the kernel function value between each pair of elements to obtain a similarity matrix. The similarity matrix is converted into attention weights through the softmax function. The input data is weighted and summed using the attention weights to generate the final output. It is applicable to a variety of data types and tasks, but the choice of kernel function and computational overhead may affect performance.
[0033] The specific steps of the KAN model are as follows: (1) Input data processing: Input Data , where n is the number of samples and d is the feature dimension.
[0034] The input data is normalized so that the data is distributed between 0 and 1.
[0035] (2) Kernel function calculation: Choose an appropriate kernel function , calculate the similarity between each pair of data points.
[0036] Generate similarity matrix ,in .
[0037] (3) Attention weight calculation: The similarity matrix K is converted into the attention weight matrix A through the softmax function:
[0038] The attention weight matrix A represents the influence of each data point on other data points.
[0039] (4) Feature weighting Use the attention weight matrix A to perform weighted summation on the input data to generate a weighted feature representation Z: Z=AX Weighted Feature Representation Captures the key features of the input data.
[0040] (5) Model training The weighted feature representation Z is input into a fully connected layer or other neural network layers for further processing.
[0041] The cross-validation method is used to determine the optimal model parameters, and the model is trained using historical data to obtain the predicted probability.
[0042] (6) Model prediction In the prediction stage, the trained KAN model is used to predict new data.
[0043] The kernel function is used to calculate the similarity between the new data and the training data, generate an attention weight matrix, and perform weighted summation on the new data to generate a prediction result.
[0044] The fusion of LSTM and KAN can be achieved in series, parallel or hybrid mode. Series fusion first uses LSTM to process time series data, and then uses KAN for attention weighting; parallel fusion allows the two to process data in parallel and then combine the output; hybrid fusion introduces KAN's attention mechanism at each time step of LSTM to dynamically adjust the memory unit. These methods can combine the time series modeling capability of LSTM and the feature extraction efficiency of KAN. The fused model has obvious advantages, enhancing the modeling capability of time series data, improving feature extraction efficiency, and improving the generalization performance in complex tasks. At the same time, the interpretability of the model is increased through the attention mechanism of KAN. This fusion model has broad application potential in scenarios that require processing complex time series data and extracting key features.
[0045] Step S22, determine the weights of the two models; establish the optimal weight assignment model by introducing the weight attention module, determine the weights of the prediction probabilities of each model, and perform integrated learning on the calculation results of the two models; and output the final prediction result.
[0046] In this example: See Figure 2 In step S22, the influencing factors are used for the training of the LSTM model and the KAN model. The influencing factor parameters and the influencing factor importance matrix are used as inputs, and the contribution of the influencing factor parameters and the influencing factor importance matrix in the model is adjusted. A cross-validation method is used to determine the model parameter combination with the best training effect, and the prediction probability of each model is obtained; The daily liquid production, pump depth, flushing times, power consumption and water content of the previous 30 days are used as inputs to the model to obtain the predicted water content on the 31st day. When the predicted value changes by more than 2% compared with the previous day and the previous two days, the actual water content is measured by manual detection and used as the input for the next iteration. At the same time, a weekly regular detection method is used to perform long-term dynamic prediction of water content based on this rule.
[0047] In the prediction stage, the prediction results of the two big data models will be integrated, and the prediction probabilities of the two models will be combined. The final prediction results will be output through algorithm optimization, and the calculation results of the two models will be integrated and learned through the optimal weight assignment model; Based on the LSTM+KAN prediction data model, a multi-data driven water cut change trend prediction model is established to realize the prediction of the water cut change trend of oil wells.
[0048] The prediction probability based on LSTM and the prediction probability based on KAN can be regarded as the prediction results of multiple perspectives. In the multi-perspective fusion method, assuming that perspectives, each of which corresponds to a feature (prediction probability). These features come from different feature extractors with different focuses. Therefore, when classifying, whether it is a method based on feature fusion or a method based on decision fusion, the proportion of different perspectives should be different. Therefore, a weight mechanism based on the classifier loss function is designed, which has achieved positive results in different fusion methods. Please refer to Figure 3 .
[0049] First, define The training sample features of each view are ,in , then The classifier loss function corresponding to the view It can be defined as: (7); in Indicates that the training data is The corresponding unique hot labels under each perspective are It is worth noting that for the same sample, the one-hot labels under different perspectives are usually the same. Only in specific self-training situations will the one-hot labels of the same sample under different perspectives be different. Indicates The classifier of each view can be defined as: (8); in, represents the identity matrix.
[0050] Define a joint weight vector as ,in It is The elements, indicating the The weight corresponding to each perspective. To calculate this joint weight, the objective function is: (9); in express norm, Here, this topic uses the Lagrange multiplier method to solve this problem, rewriting formula (9) to remove the constraint term: (10); in Represents a positive constant. is a vector. For convenience, formula (10) is written in matrix form as: (11); in , .
[0051] Assumptions , , is the optimal solution. According to the Karush-Kuhn-Tucker (KKT) condition, for , we can get: (12); Formula (12) can be rewritten in matrix form as: (13); First solve , the expression is: (14); Then solve for: (15); definition , which represents the vector The average of all the values in it. Then rewrite formula (15) as: (16); Therefore, the The best viewing angle for: (17); definition , rewrite formula (17) as: (18); By using formulas (12) and (18), we can obtain: (19); therefore Can be defined as: (20); definition According to formulas (7), (19), and (20), we can obtain: (twenty one); Here we can use Newton's method to solve the following problem: (twenty two); in Indicates derivative. is the number of iterations, which means that The optimal Finally, the final solution can be obtained: (twenty three); in It is obtained by formula (22).
[0052] In this embodiment: the step S2 also includes: step S23, according to the empirical value of the oil well water content test fluctuation, setting the water content change warning value (empirical value) of the oil well, when the water content change exceeds the warning value, it is determined that the water content change of the well is large and manual inspection is required.
[0053] The prediction results are as follows: the average accuracy of the LSTM model reached 80.579%, the average accuracy of the KAN model reached 81.924%, and the average accuracy of the multi-view fusion model reached 87.118%. Obviously, the multi-view fusion moisture content change trend prediction model has higher accuracy.
[0054] The present invention establishes a multi-source data collection and processing system based on the oilfield production Internet of Things; constructs a fusion prediction model of LSTM and KAN models to improve prediction accuracy; introduces a weighted attention mechanism to optimize the model integration strategy; and realizes real-time monitoring and early warning of water content changes. The constructed multi-data integrated learning-driven oil well water content change trend prediction model reduces the frequency of manual sampling and testing of oil wells, reduces the cost of water content testing, and provides important support for oilfield efficiency development and intelligent production.
[0055] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, the embodiments should be considered as exemplary and non-restrictive in all respects.
[0056] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A method for dynamically predicting water content in oil wells, characterized in that: The oil well water content dynamic prediction method comprises the following steps: Step S1, analyzing the main influencing factors of the water content of the oil well; Step S2, constructing a multi-data integrated learning-driven oil well water content change trend prediction model; The oil well water content prediction models based on the LSTM model and the KAN model are connected in parallel, and the optimal weight assignment model is established by introducing the weight attention module. The weights of the prediction probabilities of the two models are determined, and integrated learning is performed to output the final prediction results.
2. The method for dynamic prediction of water content in oil wells according to claim 1, characterized in that: In step S1, the factors affecting the water cut of oil wells are analyzed. Through the calculation method of the water cut of oil wells and the analysis of historical production data, four major factors affecting the water cut of oil wells are determined: the source of produced water, engineering exploitation, reservoir properties and fluid properties. At the same time, a total of 22 influencing factors are obtained by combining the reservoir type, development stage and lifting method.
3. The method for dynamic prediction of water content in oil wells according to claim 1, characterized in that: Step S2 specifically includes: Step S21, using the LSTM model and the KAN model to calculate the moisture content change value and its prediction probability respectively; Step S22, determine the weights of the two models; establish the optimal weight assignment model by introducing the weight attention module, determine the weights of the prediction probabilities of each model, and perform integrated learning on the calculation results of the two models; and output the final prediction result.
4. The method for dynamic prediction of water content in oil wells according to claim 3, characterized in that: In step S22, the influencing factors are used for training the LSTM model and the KAN model. The influencing factor parameters and the influencing factor importance matrix are used as inputs, and the contribution of the influencing factor parameters and the influencing factor importance matrix in the model is adjusted. A cross-validation method is used to determine the model parameter combination with the best training effect, and the prediction probability of each model is obtained. In the prediction stage, the prediction results of the two models will be integrated, and the prediction probabilities of the two models will be combined to output the final prediction results through algorithm optimization. The calculation results of the two models will be integrated and learned through the optimal weight assignment model; Based on the LSTM+KAN prediction data model, a multi-data driven water cut change trend prediction model is established to realize the prediction of the water cut change trend of oil wells.
5. The method for dynamic prediction of water content in oil wells according to claim 3 or 4, characterized in that: The step S2 also includes: step S23, setting a water content change warning value of the oil well according to the empirical value of the oil well water content test fluctuation. When the water content change exceeds the warning value, it is determined that the water content change of the well is large and manual inspection is required.
Citation Information
Patent Citations
Intelligent metering device and method for water content of oil well produced fluid
CN112814649A
Equipment failure mode prediction method based on double deep learning models
CN112989976A
Method for measuring water content of oil well based on phased-array antenna microwave sensor
CN117571748A
Oil well water content metering method based on nonlinear characteristic double-input network
CN117910515A