A pumping unit well pumping parameter self-optimization method based on a PIC A-Net prediction model

By using the PiCA-Net prediction model, combined with cross-attention and conditional injection mechanisms, the problem of maximizing equipment safety and production in the optimization of pumping parameters for oil wells was solved. This achieved safe and reliable parameter self-optimization, improving the model's learning efficiency and prediction accuracy.

CN122113598APending Publication Date: 2026-05-29XIAN ZHONGKONG TIANDI TECH DEV CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAN ZHONGKONG TIANDI TECH DEV CO LTD
Filing Date
2026-02-03
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing pumping parameter optimization technologies for oil wells are unable to maximize production while ensuring equipment safety. They cannot effectively learn the correlation between parameter adjustments and production index responses, and lack rigid constraints on key safety indicators such as alternating loads at suspension points.

Method used

We employ a PiCA-Net-based prediction model, extracting effective samples of parameter tuning actions and dynamic responses using an event-driven approach. We then construct a prediction model that integrates cross-attention and conditional injection mechanisms. Combining the loss function with pump efficiency boundary constraints, we perform multi-constraint extraction parameter self-optimization and use a grid search algorithm to find the optimal combination of extraction parameters.

Benefits of technology

It accurately captures the relationship between parameter adjustment actions and production indicator responses, ensures the safety of alternating loads at suspension points, maximizes production, improves model learning efficiency and prediction reliability, solves equipment safety risks, and provides technical support for intelligent oilfield refined management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122113598A_ABST
    Figure CN122113598A_ABST
Patent Text Reader

Abstract

The application discloses a pumping unit well pumping parameter self-optimization method based on a PiCA-Net prediction model, relates to the technical field of oil exploitation, and collects pumping unit well data in advance, performs cleaning and null value filling, screens input features through correlation analysis and ablation experiments, constructs a parameter variation characteristic vector, and extracts effective samples containing parameter adjustment actions and dynamic responses by adopting an event-driven method; a PiCA-Net prediction model is constructed and used for realizing the prediction of liquid production and alternating load of a suspension point. The PiCA-Net model constructed by the application innovatively fuses a cross attention mechanism and an injection mechanism, can deeply mine nonlinear correlation features between a dynamometer card displacement and a load sequence, strengthens the perception ability of sparse parameter adjustment signals, successfully establishes a precise causal mapping from a control action to a production index, and simultaneously introduces a physical constraint term based on a pump efficiency boundary in a loss function, thereby improving the credibility and applicability of the model in actual application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of oil extraction technology, and more specifically, to a method for self-optimization of pumping parameters in oil wells based on the PiCA-Net prediction model. Background Technology

[0002] Rod-operated pumping systems are the most important mechanical oil production method in onshore oilfields, and their efficiency is directly related to the setting of pumping parameters (stroke and frequency). As oilfield development enters the middle and late stages, the formation fluid supply capacity exhibits significant time-varying characteristics, leading to an imbalance in the supply and discharge relationship of oil wells. Inappropriate pumping parameter settings can not only cause production losses but may also trigger excessive alternating loads at the suspension point, resulting in safety accidents such as fatigue breakage of the sucker rod, seriously affecting the continuous and stable operation of the oil well.

[0003] Existing pumping parameter optimization technologies for oil wells are mainly divided into three categories: mechanism modeling, data-driven prediction, and parameter optimization strategies. Each type of technology has obvious limitations: Mechanism modeling methods are based on one-dimensional wave equations and nodal analysis to construct a supply and drainage coordination model, but its accuracy is highly dependent on the accuracy of parameters such as well structure and fluid properties, and its applicability is limited in field environments where parameters are time-varying or measurement errors are large; Data-driven prediction methods use models such as long short-term memory networks and convolutional neural networks to predict fluid production or bottom hole flowing pressure, but existing models mostly focus on steady-state trend fitting and ignore the transient impact of parameter adjustment actions as sparse control signals on production indicators, making it difficult to establish a direct causal mapping between parameter adjustment and indicator changes; Parameter optimization strategies use genetic algorithms, particle swarm optimization, etc., to find the optimal operating regime, but existing strategies lack rigid constraints on key safety indicators such as alternating loads at suspension points, and the optimized scheme may not be applicable in the field due to equipment safety risks.

[0004] Furthermore, pumping well production data exhibits a significant uneven distribution, with a stark contrast between massive amounts of steady-state data and sparse parameter tuning signals. This causes key parameter tuning information to be easily overwhelmed by redundant data during model training, hindering the effective learning of the correlation between parameter adjustments and production index responses. This further reduces the accuracy and reliability of parameter optimization. These combined problems make it difficult for existing technologies to maximize production while ensuring equipment safety, failing to meet the practical needs of refined development in smart oilfields. Therefore, there is an urgent need for a self-optimizing pumping parameter technology that can accurately capture the relationship between parameter tuning actions and production index responses, while balancing safety constraints and production optimization. Summary of the Invention

[0005] To address the problems in related technologies, this invention proposes a self-optimization method for pumping parameters of oil wells based on the PiCA-Net prediction model, in order to overcome the aforementioned technical problems existing in the current related technologies.

[0006] The technical solution of this invention is implemented as follows:

[0007] A self-optimization method for pumping parameters in oil wells based on the PiCA-Net prediction model includes the following steps:

[0008] Pre-collect oil pumping well data and perform cleaning and void filling. Screen input features through correlation analysis and ablation experiments, construct parameter change feature vectors, and use event-driven methods to extract effective samples containing parameter tuning actions and dynamic responses.

[0009] The PiCA-Net prediction model is constructed, including the construction of a prediction model that integrates cross-attention mechanism, conditional injection and action injection mechanism, and the calibration of loss function containing pump efficiency boundary constraints, which is used to predict the liquid production and suspension point alternating load.

[0010] The system performs multi-constraint pumping parameter self-optimization, aiming to maximize daily liquid production. It uses the safety threshold of the suspension point alternating load and the equipment performance boundary as constraints, and employs a grid search algorithm to find the optimal combination of pumping parameters, outputting a hierarchical optimization scheme.

[0011] Furthermore, the method of extracting effective samples containing parameter adjustment actions and dynamic responses using an event-driven approach includes: grouping data by well number and sorting it by time; when the change in stroke or number of strokes is ≥0.5 and the change rate of production volume or alternating load is >10% within 5 days before and after adjustment, data segments from the past 30 days to the next 4 days are extracted as effective samples.

[0012] Furthermore, the PiCA-Net prediction model includes: a dynamometer feature extraction module and a time-series prediction module, wherein: the dynamometer feature extraction module uses a cross-attention mechanism to encode high-dimensional dynamometer data to obtain low-dimensional feature vectors reflecting the pump's operating conditions; the time-series prediction module is based on a long short-term memory network, and through conditional injection and action injection strategies, it takes the current operating regime as the initial state and the adjustment command as the tail input, so as to achieve prediction of the liquid production and alternating load under specific parameter adjustment actions while retaining long-term time-series dependencies.

[0013] Furthermore, the dynamometer feature extraction module includes: mapping the single-dimensional displacement sequence and load sequence into 64-dimensional feature vectors through a single-layer linear fully connected layer, and introducing position encoding to retain the positional information of the data in the sequence; subsequently, using the displacement sequence as the query vector and the load sequence as the key vector and value vector; and using a multi-head attention mechanism with four attention heads to calculate the attention weight matrix between displacement and load, adaptively focusing on the local features in the dynamometer diagram that are most sensitive to changes in the working condition. The single-head dimension is 16. The attention mechanism calculation process is expressed as follows:

[0014] ;

[0015] In the formula, As a scaling factor, the output of the cross-attention layer remains a 64-dimensional feature matrix of length 200. This matrix is ​​flattened and then passed through a multilayer perceptron containing a non-linear activation function for dimensionality reduction. The input layer receives a 12800-dimensional vector, with 128 hidden points using the ReLU activation function. The output layer has 32 nodes. The final output feature vector G is concatenated with other daily data to form the temporal input vector of the LSTM. .

[0016] Furthermore, the time-series prediction module includes:

[0017] Calibration condition injection sets an accurate starting point for the time series prediction network, and the stroke at the current time step. With Ochon The vector is mapped to an initial hidden state vector through a multilayer perceptron. and cell state vector The memory unit used to initialize the Long Short-Term Memory network is represented as:

[0018] ;

[0019] In the formula, and These are the weight matrices for the hidden state and the cell state, respectively. and For the corresponding bias vector, This represents the normalized concatenated vector of stroke and number of strokes at the current moment. tanh and sigmoid activation function, respectively;

[0020] Using independent multilayer perceptrons to process low-dimensional action vectors The dimensionality is increased to a feature vector consistent with the dimension of the hidden state. Then, it is concatenated with the final hidden state after time evolution. Finally, it is mapped to the predicted liquid production and alternating load through a fully connected layer.

[0021] Furthermore, the loss function for the pump efficiency boundary constraint includes: calculating the theoretical daily discharge based on key parameters. This represents the maximum fluid discharge capacity of a pumping unit well under ideal conditions, and is expressed as:

[0022] ;

[0023] In the formula, D is the theoretical daily displacement; S is the pump diameter; N is the stroke; This is the physical constraint loss term.

[0024] Furthermore, the output hierarchical optimization scheme includes: grid search based on the current measured parameters, constructing a virtual grid with a step size of 0.5, traversing all nodes and predicting the liquid production and alternating load, and selecting the optimal parameter combination within the safe and feasible region, expressed as:

[0025] ;

[0026] In the formula, J is the objective function for optimization, representing the predicted daily fluid production of a single well; and These are the decision variables, namely the adjusted stroke and number of strokes; and These represent the liquid production rate and the alternating load at the suspension point predicted by PiCA-Net, respectively. The maximum alternating load threshold is set based on the strength of the rod / tube. , and , These are the allowable stroke and stroke adjustment boundaries for the equipment, respectively.

[0027] The beneficial effects of this invention are:

[0028] This invention employs an event-driven sample construction method to accurately locate sparse parameter tuning signals and extract time-series segments containing complete dynamic response processes. This effectively eliminates redundant information during non-parameter tuning periods, addressing the industry pain point of massive steady-state data overwhelming key parameter tuning information. It provides a high-quality data foundation for model training, significantly improving model learning efficiency and prediction reliability. The constructed PiCA-Net model innovatively integrates cross-attention and injection mechanisms, enabling deep mining of the nonlinear correlation features between dynamometer card displacement and load sequences. This strengthens the perception capability of sparse parameter tuning signals and successfully establishes a precise causal mapping from control actions to production indicators. Furthermore, by introducing a physical constraint term based on pump efficiency boundaries into the loss function, it ensures that the prediction results conform to... By incorporating fundamental engineering physics principles and avoiding non-physical predictions, the model's credibility and applicability in practical applications are enhanced. The designed multi-constraint optimization strategy uses the safety threshold of the alternating load at the suspension point and the equipment performance boundary as rigid constraints. It achieves the search for optimal parameters within the safe and feasible domain through global grid search, and outputs graded optimization schemes for adjusting only the stroke frequency, adjusting only the stroke, and comprehensive adjustments. This effectively mitigates the safety risk of rod and tube fatigue breakage and maximizes the daily fluid production of a single well while ensuring the safe operation of the equipment, achieving a dynamic balance between safety assurance and production efficiency. Furthermore, the graded scheme fully considers the differences in on-site operating costs, improving the engineering feasibility and implementation efficiency of the optimization scheme, and providing strong technical support for the refined management and intelligent transformation of smart oilfields. Attached Figure Description

[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0030] Figure 1 This is a schematic diagram illustrating the temporal variation of stroke, stroke frequency, production rate, and alternating load in a self-optimization method for pumping parameters of a pumping well based on a PiCA-Net prediction model according to an embodiment of the present invention.

[0031] Figure 2 This is a schematic diagram of the sample partitioning process for a self-optimization method of pumping parameters for oil wells based on the PiCA-Net prediction model according to an embodiment of the present invention.

[0032] Figure 3 This is a schematic diagram of the PiCA-Net model architecture for a self-optimization method of pumping parameters for oil wells based on the PiCA-Net prediction model according to an embodiment of the present invention.

[0033] Figure 4 This is a schematic diagram of a multi-constraint optimization strategy for a self-optimization method of pumping parameters in a pumping well based on a PiCA-Net prediction model according to an embodiment of the present invention.

[0034] Figure 5 This is a schematic diagram comparing the predicted and actual values ​​of PiCA-Net on a test set for a self-optimization method of pumping parameters for oil wells based on the PiCA-Net prediction model according to an embodiment of the present invention; in the figure, (a) is the production rate diagram and (b) is the alternating load diagram.

[0035] Figure 6 This is a stroke-time thermogram of a self-optimization method for pumping parameters of a pumping well based on a PiCA-Net prediction model according to an embodiment of the present invention; in the figure, (a) is the production rate diagram and (b) is the alternating load diagram. Detailed Implementation

[0036] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention are within the scope of protection of the present invention.

[0037] According to an embodiment of the present invention, a self-optimization method for pumping parameters of oil wells based on the PiCA-Net prediction model is provided.

[0038] like Figure 1 As shown, the self-optimization method for pumping parameters of oil wells based on the PiCA-Net prediction model according to an embodiment of the present invention includes the following steps:

[0039] Step S1 involves preliminary data processing and feature engineering, specifically including the following steps:

[0040] Pre-processing of the data in this invention is performed. The data comes from 83 pumping wells in an oil production plant of Sinopec Northwest Oilfield, including real-time data, daily data, and dynamometer card data. The data cleaning stage primarily filters outomas in the raw data, converting outliers and other data that do not conform to actual production conditions into null values ​​for later filling. Parameters with more than 50% missing values ​​are also removed. Filtering eliminates sudden noise in the data, filtering out spikes while retaining step changes caused by stroke and stroke frequency adjustments, ensuring that the data removes noise while preserving key production signals.

[0041] A differentiated strategy was employed for null value filling to improve data integrity. For data with a consecutive null value length of no more than 2, a linear fitting method was used for filling, leveraging the linear correlation between data to ensure the rationality of the filled values. Due to the strong temporal correlation of dynamometer card data, the most recent valid values ​​were used for filling to maintain the accuracy of the dynamometer card in representing the working status of the pumping unit. When the consecutive null value length exceeded 2, it was filled with 0 based on the characteristics of the production scenario to avoid data distortion caused by unfounded speculation. Then, the real-time data of each well was averaged daily and uniformly converted into a daily data format, totaling 833,526 data points.

[0042] To perform feature selection, this invention uses correlation analysis to initially screen features, and uses ablation experiments to verify the initial screening results, ultimately determining the input feature set.

[0043] The correlation analysis phase utilizes basic statistical methods such as Pearson correlation coefficient and maximum mutual information to analyze the correlation between features and output indicators. Combined with the understanding of pumping well production patterns in the oilfield, it selects key parameters including stroke, stroke frequency, wellhead temperature, oil pressure, pump diameter, pump hanger depth, overall water cut, gas-liquid ratio, and dynamometer card. As a characteristic.

[0044] Ablation experiments were conducted by removing features one by one and observing changes in model performance to determine whether feature selection could be optimized to reduce model complexity. The model used was PiCA-Net (Physics-informed Cross-Attention Network, PiCA-Net), whose structure and training parameters are detailed below. The evaluation metrics selected were the proposed physical constraint loss, mean absolute deviation (MAD), and coefficient of determination (R²). 2 The model without any parameters was used as the baseline, and the ablation experimental results are shown in Table 1.

[0045] Table 1 Ablation Experiment Results

[0046]

[0047] As shown in the table, the ablation of each parameter leads to a significant performance decrease, and each parameter is essential. Among them, the dynamometer... The model performance declined significantly after ablation because the dynamometer card represents not only the pumping work done in a single stroke of the pumping unit but also key operating conditions such as the operating status of downhole pumps and valves and the adequacy of fluid supply. The model without feature selection performed far worse than the baseline model, indicating that feature selection is necessary and appropriate.

[0048] Feature engineering and dataset construction were performed. Pumping well production data exhibits significant time-series characteristics, with marked differences in the dynamic change cycles of different parameters. The adjustment cycles for stroke and stroke frequency are typically weekly or monthly, while dynamic indicators such as production volume and alternating load fluctuate in real time. Figure 1 As shown. This periodicity means that the number of strokes remains constant for most of the time in the original continuous time series data, making it impossible for the data to reflect the impact of parameter adjustments on the index. If the original data is used directly for modeling, the model will struggle to learn the causal relationship between parameter adjustments and index changes. This section addresses the shortcomings of basic features in characterizing dynamic changes through feature engineering and solves the problem of differences in the periodicity of change by using a specially designed sample construction method.

[0049] In terms of feature engineering, this invention designs feature vectors. It consists of the change in stroke and the change in number of strokes, and its expression is:

[0050] ;

[0051] In the formula, Represents the stroke at time t. The stroke at time t-1; Represents the number of impulses at time t. This represents the impulse at time t-1. This feature design allows the model to directly obtain explicit action instructions without deriving the parameter adjustment magnitude from the raw data, thereby establishing a direct mapping between parameter changes and system response, shortening the model learning path, and improving convergence efficiency.

[0052] The goal of sample construction is to select key data segments containing effective information, enabling the model to focus on learning the patterns of changes in stroke and stroke frequency leading to changes in liquid production and alternating load, and accurately capturing the causal relationships. If all data is used directly for training, the massive amount of steady-state parameter data would overwhelm crucial parameter tuning signals, making it difficult for the model to converge to the optimal solution. However, due to the complex field environment, the measured stroke and stroke frequency values ​​collected by sensors often deviate from the theoretical values ​​on the equipment nameplate. This means that it is not possible to simply determine whether parameter tuning has occurred by whether the values ​​equal a few fixed values. Furthermore, affected by mechanical vibration and acquisition errors, even if the setpoint remains unchanged, the measured data will exhibit subtle fluctuations. This makes it difficult to directly determine whether parameter tuning has occurred based on numerical changes. Therefore, a rigorous fluctuation filtering and sample slicing logic must be developed to accurately extract effective data segments from long-term time-series data that contain the complete process from parameter adjustment to index response.

[0053] This invention proposes a sample construction method that accurately locates parameter adjustment events by traversing time series and extracts complete data segments containing the pre-adjustment state, adjustment action, and post-adjustment response as samples. The method first groups the data by well number and sorts the data by time. Since PiCA-Net needs to utilize historical data from the current moment and the past n moments to capture time-series dependencies, the data traversal for each well starts from the nth moment. Simultaneously, to observe the complete hysteresis response, it is necessary to ensure at least four days of continuous data following the time point to be processed. Subsequently, a differential threshold is used to determine whether the parameter has been adjusted: when the stroke change... or change in stroke At that time, it was initially determined that a parameter adjustment had occurred. To rule out interference from non-productive factors such as sensor drift, it was necessary to verify the indicator response. Specifically, within a time window of one day before to four days after the adjustment, if the rate of change in the production volume or alternating load exceeded 10%, then that data segment was confirmed as a valid sample. The specific procedure is as follows... Figure 2 As shown.

[0054] Step S2 involves constructing the PiCA-Net prediction model, which integrates cross-attention, conditional injection, and action injection mechanisms. A loss function incorporating pump efficiency boundary constraints is designed to achieve accurate prediction of liquid production and alternating load at the suspension point. Specifically, this includes the following steps:

[0055] This invention addresses the sparse control actions of rod-pumped oil pumping systems by proposing a production response prediction method that integrates a cross-attention mechanism and a long short-term memory network. The method consists of a dynamometer card feature extraction module and a time-series prediction module, establishing a nonlinear mapping relationship between historical production states and adjustment actions and future production indicators. The dynamometer card feature extraction module uses a cross-attention mechanism to encode high-dimensional dynamometer card data, obtaining low-dimensional feature vectors reflecting the pump's operating conditions. The time-series prediction module, based on a long short-term memory network, employs conditional injection and action injection strategies, using the current operating regime as the initial state and adjustment commands as tail inputs. This preserves long-term time-series dependencies while predicting production volume and alternating loads under specific parameter adjustments.

[0056] Among them, the feature extraction of the dynamometer card based on the cross-attention mechanism is crucial. The dynamometer card, as the core data reflecting the downhole operating conditions of the rod-pumped oil well, contains sequential information in two dimensions: displacement and load. Directly concatenating high-dimensional dynamometer card data with other low-dimensional scalar data and inputting it into the neural network will lead to an imbalance in feature dimensions, affecting the model's convergence performance. Therefore, this paper uses a cross-attention mechanism to construct a feature compressor, which reduces the dimensionality of the dynamometer card while simultaneously mining its deep, implicit features.

[0057] This module first maps the one-dimensional displacement and load sequences into 64-dimensional feature vectors using a single-layer linear fully connected layer, and introduces position encoding to preserve the positional information of the data in the sequence. Then, the displacement sequence is used as the query vector (Query, Q), and the load sequence as the key vector (Key, K) and value vector (Value, V). The model utilizes a multi-head attention mechanism with four attention heads to calculate the attention weight matrix between displacement and load, adaptively focusing on the local features in the dynamometer card that are most sensitive to changes in the working condition. Each head has a dimension of 16. The calculation process of the attention mechanism is shown in the following equation:

[0058] ;

[0059] In the formula, The scaling factor is used. The output of the cross-attention layer is still a 64-dimensional feature matrix of length 200. After flattening, it is passed through a multilayer perceptron (MLP) with a non-linear activation function for dimensionality reduction. The input layer receives a 12800-dimensional vector, with 128 hidden points and a ReLU activation function. The output layer has 32 nodes, and the final output feature vector is G. This feature vector retains core operating condition information such as pump efficiency and filling degree, and is concatenated with other daily data to form the time-series input vector of the LSTM. .

[0060] Among them, an LSTM prediction network that integrates initial state and action features is used. As a classic architecture for processing time-series data, the initialization method of the hidden state in LSTM has a significant impact on model performance. In standard sequence prediction tasks, the hidden state is usually initialized as an all-zero vector, which is reasonable when processing relatively independent samples. However, in the parameter optimization scenario of a rod-operated pumping system, the future production response of the system depends on the current operating regime; that is, the current stroke and stroke baseline values ​​constitute the system's inertial basis. If this prior information is ignored, the model will spend a large number of time steps adapting to the system's baseline state in the early stages of sequence processing, thus reducing prediction efficiency. Furthermore, since parameter adjustment actions are extremely sparse in actual production, if the adjustment amount... Simply using it as input features at each time step can easily lead to the signal strength being overwhelmed by long-term steady-state data, resulting in vanishing gradients or insensitivity to key actions. To address this, this paper designs a conditional injection and action injection architecture, using bidirectional enhancements at the head and tail to ensure that the model can fully utilize system state information and control commands.

[0061] Condition injection sets an accurate starting point for the time series prediction network. The stroke at the current time step... With Ochon The vector is mapped to an initial hidden state vector through a multilayer perceptron. and cell state vector This step is used to initialize the memory units of the Long Short-Term Memory (LSTM) network. This step ensures that the network has prior information about the current operating regime before processing time series data. The process can be described as follows:

[0062] ;

[0063] In the formula, and These are the weight matrices for the hidden state and the cell state, respectively. and For the corresponding bias vector, This represents the normalized concatenated vector of stroke and number of strokes at the current moment. tanh and sigmoid activation functions are respectively the sigmoid activation function and the hyperbolic tangent activation function. After initialization, the LSTM network begins to receive and process historical time series inputs from the past n time steps. This input sequence not only contains basic scalar data such as oil pressure and temperature, but also incorporates high-dimensional dynamometer features compressed through a cross-attention mechanism. Through the network's internal gating mechanism, the model can selectively forget outdated short-term fluctuations while accumulating long-term trend information reflecting the evolution of oil well production capacity. After n time steps of iterative evolution, the final output hidden state is... In fact, it aggregates the system's overall health status and formation fluid supply capacity characteristics up to the current moment.

[0064] To achieve accurate inference of the parameter tuning effect, the model introduces an action injection mechanism. This design treats the proposed control action as an external perturbation to the current state of the system. A separate multilayer perceptron is used to process the low-dimensional action vector. The dimensionality is increased to a feature vector consistent with the hidden state dimension, which is then concatenated with the final hidden state after temporal evolution. The concatenated fusion vector simultaneously contains the system's historical inertia features and the features of the impending control commands, and is finally mapped to the predicted liquid production and alternating load through a fully connected layer. This structure effectively solves the problem of sparse action signals being easily ignored in long-term recursion, ensuring that the model has high sensitivity to parameter adjustment actions and causal inference capabilities. The model is as follows: Figure 3 As shown.

[0065] Furthermore, its physical constraint loss function is as follows: Under sparse samples or extreme parameter tuning conditions, the pure data-driven model may output prediction results that violate physical common sense, such as predicting the daily liquid production exceeding the pump's maximum displacement, i.e., an error of pump efficiency greater than 100%. Therefore, this paper introduces a pump efficiency-based physical constraint mechanism into the loss function. First, the theoretical daily displacement is calculated based on key parameters such as pump diameter, stroke, and stroke frequency. This indicator represents the maximum fluid discharge capacity of a pumping well under ideal conditions, and is calculated as follows.

[0066] ;

[0067] In the formula, Theoretical daily displacement is t / d; D is pump diameter, mm; S is stroke, m; N is strokes, min⁻¹; This is the physical constraint loss term. Based on this, a physical constraint regularization term is constructed. When the model predicts a production volume greater than the theoretical discharge volume, the deviation of the excess is calculated and included in the loss; otherwise, this term is zero, thus forcing the model's predictions to converge to the physically feasible region. The final model optimization objective function is composed of a weighted average of the basic mean square error and the physical constraint term. By introducing hyperparameters to adjust the balance between data fitting accuracy and physical boundary constraints, the model is guided to approximate the actual production distribution while meeting the interpretability requirements of the engineering mechanism. The relevant calculation methods are as follows:

[0068] ;

[0069] ;

[0070] In the formula, The model predicts the daily liquid production, t / d; The actual daily liquid production is expressed in t / d; MSE is the mean square error. These are the physical constraint weighting coefficients.

[0071] Step S3 involves multi-constraint pumping parameter self-optimization. With the goal of maximizing daily liquid production, and constrained by the safety threshold of the alternating load at the suspension point and the equipment performance boundary, a grid search algorithm is used to find the optimal combination of pumping parameters, outputting a hierarchical optimization scheme, as detailed below:

[0072] Based on the above prediction model, this invention designs a multi-constraint optimization strategy to find the working regime that maximizes the daily production of a single well within the feasible domain, under the premise that the load at the pumping unit suspension point does not exceed the limit and the equipment operating parameters do not exceed the limit.

[0073] The optimization problem is first transformed into a constrained nonlinear integer programming mathematical model. The objective function is designed by directly maximizing the predicted daily fluid production per well, directly reflecting the demand for improved quality and efficiency in oilfield development. The decision variables are the adjusted stroke and stroke rate. Besides the basic parameter ranges, the most important constraint is the safety threshold constraint for the alternating load at the suspension point. Excessive alternating load is a major cause of sucker rod fatigue fracture; therefore, any solution where the predicted alternating load exceeds the equipment's set fatigue safety threshold will be considered infeasible. The specific mathematical optimization model is constructed as follows:

[0074] ;

[0075] In the formula, J is the objective function for optimization, representing the predicted daily liquid production of a single well, t / d; and These are the decision variables, namely the adjusted stroke (m) and number of strokes (min). -1 ); and These represent the liquid production rate and the alternating load at the suspension point predicted by PiCA-Net, respectively. The maximum alternating load threshold, kN, is set based on the strength of the rod / tube. , and , These are the allowable stroke and stroke adjustment boundaries for the equipment, respectively.

[0076] For the aforementioned optimization model, considering the relatively limited and discontinuous value space of the decision variables—for example, stroke adjustment must correspond to a specific hole position on the equipment nameplate—conventional gradient-based optimization algorithms are difficult to apply directly. Although genetic algorithms or particle swarm optimization algorithms are suitable for such problems, given the small problem size, grid-based traversal search algorithms have an irreplaceable advantage in guaranteeing a globally optimal solution, and their computational cost is completely controllable at the current scale. Therefore, this invention employs a grid search strategy for solving the problem.

[0077] In actual production, due to various reasons, the measured stroke and number of strokes of the pumping unit often do not match the theoretical gears on its nameplate, and this deviation varies from well to well, making it difficult to correct using uniform rules. If the search space is directly constructed based on the discrete gears on the equipment nameplate, the calculated optimal parameter combination will not be physically aligned precisely because the benchmark point, i.e., the current measured value, has already deviated from the theoretical value, thus causing the optimization to fail. To address this, this strategy employs a virtual grid traversal search method based on relative increments. The algorithm no longer relies on the absolute gear parameters of a specific pumping unit model, but instead uses the current measured operating regime as a benchmark, expanding outwards with a fixed step size of 0.5 to construct a grid covering the feasible region. For each grid node, the model only focuses on its incremental features relative to the current state. This predicts the resulting liquid production and alternating load response. This strategy avoids the problem of mismatch between measured and setpoint values, achieving a universal optimization solution that requires no prior knowledge of equipment models and is highly applicable to various types of existing assets. The strategy's process is as follows: Figure 4 As shown.

[0078] After obtaining the theoretically optimal solution through traversal search, considering the significant differences in operational costs for adjusting various parameters in actual production, this strategy introduces a hierarchical recommendation mechanism in the decision output stage. Stroke adjustment typically involves downtime and physical changes to the mechanical structure, such as replacing pulleys or adjusting crank pin holes. Its operational complexity and downtime losses are far higher than adjusting the stroke parameter solely through the frequency converter or control cabinet. Therefore, the algorithm ultimately outputs the optimal solution for adjusting only the stroke, the optimal solution for adjusting only the stroke, and the globally optimal solution under comprehensive adjustment, as a reference for auxiliary decision-making. On-site managers can select the appropriate parameter adjustment scheme based on the current situation.

[0079] Using the above scheme, experimental analysis and application verification were conducted, as follows:

[0080] The dataset used in the experiment originated from the sample set after preprocessing and feature engineering in step S1, containing a total of 5884 valid samples. To ensure the objectivity of the model evaluation, the sample set was randomly divided into a training set and a test set in an 8:2 ratio, with 4707 samples in the training set and 1177 samples in the test set. The input data includes time-series features from the past n=30 days and the current... The characteristics and output labels are the adjusted daily fluid production and the alternating load at the suspension point. All continuous variables are processed to between 0 and 1 using the max-min normalization method well by well before being input into the network.

[0081] To verify the performance of the prediction model based on cross-attention and action injection mechanisms proposed in this invention, three sets of comparative models were constructed and subjected to isomorphic experiments with the model in this paper. The baseline model uses a standard Long Short-Term Memory (LSTM) network, which does not include feature compression and injection mechanisms, and directly concatenates the flattened dynamometer data with other temporal features as input. Comparative model A uses a one-dimensional convolutional neural network combined with a long short-term memory network (1DCNN-LSTM), using three one-dimensional convolutional layers to extract local morphological features of the dynamometer. Comparative model B uses an autoencoder combined with a long short-term memory network (AE-LSTM), using a pre-trained autoencoder to perform unsupervised dimensionality reduction encoding of the dynamometer. During training, all models use the Adam optimizer for parameter optimization, and the loss function proposed in section 2.1.3 is used. To ensure fairness in the comparative experiments, common hyperparameters such as the number of backbone network layers, hidden layer dimensions, batch size, and iteration rounds were kept consistent across all models. The specific parameters of the proposed cross-attention module and the comparative models were optimally set based on their respective network characteristics. Detailed training hyperparameter settings are shown in Table 2. Where K represents the kernel size, C represents the number of kernels, S represents the pooling window size, P represents padding, and T represents the window stride.

[0082] Table 2 Model Training Hyperparameter Settings

[0083] The experimental hardware environment consisted of an Intel 14650HX processor, an NVIDIA RTX 4070 mobile graphics card, and 32GB of DDR5 memory. The software environment was based on Python 3.10.5, the Baidu PaddlePaddle 2.6.1 framework, and CUDA 13.0.

[0084] The model performance was validated, as follows:

[0085] To analyze the accuracy of production volume and load predictions, and to evaluate the predictive performance of the PiCA-Net model, the trained model was validated on an independent test set. The evaluation metrics selected were root mean square error (RMSE), mean absolute deviation (MAD), and coefficient of determination (R²). 2 It introduces the accuracy metric, defined as the percentage of samples where the absolute value of the relative error between the predicted and the true values ​​is less than 10%.

[0086] in, Figure 5This paper presents a scatter plot comparing the predicted and actual values ​​of daily production and alternating load at the suspension point for a single well on the test set. The horizontal axis represents the actual production monitoring value, and the vertical axis represents the predicted value output by the model. The red dashed line is the diagonal, i.e., the ideal prediction line. As shown in the figure, the vast majority of sample points are closely distributed on both sides of the diagonal, without significant systematic bias. Particularly in the high-yield and low-yield well range where production data are more dispersed, the model still maintains good tracking performance, indicating that the PiCA-Net model can effectively capture the nonlinear influence of stroke and stroke frequency adjustments on production indicators.

[0087] Table 3 details the statistical results of the model's prediction errors on the test set. The test results based on normalized data show that the overall normalized root mean square error of the model is 0.075, the mean absolute deviation is only 0.024, and the coefficient of determination reaches 0.85. After restoring the results to physical dimensions, the root mean square error of the predicted daily liquid production is approximately 4.35 t·d. -1 The average absolute deviation was controlled at 1.39 t·d. -1 Within a certain range, the average absolute deviation of the alternating load at the suspension point was approximately 1.15 kN, achieving accuracy rates of 91.2% and 88.5% in production rate and alternating load prediction tasks, respectively. The high-precision prediction results confirm the effectiveness of the cross-attention feature extraction module and action injection mechanism proposed in this invention. The model successfully established a precise mapping relationship between pumping parameter adjustment commands and the dynamic response of oil well production, providing a reliable model foundation for subsequent parameter optimization decisions.

[0088] Table 3. Prediction error statistics of the PiCA-Net model on the test set.

[0089]

[0090] A comparative analysis of different network architectures is conducted, as follows:

[0091] To further verify the rationality and superiority of the proposed PiCA-Net model architecture, its performance was evaluated on the same test set against three comparative models: the aforementioned standard LSTM, 1DCNN-LSTM, and AE-LSTM. Simultaneously, a model called PiCA-Net+MSE, which includes only MSE in its loss function and does not contain physical constraints, was introduced to evaluate the effect of physical constraints. The error statistics for each model on the daily liquid production prediction task are shown in Table 4.

[0092] Table 4 Comparison of Prediction Performance of Different Network Architecture Models

[0093] As shown in Table 4, the proposed model significantly outperforms other comparative models in all evaluation metrics, verifying its effectiveness in processing complex time-series data from pumping wells. The models using 1DCNN and AE for feature dimensionality reduction both outperform the baseline models, indicating that dimensionality reduction encoding of high-dimensional dynamometer maps helps improve the stability of time-series predictions. However, the 1DCNN-LSTM model primarily extracts features through local receptive fields with fixed convolutional kernels, making it difficult to accurately locate key feature information. The AE-LSTM model utilizes autoencoders for unsupervised feature learning, with its optimization objective focusing on data reconstruction rather than production prediction, resulting in extracted potential features that may contain redundant information or noise that does not contribute to the prediction task. In contrast, the PiCA-Net model adaptively extracts core features related to production and alternating load using a cross-attention mechanism; this supervised attention feature extraction method has stronger task orientation.

[0094] In some test samples with significantly increased stroke rates, the comparative model, which did not introduce physical constraints, was prone to over-extrapolation based on statistical data, leading to predicted daily liquid production exceeding the pump's theoretical displacement. The PiCA-Net model, by introducing a physical boundary penalty term during training, forces the network weights to automatically adapt to the physical feasible region constraints during backpropagation. Experimental results show that all predicted liquid production on the test set did not exceed the theoretical displacement limit, completely eliminating non-physical predictions of pump efficiency greater than 1. This significantly improves the model's physical consistency and reliability in engineering applications while maintaining prediction accuracy.

[0095] Furthermore, to verify the applicability of the parameter traversal optimization strategy proposed in this paper to actual production, the PiCA-Net model and its supporting optimization algorithm were deployed on the production management platform of an oil production plant in Northwest Oilfield, covering 40 pumping unit wells. With safe operation as the goal, the system only triggers parameter optimization calculations and outputs parameter adjustment schemes to reduce the load when the real-time monitored alternating load at the suspension point exceeds the safety threshold set for each well. During the experiment, the system identified 32 pumping unit wells with operating conditions exceeding limits and implemented corresponding parameter optimization adjustments.

[0096] Taking well TK825 as an example, the single-well application effect is analyzed. The safe threshold for alternating load in this well is 50kN. For this operating condition, a parameter traversal optimization strategy is applied to perform a global search within the feasible region where the load does not exceed 50kN. The model output suggests reducing the stroke rate from 4.2 to 3.3 while keeping the stroke rate unchanged. This adjustment scheme was implemented in the field and retested. The results show that although the daily fluid production decreased slightly due to the parameter reduction, the alternating load at the suspension point successfully returned to the safe operating range, eliminating potential equipment operation hazards. The specific production parameters and indicators of well TK825 before and after optimization are compared in Table 5. The model predicts the values ​​of fluid production and alternating load under different stroke rates as follows: Figure 6As shown, (a) is a thermal graph of liquid production and stroke count, and the shaded area in the upper right corner represents that the alternating load in this area exceeds the safety threshold. (b) is a thermal graph of alternating load and stroke count.

[0097] Table 5 Comparison of production indicators before and after parameter optimization of well TK825

[0098]

[0099] A comprehensive statistical analysis was conducted on the effects of 32 parameter adjustments implemented during the experiment. To intuitively assess the safety benefits of the strategy, the distribution of alternating loads at the suspension points of the 32 wells before and after optimization was compared. After optimization, the overall load distribution shifted significantly downwards, with the measured load successfully reduced below the threshold in 31 out of the 32 adjustments, achieving a safety compliance rate of 96.9%. In one well, due to severe fluctuations in formation fluid supply, the measured value was slightly higher than the predicted value, but it was still an improvement compared to before parameter adjustment.

[0100] Regarding the impact on production, the expected decrease in fluid production occurred due to the adoption of parameter reduction and load reduction measures primarily aimed at ensuring equipment safety. It can be observed that the vast majority of data points are distributed below the diagonal line, indicating that the optimized fluid production is lower than before optimization, but all points are closely distributed along the diagonal line, without significant deviation. Statistical results show that the average daily fluid production per well decreased by 1.15t after parameter adjustment, with a cumulative reduction of 36.8t in daily fluid production across 32 wells. This result confirms that the PiCA-Net model and optimization strategy proposed in this invention can effectively mitigate the risk of overload during the production process at the cost of relatively small production losses, curbing well collapse accidents from a full life-cycle perspective and ensuring the continuous and stable operation of pumping wells.

[0101] Experiments show that the PiCA-Net model performs excellently in time series forecasting tasks under complex operating conditions, achieving an RMSE of 4.35 t·d for daily liquid production forecasting on the test set. -1 MAD at 1.39t·d -1 Within, R 2 The accuracy was 0.86, demonstrating high precision. The multi-constraint optimization strategy based on this model showed significant practical value in a test of 40 wells in the Northwest Oilfield. It accurately identified and optimized 32 wells with excessive loads, achieving a 96.9% compliance rate for operational safety standards. This effectively mitigated the risk of rod and tubing fatigue breakage, providing effective technical support for the scientific development and refined management of intelligent oilfields.

[0102] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Those skilled in the art, upon considering the disclosure in the specification and embodiments, will readily conceive of other embodiments of this disclosure. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

[0103] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A self-optimization method for pumping parameters in oil wells based on the PiCA-Net prediction model, characterized in that, Includes the following steps: Pre-collect oil pumping well data and perform cleaning and void filling. Screen input features through correlation analysis and ablation experiments, construct parameter change feature vectors, and use event-driven methods to extract effective samples containing parameter tuning actions and dynamic responses. The PiCA-Net prediction model is constructed, including the construction of a prediction model that integrates cross-attention mechanism, conditional injection and action injection mechanism, and the calibration of loss function containing pump efficiency boundary constraints, which is used to predict the liquid production and suspension point alternating load. The system performs multi-constraint pumping parameter self-optimization, aiming to maximize daily liquid production. It uses the safety threshold of the suspension point alternating load and the equipment performance boundary as constraints, and employs a grid search algorithm to find the optimal combination of pumping parameters, outputting a hierarchical optimization scheme.

2. The self-optimization method for pumping parameters of oil wells based on the PiCA-Net prediction model according to claim 1, characterized in that, The event-driven method is used to extract valid samples containing parameter adjustment actions and dynamic responses, including: grouping data by well number and sorting it by time; when the change in stroke or number of strokes is ≥0.5 and the change rate of production volume or alternating load is >10% within 5 days before and after adjustment, data segments from the past 30 days to the next 4 days are extracted as valid samples.

3. The self-optimization method for pumping parameters of oil wells based on the PiCA-Net prediction model according to claim 1, characterized in that, The PiCA-Net prediction model includes: a dynamometer feature extraction module and a time-series prediction module, wherein: the dynamometer feature extraction module uses a cross-attention mechanism to encode high-dimensional dynamometer data to obtain low-dimensional feature vectors reflecting the pump's operating conditions; the time-series prediction module is based on a long short-term memory network, and through conditional injection and action injection strategies, it takes the current operating regime as the initial state and the adjustment command as the tail input, so as to achieve prediction of the liquid production and alternating load under specific parameter adjustment actions while retaining long-term time-series dependencies.

4. The self-optimization method for pumping parameters of oil wells based on the PiCA-Net prediction model according to claim 3, characterized in that, The dynamometer feature extraction module includes: mapping the single-dimensional displacement sequence and load sequence into 64-dimensional feature vectors through a single-layer linear fully connected layer, and introducing position encoding to retain the positional information of the data in the sequence; subsequently, using the displacement sequence as the query vector and the load sequence as the key vector and value vector; and using a multi-head attention mechanism with four attention heads to calculate the attention weight matrix between displacement and load, adaptively focusing on the local features in the dynamometer diagram that are most sensitive to changes in the working condition. The single-head dimension is 16. The attention mechanism calculation process is expressed as follows: ; In the formula, As a scaling factor, the output of the cross-attention layer remains a 64-dimensional feature matrix of length 200. This matrix is ​​flattened and then passed through a multilayer perceptron containing a non-linear activation function for dimensionality reduction. The input layer receives a 12800-dimensional vector, with 128 hidden points using the ReLU activation function. The output layer has 32 nodes. The final output feature vector G is concatenated with other daily data to form the temporal input vector of the LSTM. .

5. The self-optimization method for pumping parameters of oil wells based on the PiCA-Net prediction model according to claim 4, characterized in that, The time series prediction module includes: Calibration condition injection sets an accurate starting point for the time series prediction network, and the stroke at the current time step. With Ochon The vector is mapped to an initial hidden state vector through a multilayer perceptron. and cell state vector The memory unit used to initialize the Long Short-Term Memory network is represented as: ; In the formula, and These are the weight matrices for the hidden state and the cell state, respectively. and For the corresponding bias vector, This represents the normalized concatenated vector of stroke and number of strokes at the current moment. tanh and sigmoid activation function, respectively; Using independent multilayer perceptrons to process low-dimensional action vectors The dimensionality is increased to a feature vector consistent with the dimension of the hidden state. Then, it is concatenated with the final hidden state after time evolution. Finally, it is mapped to the predicted liquid production and alternating load through a fully connected layer.

6. The self-optimization method for pumping parameters of oil wells based on the PiCA-Net prediction model according to claim 5, characterized in that, The loss function for the pump efficiency boundary constraint includes: calculating the theoretical daily discharge based on key parameters. This represents the maximum fluid discharge capacity of a pumping unit well under ideal conditions, and is expressed as: ; In the formula, D is the theoretical daily displacement; S is the pump diameter; N is the stroke; This is the physical constraint loss term.

7. The self-optimization method for pumping parameters of oil wells based on the PiCA-Net prediction model according to claim 1, characterized in that, The output hierarchical optimization scheme includes: grid search based on the current measured parameters, constructing a virtual grid with a step size of 0.5, traversing all nodes and predicting the liquid production and alternating load, and selecting the optimal parameter combination within the safe and feasible region, expressed as: ; In the formula, J is the objective function for optimization, representing the predicted daily fluid production of a single well; and These are the decision variables, namely the adjusted stroke and number of strokes; and These represent the liquid production rate and the alternating load at the suspension point predicted by PiCA-Net, respectively. The maximum alternating load threshold is set based on the strength of the rod / tube. , and , These are the allowable stroke and stroke adjustment boundaries for the equipment, respectively.